Realistic 3D camera system
3D camera system components
|
Provides waitable timer functionality. More...
#include <basic_waitable_timer.hpp>
Public Types | |
typedef Clock | clock_type |
The clock type. More... | |
typedef clock_type::duration | duration |
The duration type of the clock. More... | |
typedef clock_type::time_point | time_point |
The time point type of the clock. More... | |
typedef WaitTraits | traits_type |
The wait traits type. More... | |
Public Types inherited from asio::basic_io_object< WaitableTimerService > | |
typedef WaitableTimerService | service_type |
The type of the service that will be used to provide I/O operations. More... | |
typedef service_type::implementation_type | implementation_type |
The underlying implementation type of I/O object. More... | |
Public Member Functions | |
basic_waitable_timer (asio::io_service &io_service) | |
Constructor. More... | |
basic_waitable_timer (asio::io_service &io_service, const time_point &expiry_time) | |
Constructor to set a particular expiry time as an absolute time. More... | |
basic_waitable_timer (asio::io_service &io_service, const duration &expiry_time) | |
Constructor to set a particular expiry time relative to now. More... | |
std::size_t | cancel () |
Cancel any asynchronous operations that are waiting on the timer. More... | |
std::size_t | cancel (asio::error_code &ec) |
Cancel any asynchronous operations that are waiting on the timer. More... | |
std::size_t | cancel_one () |
Cancels one asynchronous operation that is waiting on the timer. More... | |
std::size_t | cancel_one (asio::error_code &ec) |
Cancels one asynchronous operation that is waiting on the timer. More... | |
time_point | expires_at () const |
Get the timer's expiry time as an absolute time. More... | |
std::size_t | expires_at (const time_point &expiry_time) |
Set the timer's expiry time as an absolute time. More... | |
std::size_t | expires_at (const time_point &expiry_time, asio::error_code &ec) |
Set the timer's expiry time as an absolute time. More... | |
duration | expires_from_now () const |
Get the timer's expiry time relative to now. More... | |
std::size_t | expires_from_now (const duration &expiry_time) |
Set the timer's expiry time relative to now. More... | |
std::size_t | expires_from_now (const duration &expiry_time, asio::error_code &ec) |
Set the timer's expiry time relative to now. More... | |
void | wait () |
Perform a blocking wait on the timer. More... | |
void | wait (asio::error_code &ec) |
Perform a blocking wait on the timer. More... | |
template<typename WaitHandler > | |
ASIO_INITFN_RESULT_TYPE (WaitHandler, void(asio::error_code)) async_wait(ASIO_MOVE_ARG(WaitHandler) handler) | |
Start an asynchronous wait on the timer. More... | |
Public Member Functions inherited from asio::basic_io_object< WaitableTimerService > | |
asio::io_service & | get_io_service () |
Get the io_service associated with the object. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from asio::basic_io_object< WaitableTimerService > | |
basic_io_object (asio::io_service &io_service) | |
Construct a basic_io_object. More... | |
~basic_io_object () | |
Protected destructor to prevent deletion through this type. More... | |
service_type & | get_service () |
Get the service associated with the I/O object. More... | |
const service_type & | get_service () const |
Get the service associated with the I/O object. More... | |
implementation_type & | get_implementation () |
Get the underlying implementation of the I/O object. More... | |
const implementation_type & | get_implementation () const |
Get the underlying implementation of the I/O object. More... | |
Protected Attributes inherited from asio::basic_io_object< WaitableTimerService > | |
service_type & | service |
implementation_type | implementation |
Provides waitable timer functionality.
The basic_waitable_timer class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
A waitable timer is always in one of two states: "expired" or "not expired". If the wait() or async_wait() function is called on an expired timer, the wait operation will complete immediately.
Most applications will use one of the asio::steady_timer, asio::system_timer or asio::high_resolution_timer typedefs.
<chrono>
facility, or with the Boost.Chrono library.Changing the expiry time of a timer while there are pending asynchronous waits causes those wait operations to be cancelled. To ensure that the action associated with the timer is performed only once, use something like this: used:
Definition at line 126 of file basic_waitable_timer.hpp.
typedef Clock asio::basic_waitable_timer< Clock, WaitTraits, WaitableTimerService >::clock_type |
The clock type.
Definition at line 131 of file basic_waitable_timer.hpp.
typedef clock_type::duration asio::basic_waitable_timer< Clock, WaitTraits, WaitableTimerService >::duration |
The duration type of the clock.
Definition at line 134 of file basic_waitable_timer.hpp.
typedef clock_type::time_point asio::basic_waitable_timer< Clock, WaitTraits, WaitableTimerService >::time_point |
The time point type of the clock.
Definition at line 137 of file basic_waitable_timer.hpp.
typedef WaitTraits asio::basic_waitable_timer< Clock, WaitTraits, WaitableTimerService >::traits_type |
The wait traits type.
Definition at line 140 of file basic_waitable_timer.hpp.
|
inlineexplicit |
Constructor.
This constructor creates a timer without setting an expiry time. The expires_at() or expires_from_now() functions must be called to set an expiry time before the timer can be waited on.
io_service | The io_service object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. |
Definition at line 151 of file basic_waitable_timer.hpp.
|
inline |
Constructor to set a particular expiry time as an absolute time.
This constructor creates a timer and sets the expiry time.
io_service | The io_service object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. |
expiry_time | The expiry time to be used for the timer, expressed as an absolute time. |
Definition at line 166 of file basic_waitable_timer.hpp.
|
inline |
Constructor to set a particular expiry time relative to now.
This constructor creates a timer and sets the expiry time.
io_service | The io_service object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. |
expiry_time | The expiry time to be used for the timer, relative to now. |
Definition at line 185 of file basic_waitable_timer.hpp.
|
inline |
Start an asynchronous wait on the timer.
This function may be used to initiate an asynchronous wait against the timer. It always returns immediately.
For each call to async_wait(), the supplied handler will be called exactly once. The handler will be called when:
handler | The handler to be called when the timer expires. Copies will be made of the handler as required. The function signature of the handler must be: Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post(). |
Definition at line 502 of file basic_waitable_timer.hpp.
|
inline |
Cancel any asynchronous operations that are waiting on the timer.
This function forces the completion of any pending asynchronous wait operations against the timer. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancelling the timer does not change the expiry time.
asio::system_error | Thrown on failure. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 216 of file basic_waitable_timer.hpp.
|
inline |
Cancel any asynchronous operations that are waiting on the timer.
This function forces the completion of any pending asynchronous wait operations against the timer. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancelling the timer does not change the expiry time.
ec | Set to indicate what error occurred, if any. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 246 of file basic_waitable_timer.hpp.
|
inline |
Cancels one asynchronous operation that is waiting on the timer.
This function forces the completion of one pending asynchronous wait operation against the timer. Handlers are cancelled in FIFO order. The handler for the cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancelling the timer does not change the expiry time.
asio::system_error | Thrown on failure. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 275 of file basic_waitable_timer.hpp.
|
inline |
Cancels one asynchronous operation that is waiting on the timer.
This function forces the completion of one pending asynchronous wait operation against the timer. Handlers are cancelled in FIFO order. The handler for the cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancelling the timer does not change the expiry time.
ec | Set to indicate what error occurred, if any. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 307 of file basic_waitable_timer.hpp.
|
inline |
Get the timer's expiry time as an absolute time.
This function may be used to obtain the timer's current expiry time. Whether the timer has expired or not does not affect this value.
Definition at line 317 of file basic_waitable_timer.hpp.
|
inline |
Set the timer's expiry time as an absolute time.
This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
expiry_time | The expiry time to be used for the timer. |
asio::system_error | Thrown on failure. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 344 of file basic_waitable_timer.hpp.
|
inline |
Set the timer's expiry time as an absolute time.
This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
expiry_time | The expiry time to be used for the timer. |
ec | Set to indicate what error occurred, if any. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 375 of file basic_waitable_timer.hpp.
|
inline |
Get the timer's expiry time relative to now.
This function may be used to obtain the timer's current expiry time. Whether the timer has expired or not does not affect this value.
Definition at line 386 of file basic_waitable_timer.hpp.
|
inline |
Set the timer's expiry time relative to now.
This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
expiry_time | The expiry time to be used for the timer. |
asio::system_error | Thrown on failure. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 413 of file basic_waitable_timer.hpp.
|
inline |
Set the timer's expiry time relative to now.
This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
expiry_time | The expiry time to be used for the timer. |
ec | Set to indicate what error occurred, if any. |
These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
Definition at line 444 of file basic_waitable_timer.hpp.
|
inline |
Perform a blocking wait on the timer.
This function is used to wait for the timer to expire. This function blocks and does not return until the timer has expired.
asio::system_error | Thrown on failure. |
Definition at line 458 of file basic_waitable_timer.hpp.
|
inline |
Perform a blocking wait on the timer.
This function is used to wait for the timer to expire. This function blocks and does not return until the timer has expired.
ec | Set to indicate what error occurred, if any. |
Definition at line 472 of file basic_waitable_timer.hpp.