HPX - High Performance ParalleX

PrevUpHomeNext

Macro HPX_PLAIN_ACTION_ID

HPX_PLAIN_ACTION_ID — Defines a plain action type based on the given function func and registers it with HPX.

Synopsis

// In header: <hpx/runtime/actions/plain_action.hpp>

HPX_PLAIN_ACTION_ID(func, name, id)

Description

The macro HPX_PLAIN_ACTION_ID can be used to define a plain action (e.g. an action encapsulating a global or free function) based on the given function func. It defines the action type actionname representing the given function. The parameter actionid

The parameter actionid specifies an unique integer value which will be used to represent the action during serialization.

The parameter func is a global or free (non-member) function which should be encapsulated into a plain action. The parameter name is the name of the action type defined by this macro.

The second parameter has to be usable as a plain (non-qualified) C++ identifier, it should not contain special characters which cannot be part of a C++ identifier, such as '<', '>', or ':'.

Example: 

namespace app
{
    void some_global_function(double d)
    {
        cout << d;
    }
}

// This will define the action type 'some_global_action' which represents
// the function 'app::some_global_function'.
HPX_PLAIN_ACTION_ID(app::some_global_function, some_global_action,
  some_unique_id);
[Note] Note

The macro HPX_PLAIN_ACTION_ID has to be used at global namespace even if the wrapped function is located in some other namespace. The newly defined action type is placed into the global namespace as well.

Only one of the forms of this macro HPX_PLAIN_ACTION or HPX_PLAIN_ACTION_ID should be used for a particular action, never both.


PrevUpHomeNext