design_pattern_for_c  V 1.00
tpool_event_if.h
Go to the documentation of this file.
1 
5 #ifndef TPOOL_EVENT_IF_H_
6 #define TPOOL_EVENT_IF_H_
7 
9 
13 typedef void * EventInstance;
15 typedef void * EventHandler;
20 
37 EventHandler event_if_add(EventInstance this, EventSubscriber subscriber, void *arg);
47 EventHandler event_if_update(EventInstance this, EventHandler handler, EventSubscriber subscriber, void *arg);
54 void event_if_del(EventInstance this, EventHandler handler);
60 int event_if_getfd(EventHandler handler);
80 void event_if_exit(EventInstance this);
86 void event_if_free(EventInstance this);
88 #endif
int event_if_getfd(EventHandler handler)
get fd related to handler
void event_if_loopbreak(EventInstance this)
break main loop
void * EventHandler
Event handler related to fd.
EventHandler event_if_add(EventInstance this, EventSubscriber subscriber, void *arg)
add event handler related to fd
This is API as ThreadPool data definition for ThreadPooldesign petten by using libevent.
int event_if_loop(EventInstance this)
main loop, start to watch event
void event_if_exit(EventInstance this)
exit instances for loop, if plugin want.
EventHandler event_if_update(EventInstance this, EventHandler handler, EventSubscriber subscriber, void *arg)
update event handler related to fd
EventSubscriber class instance definition, this is storaged in any threads.
EventInstance event_if_new(void)
new event instance
void * EventInstance
Event management instance which get from event_if_new.
void event_if_del(EventInstance this, EventHandler handler)
delete event handler related to fd
void event_if_free(EventInstance this)
free instances