Classes | |
struct | TimerEvent |
Structure to contain information for a timer event. More... | |
Functions | |
Scope restricted to file | |
TimerEvent * | CreateTimerEvent (TimerThread *timer, ThreadPoolJob *job, Duration persistent, time_t eventTime, int id) |
Creates a Timer Event. | |
void | FreeTimerEvent (TimerThread *timer, TimerEvent *event) |
Deallocates a dynamically allocated TimerEvent. | |
void | TimerThreadWorker (void *arg) |
Implements timer thread. | |
int | CalculateEventTime (time_t *timeout, TimeoutType type) |
Calculates the appropriate timeout in absolute seconds since Jan 1, 1970. | |
struct anonymous_namespace{TimerThread.cpp}::TimerEvent |
Structure to contain information for a timer event.
Internal to the TimerThread.
Definition at line 58 of file TimerThread.cpp.
Class Members | ||
---|---|---|
ThreadPoolJob | job | |
time_t | eventTime |
Absolute time for event in seconds since Jan 1, 1970. |
Duration | persistent |
Long term or short term job. |
int | id |
Id of timer event. (can be null?). |
|
inline |
Creates a Timer Event.
[in] | timer | Valid timer thread pointer. |
[in] | job | . |
[in] | persistent | . |
[in] | eventTime | The absoule time of the event in seconds from Jan, 1970. |
[in] | id | Id of job. |
Definition at line 79 of file TimerThread.cpp.
void anonymous_namespace{TimerThread.cpp}::FreeTimerEvent | ( | TimerThread * | timer, |
TimerEvent * | event | ||
) |
Deallocates a dynamically allocated TimerEvent.
[in] | timer | Valid timer thread pointer. |
[in] | event | Must be allocated with CreateTimerEvent. |
Definition at line 109 of file TimerThread.cpp.
void anonymous_namespace{TimerThread.cpp}::TimerThreadWorker | ( | void * | arg | ) |
Implements timer thread.
Waits for next event to occur and schedules associated job into threadpool.
[in] | arg | arg is cast to (TimerThread *). |
Definition at line 124 of file TimerThread.cpp.
|
inline |
Calculates the appropriate timeout in absolute seconds since Jan 1, 1970.
[out] | timeout | Timeout. |
[in] | type | Timeout type. |
Definition at line 198 of file TimerThread.cpp.