Timerable Service.
More...
#include <TimerableService_V1.h>
◆ ~TimerableService()
TimerableService::~TimerableService |
( |
| ) |
|
|
override |
◆ cancelTimeoutEvent()
void TimerableService::cancelTimeoutEvent |
( |
TimeoutEvent * | timeout_event | ) |
|
◆ createTimeoutEvent()
TimeoutEvent * TimerableService::createTimeoutEvent |
( |
int | fd, |
|
|
void * | data, |
|
|
uint64_t | seconds ) |
Create a timeout event
- Note
- Each file descriptor can correspond to only one timeout event.
Repeating the file descriptor will cause the original timeout event to be overwritten.
Typically, file descriptors refer to socket file descriptors.
For custom timeout events unrelated to sockets,
the file descriptor can be set to a negative number less than -1.
The timeout service does not care about the sign of the file descriptor.
- Parameters
-
fd | File descriptor |
data | Extra data |
seconds | Timeout in seconds |
- Returns
- Timeout event structure
References sese::service::v2::TimeoutEvent::data, startTimestamp, timeoutMap, and timeoutTable.
◆ dispatch()
void TimerableService::dispatch |
( |
uint32_t | timeout | ) |
|
|
override |
◆ freeTimeoutEvent()
void TimerableService::freeTimeoutEvent |
( |
TimeoutEvent * | timeout_event | ) |
|
◆ getTimeoutEventByFd()
TimeoutEvent * TimerableService::getTimeoutEventByFd |
( |
int | fd | ) |
|
Get the timeout event structure by file descriptor
- Parameters
-
- Return values
-
nullptr | The corresponding timeout event does not exist |
- Returns
- The corresponding timeout event structure
References timeoutMap.
◆ init()
bool TimerableService::init |
( |
| ) |
|
|
override |
◆ onTimeout()
void TimerableService::onTimeout |
( |
TimeoutEvent * | timeout_event | ) |
|
|
virtual |
◆ setTimeoutEvent()
void TimerableService::setTimeoutEvent |
( |
TimeoutEvent * | timeout_event, |
|
|
uint64_t | seconds ) |
◆ startTimestamp
uint64_t sese::service::v1::TimerableService::startTimestamp {0} |
|
private |
◆ timeoutMap
std::map<int, TimeoutEvent *> sese::service::v1::TimerableService::timeoutMap |
|
private |
◆ timeoutTable
std::list<TimeoutEvent *> sese::service::v1::TimerableService::timeoutTable[60] {} |
|
private |
The documentation for this class was generated from the following files: