Plugins API

al_status_t al_register_plugin(const char *plugin_name)

Register an Access Layer plugin.

Plugins extend the functionality of the Access Layer. Plugins must be registered before they can be activated with al_bind_plugin().

The environment variable IMAS_AL_PLUGINS indicates the folder where the compiled plugin(s) are located. If this environment variable is unset, or no shared library with the name <plugin_name>_plugin.so can be found, an exception status is returned.

Parameters:
const char *plugin_name

Name of the plugin to register

Example

al_status_t status = al_register_plugin("debug");
if (status.code != 0) {
    std::cerr << status.message << std::endl;
    exit(1);
}
al_status_t al_unregister_plugin(const char *plugin_name)

Unregister a previously registered Access Layer plugin.

Parameters:
const char *plugin_name

Name of the plugin to unregister

al_status_t al_bind_plugin(const char *fieldPath, const char *pluginName)

Activate an Access Layer plugin.

Plugins are inactive until activated with bind_plugin. After activation, plugins can modify the data on the path(s) they are activated on during a IdsNs::Ids.put(), IdsNs::Ids.put_slice(), IdsNs::Ids.get() or IdsNs::Ids.get_slice().

Parameters:
const char *fieldPath

The path that the plugin is allowed to operate on: <ids_name>:<occurrence>/<path_in_ids>.

const char *pluginName

Name of the plugin. The plugin must have been registered with a call to al_register_plugin().

Example

al_status_t status = al_register_plugin("debug");
if (status.code != 0) {
    std::cerr << status.message << std::endl;
    exit(1);
}
al_bind_plugin("magnetics:0/ids_properties/version_put/access_layer", "debug");
al_bind_plugin("magnetics:0/flux_loop", "debug");
al_status_t al_unbind_plugin(const char *fieldPath, const char *pluginName)

Unbind a plugin on a previously bound path.

Arguments are the same as for al_bind_plugin().

al_status_t al_setvalue_parameter_plugin(const char *parameter_name, int datatype, int dim, int *size, void *data, const char *pluginName)

Set a plugin parameter value.

See the documentation of your specific plugin for more details.

Parameters:
const char *parameter_name

Name of the parameter to set

int datatype

Type of data (one of CHAR_DATA, INTEGER_DATA, DOUBLE_DATA or COMPLEX_DATA)

int dim

Dimension of the data

int *size

Pointer to array specifying the shape of the array (must have dim elements)

void *data

Pointer to the data

const char *pluginName

Name of the plugin, the plugin must be registered (see al_register_plugin())

al_status_t al_setvalue_int_scalar_parameter_plugin(const char *parameter_name, int parameter_value, const char *pluginName)

Convenience method to set a plugin parameter value to a scalar integer.

See the documentation of your specific plugin for more details.

Parameters:
const char *parameter_name

Name of the parameter to set

int parameter_value

Value to set the parameter to

const char *pluginName

Name of the plugin, the plugin must be registered (see al_register_plugin())

al_status_t al_setvalue_double_scalar_parameter_plugin(const char *parameter_name, double parameter_value, const char *pluginName)

Convenience method to set a plugin parameter value to a scalar double.

See the documentation of your specific plugin for more details.

Parameters:
const char *parameter_name

Name of the parameter to set

double parameter_value

Value to set the parameter to

const char *pluginName

Name of the plugin, the plugin must be registered (see al_register_plugin())