|
Lely core libraries 2.3.5
|
An object providing the means to issue a stop request. More...
#include <stop.hpp>
Public Member Functions | |
| StopSource () | |
| Constructs a stop source with a new stop-state. | |
| StopSource (stop_source_t *source) noexcept | |
| Constructs an empty stop source with no assiociated stop-state. | |
| StopSource (const StopSource &other) noexcept | |
| Constructs a stop source whose associated stop-state is the same as that if other. | |
| StopSource (StopSource &&other) noexcept | |
| Constructs a stop source whose associated stop-state is the same as that if other; other is left as valid stop source with no associated stop-state. | |
| StopSource & | operator= (const StopSource &other) noexcept |
Copy-assigns the stop-state of other to *this. | |
| StopSource & | operator= (StopSource &&other) noexcept |
Move-assigns the stop-state of other to *this. | |
| ~StopSource () | |
| Destroys a stop source. | |
| operator bool () const noexcept | |
Returns true if *this has a stop-state, and false otherwise. | |
| bool | request_stop () noexcept |
Issues a stop requests to the stop-state, if *this has a stop-state` and it has not already received a stop request. | |
| bool | stop_requested () const noexcept |
Returns true if *this has a stop-state and it has received a stop request, and false otherwise. | |
| bool | stop_possible () const noexcept |
Returns true if *this has a stop-state, and false otherwise. | |
| void | swap (StopSource &other) noexcept |
Exchanges the stop-state of *this and other/. | |
| StopToken | get_token () const noexcept |
Returns a stop token associated with the stop-state of *this, if it has any, and a default-constructed (empty) stop token otherwise. | |
Friends | |
| bool | operator== (const StopSource &lhs, const StopSource &rhs) noexcept |
Returns true if lhs and rhs have the same stop-state, and false otherwise. | |
| bool | operator!= (const StopSource &lhs, const StopSource &rhs) noexcept |
Returns false if lhs and rhs have the same stop-state, and true otherwise. | |
| void | swap (StopSource &lhs, StopSource &rhs) noexcept |
| Exchanges the stop-state of lhs with rhs. | |
An object providing the means to issue a stop request.
A stop request is visible to all lely::util::StopSource and lely::util::StopToken objects of the same associated stop-state.
|
inline |
Constructs a stop source with a new stop-state.
|
inlineexplicitnoexcept |
Constructs an empty stop source with no assiociated stop-state.
false.
|
inlinenoexcept |
Constructs a stop source whose associated stop-state is the same as that if other.
*this and other compare equal.
|
inlinenoexcept |
|
inline |
Destroys a stop source.
If *this has a stop-state, its ownership is released.
|
inlinenoexcept |
Copy-assigns the stop-state of other to *this.
*this and other compare equal.
|
inlinenoexcept |
|
inlinenoexcept |
Issues a stop requests to the stop-state, if *this has a stop-state` and it has not already received a stop request.
Once a stop is requested, it cannot be withdrawn. If a stop request is issued, any lely::util::StopCallback callbacks registered with a lely::util::StopToken with the same associated stop-state are invoked synchronously on the calling thread.
true if a stop request was issued, and false if not. In the latter case, another thread MAY still be in the middle of invoking a lely::util::StopCallback callback.false or stop_requested() returns true.
|
inlinenoexcept |
Returns true if *this has a stop-state and it has received a stop request, and false otherwise.