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

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

#include <yarp/os/YarpPluginSettings.h>

Public Member Functions

 YarpPluginSettings ()
 Constructor. More...
 
void setLibraryMethodName (const ConstString &dll_name, const ConstString &fn_name)
 Set the name of the library to load and the method name to use as a factory. More...
 
void setPluginName (const ConstString &name)
 Set the name of the plugin to load. More...
 
void setClassInfo (const ConstString &class_name, const ConstString &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 ConstString &name)
 Configure settings from a configuration file or other searchable object. More...
 
ConstString getPluginName () const
 
ConstString getLibraryName () const
 
ConstString getMethodName () const
 
YarpPluginSelectorgetSelector () const
 
ConstString getWrapperName () const
 
ConstString getClassName () const
 
ConstString 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 ConstString &dll_name, const ConstString &fn_name)
 
bool open (SharedLibraryFactory &factory, const ConstString &dll_name, const ConstString &fn_name)
 
bool readFromSelector (const ConstString &name)
 

Private Attributes

ConstString name
 
ConstString dll_name
 
ConstString fn_name
 
ConstString wrapper_name
 
ConstString class_name
 
ConstString baseclass_name
 
YarpPluginSelectorselector
 
bool verbose
 

Detailed Description

Collect hints for finding a particular plugin.

Definition at line 26 of file YarpPluginSettings.h.

Constructor & Destructor Documentation

◆ YarpPluginSettings()

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

Constructor.

Definition at line 34 of file YarpPluginSettings.h.

Member Function Documentation

◆ getBaseClassName()

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

Definition at line 200 of file YarpPluginSettings.h.

◆ getClassName()

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

Definition at line 191 of file YarpPluginSettings.h.

◆ getLibraryName()

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

Definition at line 155 of file YarpPluginSettings.h.

◆ getMethodName()

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

Definition at line 164 of file YarpPluginSettings.h.

◆ getPluginName()

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

Definition at line 146 of file YarpPluginSettings.h.

◆ getSelector()

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

Definition at line 173 of file YarpPluginSettings.h.

◆ getWrapperName()

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

Definition at line 182 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 49 of file YarpPlugin.cpp.

◆ open() [2/2]

bool YarpPluginSettings::open ( SharedLibraryFactory factory,
const ConstString dll_name,
const ConstString fn_name 
)
private

Definition at line 22 of file YarpPlugin.cpp.

◆ readFromSearchable()

bool yarp::os::YarpPluginSettings::readFromSearchable ( Searchable options,
const ConstString 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 127 of file YarpPluginSettings.h.

◆ readFromSelector()

bool yarp::os::YarpPluginSettings::readFromSelector ( const ConstString name)
inlineprivate

Definition at line 248 of file YarpPluginSettings.h.

◆ reportFailure()

void YarpPluginSettings::reportFailure ( ) const

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

Definition at line 151 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 119 of file YarpPlugin.cpp.

◆ setClassInfo()

void yarp::os::YarpPluginSettings::setClassInfo ( const ConstString class_name,
const ConstString 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 79 of file YarpPluginSettings.h.

◆ setLibraryMethodName()

void yarp::os::YarpPluginSettings::setLibraryMethodName ( const ConstString dll_name,
const ConstString 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 52 of file YarpPluginSettings.h.

◆ setPluginName()

void yarp::os::YarpPluginSettings::setPluginName ( const ConstString 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 67 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 97 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 112 of file YarpPluginSettings.h.

◆ subopen()

bool YarpPluginSettings::subopen ( SharedLibraryFactory factory,
const ConstString dll_name,
const ConstString fn_name 
)
private

Definition at line 28 of file YarpPlugin.cpp.

Member Data Documentation

◆ baseclass_name

ConstString yarp::os::YarpPluginSettings::baseclass_name
private

Definition at line 238 of file YarpPluginSettings.h.

◆ class_name

ConstString yarp::os::YarpPluginSettings::class_name
private

Definition at line 237 of file YarpPluginSettings.h.

◆ dll_name

ConstString yarp::os::YarpPluginSettings::dll_name
private

Definition at line 234 of file YarpPluginSettings.h.

◆ fn_name

ConstString yarp::os::YarpPluginSettings::fn_name
private

Definition at line 235 of file YarpPluginSettings.h.

◆ name

ConstString yarp::os::YarpPluginSettings::name
private

Definition at line 233 of file YarpPluginSettings.h.

◆ selector

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

Definition at line 239 of file YarpPluginSettings.h.

◆ verbose

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

Definition at line 240 of file YarpPluginSettings.h.

◆ wrapper_name

ConstString yarp::os::YarpPluginSettings::wrapper_name
private

Definition at line 236 of file YarpPluginSettings.h.


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