hpx/components_base/server/managed_component_base.hpp#

Defined in header hpx/components_base/server/managed_component_base.hpp.

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

template<>
struct hpx::components::detail_adl_barrier::init<traits::construct_with_back_ptr>#

Public Static Functions

template<typename Component, typename Managed>
static inline constexpr void call(Component*, Managed*) noexcept#
template<typename Component, typename Managed, typename ...Ts>
static inline void call_new(Component *&component, Managed *this_, Ts&&... vs)#
template<>
struct hpx::components::detail_adl_barrier::init<traits::construct_without_back_ptr>#

Public Static Functions

template<typename Component, typename Managed>
static inline void call(Component *component, Managed *this_)#
template<typename Component, typename Managed, typename ...Ts>
static inline void call_new(Component *&component, Managed *this_, Ts&&... vs)#
template<>
struct hpx::components::detail_adl_barrier::destroy_backptr<traits::managed_object_is_lifetime_controlled>#

Public Static Functions

template<typename BackPtr>
static inline void call(BackPtr *back_ptr)#
template<>
struct hpx::components::detail_adl_barrier::destroy_backptr<traits::managed_object_controls_lifetime>#

Public Static Functions

template<typename BackPtr>
static inline constexpr void call(BackPtr*) noexcept#
template<>
struct hpx::components::detail_adl_barrier::manage_lifetime<traits::managed_object_is_lifetime_controlled>#

Public Static Functions

template<typename Component>
static inline constexpr void call(Component*) noexcept#
template<typename Component>
static inline void addref(Component *component) noexcept#
template<typename Component>
static inline void release(Component *component) noexcept#
template<>
struct hpx::components::detail_adl_barrier::manage_lifetime<traits::managed_object_controls_lifetime>#

Public Static Functions

template<typename Component>
static inline void call(Component *component) noexcept(noexcept(component->finalize()))#
template<typename Component>
static inline constexpr void addref(Component*) noexcept#
template<typename Component>
static inline constexpr void release(Component*) noexcept#
namespace hpx
namespace components

Functions

template<typename Component, typename Derived>
void intrusive_ptr_add_ref(managed_component<Component, Derived> *p) noexcept#
template<typename Component, typename Derived>
void intrusive_ptr_release(managed_component<Component, Derived> *p) noexcept#
template<typename Component, typename Derived>
class managed_component#
#include <managed_component_base.hpp>

The managed_component template is used as an indirection layer for components allowing to gracefully handle the access to non-existing components.

Additionally, it provides memory management capabilities for the wrapping instances, and it integrates the memory management with the AGAS service. Every instance of a managed_component gets assigned a global id. The provided memory management allocates the managed_component instances from a special heap, ensuring fast allocation and avoids a full network round trip to the AGAS service for each of the allocated instances.

Template Parameters
  • Component – Component type

  • Derived – Most derived component type

Public Types

using derived_type = std::conditional_t<std::is_void_v<Derived>, managed_component, Derived>#
using wrapped_type = Component#
using type_holder = Component#
using base_type_holder = typename Component::base_type_holder#
using heap_type = detail::wrapper_heap_list<detail::fixed_wrapper_heap<derived_type>>#
using value_type = derived_type#

Public Functions

managed_component(managed_component const&) = delete#
managed_component(managed_component&&) = delete#
managed_component &operator=(managed_component const&) = delete#
managed_component &operator=(managed_component&&) = delete#
inline explicit managed_component(Component *comp)#

Construct a managed_component instance holding a wrapped instance. This constructor takes ownership of the passed pointer.

Parameters

comp – [in] The pointer to the wrapped instance. The managed_component takes ownership of this pointer.

inline managed_component()#
template<typename T, typename ...Ts, typename Enable = std::enable_if_t<!std::is_same_v<std::decay_t<T>, managed_component>>>
inline explicit managed_component(T &&t, Ts&&... ts)#
inline ~managed_component()#
inline constexpr Component *get() noexcept#

Return a pointer to the wrapped instance.

Note

Caller must check validity of returned pointer

inline constexpr Component const *get() const noexcept#
inline Component *get_checked()#
inline Component const *get_checked() const#
inline Component *operator->()#
inline Component const *operator->() const#
inline Component &operator*()#
inline Component const &operator*() const#
inline hpx::id_type get_unmanaged_id() const#

Return the global id of this future instance.

inline naming::gid_type get_base_gid(naming::gid_type const &assign_gid = naming::invalid_gid) const#

Public Static Functions

static inline constexpr void finalize() noexcept#

Protected Attributes

Component *component_ = nullptr#

Friends

template<typename C, typename D>
friend void intrusive_ptr_add_ref(managed_component<C, D> *p) noexcept#
template<typename C, typename D>
friend void intrusive_ptr_release(managed_component<C, D> *p) noexcept#
template<typename Component, typename Wrapper, typename CtorPolicy, typename DtorPolicy>
class managed_component_base : public hpx::components::detail::base_managed_component#

Public Types

using this_component_type = std::conditional_t<std::is_void_v<Component>, managed_component_base, Component>#
using wrapped_type = this_component_type#
using has_managed_component_base = void#
using ctor_policy = CtorPolicy#
using dtor_policy = DtorPolicy#
using wrapping_type = managed_component<Component, Wrapper>#
using base_type_holder = Component#

Public Functions

managed_component_base(managed_component_base const&) = delete#
managed_component_base(managed_component_base&&) = delete#
managed_component_base &operator=(managed_component_base const&) = delete#
managed_component_base &operator=(managed_component_base&&) = delete#
constexpr managed_component_base() noexcept = default#
inline explicit managed_component_base(managed_component<Component, Wrapper> *back_ptr) noexcept#
inline ~managed_component_base()#
hpx::id_type get_unmanaged_id() const#
hpx::id_type get_id() const#

Protected Functions

naming::gid_type get_base_gid() const#
inline void set_back_ptr(components::managed_component<Component, Wrapper> *bp) noexcept#

Private Members

managed_component<Component, Wrapper> *back_ptr_ = nullptr#

Friends

friend struct detail_adl_barrier::init
namespace detail_adl_barrier#
template<typename DtorTag>
struct destroy_backptr#
template<> managed_object_controls_lifetime >

Public Static Functions

template<typename BackPtr>
static inline constexpr void call(BackPtr*) noexcept#
template<> managed_object_is_lifetime_controlled >

Public Static Functions

template<typename BackPtr>
static inline void call(BackPtr *back_ptr)
template<typename BackPtrTag>
struct init#
template<> construct_with_back_ptr >

Public Static Functions

template<typename Component, typename Managed>
static inline constexpr void call(Component*, Managed*) noexcept#
template<typename Component, typename Managed, typename ...Ts>
static inline void call_new(Component *&component, Managed *this_, Ts&&... vs)#
template<> construct_without_back_ptr >

Public Static Functions

template<typename Component, typename Managed>
static inline void call(Component *component, Managed *this_)
template<typename Component, typename Managed, typename ...Ts>
static inline void call_new(Component *&component, Managed *this_, Ts&&... vs)
template<typename DtorTag>
struct manage_lifetime#
template<> managed_object_controls_lifetime >

Public Static Functions

template<typename Component>
static inline void call(Component *component) noexcept(noexcept(component->finalize()))#
template<typename Component>
static inline constexpr void addref(Component*) noexcept#
template<typename Component>
static inline constexpr void release(Component*) noexcept#
template<> managed_object_is_lifetime_controlled >

Public Static Functions

template<typename Component>
static inline constexpr void call(Component*) noexcept
template<typename Component>
static inline void addref(Component *component) noexcept
template<typename Component>
static inline void release(Component *component) noexcept