Realistic 3D camera system
3D camera system components
|
Provides signal functionality. More...
#include <basic_signal_set.hpp>
Public Member Functions | |
basic_signal_set (asio::io_service &io_service) | |
Construct a signal set without adding any signals. More... | |
basic_signal_set (asio::io_service &io_service, int signal_number_1) | |
Construct a signal set and add one signal. More... | |
basic_signal_set (asio::io_service &io_service, int signal_number_1, int signal_number_2) | |
Construct a signal set and add two signals. More... | |
basic_signal_set (asio::io_service &io_service, int signal_number_1, int signal_number_2, int signal_number_3) | |
Construct a signal set and add three signals. More... | |
void | add (int signal_number) |
Add a signal to a signal_set. More... | |
asio::error_code | add (int signal_number, asio::error_code &ec) |
Add a signal to a signal_set. More... | |
void | remove (int signal_number) |
Remove a signal from a signal_set. More... | |
asio::error_code | remove (int signal_number, asio::error_code &ec) |
Remove a signal from a signal_set. More... | |
void | clear () |
Remove all signals from a signal_set. More... | |
asio::error_code | clear (asio::error_code &ec) |
Remove all signals from a signal_set. More... | |
void | cancel () |
Cancel all operations associated with the signal set. More... | |
asio::error_code | cancel (asio::error_code &ec) |
Cancel all operations associated with the signal set. More... | |
template<typename SignalHandler > | |
ASIO_INITFN_RESULT_TYPE (SignalHandler, void(asio::error_code, int)) async_wait(ASIO_MOVE_ARG(SignalHandler) handler) | |
Start an asynchronous operation to wait for a signal to be delivered. More... | |
Public Member Functions inherited from asio::basic_io_object< SignalSetService > | |
asio::io_service & | get_io_service () |
Get the io_service associated with the object. More... | |
Additional Inherited Members | |
Public Types inherited from asio::basic_io_object< SignalSetService > | |
typedef SignalSetService | 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... | |
Protected Member Functions inherited from asio::basic_io_object< SignalSetService > | |
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< SignalSetService > | |
service_type & | service |
implementation_type | implementation |
Provides signal functionality.
The basic_signal_set class template provides the ability to perform an asynchronous wait for one or more signals to occur.
Most applications will use the asio::signal_set typedef.
If a signal is registered with a signal_set, and the signal occurs when there are no waiting handlers, then the signal notification is queued. The next async_wait operation on that signal_set will dequeue the notification. If multiple notifications are queued, subsequent async_wait operations dequeue them one at a time. Signal notifications are dequeued in order of ascending signal number.
If a signal number is removed from a signal_set (using the remove
or erase
member functions) then any queued notifications for that signal are discarded.
The same signal number may be registered with different signal_set objects. When the signal occurs, one handler is called for each signal_set object.
Note that multiple registration only works for signals that are registered using Asio. The application must not also register a signal handler using functions such as signal()
or sigaction()
.
POSIX allows signals to be blocked using functions such as sigprocmask()
and pthread_sigmask()
. For signals to be delivered, programs must ensure that any signals registered using signal_set objects are unblocked in at least one thread.
Definition at line 93 of file basic_signal_set.hpp.
|
inlineexplicit |
Construct a signal set without adding any signals.
This constructor creates a signal set without registering for any signals.
io_service | The io_service object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. |
Definition at line 104 of file basic_signal_set.hpp.
|
inline |
Construct a signal set and add one signal.
This constructor creates a signal set and registers for one signal.
io_service | The io_service object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. |
signal_number_1 | The signal number to be added. |
Definition at line 122 of file basic_signal_set.hpp.
|
inline |
Construct a signal set and add two signals.
This constructor creates a signal set and registers for two signals.
io_service | The io_service object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. |
signal_number_1 | The first signal number to be added. |
signal_number_2 | The second signal number to be added. |
Definition at line 146 of file basic_signal_set.hpp.
|
inline |
Construct a signal set and add three signals.
This constructor creates a signal set and registers for three signals.
io_service | The io_service object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. |
signal_number_1 | The first signal number to be added. |
signal_number_2 | The second signal number to be added. |
signal_number_3 | The third signal number to be added. |
Definition at line 176 of file basic_signal_set.hpp.
|
inline |
Add a signal to a signal_set.
This function adds the specified signal to the set. It has no effect if the signal is already in the set.
signal_number | The signal to be added to the set. |
asio::system_error | Thrown on failure. |
Definition at line 198 of file basic_signal_set.hpp.
|
inline |
Add a signal to a signal_set.
This function adds the specified signal to the set. It has no effect if the signal is already in the set.
signal_number | The signal to be added to the set. |
ec | Set to indicate what error occurred, if any. |
Definition at line 214 of file basic_signal_set.hpp.
|
inline |
Start an asynchronous operation to wait for a signal to be delivered.
This function may be used to initiate an asynchronous wait against the signal set. 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 signal occurs. Copies will be made of the handler as required. The function signature of the handler must be: void handler( int signal_number // Indicates which signal occurred. ); |
Definition at line 367 of file basic_signal_set.hpp.
|
inline |
Cancel all operations associated with the signal set.
This function forces the completion of any pending asynchronous wait operations against the signal set. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancellation does not alter the set of registered signals.
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 308 of file basic_signal_set.hpp.
|
inline |
Cancel all operations associated with the signal set.
This function forces the completion of any pending asynchronous wait operations against the signal set. The handler for each cancelled operation will be invoked with the asio::error::operation_aborted error code.
Cancellation does not alter the set of registered signals.
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 336 of file basic_signal_set.hpp.
|
inline |
Remove all signals from a signal_set.
This function removes all signals from the set. It has no effect if the set is already empty.
asio::system_error | Thrown on failure. |
Definition at line 266 of file basic_signal_set.hpp.
|
inline |
Remove all signals from a signal_set.
This function removes all signals from the set. It has no effect if the set is already empty.
ec | Set to indicate what error occurred, if any. |
Definition at line 282 of file basic_signal_set.hpp.
|
inline |
Remove a signal from a signal_set.
This function removes the specified signal from the set. It has no effect if the signal is not in the set.
signal_number | The signal to be removed from the set. |
asio::system_error | Thrown on failure. |
Definition at line 232 of file basic_signal_set.hpp.
|
inline |
Remove a signal from a signal_set.
This function removes the specified signal from the set. It has no effect if the signal is not in the set.
signal_number | The signal to be removed from the set. |
ec | Set to indicate what error occurred, if any. |
Definition at line 251 of file basic_signal_set.hpp.