11 #ifndef ASIO_BASIC_WAITABLE_TIMER_HPP 12 #define ASIO_BASIC_WAITABLE_TIMER_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 123 template <
typename Clock,
125 typename WaitableTimerService = waitable_timer_service<Clock, WaitTraits> >
167 const time_point& expiry_time)
186 const duration& expiry_time)
347 std::size_t
s = this->
service.expires_at(
416 std::size_t
s = this->
service.expires_from_now(
447 return this->
service.expires_from_now(
501 template <
typename WaitHandler>
519 #endif // ASIO_BASIC_WAITABLE_TIMER_HPP void throw_error(const asio::error_code &err)
Provides core I/O functionality.
void wait()
Perform a blocking wait on the timer.
Base class for all I/O objects.
std::size_t expires_from_now(const duration &expiry_time, asio::error_code &ec)
Set the timer's expiry time relative to now.
std::size_t expires_from_now(const duration &expiry_time)
Set the timer's expiry time relative to now.
#define ASIO_WAIT_HANDLER_CHECK(handler_type, handler)
Clock clock_type
The clock type.
time_point expires_at() const
Get the timer's expiry time as an absolute time.
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
WaitTraits traits_type
The wait traits type.
implementation_type implementation
Wait traits suitable for use with the basic_waitable_timer class template.
Class to represent an error code value.
basic_waitable_timer(asio::io_service &io_service)
Constructor.
ASIO_INITFN_RESULT_TYPE(WaitHandler, void(asio::error_code)) async_wait(ASIO_MOVE_ARG(WaitHandler) handler)
Start an asynchronous wait on the timer.
std::size_t expires_at(const time_point &expiry_time, asio::error_code &ec)
Set the timer's expiry time as an absolute time.
std::size_t cancel_one(asio::error_code &ec)
Cancels one asynchronous operation that is waiting on the timer.
basic_waitable_timer(asio::io_service &io_service, const duration &expiry_time)
Constructor to set a particular expiry time relative to now.
std::size_t cancel_one()
Cancels one asynchronous operation that is waiting on the timer.
Provides waitable timer functionality.
std::size_t cancel()
Cancel any asynchronous operations that are waiting on the timer.
#define ASIO_MOVE_CAST(type)
std::size_t expires_at(const time_point &expiry_time)
Set the timer's expiry time as an absolute time.
clock_type::time_point time_point
The time point type of the clock.
duration expires_from_now() const
Get the timer's expiry time relative to now.
clock_type::duration duration
The duration type of the clock.
basic_waitable_timer(asio::io_service &io_service, const time_point &expiry_time)
Constructor to set a particular expiry time as an absolute time.
std::size_t cancel(asio::error_code &ec)
Cancel any asynchronous operations that are waiting on the timer.
void wait(asio::error_code &ec)
Perform a blocking wait on the timer.