YARP
Yet Another Robot Platform
yarp::os::YarpPluginSettings Class Reference

Collect hints for finding a particular plugin. More...

#include <yarp/os/YarpPluginSettings.h>

Detailed Description

Collect hints for finding a particular plugin.

Definition at line 29 of file YarpPluginSettings.h.

Public Member Functions

 YarpPluginSettings ()
 Constructor. More...
 
void setLibraryMethodName (const std::string &dll_name, const std::string &fn_name)
 Set the name of the library to load and the method name to use as a factory. More...
 
void setPluginName (const std::string &name)
 Set the name of the plugin to load. More...
 
void setClassInfo (const std::string &class_name, const std::string &baseclass_name)
 Set the information about the class and the base class constructed by this plugin. More...
 
bool setSelector (YarpPluginSelector &selector)
 Use a selector to find a plugin or plugins. More...
 
void setVerboseMode (bool verbose)
 Should messages be printed showing what searches YARP is trying out? More...
 
bool readFromSearchable (Searchable &options, const std::string &name)
 Configure settings from a configuration file or other searchable object. More...
 
std::string getPluginName () const
 
std::string getLibraryName () const
 
std::string getMethodName () const
 
YarpPluginSelectorgetSelector () const
 
std::string getWrapperName () const
 
std::string getClassName () const
 
std::string getBaseClassName () const
 
bool open (SharedLibraryFactory &factory)
 Initialize a factory object based on the hints available. More...
 
void reportStatus (SharedLibraryFactory &factory) const
 Give a human-readable report of the status of a factory. More...
 
void reportFailure () const
 Give a human-readable failure-to-load report, summarizing the active hints. More...
 

Private Member Functions

bool subopen (SharedLibraryFactory &factory, const std::string &dll_name, const std::string &fn_name)
 
bool open (SharedLibraryFactory &factory, const std::string &dll_name, const std::string &fn_name)
 
bool readFromSelector (const std::string &name)
 

Private Attributes

std::string name
 
std::string dll_name
 
std::string fn_name
 
std::string wrapper_name
 
std::string class_name
 
std::string baseclass_name
 
YarpPluginSelectorselector
 
bool verbose
 

Constructor & Destructor Documentation

◆ YarpPluginSettings()

yarp::os::YarpPluginSettings::YarpPluginSettings ( )
inline

Constructor.

Definition at line 37 of file YarpPluginSettings.h.

Member Function Documentation

◆ getBaseClassName()

std::string yarp::os::YarpPluginSettings::getBaseClassName ( ) const
inline
Returns
the name of the base class, if set

Definition at line 203 of file YarpPluginSettings.h.

◆ getClassName()

std::string yarp::os::YarpPluginSettings::getClassName ( ) const
inline
Returns
the name of the class, if set

Definition at line 194 of file YarpPluginSettings.h.

◆ getLibraryName()

std::string yarp::os::YarpPluginSettings::getLibraryName ( ) const
inline
Returns
the name of the shared library, if set

Definition at line 158 of file YarpPluginSettings.h.

◆ getMethodName()

std::string yarp::os::YarpPluginSettings::getMethodName ( ) const
inline
Returns
the name of the factory method, if set

Definition at line 167 of file YarpPluginSettings.h.

◆ getPluginName()

std::string yarp::os::YarpPluginSettings::getPluginName ( ) const
inline
Returns
the name of the plugin, if set

Definition at line 149 of file YarpPluginSettings.h.

◆ getSelector()

YarpPluginSelector* yarp::os::YarpPluginSettings::getSelector ( ) const
inline
Returns
the selector object, if set

Definition at line 176 of file YarpPluginSettings.h.

◆ getWrapperName()

std::string yarp::os::YarpPluginSettings::getWrapperName ( ) const
inline
Returns
the name of the wrapper, if set

Definition at line 185 of file YarpPluginSettings.h.

◆ open() [1/2]

bool YarpPluginSettings::open ( SharedLibraryFactory factory)

Initialize a factory object based on the hints available.

Parameters
factorythe factory to initialize
Returns
true on success

Definition at line 51 of file YarpPlugin.cpp.

◆ open() [2/2]

bool YarpPluginSettings::open ( SharedLibraryFactory factory,
const std::string &  dll_name,
const std::string &  fn_name 
)
private

Definition at line 24 of file YarpPlugin.cpp.

◆ readFromSearchable()

bool yarp::os::YarpPluginSettings::readFromSearchable ( Searchable options,
const std::string &  name 
)
inline

Configure settings from a configuration file or other searchable object.

Parameters
optionsconfiguration object to read from
namefallback name for plugin if not in configuration
Returns
true on success

Definition at line 130 of file YarpPluginSettings.h.

◆ readFromSelector()

bool yarp::os::YarpPluginSettings::readFromSelector ( const std::string &  name)
inlineprivate

Definition at line 251 of file YarpPluginSettings.h.

◆ reportFailure()

void YarpPluginSettings::reportFailure ( ) const

Give a human-readable failure-to-load report, summarizing the active hints.

Definition at line 153 of file YarpPlugin.cpp.

◆ reportStatus()

void YarpPluginSettings::reportStatus ( SharedLibraryFactory factory) const

Give a human-readable report of the status of a factory.

Parameters
factorythe factory about which to report

Definition at line 121 of file YarpPlugin.cpp.

◆ setClassInfo()

void yarp::os::YarpPluginSettings::setClassInfo ( const std::string &  class_name,
const std::string &  baseclass_name 
)
inline

Set the information about the class and the base class constructed by this plugin.

Parameters
class_namethe name of the class
baseclass_namethe name of the base class

Definition at line 82 of file YarpPluginSettings.h.

◆ setLibraryMethodName()

void yarp::os::YarpPluginSettings::setLibraryMethodName ( const std::string &  dll_name,
const std::string &  fn_name 
)
inline

Set the name of the library to load and the method name to use as a factory.

The library can include a complete path, or be left to the operating system to find according to the regular search path for libraries. Prefixes and suffixes such as "lib", ".dll", ".so", ".dylib" may be omitted.

Parameters
dll_namethe name of the shared library to load
fn_namethe name of the method within that library to use as a factory

Definition at line 55 of file YarpPluginSettings.h.

◆ setPluginName()

void yarp::os::YarpPluginSettings::setPluginName ( const std::string &  name)
inline

Set the name of the plugin to load.

If a corresponding YARP configuration file can be found, this may be a sufficient hint for YARP to fill in everything else.

Parameters
namethe name of the plugin to load

Definition at line 70 of file YarpPluginSettings.h.

◆ setSelector()

bool yarp::os::YarpPluginSettings::setSelector ( YarpPluginSelector selector)
inline

Use a selector to find a plugin or plugins.

If the name of the plugin has already been set, the selector will be used to increase what is known about the plugin.

Parameters
selectorthe yarp::os::YarpPluginSelector to use
Returns
true if a section about the plugin was found

Definition at line 100 of file YarpPluginSettings.h.

◆ setVerboseMode()

void yarp::os::YarpPluginSettings::setVerboseMode ( bool  verbose)
inline

Should messages be printed showing what searches YARP is trying out?

Parameters
verboseverbosity flag

Definition at line 115 of file YarpPluginSettings.h.

◆ subopen()

bool YarpPluginSettings::subopen ( SharedLibraryFactory factory,
const std::string &  dll_name,
const std::string &  fn_name 
)
private

Definition at line 30 of file YarpPlugin.cpp.

Member Data Documentation

◆ baseclass_name

std::string yarp::os::YarpPluginSettings::baseclass_name
private

Definition at line 241 of file YarpPluginSettings.h.

◆ class_name

std::string yarp::os::YarpPluginSettings::class_name
private

Definition at line 240 of file YarpPluginSettings.h.

◆ dll_name

std::string yarp::os::YarpPluginSettings::dll_name
private

Definition at line 237 of file YarpPluginSettings.h.

◆ fn_name

std::string yarp::os::YarpPluginSettings::fn_name
private

Definition at line 238 of file YarpPluginSettings.h.

◆ name

std::string yarp::os::YarpPluginSettings::name
private

Definition at line 236 of file YarpPluginSettings.h.

◆ selector

YarpPluginSelector* yarp::os::YarpPluginSettings::selector
private

Definition at line 242 of file YarpPluginSettings.h.

◆ verbose

bool yarp::os::YarpPluginSettings::verbose
private

Definition at line 243 of file YarpPluginSettings.h.

◆ wrapper_name

std::string yarp::os::YarpPluginSettings::wrapper_name
private

Definition at line 239 of file YarpPluginSettings.h.


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