JANA2
JPluginLoader Class Reference
Inheritance diagram for JPluginLoader:
Collaboration diagram for JPluginLoader:

Public Member Functions

 JPluginLoader (JApplication *app)
 
void acquire_services (JServiceLocator *) override
 
void add_plugin (std::string plugin_name)
 
void add_plugin_path (std::string path)
 
void attach_plugins (JComponentManager *jcm)
 
void attach_plugin (JComponentManager *jcm, std::string plugin_name)
 
- Public Member Functions inherited from JService
virtual ~JService ()=default
 acquire_services is a callback which allows the user to configure a JService which relies on other JServices. More...
 

Member Function Documentation

void JPluginLoader::add_plugin ( std::string  plugin_name)

Add the specified plugin to the list of plugins to be attached. This only records the name. The plugin is not actually attached until AttachPlugins() is called (typically from Initialize() which is called from Run()). This will check if the plugin already exists in the list of plugins to attach and will not add it a second time if it is already there. This may be important if the order of plugins is important. It is left to the user to handle in those cases.

Parameters
plugin_namename of the plugin. Do not include the ".so" or ".dylib" suffix in the name. The path to the plugin will be searched from the JANA_PLUGIN_PATH envar.
void JPluginLoader::add_plugin_path ( std::string  path)

Add a path to the directories searched for plugins. This should not include the plugin name itself. This only has an effect when called before AttachPlugins is called (i.e. before Run is called). n.b. if this is called with a path already in the list, then the call is silently ignored.

Generally, users will set the path via the JANA_PLUGIN_PATH environment variable and won't need to call this method. This may be called if it needs to be done programmatically.

Parameters
pathdirectory to search for plugins.

Referenced by attach_plugins().

Here is the caller graph for this function:

void JPluginLoader::attach_plugin ( JComponentManager jcm,
std::string  plugin_name 
)

Attach a plugin by opening the shared object file and running the InitPlugin_t(JApplication* app) global C-style routine in it. An exception will be thrown if the plugin is not successfully opened. Users will not need to call this directly since it is called automatically from Initialize().

Parameters
sonamename of shared object file to attach. This may include an absolute or relative path.
verboseif set to true, failed attempts will be recorded via the JLog. Default is false so JANA can silently ignore files that are not valid plugins.

References JServiceLocator::get(), and JParameterManager::SetDefaultParameter().

Referenced by attach_plugins().

Here is the call graph for this function:

Here is the caller graph for this function:

void JPluginLoader::attach_plugins ( JComponentManager jcm)

Loop over list of plugin names added via AddPlugin() and actually attach and initialize them. See AddPlugin method for more.

References add_plugin_path(), and attach_plugin().

Here is the call graph for this function:


The documentation for this class was generated from the following files: