hpx/lcos_local/and_gate.hpp

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

namespace hpx
namespace lcos
namespace local
struct and_gate : public hpx::lcos::local::base_and_gate<hpx::no_mutex>

Public Functions

and_gate(std::size_t count = 0)
and_gate(and_gate &&rhs)
and_gate &operator=(and_gate &&rhs)
template<typename Lock>
hpx::future<void> get_future(Lock &l, std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)
template<typename Lock>
hpx::shared_future<void> get_shared_future(Lock &l, std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)
template<typename Lock>
bool set(std::size_t which, Lock l, error_code &ec = throws)
template<typename Lock>
void synchronize(std::size_t generation_value, Lock &l, char const *function_name = "and_gate::synchronize", error_code &ec = throws)

Private Types

typedef base_and_gate<hpx::no_mutex> base_type
template<typename Mutex = hpx::spinlock>
struct base_and_gate

Public Functions

base_and_gate(std::size_t count = 0)

This constructor initializes the base_and_gate object from the the number of participants to synchronize the control flow with.

base_and_gate(base_and_gate &&rhs)
base_and_gate &operator=(base_and_gate &&rhs)
hpx::future<void> get_future(std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)
hpx::shared_future<void> get_shared_future(std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)
bool set(std::size_t which, error_code &ec = throws)
void synchronize(std::size_t generation_value, char const *function_name = "base_and_gate<>::synchronize", error_code &ec = throws)

Wait for the generational counter to reach the requested stage.

std::size_t next_generation()
std::size_t generation() const

Protected Types

typedef Mutex mutex_type

Protected Functions

bool trigger_conditions(error_code &ec = throws)
template<typename OuterLock>
hpx::future<void> get_future(OuterLock &outer_lock, std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)

get a future allowing to wait for the gate to fire

template<typename OuterLock>
hpx::shared_future<void> get_shared_future(OuterLock &outer_lock, std::size_t count = std::size_t(-1), std::size_t *generation_value = nullptr, error_code &ec = hpx::throws)

get a shared future allowing to wait for the gate to fire

template<typename OuterLock>
bool set(std::size_t which, OuterLock outer_lock, error_code &ec = throws)

Set the data which has to go into the segment which.

bool test_condition(std::size_t generation_value)
template<typename Lock>
void synchronize(std::size_t generation_value, Lock &l, char const *function_name = "base_and_gate<>::synchronize", error_code &ec = throws)
template<typename OuterLock, typename Lock>
void init_locked(OuterLock &outer_lock, Lock &l, std::size_t count, error_code &ec = throws)

Private Types

typedef std::list<conditional_trigger*> condition_list_type

Private Members

mutex_type mtx_
hpx::detail::dynamic_bitset received_segments_
hpx::promise<void> promise_
std::size_t generation_
condition_list_type conditions_
struct manage_condition

Public Functions

template<>
manage_condition(base_and_gate &gate, conditional_trigger &cond)
template<>
~manage_condition()
template<typename Condition>
hpx::future<void> get_future(Condition &&func, error_code &ec = hpx::throws)

Public Members

template<>
base_and_gate &this_
template<>
condition_list_type::iterator it_