11 #ifndef ASIO_BASIC_DEADLINE_TIMER_HPP 12 #define ASIO_BASIC_DEADLINE_TIMER_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) 122 template <
typename Time,
123 typename TimeTraits = asio::time_traits<Time>,
124 typename TimerService = deadline_timer_service<Time, TimeTraits> >
125 class basic_deadline_timer
126 :
public basic_io_object<TimerService>
130 typedef TimeTraits traits_type;
133 typedef typename traits_type::time_type time_type;
136 typedef typename traits_type::duration_type duration_type;
148 : basic_io_object<TimerService>(io_service)
163 const time_type& expiry_time)
164 : basic_io_object<TimerService>(io_service)
167 this->service.expires_at(this->implementation, expiry_time, ec);
182 const duration_type& expiry_time)
183 : basic_io_object<TimerService>(io_service)
186 this->service.expires_from_now(this->implementation, expiry_time, ec);
215 std::size_t
s = this->service.cancel(this->implementation, ec);
244 return this->service.cancel(this->implementation, ec);
271 std::size_t cancel_one()
274 std::size_t s = this->service.cancel_one(this->implementation, ec);
305 return this->service.cancel_one(this->implementation, ec);
313 time_type expires_at()
const 315 return this->service.expires_at(this->implementation);
340 std::size_t expires_at(
const time_type& expiry_time)
343 std::size_t s = this->service.expires_at(
344 this->implementation, expiry_time, ec);
371 std::size_t expires_at(
const time_type& expiry_time,
374 return this->service.expires_at(this->implementation, expiry_time, ec);
382 duration_type expires_from_now()
const 384 return this->service.expires_from_now(this->implementation);
409 std::size_t expires_from_now(
const duration_type& expiry_time)
412 std::size_t s = this->service.expires_from_now(
413 this->implementation, expiry_time, ec);
440 std::size_t expires_from_now(
const duration_type& expiry_time,
443 return this->service.expires_from_now(
444 this->implementation, expiry_time, ec);
457 this->service.wait(this->implementation, ec);
470 this->service.wait(this->implementation, ec);
497 template <
typename WaitHandler>
506 return this->service.async_wait(this->implementation,
513 #include "asio/detail/pop_options.hpp" 515 #endif // defined(ASIO_HAS_BOOST_DATE_TIME) 518 #endif // ASIO_BASIC_DEADLINE_TIMER_HPP void throw_error(const asio::error_code &err)
Provides core I/O functionality.
#define ASIO_WAIT_HANDLER_CHECK(handler_type, 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)