![]() |
HPX_REGISTER_PLAIN_ACTION_TEMPLATE — Registers an existing template-free function as a plain action with HPX.
// In header: <hpx/runtime/actions/plain_action.hpp>
HPX_REGISTER_PLAIN_ACTION_TEMPLATE(template_, action_type)
The macro HPX_REGISTER_PLAIN_ACTION can be used to register an existing template-free function as a plain action. It relies on a separately defined action type named action_type.
The parameter action_type
is the name of the action type to register with HPX.
Example:
namespace app { template <typename T> void some_global_function(T d) { cout << d; } // define a new template action type named some_global_action template <typename T> struct some_global_action : hpx::actions::make_action< void (*)(T), &some_global_function<T>, some_global_action<T> > {}; } // The following macro expands to a series of definitions of global objects // which are needed for proper serialization and initialization support // enabling the remote invocation of the function `app::some_global_function`. // // Please note the extra parenthesis around both macro arguments. HPX_REGISTER_PLAIN_ACTION_TEMPLATE((template <typename T>), (app::some_global_action<T>));