#include <hysteresis.h>
Collaboration diagram for hysteresis:

Public Member Functions | |
| hysteresis (int staleness_period, int longest_delay) | |
| void | record_event () |
| records that we have just seen an event. | |
| void | reset_waiter () |
| resets the timestamp to indicate that we have just handled an event. | |
| bool | time_to_process () |
| returns true if it is time to do some processing now. | |
| istring | text_form () const |
Public Attributes | |
| int | _staleness_period |
| time_stamp | _last_event |
| int | _longest_delay |
| time_stamp | _end_of_wait |
Rather than triggering right away and possibly flipping back and forth quickly once a threshold is reached, the hysteresis object will allow more time to pass before the decision to flip is made.
Definition at line 29 of file hysteresis.h.
| hysteresis::hysteresis | ( | int | staleness_period, | |
| int | longest_delay | |||
| ) | [inline] |
Definition at line 32 of file hysteresis.h.
| void hysteresis::record_event | ( | ) | [inline] |
| void hysteresis::reset_waiter | ( | ) | [inline] |
resets the timestamp to indicate that we have just handled an event.
Definition at line 41 of file hysteresis.h.
| bool hysteresis::time_to_process | ( | ) |
returns true if it is time to do some processing now.
this will happen if the last_event has languished too long or if the period we've been delaying has gotten too large.
Definition at line 22 of file hysteresis.cpp.
References _end_of_wait, _last_event, and _staleness_period.
| istring hysteresis::text_form | ( | ) | const |
Definition at line 25 of file hysteresis.cpp.
References _end_of_wait, _last_event, _longest_delay, _staleness_period, istring::SPRINTF, and time_stamp::text_form().
1.5.1