|
|
@ -46,8 +46,8 @@ TR_CLASS(TR_EventDispatcher) { |
|
|
TR_Hash handler; |
|
|
TR_Hash handler; |
|
|
TR_EventHandler default_handler; |
|
|
TR_EventHandler default_handler; |
|
|
int running; |
|
|
int running; |
|
|
time_t heartbeat; |
|
|
|
|
|
time_t nextbeat; |
|
|
|
|
|
|
|
|
int heartbeat; // milliseconds |
|
|
|
|
|
int nextbeat; // milliseconds |
|
|
TR_EventDispatcherMode mode; |
|
|
TR_EventDispatcherMode mode; |
|
|
}; |
|
|
}; |
|
|
TR_INSTANCE_INIT(TR_EventDispatcher); |
|
|
TR_INSTANCE_INIT(TR_EventDispatcher); |
|
|
@ -61,12 +61,12 @@ TR_CLASSVARS_DECL(TR_EventDispatcher) { |
|
|
#define TR_DISPATCHER_EVENT_SHUTDOWN 3 |
|
|
#define TR_DISPATCHER_EVENT_SHUTDOWN 3 |
|
|
#define TR_DISPATCHER_EVENT_MAX ((size_t)TR_DISPATCHER_EVENT_SHUTDOWN) |
|
|
#define TR_DISPATCHER_EVENT_MAX ((size_t)TR_DISPATCHER_EVENT_SHUTDOWN) |
|
|
|
|
|
|
|
|
void TR_eventDispatcherRegisterHandler(TR_EventDispatcher, TR_EventHandler); |
|
|
|
|
|
void TR_eventDispatcherSetHeartbeat(TR_EventDispatcher, time_t); |
|
|
|
|
|
time_t TR_eventDispatcherGetBeatTime(TR_EventDispatcher); |
|
|
|
|
|
time_t TR_eventDispatcherGerDataWaitTime(TR_EventDispatcher); |
|
|
|
|
|
void TR_eventDispatcherStart(TR_EventDispatcher); |
|
|
|
|
|
void TR_eventDispatcherShutdown(TR_EventDispatcher); |
|
|
|
|
|
|
|
|
void TR_eventDispatcherRegisterHandler(TR_EventDispatcher, TR_EventHandler); |
|
|
|
|
|
void TR_eventDispatcherSetHeartbeat(TR_EventDispatcher, int); |
|
|
|
|
|
int TR_eventDispatcherGetBeatTime(TR_EventDispatcher); |
|
|
|
|
|
int TR_eventDispatcherGerDataWaitTime(TR_EventDispatcher); |
|
|
|
|
|
void TR_eventDispatcherStart(TR_EventDispatcher); |
|
|
|
|
|
void TR_eventDispatcherShutdown(TR_EventDispatcher); |
|
|
|
|
|
|
|
|
#define TR_eventDispatcherEnqueueEvent(disp,ev) \ |
|
|
#define TR_eventDispatcherEnqueueEvent(disp,ev) \ |
|
|
(TR_queuePut((disp)->events, (ev))) |
|
|
(TR_queuePut((disp)->events, (ev))) |
|
|
|