CppCMS
|
A timer object. More...
#include <booster/booster/aio/deadline_timer.h>
Public Member Functions | |
deadline_timer () | |
deadline_timer (io_service &srv) | |
io_service & | get_io_service () |
void | set_io_service (io_service &srv) |
void | reset_io_service () |
void | expires_from_now (ptime t) |
ptime | expires_from_now () |
void | expires_at (ptime t) |
ptime | expires_at () |
void | wait () |
void | async_wait (event_handler const &h) |
void | cancel () |
Friends | |
struct | waiter |
A timer object.
Create a new timer object
Create a new timer object connected to the io_service srv
void booster::aio::deadline_timer::async_wait | ( | event_handler const & | h | ) |
Wait asynchronously for the timer.
If io_service is not assigned throws system::system_error, all other errors reported via h
void booster::aio::deadline_timer::cancel | ( | ) |
Cancel asynchronous operation. The active handler is immediately scheduled for execution with booster::aio::aio_error::cancel error code in booster::aio::aio_error_cat category.
It allows to distinguish between operation cancellation and normal completion
Set an absolute expiration time
If the function is called during the wait operation the behavior is undefined
Get an absolute expiration time
Set an expiration time relativelty to the current point with an offset t
If the function is called during the wait operation the behavior is undefined
Get an expiration time relativelty to the current point with an offset t
Returns the connected io_service, throws system::system_error if no io_service connected
Unsets the io_service. Cancels all pending asynchronous operations on the connected io_service.
void booster::aio::deadline_timer::set_io_service | ( | io_service & | srv | ) |
Sets new io_service. Cancels all pending asynchronous operations on the connected io_service.
void booster::aio::deadline_timer::wait | ( | ) |
Wait synchronously for the timer