11 #ifndef ASIO_DEADLINE_TIMER_SERVICE_HPP 12 #define ASIO_DEADLINE_TIMER_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_BOOST_DATE_TIME) \ 21 || defined(GENERATING_DOCUMENTATION) 35 template <
typename TimeType,
36 typename TimeTraits = asio::time_traits<TimeType> >
37 class deadline_timer_service
38 #if defined(GENERATING_DOCUMENTATION)
42 deadline_timer_service<TimeType, TimeTraits> >
46 #if defined(GENERATING_DOCUMENTATION) 52 typedef TimeTraits traits_type;
55 typedef typename traits_type::time_type time_type;
58 typedef typename traits_type::duration_type duration_type;
62 typedef detail::deadline_timer_service<traits_type> service_impl_type;
66 #if defined(GENERATING_DOCUMENTATION) 67 typedef implementation_defined implementation_type;
69 typedef typename service_impl_type::implementation_type implementation_type;
74 :
asio::detail::service_base<
75 deadline_timer_service<TimeType, TimeTraits> >(io_service),
76 service_impl_(io_service)
81 void construct(implementation_type& impl)
83 service_impl_.construct(impl);
87 void destroy(implementation_type& impl)
89 service_impl_.destroy(impl);
95 return service_impl_.cancel(impl, ec);
99 std::size_t cancel_one(implementation_type& impl,
102 return service_impl_.cancel_one(impl, ec);
106 time_type expires_at(
const implementation_type& impl)
const 108 return service_impl_.expires_at(impl);
112 std::size_t expires_at(implementation_type& impl,
115 return service_impl_.expires_at(impl, expiry_time, ec);
119 duration_type expires_from_now(
const implementation_type& impl)
const 121 return service_impl_.expires_from_now(impl);
125 std::size_t expires_from_now(implementation_type& impl,
128 return service_impl_.expires_from_now(impl, expiry_time, ec);
134 service_impl_.wait(impl, ec);
138 template <
typename WaitHandler>
141 async_wait(implementation_type& impl,
144 detail::async_result_init<
148 service_impl_.async_wait(impl,
init.handler);
150 return init.result.get();
155 void shutdown_service()
157 service_impl_.shutdown_service();
161 service_impl_type service_impl_;
168 #endif // defined(ASIO_HAS_BOOST_DATE_TIME) 171 #endif // ASIO_DEADLINE_TIMER_SERVICE_HPP
Class used to uniquely identify a service.
Provides core I/O functionality.
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))
ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void(asio::error_code, Iterator)) async_connect(basic_socket< Protocol
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
Class to represent an error code value.
#define ASIO_MOVE_CAST(type)
Base class for all io_service services.