fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::TimerEvent< T > Class Template Reference

Timer event object to provide callback context with Timer. More...

#include <timer.hpp>

Public Member Functions

 TimerEvent (bool(T::*callback)(), bool repeat=false)
 
 ~TimerEvent ()
 Dtor. More...
 
void set (const Tickval &t)
 
bool operator< (const TimerEvent< T > &right) const
 

Private Attributes

bool(T::* _callback )()
 
Tickval _t {}
 
unsigned _intervalMS = 0
 
bool _repeat
 

Friends

class Timer< T >
 

Detailed Description

template<typename T>
class FIX8::TimerEvent< T >

Timer event object to provide callback context with Timer.

Template Parameters
TCallback class

Definition at line 60 of file timer.hpp.

Constructor & Destructor Documentation

template<typename T>
FIX8::TimerEvent< T >::TimerEvent ( bool(T::*)()  callback,
bool  repeat = false 
)
inlineexplicit

Ctor. The callback method returns a bool. If false, exit timer

Parameters
callbackpointer to callback method
repeatif true, repeat indefinately

Definition at line 72 of file timer.hpp.

72 : _callback(callback), _repeat(repeat) {}
bool(T::* _callback)()
Definition: timer.hpp:62
template<typename T>
FIX8::TimerEvent< T >::~TimerEvent ( )
inline

Dtor.

Definition at line 75 of file timer.hpp.

75 {}

Member Function Documentation

template<typename T>
bool FIX8::TimerEvent< T >::operator< ( const TimerEvent< T > &  right) const
inline

Less than operator.

Parameters
rightcheck if this TimeEvent is less than rhs
Returns
true if less than

Definition at line 84 of file timer.hpp.

84 { return _t > right._t; };
Tickval _t
Definition: timer.hpp:63
template<typename T>
void FIX8::TimerEvent< T >::set ( const Tickval t)
inline

Set the event trigger time.

Parameters
tTickval to assign

Definition at line 79 of file timer.hpp.

Referenced by FIX8::Timer< T >::schedule().

79 { _t = t; }
Tickval _t
Definition: timer.hpp:63

Friends And Related Function Documentation

template<typename T>
friend class Timer< T >
friend

Definition at line 84 of file timer.hpp.

Member Data Documentation

template<typename T>
bool(T::* FIX8::TimerEvent< T >::_callback) ()
private

Definition at line 62 of file timer.hpp.

template<typename T>
unsigned FIX8::TimerEvent< T >::_intervalMS = 0
private

Definition at line 64 of file timer.hpp.

Referenced by FIX8::Timer< T >::schedule().

template<typename T>
bool FIX8::TimerEvent< T >::_repeat
private

Definition at line 65 of file timer.hpp.

template<typename T>
Tickval FIX8::TimerEvent< T >::_t {}
private

Definition at line 63 of file timer.hpp.

Referenced by FIX8::TimerEvent< FIX8::Session >::set().


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