19 #ifndef _H_HT_MANAGER_H
20 #define _H_HT_MANAGER_H
67 virtual void Tick(
float time );
75 void UnRegisterClient(
HTClient *c );
95 void Init(
float start_time );
101 void ScheduleNextTick(
HTClient *c,
float time );
176 void* user_data = 0 ) {
177 mt_interval = interval;
181 mt_tick_function = tick_function;
182 mt_user_data = user_data;
191 virtual bool Tick(
float request_time,
float actual_time ){
192 if( mt_tick_function )
193 return mt_tick_function(request_time, actual_time, mt_user_data);
235 void SetUserData(
void* user_data ) { mt_user_data = user_data; };
void * mt_user_data
Definition: HTManager.h:266
Definition: HTManager.h:55
HTClient(float interval=0.1f, HTCStyle style=HTCS_Invalid, HTClientTickFunction tick_function=0, void *user_data=0)
Definition: HTManager.h:173
void * GetUserData() const
Definition: HTManager.h:238
HTClientTickFunction mt_tick_function
Definition: HTManager.h:270
int mt_priority
Definition: HTManager.h:263
void SetNextRequest(float nr)
Definition: HTManager.h:217
float GetNextRequest() const
Definition: HTManager.h:220
double m_request_time
The time that the current bucket's events had requested.
Definition: HTManager.h:81
struct vlist_s ** m_buckets
The array of buckets of size m_output_hz. This array holds precisely 1 sec of events.
Definition: HTManager.h:84
An invalid default state for the client style. The client style must be set before anything useful wi...
Definition: HTManager.h:108
double m_actual_time
The actual time which may be different from m_request_time if control is lost for a while...
Definition: HTManager.h:82
Definition: HTManager.h:162
int m_output_hz
The granularity of the timer, i.e. the number of buckets into which the timer manager splits a single...
Definition: HTManager.h:83
A single event will be delivered at the designated time, after which the timer client will automatica...
Definition: HTManager.h:109
HTCStyle GetStyle() const
Definition: HTManager.h:212
struct vhash_s * m_active_clients
A hash table of all the currently registered clients. Only currently registered clients can receive t...
Definition: HTManager.h:87
int GetPriority() const
Definition: HTManager.h:225
void SetInterval(float interval)
Definition: HTManager.h:200
struct vlist_s * m_recently_deleted_expirations
A vlist parallel to m_recently_deleted_clients to indicate how long things need to stay on the list...
Definition: HTManager.h:88
HTCStyle
Definition: HTManager.h:107
Similar to HTCS_Periodic but this option has no make-up events.
Definition: HTManager.h:111
void SetPriorityLowest()
Definition: HTManager.h:230
float GetInterval() const
Definition: HTManager.h:203
void SetUserData(void *user_data)
Definition: HTManager.h:235
Events will be delivered at the interval specified with the timer client's "mt_interval" member var...
Definition: HTManager.h:110
void SetTickFunction(HTClientTickFunction tick_function)
Definition: HTManager.h:243
void SetStyle(HTCStyle style)
Definition: HTManager.h:209
struct vlist_s * m_spillover
An array of things that need to be scheduled for more than 1s away.
Definition: HTManager.h:86
struct vlist_s * m_recently_deleted_clients
A list of recently deleted clients. Only if an item is unregistered and then re-registered very quick...
Definition: HTManager.h:89
float mt_interval
Definition: HTManager.h:255
virtual bool Tick(float request_time, float actual_time)
Definition: HTManager.h:191
bool(* HTClientTickFunction)(float request_time, float actual_time, void *user_data)
Definition: HTManager.h:115
double m_interval
1.0 / m_output_hz
Definition: HTManager.h:80
float mt_next_request
Definition: HTManager.h:258
int m_current_bucket
The bucket of events currently being dispatched.
Definition: HTManager.h:85