design_pattern_for_c
V 1.00
|
#include "tpool_event_if.h"
#include "dp_debug.h"
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <unistd.h>
#include <errno.h>
Go to the source code of this file.
Data Structures | |
struct | event_epoll_t |
struct | event_epoll_handler_t |
Macros | |
#define | EVENT_EPOLL_DEFMAX (4096) |
#define | EVENT_EPOLL_TIMEOUT (50) |
Typedefs | |
typedef struct event_epoll_t | event_epoll_t |
typedef struct event_epoll_t * | EventEpoll |
typedef struct event_epoll_handler_t | event_epoll_handler_t |
typedef struct event_epoll_handler_t * | EventEpollHandler |
Functions | |
static int | convert_etpoll_eveid2own (int eventflag) |
static short | convert_etpoll_ownid2eve (int eventflag) |
API for event if | |
EventInstance | event_if_new (void) |
event new More... | |
EventHandler | event_if_add (EventInstance this, EventSubscriber subscriber, void *arg) |
add new event More... | |
void * | event_if_update (EventInstance this, EventHandler handler, EventSubscriber subscriber, void *arg) |
update registered event More... | |
void | event_if_del (EventInstance this, EventHandler handler) |
delete event More... | |
int | event_if_getfd (EventHandler handler) |
get fd related to handler More... | |
int | event_if_loop (EventInstance this) |
main loop of this event More... | |
void | event_if_loopbreak (EventInstance this) |
break event More... | |
void | event_if_exit (EventInstance this) |
exit after main loop More... | |
void | event_if_free (EventInstance this) |
free event if instance More... | |
#define EVENT_EPOLL_DEFMAX (4096) |
Definition at line 8 of file event_if_epoll.c.
#define EVENT_EPOLL_TIMEOUT (50) |
Definition at line 10 of file event_if_epoll.c.
typedef struct event_epoll_handler_t event_epoll_handler_t |
Definition at line 25 of file event_if_epoll.c.
typedef struct event_epoll_t event_epoll_t |
Definition at line 19 of file event_if_epoll.c.
typedef struct event_epoll_t * EventEpoll |
Definition at line 19 of file event_if_epoll.c.
typedef struct event_epoll_handler_t * EventEpollHandler |
Definition at line 25 of file event_if_epoll.c.
|
inlinestatic |
|
inlinestatic |
EventHandler event_if_add | ( | EventInstance | this, |
EventSubscriber | subscriber, | ||
void * | arg | ||
) |
void event_if_del | ( | EventInstance | this, |
EventHandler | handler | ||
) |
void event_if_exit | ( | EventInstance | this | ) |
exit after main loop
exit instances for loop, if plugin want.
Definition at line 190 of file event_if_epoll.c.
void event_if_free | ( | EventInstance | this | ) |
free event if instance
free instances
Definition at line 195 of file event_if_epoll.c.
int event_if_getfd | ( | EventHandler | handler | ) |
get fd related to handler
[in] | handler | EventHandler instance returned at event_if_add. |
Definition at line 139 of file event_if_epoll.c.
int event_if_loop | ( | EventInstance | this | ) |
main loop of this event
main loop, start to watch event
Definition at line 144 of file event_if_epoll.c.
void event_if_loopbreak | ( | EventInstance | this | ) |
EventInstance event_if_new | ( | void | ) |
void* event_if_update | ( | EventInstance | this, |
EventHandler | handler, | ||
EventSubscriber | subscriber, | ||
void * | arg | ||
) |
update registered event
update event handler related to fd
Definition at line 105 of file event_if_epoll.c.