![]() |
fix8
version 1.4.0
Open Source C++ FIX Framework
|
High resolution timer. More...
#include <timer.hpp>
Public Member Functions | |
| Timer (T &monitor, int granularity=10) | |
| virtual | ~Timer () |
| Dtor. More... | |
| bool | schedule (TimerEvent< T > what, unsigned timeToWaitMS) |
| size_t | clear () |
| void | join () |
| Join timer thread. Wait till exits. More... | |
| void | start () |
| Start the timer thread. More... | |
| void | stop () |
| Stop the timer thread. More... | |
| int | operator() () |
| f8_thread_cancellation_token & | cancellation_token () |
Private Attributes | |
| T & | _monitor |
| f8_thread< Timer > | _thread |
| f8_spin_lock | _spin_lock |
| unsigned | _granularity |
| std::priority_queue< TimerEvent< T > > | _event_queue |
| f8_thread_cancellation_token | _cancellation_token |
High resolution timer.
| T | callback context class |
|
inlineexplicit |
|
inlinevirtual |
|
inline |
Definition at line 139 of file timer.hpp.
| size_t FIX8::Timer< T >::clear | ( | ) |
Empty the scheduler of any pending timer events.
Definition at line 193 of file timer.hpp.
|
inline |
Join timer thread. Wait till exits.
Definition at line 127 of file timer.hpp.
Referenced by FIX8::Timer< FIX8::Session >::~Timer().
| int FIX8::Timer< T >::operator() | ( | ) |
Timer thread entry point.
Definition at line 144 of file timer.hpp.
References FIX8::Tickval::get_ticks(), FIX8::Tickval::get_tickval(), glout_info, FIX8::hypersleep< h_milliseconds >(), and FIX8::Tickval::million.
| bool FIX8::Timer< T >::schedule | ( | TimerEvent< T > | what, |
| unsigned | timeToWaitMS | ||
| ) |
Schedule a timer event. Callback method in event called on timer expiry.
| what | TimeEvent to schedule |
| timeToWaitMS | interval to wait in ms |
Definition at line 209 of file timer.hpp.
References FIX8::TimerEvent< T >::_intervalMS, FIX8::Tickval::get_tickval(), FIX8::Tickval::million, and FIX8::TimerEvent< T >::set().
|
inline |
|
inline |
Stop the timer thread.
Definition at line 133 of file timer.hpp.
Referenced by FIX8::Timer< FIX8::Session >::~Timer().
|
private |
Definition at line 101 of file timer.hpp.
Referenced by FIX8::Timer< FIX8::Session >::cancellation_token().
|
private |
|
private |
|
private |
|
private |
|
private |