11 #ifndef ASIO_WAITABLE_TIMER_SERVICE_HPP 12 #define ASIO_WAITABLE_TIMER_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 31 template <
typename Clock,
34 #if defined(GENERATING_DOCUMENTATION)
38 waitable_timer_service<Clock, WaitTraits> >
42 #if defined(GENERATING_DOCUMENTATION) 51 typedef typename clock_type::duration
duration;
66 #if defined(GENERATING_DOCUMENTATION) 76 service_impl_(io_service)
95 return service_impl_.
cancel(impl, ec);
115 return service_impl_.
expires_at(impl, expiry_time, ec);
134 service_impl_.
wait(impl, ec);
138 template <
typename WaitHandler>
141 async_wait(implementation_type& impl,
155 void shutdown_service()
161 service_impl_type service_impl_;
168 #endif // ASIO_WAITABLE_TIMER_SERVICE_HPP void wait(implementation_type &impl, asio::error_code &ec)
clock_type::time_point time_point
The time point type of the clock.
ASIO_MOVE_ARG(WaitHandler) handler)
Class used to uniquely identify a service.
Provides core I/O functionality.
std::size_t cancel_one(implementation_type &impl, asio::error_code &ec)
Cancels one asynchronous wait operation associated with the timer.
WaitTraits traits_type
The wait traits type.
asio::basic_streambuf< Allocator > MatchCondition enable_if< is_match_condition< MatchCondition >::value >::type *detail::async_result_init< ReadHandler, void(asio::error_code, std::size_t)> init(ASIO_MOVE_CAST(ReadHandler)(handler))
std::size_t cancel(implementation_type &impl, asio::error_code &ec)
Cancel any asynchronous wait operations associated with the timer.
std::size_t cancel_one(implementation_type &impl, asio::error_code &ec)
void wait(implementation_type &impl, asio::error_code &ec)
duration_type expires_from_now(const implementation_type &impl) const
std::size_t expires_at(implementation_type &impl, const time_point &expiry_time, asio::error_code &ec)
Set the expiry time for the timer as an absolute time.
void async_wait(implementation_type &impl, Handler &handler)
time_type expires_at(const implementation_type &impl) const
Wait traits suitable for use with the basic_waitable_timer class template.
duration expires_from_now(const implementation_type &impl) const
Get the expiry time for the timer relative to now.
void destroy(implementation_type &impl)
Destroy a timer implementation.
waitable_timer_service(asio::io_service &io_service)
Construct a new timer service for the specified io_service.
Class to represent an error code value.
ASIO_INITFN_RESULT_TYPE(WaitHandler, void(asio::error_code)) async_wait(implementation_type &impl
clock_type::duration duration
The duration type of the clock.
void construct(implementation_type &impl)
Construct a new timer implementation.
static asio::detail::service_id< waitable_timer_service< Clock, WaitTraits > > id
std::size_t expires_from_now(implementation_type &impl, const duration &expiry_time, asio::error_code &ec)
Set the expiry time for the timer relative to now.
void destroy(implementation_type &impl)
void construct(implementation_type &impl)
handler_type< Handler, Signature >::type handler
#define ASIO_MOVE_CAST(type)
async_result< typename handler_type< Handler, Signature >::type > result
Clock clock_type
The clock type.
service_base(asio::io_service &io_service)
Default service implementation for a timer.
Base class for all io_service services.
std::size_t cancel(implementation_type &impl, asio::error_code &ec)
service_impl_type::implementation_type implementation_type
The implementation type of the waitable timer.
time_point expires_at(const implementation_type &impl) const
Get the expiry time for the timer as an absolute time.