RSC  0.17.1
rsc::plugins::Configurator Class Reference

Instances of this class can be used to configure the #Manager based on configuration options. More...

#include <Configurator.h>

Inheritance diagram for rsc::plugins::Configurator:
Inheritance graph
Collaboration diagram for rsc::plugins::Configurator:
Collaboration graph

Public Member Functions

 Configurator (ManagerPtr manager, const std::vector< boost::filesystem::path > &defaultPath)
 Constructs a Configurator with default plugin search path defaultPath. More...
 
virtual ~Configurator ()
 
void handleOption (const std::vector< std::string > &key, const std::string &value)
 This method is called once for each individual option available from a given ConfigSource. More...
 
void execute (bool errorOnMissing=true)
 Performs the actual loading of plugins. More...
 
- Public Member Functions inherited from rsc::config::OptionHandler
virtual ~OptionHandler ()
 

Private Member Functions

void addDefaultPath ()
 
void addPathEntries (const std::vector< std::string > &entries)
 
void loadPlugins (const std::vector< std::string > &names, bool errorOnMissing)
 

Private Attributes

logging::LoggerPtr logger
 
ManagerPtr manager
 
std::vector< boost::filesystem::path > defaultPath
 
std::vector< std::string > path
 
std::vector< std::string > load
 

Detailed Description

Instances of this class can be used to configure the #Manager based on configuration options.

Author
jmoringe

Definition at line 48 of file Configurator.h.

Constructor & Destructor Documentation

rsc::plugins::Configurator::Configurator ( ManagerPtr  manager,
const std::vector< boost::filesystem::path > &  defaultPath 
)

Constructs a Configurator with default plugin search path defaultPath.

Parameters
managerthe manager to configure
defaultPathA #vector of #boost::filesystem::path objects which should be installed as plugin search path in case no plugin search path is configured.

Definition at line 48 of file Configurator.cpp.

References path.

rsc::plugins::Configurator::~Configurator ( )
virtual

Definition at line 58 of file Configurator.cpp.

Member Function Documentation

void rsc::plugins::Configurator::addDefaultPath ( )
private

Definition at line 92 of file Configurator.cpp.

References defaultPath, and manager.

Referenced by addPathEntries().

Here is the caller graph for this function:

void rsc::plugins::Configurator::addPathEntries ( const std::vector< std::string > &  entries)
private

Definition at line 99 of file Configurator.cpp.

References addDefaultPath(), defaultPath, logger, manager, path, and RSCINFO.

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

void rsc::plugins::Configurator::execute ( bool  errorOnMissing = true)

Performs the actual loading of plugins.

Potential errors are reported via exceptions here.

Parameters
errorOnMissingIf true, report and error in case a requested plugin could not be loaded.
Exceptions
rsc::runtime::NoSuchObjecta requested plugin could not be found
std::runtime_errorA plugin failed to load

Definition at line 61 of file Configurator.cpp.

References addPathEntries(), load, loadPlugins(), and path.

Here is the call graph for this function:

void rsc::plugins::Configurator::handleOption ( const std::vector< std::string > &  key,
const std::string &  value 
)
virtual

This method is called once for each individual option available from a given ConfigSource.

Parameters
keyA list of hierarchical key components that identify the option.
valueThe value of the option.

Implements rsc::config::OptionHandler.

Definition at line 66 of file Configurator.cpp.

References std::container_none, std::element_sequence(), load, logger, rsc::config::mergeSequenceValue(), path, and RSCDEBUG.

Here is the call graph for this function:

void rsc::plugins::Configurator::loadPlugins ( const std::vector< std::string > &  names,
bool  errorOnMissing 
)
private

Definition at line 120 of file Configurator.cpp.

References logger, manager, and RSCDEBUG.

Referenced by execute().

Here is the caller graph for this function:

Member Data Documentation

std::vector<boost::filesystem::path> rsc::plugins::Configurator::defaultPath
private

Definition at line 84 of file Configurator.h.

Referenced by addDefaultPath(), and addPathEntries().

std::vector<std::string> rsc::plugins::Configurator::load
private

Definition at line 87 of file Configurator.h.

Referenced by execute(), and handleOption().

logging::LoggerPtr rsc::plugins::Configurator::logger
private

Definition at line 80 of file Configurator.h.

Referenced by addPathEntries(), handleOption(), and loadPlugins().

ManagerPtr rsc::plugins::Configurator::manager
private

Definition at line 82 of file Configurator.h.

Referenced by addDefaultPath(), addPathEntries(), and loadPlugins().

std::vector<std::string> rsc::plugins::Configurator::path
private

Definition at line 86 of file Configurator.h.

Referenced by addPathEntries(), Configurator(), execute(), and handleOption().


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