components¶
The contents of this module can be included with the header
hpx/modules/components.hpp
. These headers may be used by user-code but are not
guaranteed stable (neither header location nor contents). You are using these at
your own risk. If you wish to use non-public functionality from a module we
strongly suggest only including the module header hpx/modules/components.hpp
, not
the particular header in which the functionality you would like to use is
defined. See Public API for a list of names that are part of the public
HPX API.
-
namespace
hpx
Functions
-
template<typename
Client
>
std::vector<Client>find_all_from_basename
(std::string base_name, std::size_t num_ids)¶ Return all registered clients from all localities from the given base name.
This function locates all ids which were registered with the given base name. It returns a list of futures representing those ids.
Return all registered ids from all localities from the given base name.
- Return
A list of futures representing the ids which were registered using the given base name.
- Note
The futures embedded in the returned client objects will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.num_ids
: [in] The number of registered ids to expect.
This function locates all ids which were registered with the given base name. It returns a list of futures representing those ids.
- Return
A list of futures representing the ids which were registered using the given base name.
- Note
The futures will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.num_ids
: [in] The number of registered ids to expect.
-
template<typename
Client
>
std::vector<Client>find_from_basename
(std::string base_name, std::vector<std::size_t> const &ids)¶ Return registered clients from the given base name and sequence numbers.
This function locates the ids which were registered with the given base name and the given sequence numbers. It returns a list of futures representing those ids.
Return registered ids from the given base name and sequence numbers.
- Return
A list of futures representing the ids which were registered using the given base name and sequence numbers.
- Note
The futures embedded in the returned client objects will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.ids
: [in] The sequence numbers of the registered ids.
This function locates the ids which were registered with the given base name and the given sequence numbers. It returns a list of futures representing those ids.
- Return
A list of futures representing the ids which were registered using the given base name and sequence numbers.
- Note
The futures will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.ids
: [in] The sequence numbers of the registered ids.
-
template<typename
Client
>
Clientfind_from_basename
(std::string base_name, std::size_t sequence_nr)¶ Return registered id from the given base name and sequence number.
This function locates the id which was registered with the given base name and the given sequence number. It returns a future representing those id.
This function locates the id which was registered with the given base name and the given sequence number. It returns a future representing those id.
- Return
A representing the id which was registered using the given base name and sequence numbers.
- Note
The future embedded in the returned client object will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in] The sequence number of the registered id.
- Return
A representing the id which was registered using the given base name and sequence numbers.
- Note
The future will become ready even if the event (for instance, binding the name to an id) has already happened in the past. This is important in order to reliably retrieve ids from a name, even if the name was already registered.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in] The sequence number of the registered id.
-
template<typename
Client
, typenameStub
>
hpx::future<bool>register_with_basename
(std::string base_name, components::client_base<Client, Stub> &client, std::size_t sequence_nr)¶ Register the id wrapped in the given client using the given base name.
The function registers the object the given client refers to using the provided base name.
- Return
A future representing the result of the registration operation itself.
- Note
The operation will fail if the given sequence number is not unique.
- Template Parameters
Client
: The client type to register
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.client
: [in] The client which should be registered using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
template<typename
Client
>
Clientunregister_with_basename
(std::string base_name, std::size_t sequence_nr)¶ Unregister the given id using the given base name.
Unregister the given base name.
The function unregisters the given ids using the provided base name.
The function unregisters the given ids using the provided base name.
- Return
A future representing the result of the un-registration operation itself.
- Template Parameters
Client
: The client type to return
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in, optional] The sequential number to use for the un-registration. This number has to be the same as has been used with register_with_basename before.
- Return
A future representing the result of the un-registration operation itself.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.sequence_nr
: [in, optional] The sequential number to use for the un-registration. This number has to be the same as has been used with register_with_basename before.
-
template<typename
-
namespace
hpx
Functions
-
hpx::future<bool>
register_with_basename
(std::string base_name, hpx::id_type id, std::size_t sequence_nr = ~static_cast<std::size_t>(0))¶ Register the given id using the given base name.
The function registers the given ids using the provided base name.
- Return
A future representing the result of the registration operation itself.
- Note
The operation will fail if the given sequence number is not unique.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.id
: [in] The id to register using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
hpx::future<bool>
register_with_basename
(std::string base_name, hpx::future<hpx::id_type> f, std::size_t sequence_nr = ~static_cast<std::size_t>(0))¶ Register the id wrapped in the given future using the given base name.
The function registers the object the given future refers to using the provided base name.
- Return
A future representing the result of the registration operation itself.
- Note
The operation will fail if the given sequence number is not unique.
- Parameters
base_name
: [in] The base name for which to retrieve the registered ids.f
: [in] The future which should be registered using the given base name.sequence_nr
: [in, optional] The sequential number to use for the registration of the id. This number has to be unique system wide for each registration using the same base name. The default is the current locality identifier. Also, the sequence numbers have to be consecutive starting from zero.
-
hpx::future<bool>
-
namespace
hpx
-
namespace
hpx
-
namespace
components
Functions
-
template<typename
Derived
, typenameStub
>
classclient_base
: public detail::make_stub::type<Stub>¶ Public Types
-
template<>
usingstub_argument_type
= Stub¶
-
template<>
usingserver_component_type
= typename detail::make_stub::server_component_type¶
-
template<>
usingis_client_tag
= void¶
Public Functions
-
client_base
()¶
-
client_base
(id_type const &id)¶
-
client_base
(id_type &&id)¶
-
client_base
(future<id_type> &&f)¶
-
client_base
(client_base const &rhs)¶
-
client_base
(client_base &&rhs)¶
-
client_base
(future<Derived> &&d)¶
-
~client_base
()¶
-
client_base &
operator=
(id_type const &id)¶
-
client_base &
operator=
(id_type &&id)¶
-
client_base &
operator=
(future<id_type> &&f)¶
-
client_base &
operator=
(client_base const &rhs)¶
-
client_base &
operator=
(client_base &&rhs)¶
-
bool
valid
() const¶
-
operator bool
() const¶
-
void
free
()¶
-
id_type const &
get_id
() const¶
-
shared_future<id_type>
detach
()¶
-
void
reset
(id_type const &id)¶
-
void
reset
(id_type &&id)¶
-
id_type const &
get
() const¶
-
bool
is_ready
() const¶
-
bool
has_value
() const¶
-
bool
has_exception
() const¶
-
void
wait
() const¶
Protected Types
-
template<>
usingstub_type
= typename detail::make_stub<Stub>::type¶
-
template<>
usingfuture_type
= shared_future<id_type>¶
Protected Functions
Protected Attributes
-
template<>
-
template<typename
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
components
-
template<typename
Executor
, typenameBaseComponent
>
structexecutor_component
: public BaseComponent¶ Public Functions
-
template<typename ...
Arg
>executor_component
(executor_type const &exec, Arg&&... arg)¶
Public Static Functions
-
template<typename
Executor_
= Executor>
static voidschedule_thread
(hpx::naming::address::address_type lva, naming::address::component_type, hpx::threads::thread_init_data &data, hpx::threads::thread_schedule_state)¶ This is the default hook implementation for schedule_thread which forwards to the executor instance associated with this component.
Protected Attributes
-
executor_type
exec_
¶
-
template<typename ...
-
template<typename
-
namespace
-
namespace
hpx
Functions
Returns a future referring to the pointer to the underlying memory of a component.
The function hpx::get_ptr can be used to extract a future referring to the pointer to the underlying memory of a given component.
- Return
This function returns a future representing the pointer to the underlying memory for the component instance with the given id.
- Note
This function will successfully return the requested result only if the given component is currently located on the calling locality. Otherwise the function will raise an error.
- Note
The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Parameters
id
: [in] The global id of the component for which the pointer to the underlying memory should be retrieved.
- Template Parameters
The
: only template parameter has to be the type of the server side component.
Returns a future referring to the pointer to the underlying memory of a component.
The function hpx::get_ptr can be used to extract a future referring to the pointer to the underlying memory of a given component.
- Return
This function returns a future representing the pointer to the underlying memory for the component instance with the given id.
- Note
This function will successfully return the requested result only if the given component is currently located on the calling locality. Otherwise the function will raise an error.
- Note
The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Parameters
c
: [in] A client side representation of the component for which the pointer to the underlying memory should be retrieved.
Returns the pointer to the underlying memory of a component.
The function hpx::get_ptr_sync can be used to extract the pointer to the underlying memory of a given component.
- Return
This function returns the pointer to the underlying memory for the component instance with the given id.
- Note
This function will successfully return the requested result only if the given component is currently located on the requesting locality. Otherwise the function will raise and error.
- Note
The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Note
As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
p
: [in] The parameter p represents a placeholder type to turn make the call synchronous.id
: [in] The global id of the component for which the pointer to the underlying memory should be retrieved.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
- Template Parameters
The
: only template parameter has to be the type of the server side component.
Returns the pointer to the underlying memory of a component.
The function hpx::get_ptr_sync can be used to extract the pointer to the underlying memory of a given component.
- Return
This function returns the pointer to the underlying memory for the component instance with the given id.
- Note
This function will successfully return the requested result only if the given component is currently located on the requesting locality. Otherwise the function will raise and error.
- Note
The component instance the returned pointer refers to can not be migrated as long as there is at least one copy of the returned shared_ptr alive.
- Note
As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.
- Parameters
p
: [in] The parameter p represents a placeholder type to turn make the call synchronous.c
: [in] A client side representation of the component for which the pointer to the underlying memory should be retrieved.ec
: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.
-
namespace
hpx
-
namespace
components
Functions
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, Client>::typemake_client
(hpx::id_type const &id)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, Client>::typemake_client
(hpx::id_type &&id)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, Client>::typemake_client
(hpx::future<hpx::id_type> const &id)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, Client>::typemake_client
(hpx::future<hpx::id_type> &&id)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, std::vector<Client>>::typemake_clients
(std::vector<hpx::id_type> const &ids)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, std::vector<Client>>::typemake_clients
(std::vector<hpx::id_type> &&ids)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, std::vector<Client>>::typemake_clients
(std::vector<hpx::future<hpx::id_type>> const &ids)¶
-
template<typename
Client
>
std::enable_if<traits::is_client<Client>::value, std::vector<Client>>::typemake_clients
(std::vector<hpx::future<hpx::id_type>> &&ids)¶
-
template<typename
-
namespace