hpx/synchronization/stop_token.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx

Functions

template<typename Callback>
stop_callback(stop_token, Callback)
void swap(stop_token &lhs, stop_token &rhs)
void swap(stop_source &lhs, stop_source &rhs)

Variables

constexpr nostopstate_t nostopstate = {}
struct nostopstate_t

Public Functions

nostopstate_t()
template<typename Callback>
class stop_callback

Public Types

template<>
using callback_type = Callback

Public Functions

template<typename CB, typename Enable = std::enable_if_t<std::is_constructible_v<Callback, CB>>>
stop_callback(stop_token const &st, CB &&cb)
template<typename CB, typename Enable = std::enable_if_t<std::is_constructible_v<Callback, CB>>>
stop_callback(stop_token &&st, CB &&cb)
~stop_callback()
stop_callback(stop_callback const&)
stop_callback(stop_callback&&)
stop_callback &operator=(stop_callback const&)
stop_callback &operator=(stop_callback&&)

Private Functions

void execute()

Private Members

HPX_NO_UNIQUE_ADDRESS Callback hpx::stop_callback::callback_
hpx::intrusive_ptr<detail::stop_state> state_
class stop_source

Public Functions

stop_source()
stop_source(nostopstate_t)
stop_source(stop_source const &rhs)
stop_source(stop_source&&)
stop_source &operator=(stop_source const &rhs)
stop_source &operator=(stop_source&&)
~stop_source()
void swap(stop_source &s)
stop_token get_token() const
bool stop_possible() const
bool stop_requested() const
bool request_stop()

Private Members

hpx::intrusive_ptr<detail::stop_state> state_

Friends

bool operator==(stop_source const &lhs, stop_source const &rhs)
bool operator!=(stop_source const &lhs, stop_source const &rhs)
class stop_token

Public Types

template<typename Callback>
using callback_type = stop_callback<Callback>

Public Functions

stop_token()
stop_token(stop_token const &rhs)
stop_token(stop_token&&)
stop_token &operator=(stop_token const &rhs)
stop_token &operator=(stop_token&&)
~stop_token()
void swap(stop_token &s)
bool stop_requested() const
bool stop_possible() const

Private Functions

stop_token(hpx::intrusive_ptr<detail::stop_state> const &state)

Private Members

hpx::intrusive_ptr<detail::stop_state> state_

Friends

friend hpx::stop_callback
friend hpx::stop_source
bool operator==(stop_token const &lhs, stop_token const &rhs)
bool operator!=(stop_token const &lhs, stop_token const &rhs)
namespace p2300_stop_token

Functions

template<typename Callback>
in_place_stop_callback(in_place_stop_token, Callback)
template<typename Callback>
class in_place_stop_callback

Public Types

template<>
using callback_type = Callback

Public Functions

template<typename CB, typename Enable = std::enable_if_t<std::is_constructible_v<Callback, CB>>>
in_place_stop_callback(in_place_stop_token const &st, CB &&cb)
template<typename CB, typename Enable = std::enable_if_t<std::is_constructible_v<Callback, CB>>>
in_place_stop_callback(in_place_stop_token &&st, CB &&cb)
~in_place_stop_callback()
in_place_stop_callback(in_place_stop_callback const&)
in_place_stop_callback(in_place_stop_callback&&)
in_place_stop_callback &operator=(in_place_stop_callback const&)
in_place_stop_callback &operator=(in_place_stop_callback&&)

Private Functions

void execute()

Private Members

HPX_NO_UNIQUE_ADDRESS Callback hpx::p2300_stop_token::in_place_stop_callback::callback_
in_place_stop_source *source_
class in_place_stop_source

Public Functions

in_place_stop_source()
~in_place_stop_source()
in_place_stop_source(in_place_stop_source const&)
in_place_stop_source(in_place_stop_source&&)
in_place_stop_source &operator=(in_place_stop_source const&)
in_place_stop_source &operator=(in_place_stop_source&&)
in_place_stop_token get_token() const
bool request_stop()
bool stop_requested() const
bool stop_possible() const

Private Functions

bool register_callback(hpx::detail::stop_callback_base *cb)
void remove_callback(hpx::detail::stop_callback_base *cb)

Private Members

hpx::detail::stop_state state_

Friends

friend hpx::p2300_stop_token::in_place_stop_token
friend hpx::p2300_stop_token::in_place_stop_callback
class in_place_stop_token

Public Types

template<typename Callback>
using callback_type = in_place_stop_callback<Callback>

Public Functions

constexpr in_place_stop_token()
in_place_stop_token(in_place_stop_token const &rhs)
in_place_stop_token(in_place_stop_token &&rhs)
in_place_stop_token &operator=(in_place_stop_token const &rhs)
in_place_stop_token &operator=(in_place_stop_token &&rhs)
bool stop_requested() const
bool stop_possible() const
void swap(in_place_stop_token &rhs)

Private Functions

in_place_stop_token(in_place_stop_source const *source)

Private Members

in_place_stop_source const *source_

Friends

friend hpx::p2300_stop_token::in_place_stop_source
friend hpx::p2300_stop_token::in_place_stop_callback
friend constexpr bool operator==(in_place_stop_token const &lhs, in_place_stop_token const &rhs)
void swap(in_place_stop_token &x, in_place_stop_token &y)
struct never_stop_token

Public Types

template<typename>
using callback_type = callback_impl

Public Static Functions

static constexpr bool stop_requested()
static constexpr bool stop_possible()

Friends

friend constexpr bool operator==(never_stop_token const&, never_stop_token const&)
struct callback_impl

Public Functions

template<typename Callback>
constexpr callback_impl(never_stop_token, Callback&&)