HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_TimeGate< TIMEOUT_MS > Class Template Reference

#include <UT_TimeGate.h>

Public Member Functions

 UT_TimeGate ()
 
bool tryAcquire ()
 
bool canAcquire ()
 
void acquire ()
 

Detailed Description

template<int TIMEOUT_MS>
class UT_TimeGate< TIMEOUT_MS >

Used to reduce the frequency of checks gated by a time out (in milliseconds at resolution of ~100ms). Note that the frequency is not guaranteed, esp. if you try to call tryAcquire() from multiple threads on the same UT_TimeGate object.

Definition at line 27 of file UT_TimeGate.h.

Constructor & Destructor Documentation

template<int TIMEOUT_MS>
UT_TimeGate< TIMEOUT_MS >::UT_TimeGate ( )
inline

Definition at line 30 of file UT_TimeGate.h.

Member Function Documentation

template<int TIMEOUT_MS>
void UT_TimeGate< TIMEOUT_MS >::acquire ( )
inline

Resets the gate so that canAcquire()/tryAcquire() will return false until at least TIMEOUT_MS has elapsed.

Definition at line 57 of file UT_TimeGate.h.

template<int TIMEOUT_MS>
bool UT_TimeGate< TIMEOUT_MS >::canAcquire ( )
inline

Return true if at least TIMEOUT_MS has elapsed from the last call to acquire(), without actually acquiring.

Definition at line 49 of file UT_TimeGate.h.

template<int TIMEOUT_MS>
bool UT_TimeGate< TIMEOUT_MS >::tryAcquire ( )
inline

Return true if at least TIMEOUT_MS has elapsed from the last time this method returned true. Resolution is ~100ms.

Definition at line 38 of file UT_TimeGate.h.


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