hpx/async_distributed/base_lco_with_value.hpp#

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

Defines

HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION2(Value, RemoteValue, Name)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_1(Value)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_2(Value, Name)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_3(Value, RemoteValue, Name)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_4(Value, RemoteValue, Name, Tag)#
HPX_REGISTER_BASE_LCO_WITH_VALUE(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_1(Value)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_2(Value, Name)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_3(Value, RemoteValue, Name)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_4(Value, RemoteValue, Name, Tag)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_(...)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID2(Value, RemoteValue, Name, ActionIdGet, ActionIdSet)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_4(Value, Name, ActionIdGet, ActionIdSet)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_5(Value, RemoteValue, Name, ActionIdGet, ActionIdSet)#
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_6(Value, RemoteValue, Name, ActionIdGet, ActionIdSet, Tag)#
namespace hpx
namespace components
namespace lcos
template<typename Result, typename RemoteResult, typename ComponentTag>
class base_lco_with_value : public hpx::lcos::base_lco, public ComponentTag#
#include <base_lco_with_value.hpp>

The base_lco_with_value class is the common base class for all LCO’s synchronizing on a value. The RemoteResult template argument should be set to the type of the argument expected for the set_value action.

Template Parameters
  • RemoteResult – The type of the result value to be carried back to the LCO instance.

  • ComponentTag – The tag type representing the type of the component (either component_tag or managed_component_tag).

Public Types

using wrapping_type = typename detail::base_lco_wrapping_type<ComponentTag, base_lco_with_value>::type#
using base_type_holder = base_lco_with_value#

Public Functions

inline void set_value_nonvirt(RemoteResult &&result)#

The function set_value_nonvirt is called whenever a set_value_action is applied on this LCO instance. This function just forwards to the virtual function set_value, which is overloaded by the derived concrete LCO.

Parameters

result – [in] The result value to be transferred from the remote operation back to this LCO instance.

inline Result get_value_nonvirt()#

The function get_result_nonvirt is called whenever a get_result_action is applied on this LCO instance. This function just forwards to the virtual function get_result, which is overloaded by the derived concrete LCO.

HPX_DEFINE_COMPONENT_DIRECT_ACTION (base_lco_with_value, set_value_nonvirt, set_value_action) HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco_with_value

The set_value_action may be used to trigger any LCO instances while carrying an additional parameter of any type.

RemoteResult is taken by rvalue ref. This allows for perfect forwarding. When the action thread function is created, the values are moved into the called function. If we took it by const lvalue reference, we would disable the possibility to further move the result to the designated destination.

Parameters

RemoteResult – [in] The type of the result to be transferred back to this LCO instance. The get_value_action may be used to query the value this LCO instance exposes as its ‘result’ value.

Public Members

get_value_nonvirt

Public Static Functions

static inline components::component_type get_component_type() noexcept#
static inline void set_component_type(components::component_type type)#

Protected Types

using result_type = std::conditional_t<std::is_void_v<Result>, util::unused_type, Result>#

Protected Functions

~base_lco_with_value() override = default#

Destructor, needs to be virtual to allow for clean destruction of derived objects

inline virtual void set_event() override#
inline void set_event_nonvirt(std::false_type)#
inline void set_event_nonvirt(std::true_type)#
virtual void set_value(RemoteResult &&result) = 0#
virtual result_type get_value() = 0#
inline virtual result_type get_value(error_code&)#
template<typename ComponentTag>
class base_lco_with_value<void, void, ComponentTag> : public hpx::lcos::base_lco, public ComponentTag#
#include <base_lco_with_value.hpp>

The base_lco<void> specialization is used whenever the set_event action for a particular LCO doesn’t carry any argument.

Template Parameters

void – This specialization expects no result value and is almost completely equivalent to the plain base_lco.

Public Types

using wrapping_type = typename detail::base_lco_wrapping_type<ComponentTag, base_lco_with_value>::type#
using base_type_holder = base_lco_with_value#
using set_value_action = typename base_lco::set_event_action#

Public Functions

inline void get_value()#

Protected Functions

~base_lco_with_value() override = default#

Destructor, needs to be virtual to allow for clean destruction of derived objects

namespace traits