Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::async::AnyStopToken Class Reference

A type-erased stop token. More...

#include <AnyStopToken.hpp>

Public Member Functions

template<SomeStopToken TokenType>
requires NotSameAs<TokenType, AnyStopToken>
 AnyStopToken (TokenType &&token)
 Construct a new type-erased Stop Token object.
 
bool isStopRequested () const noexcept
 Check if stop is requested.
 
 operator bool () const noexcept
 Check if stop is requested.
 
 operator boost::asio::yield_context () const
 Get the underlying boost::asio::yield_context.
 

Detailed Description

A type-erased stop token.

Constructor & Destructor Documentation

◆ AnyStopToken()

template<SomeStopToken TokenType>
requires NotSameAs<TokenType, AnyStopToken>
util::async::AnyStopToken::AnyStopToken ( TokenType && token)
inline

Construct a new type-erased Stop Token object.

Template Parameters
TokenTypeThe type of the stop token to wrap
Parameters
tokenThe stop token to wrap

Member Function Documentation

◆ isStopRequested()

bool util::async::AnyStopToken::isStopRequested ( ) const
inlinenodiscardnoexcept

Check if stop is requested.

Returns
true if stop is requested; false otherwise

◆ operator bool()

util::async::AnyStopToken::operator bool ( ) const
inlinenodiscardnoexcept

Check if stop is requested.

Returns
true if stop is requested; false otherwise

◆ operator boost::asio::yield_context()

util::async::AnyStopToken::operator boost::asio::yield_context ( ) const
inlinenodiscard

Get the underlying boost::asio::yield_context.

Note
ASSERTs if the stop token is not convertible to boost::asio::yield_context
Returns
The underlying boost::asio::yield_context

The documentation for this class was generated from the following file: