/* */ #ifndef D_EVENT_POLL_H #define D_EVENT_POLL_H #include "common.h" #include "SharedHandle.h" #include "a2time.h" #include "a2netcompat.h" namespace aria2 { class SocketCore; class Command; class AsyncNameResolver; class EventPoll { public: enum EventType { EVENT_READ = 1, EVENT_WRITE = 1 << 1, EVENT_ERROR = 1 << 2, EVENT_HUP = 1 << 3, }; virtual ~EventPoll() {} virtual void poll(const struct timeval& tv) = 0; virtual bool addEvents(sock_t socket, Command* command, EventType events) = 0; virtual bool deleteEvents(sock_t socket, Command* command, EventType events) = 0; #ifdef ENABLE_ASYNC_DNS virtual bool addNameResolver(const SharedHandle& resolver, Command* command) = 0; virtual bool deleteNameResolver (const SharedHandle& resolver, Command* command) = 0; #endif // ENABLE_ASYNC_DNS }; } // namespace aria2 #endif // D_EVENT_POLL_H