EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
Throttle Class Reference

Timer for throttling messages, thread safe. More...

#include <Throttle.h>

Inheritance diagram for Throttle:
ThrottledMsgLogger

Public Member Functions

 Throttle (const char *name, double seconds_between_messages)
 Create throttle with the given name and threshold. More...
 
void reset ()
 Reset the throttle so that isPermitted will return 'true'. More...
 
void fire ()
 Fire the throttle so that isPermitted will return 'false' until the threshold is exceeded.
 
bool isPermitted (const epicsTime &when)
 
bool isPermitted ()
 
double getThrottleThreshold ()
 

Detailed Description

Timer for throttling messages, thread safe.

In order to avoid hundreds of similar messages, use the Throttle to check if it's OK to print the message.

Constructor & Destructor Documentation

Throttle::Throttle ( const char *  name,
double  seconds_between_messages 
)

Create throttle with the given name and threshold.

Member Function Documentation

double Throttle::getThrottleThreshold ( )
inline
Returns
Returns the message threshold in seconds.
bool Throttle::isPermitted ( const epicsTime &  when)
Returns
Returns true when it's OK to print message at given time.
bool Throttle::isPermitted ( )
Returns
Returns true when it's OK to print another message now.
void Throttle::reset ( )

Reset the throttle so that isPermitted will return 'true'.


The documentation for this class was generated from the following file: