![]() |
Kea 3.1.5
|
File descriptor event handler class handles events for registered file descriptors. More...
#include <fd_event_handler.h>
Inheritance diagram for isc::util::FDEventHandler:Public Types | |
| enum | HandlerType : uint16_t { TYPE_UNKNOWN = 0 , TYPE_SELECT = 1 , TYPE_POLL = 2 } |
Public Member Functions | |
| FDEventHandler (HandlerType type=TYPE_UNKNOWN) | |
| Constructor. | |
| virtual | ~FDEventHandler ()=default |
| Destructor. | |
| virtual void | add (int fd)=0 |
| Add file descriptor to watch for events. | |
| virtual void | clear ()=0 |
| Clear registered file descriptors. | |
| virtual bool | hasError (int fd)=0 |
| Check if file descriptor has error. | |
| virtual bool | readReady (int fd)=0 |
| Check if file descriptor is ready for read operation. | |
| HandlerType | type () |
| Return the event handler type. | |
| virtual int | waitEvent (uint32_t timeout_sec, uint32_t timeout_usec=0, bool use_timeout=true)=0 |
| Wait for events on registered file descriptors. | |
File descriptor event handler class handles events for registered file descriptors.
Definition at line 18 of file fd_event_handler.h.
| enum isc::util::FDEventHandler::HandlerType : uint16_t |
| Enumerator | |
|---|---|
| TYPE_UNKNOWN | |
| TYPE_SELECT | |
| TYPE_POLL | |
Definition at line 20 of file fd_event_handler.h.
| isc::util::FDEventHandler::FDEventHandler | ( | HandlerType | type = TYPE_UNKNOWN | ) |
Constructor.
| type | The file descriptor event handler type. |
Definition at line 14 of file fd_event_handler.cc.
References type().
Referenced by isc::util::PollEventHandler::PollEventHandler(), and isc::util::SelectEventHandler::SelectEventHandler().
Here is the call graph for this function:
|
virtualdefault |
Destructor.
|
pure virtual |
Add file descriptor to watch for events.
| fd | The file descriptor. |
Implemented in isc::util::PollEventHandler, and isc::util::SelectEventHandler.
|
pure virtual |
Clear registered file descriptors.
Implemented in isc::util::PollEventHandler, and isc::util::SelectEventHandler.
|
pure virtual |
Check if file descriptor has error.
| fd | The file descriptor. |
Implemented in isc::util::PollEventHandler, and isc::util::SelectEventHandler.
|
pure virtual |
Check if file descriptor is ready for read operation.
| fd | The file descriptor. |
Implemented in isc::util::PollEventHandler, and isc::util::SelectEventHandler.
| FDEventHandler::HandlerType isc::util::FDEventHandler::type | ( | ) |
Return the event handler type.
Definition at line 17 of file fd_event_handler.cc.
Referenced by FDEventHandler().
|
pure virtual |
Wait for events on registered file descriptors.
| timeout_sec | The wait timeout in seconds. |
| timeout_usec | The wait timeout in micro seconds. |
| use_timeout | Flag which indicates if function should wait with no timeout (wait forever). |
Implemented in isc::util::PollEventHandler, and isc::util::SelectEventHandler.