Arc::PluginsFactory Class Reference

Generic ARC plugins loader. More...

#include <Plugin.h>

Inheritance diagram for Arc::PluginsFactory:
Arc::ModuleManager Arc::ClassLoader

Public Member Functions

 PluginsFactory (XMLNode cfg)
void TryLoad (bool v)
bool load (const std::string &name)
bool scan (const std::string &name, ModuleDesc &desc)
void report (std::list< ModuleDesc > &descs)

Static Public Member Functions

static void FilterByKind (const std::string &kind, std::list< ModuleDesc > &descs)

Detailed Description

Generic ARC plugins loader.

The instance of this class provides functionality of loading pluggable ARC components stored in shared libraries. For more information please check HED documentation. This class is thread-safe - its methods are proceted from simultatneous use form multiple threads. Current thread protection implementation is suboptimal and will be revised in future.


Constructor & Destructor Documentation

Arc::PluginsFactory::PluginsFactory ( XMLNode  cfg  ) 

Constructor - accepts configuration (not yet used) meant to tune loading of modules.


Member Function Documentation

static void Arc::PluginsFactory::FilterByKind ( const std::string &  kind,
std::list< ModuleDesc > &  descs 
) [static]

Filter list of modules by kind.

bool Arc::PluginsFactory::load ( const std::string &  name  ) 

These methods load module named lib'name' and check if it contains ARC plugin(s) of specified 'kind' and 'name'. If there are no specified plugins or module does not contain any ARC plugins it is unloaded. All loaded plugins are also registered in internal list of this instance of PluginsFactory class. Returns true if any plugin was loaded.

void Arc::PluginsFactory::report ( std::list< ModuleDesc > &  descs  ) 

Provides information about currently loaded modules and plugins.

bool Arc::PluginsFactory::scan ( const std::string &  name,
ModuleDesc desc 
)

Collect information about plugins stored in module(s) with specified names. Returns true if any of specified modules has plugins.

void Arc::PluginsFactory::TryLoad ( bool  v  )  [inline]

These methods load module named lib'name', locate plugin constructor functions of specified 'kind' and 'name' (if specified) and call it. Supplied argument affects way plugin instance is created in plugin-specific way. If name of plugin is not specified then all plugins of specified kind are tried with supplied argument till valid instance is created. All loaded plugins are also registered in internal list of this instance of PluginsFactory class. If search is set to false then no attempt is made to find plugins in loadable modules. Only plugins already loaded with previous calls to get_instance() and load() are checked. Returns created instance or NULL if failed. Specifies if loadable module may be loaded while looking for analyzing its content. If set to false only *.apd files are checked. Modules without corresponding *.apd will be ignored. Default is true;


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:24 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3