An object providing the means to check if a stop request has been made for its associated lely::util::StopSource object.
More...
#include <stop.hpp>
|
| StopToken () noexcept=default |
| Constructs an empty stop token with no assiociated stop-state. More...
|
|
| StopToken (const StopToken &other) noexcept |
| Constructs a stop token whose associated stop-state is the same as that if other. More...
|
|
| StopToken (StopToken &&other) noexcept |
| Constructs a stop token whose associated stop-state is the same as that if other; other is left as valid stop token with no associated stop-state. More...
|
|
StopToken & | operator= (const StopToken &other) noexcept |
| Copy-assigns the stop-state of other to *this . More...
|
|
StopToken & | operator= (StopToken &&other) noexcept |
| Move-assigns the stop-state of other to *this . More...
|
|
| ~StopToken () |
| Destroys a stop token. More...
|
|
| operator bool () const noexcept |
| Returns true if *this has a stop-state, and false otherwise.
|
|
bool | stop_requested () const noexcept |
| Returns true if *this has a stop-state and it has received a stop request, and false otherwise. More...
|
|
bool | stop_possible () const noexcept |
| Returns true if *this has a stop-state and it has received a stop request, or if it has an associated stop source that can still issue such a request, and false otherwise. More...
|
|
void | swap (StopToken &other) noexcept |
| Exchanges the stop-state of *this and other/.
|
|
|
bool | operator== (const StopToken &lhs, const StopToken &rhs) noexcept |
| Returns true if lhs and rhs have the same stop-state, and false otherwise.
|
|
bool | operator!= (const StopToken &lhs, const StopToken &rhs) noexcept |
| Returns false if lhs and rhs have the same stop-state, and true otherwise.
|
|
void | swap (StopToken &lhs, StopToken &rhs) noexcept |
| Exchanges the stop-state of lhs with rhs.
|
|
An object providing the means to check if a stop request has been made for its associated lely::util::StopSource object.
It is essentially a thread-safe "view" of the associated stop-state.
Definition at line 40 of file stop.hpp.
◆ StopToken() [1/3]
lely::util::StopToken::StopToken |
( |
| ) |
|
|
defaultnoexcept |
◆ StopToken() [2/3]
lely::util::StopToken::StopToken |
( |
const StopToken & |
other | ) |
|
|
inlinenoexcept |
Constructs a stop token whose associated stop-state is the same as that if other.
- Postcondition
*this
and other compare equal.
- See also
- stop_token_acquire()
Definition at line 60 of file stop.hpp.
◆ StopToken() [3/3]
lely::util::StopToken::StopToken |
( |
StopToken && |
other | ) |
|
|
inlinenoexcept |
Constructs a stop token whose associated stop-state is the same as that if other; other is left as valid stop token with no associated stop-state.
- Postcondition
other.stop_possible()
returns false
.
Definition at line 70 of file stop.hpp.
◆ ~StopToken()
lely::util::StopToken::~StopToken |
( |
| ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
Move-assigns the stop-state of other to *this
.
After the assignment, *this
contains the previous stop-state of other, and other has no stop-state.
- Postcondition
other.stop_possible()
returns false
.
Definition at line 98 of file stop.hpp.
◆ stop_requested()
bool lely::util::StopToken::stop_requested |
( |
| ) |
const |
|
inlinenoexcept |
◆ stop_possible()
bool lely::util::StopToken::stop_possible |
( |
| ) |
const |
|
inlinenoexcept |
Returns true
if *this
has a stop-state and it has received a stop request, or if it has an associated stop source that can still issue such a request, and false
otherwise.
- See also
- stop_token_stop_possible()
Definition at line 136 of file stop.hpp.
The documentation for this class was generated from the following file: