xentara-utils v2.0.4
The Xentara Utility Library
|
A class that allows interrupting wait operations on communications classes. More...
#include <xentara/utils/io/StopSource.hpp>
Public Member Functions | |
internal auto | requestStop () -> void |
Requests all associated operations to stop. | |
auto | reset () -> void |
Resets the object so that is can be used again. | |
auto | handle () const noexcept -> HANDLE |
Returns a handle that can be used to wait for the stop source to be triggered. | |
auto | pollFd () const noexcept -> ::pollfd |
Creates a pollfd structure that can be used to wait for the stop source to be triggered. | |
A class that allows interrupting wait operations on communications classes.
This class allows interruption of blocking wait functions on communication classes like ipc::NamedPipe. This is normally done so that the device can be closed and the service stopped when the application is shut down. The methods of the communications class that are affected by the stop source will throw an exception of type io::StopRequested if a stop is requested while they run, or has been requested before thay ran.
|
noexcept |
Returns a handle that can be used to wait for the stop source to be triggered.
The returned handle is suitable for use in functions like WaitForSingleObject or WaitForMultipleObjects.
|
noexcept |
Creates a pollfd structure that can be used to wait for the stop source to be triggered.
The returned structure can be used in poll() to wait for the stop request.
internal auto xentara::utils::io::StopSource::requestStop | ( | ) | -> void |
Requests all associated operations to stop.
Affected functions will throw an exception of type io::StopRequested.
auto xentara::utils::io::StopSource::reset | ( | ) | -> void |
Resets the object so that is can be used again.