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 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

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

Public Functions

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.

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)

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

hpx::lcos::base_lco_with_value::get_value_nonvirt

Public Static Functions

static components::component_type get_component_type()
static void set_component_type(components::component_type type)

Protected Types

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

Protected Functions

~base_lco_with_value()

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

void set_event()
void set_event_nonvirt(std::false_type)
void set_event_nonvirt(std::true_type)
virtual void set_value(RemoteResult &&result) = 0
virtual result_type get_value() = 0
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

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

Public Functions

void get_value()

Protected Functions

~base_lco_with_value()

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