Bifrost SDK
Bifrost SDK documentation
Amino::StopToken Class Reference

A token that can be used to check if a stop has been requested. More...

#include <StopToken.h>

Public Member Functions

AMINO_CORE_SHARED_DECL StopToken () noexcept
 Default constructor (constructs an invalid StopToken that can't be stopped). More...
 
AMINO_CORE_SHARED_DECL StopToken (StopToken &&o) noexcept
 Move constructor. More...
 
AMINO_CORE_SHARED_DECL StopToken (StopToken const &o)
 Copy constructor. More...
 
AMINO_CORE_SHARED_DECL ~StopToken ()
 Destructor. More...
 
AMINO_CORE_SHARED_DECL StopTokenoperator= (StopToken &&o) noexcept
 Move assignment operator. More...
 
AMINO_CORE_SHARED_DECL StopTokenoperator= (StopToken const &o)
 Copy assignment operator. More...
 
AMINO_CORE_SHARED_DECL bool stopRequested () const
 Check if a stop has been requested on the StopSource that was used to create this StopToken. More...
 
AMINO_CORE_SHARED_DECL bool stopPossible () const
 Check if a stop can be requested on the StopSource that was used to create this StopToken. More...
 

Friends

bool operator== (StopToken const &lhs, StopToken const &rhs)
 Equality operators. More...
 
bool operator!= (StopToken const &lhs, StopToken const &rhs)
 Equality operators. More...
 

Detailed Description

A token that can be used to check if a stop has been requested.

Note
Essentially the same as std::stop_token.

Definition at line 45 of file StopToken.h.

Constructor & Destructor Documentation

◆ StopToken() [1/3]

AMINO_CORE_SHARED_DECL Amino::StopToken::StopToken ( )
noexcept

Default constructor (constructs an invalid StopToken that can't be stopped).

Postcondition
stopPossible() will return false.

◆ StopToken() [2/3]

AMINO_CORE_SHARED_DECL Amino::StopToken::StopToken ( StopToken &&  o)
noexcept

Move constructor.

◆ StopToken() [3/3]

AMINO_CORE_SHARED_DECL Amino::StopToken::StopToken ( StopToken const &  o)

Copy constructor.

◆ ~StopToken()

AMINO_CORE_SHARED_DECL Amino::StopToken::~StopToken ( )

Destructor.

Member Function Documentation

◆ operator=() [1/2]

AMINO_CORE_SHARED_DECL StopToken & Amino::StopToken::operator= ( StopToken &&  o)
noexcept

Move assignment operator.

◆ operator=() [2/2]

AMINO_CORE_SHARED_DECL StopToken & Amino::StopToken::operator= ( StopToken const &  o)

Copy assignment operator.

◆ stopPossible()

AMINO_CORE_SHARED_DECL bool Amino::StopToken::stopPossible ( ) const

Check if a stop can be requested on the StopSource that was used to create this StopToken.

See StopSource::stopPossible() for more information.

◆ stopRequested()

AMINO_CORE_SHARED_DECL bool Amino::StopToken::stopRequested ( ) const

Check if a stop has been requested on the StopSource that was used to create this StopToken.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( StopToken const &  lhs,
StopToken const &  rhs 
)
friend

Equality operators.

Definition at line 73 of file StopToken.h.

◆ operator==

bool operator== ( StopToken const &  lhs,
StopToken const &  rhs 
)
friend

Equality operators.

Definition at line 70 of file StopToken.h.