14 #ifndef _H_HT_MANAGER_H
15 #define _H_HT_MANAGER_H
62 virtual void Tick(
float time );
70 void UnRegisterClient(
HTClient *c );
90 void Init(
float start_time );
96 void ScheduleNextTick(
HTClient *c,
float time );
171 void* user_data = 0 ) {
172 mt_interval = interval;
176 mt_tick_function = tick_function;
177 mt_user_data = user_data;
186 virtual bool Tick(
float request_time,
float actual_time ){
187 if( mt_tick_function )
188 return mt_tick_function(request_time, actual_time, mt_user_data);
230 void SetUserData(
void* user_data ) { mt_user_data = user_data; };
void * mt_user_data
Definition: HTManager.h:261
Definition: HTManager.h:50
HTClient(float interval=0.1f, HTCStyle style=HTCS_Invalid, HTClientTickFunction tick_function=0, void *user_data=0)
Definition: HTManager.h:168
void * GetUserData() const
Definition: HTManager.h:233
HTClientTickFunction mt_tick_function
Definition: HTManager.h:265
int mt_priority
Definition: HTManager.h:258
void SetNextRequest(float nr)
Definition: HTManager.h:212
float GetNextRequest() const
Definition: HTManager.h:215
double m_request_time
The time that the current bucket's events had requested.
Definition: HTManager.h:76
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:79
An invalid default state for the client style. The client style must be set before anything useful wi...
Definition: HTManager.h:103
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:77
Definition: HTManager.h:157
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:78
A single event will be delivered at the designated time, after which the timer client will automatica...
Definition: HTManager.h:104
HTCStyle GetStyle() const
Definition: HTManager.h:207
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:82
int GetPriority() const
Definition: HTManager.h:220
void SetInterval(float interval)
Definition: HTManager.h:195
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:83
HTCStyle
Definition: HTManager.h:102
Similar to HTCS_Periodic but this option has no make-up events.
Definition: HTManager.h:106
void SetPriorityLowest()
Definition: HTManager.h:225
float GetInterval() const
Definition: HTManager.h:198
void SetUserData(void *user_data)
Definition: HTManager.h:230
Events will be delivered at the interval specified with the timer client's "mt_interval" member var...
Definition: HTManager.h:105
void SetTickFunction(HTClientTickFunction tick_function)
Definition: HTManager.h:238
void SetStyle(HTCStyle style)
Definition: HTManager.h:204
struct vlist_s * m_spillover
An array of things that need to be scheduled for more than 1s away.
Definition: HTManager.h:81
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:84
float mt_interval
Definition: HTManager.h:250
virtual bool Tick(float request_time, float actual_time)
Definition: HTManager.h:186
bool(* HTClientTickFunction)(float request_time, float actual_time, void *user_data)
Definition: HTManager.h:110
double m_interval
1.0 / m_output_hz
Definition: HTManager.h:75
float mt_next_request
Definition: HTManager.h:253
int m_current_bucket
The bucket of events currently being dispatched.
Definition: HTManager.h:80