|
|
@ -40,6 +40,8 @@ typedef enum TR_e_EventDispatcherMode { |
|
|
} TR_EventDispatcherMode; |
|
|
} TR_EventDispatcherMode; |
|
|
|
|
|
|
|
|
TR_CLASS(TR_EventDispatcher) { |
|
|
TR_CLASS(TR_EventDispatcher) { |
|
|
|
|
|
TR_EXTENDS(TR_EventSubject); |
|
|
|
|
|
|
|
|
TR_Queue events; |
|
|
TR_Queue events; |
|
|
TR_Hash handler; |
|
|
TR_Hash handler; |
|
|
TR_EventHandler default_handler; |
|
|
TR_EventHandler default_handler; |
|
|
@ -49,7 +51,14 @@ TR_CLASS(TR_EventDispatcher) { |
|
|
TR_EventDispatcherMode mode; |
|
|
TR_EventDispatcherMode mode; |
|
|
}; |
|
|
}; |
|
|
TR_INSTANCE_INIT(TR_EventDispatcher); |
|
|
TR_INSTANCE_INIT(TR_EventDispatcher); |
|
|
TR_CLASSVARS_DECL(TR_EventDispatcher) {}; |
|
|
|
|
|
|
|
|
TR_CLASSVARS_DECL(TR_EventDispatcher) { |
|
|
|
|
|
TR_CV_EXTENDS(TR_EventSubject); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
#define TR_DISPATCHER_EVENT_HEARTBEAT 0 |
|
|
|
|
|
#define TR_DISPATCHER_EVENT_USER_WAIT 1 |
|
|
|
|
|
#define TR_DISPATCHER_EVENT_DATA_WAIT 2 |
|
|
|
|
|
#define TR_DISPATCHER_EVENT_SHUTDOWN 3 |
|
|
|
|
|
|
|
|
void TR_eventDispatcherRegisterHandler(TR_EventDispatcher, TR_EventHandler); |
|
|
void TR_eventDispatcherRegisterHandler(TR_EventDispatcher, TR_EventHandler); |
|
|
void TR_eventDispatcherSetHeartbeat(TR_EventDispatcher, time_t); |
|
|
void TR_eventDispatcherSetHeartbeat(TR_EventDispatcher, time_t); |
|
|
|