YARP
Yet Another Robot Platform
yarp::os::YarpPlugin< T > Class Template Reference

Type-safe access to a plugin. More...

#include <yarp/os/YarpPlugin.h>

+ Inheritance diagram for yarp::os::YarpPlugin< T >:

Public Member Functions

 YarpPlugin ()
 Constructor. More...
 
virtual ~YarpPlugin ()
 Destructor. More...
 
bool open (YarpPluginSettings &settings)
 Load a library and prepare an object factory, based on the hints supplied. More...
 
bool close ()
 End this use of the plugin. More...
 
bool isValid () const
 
T * create ()
 Create an object using the plugin. More...
 
void destroy (T *obj)
 Destroy an object previously created using the plugin. More...
 
std::string getName ()
 
std::string getClassName ()
 
std::string getBaseClassName ()
 
SharedLibraryClassFactory< T > * getFactory () const
 

Detailed Description

template<class T>
class yarp::os::YarpPlugin< T >

Type-safe access to a plugin.

Definition at line 21 of file YarpPlugin.h.

Constructor & Destructor Documentation

◆ YarpPlugin()

template<class T >
yarp::os::YarpPlugin< T >::YarpPlugin ( )
inline

Constructor.

Definition at line 34 of file YarpPlugin.h.

◆ ~YarpPlugin()

template<class T >
virtual yarp::os::YarpPlugin< T >::~YarpPlugin ( )
inlinevirtual

Destructor.

Definition at line 44 of file YarpPlugin.h.

Member Function Documentation

◆ close()

template<class T >
bool yarp::os::YarpPlugin< T >::close ( )
inline

End this use of the plugin.

Returns
true on success

Definition at line 82 of file YarpPlugin.h.

◆ create()

template<class T >
T* yarp::os::YarpPlugin< T >::create ( )
inline

Create an object using the plugin.

Returns
an object of the type the plugin creates (nullptr on failure)

Definition at line 113 of file YarpPlugin.h.

◆ destroy()

template<class T >
void yarp::os::YarpPlugin< T >::destroy ( T *  obj)
inline

Destroy an object previously created using the plugin.

Parameters
objthe object to destroy

Definition at line 128 of file YarpPlugin.h.

◆ getBaseClassName()

template<class T >
std::string yarp::os::YarpPlugin< T >::getBaseClassName ( )
inline
Returns
the base class the objects constructed by this plugin

Definition at line 167 of file YarpPlugin.h.

◆ getClassName()

template<class T >
std::string yarp::os::YarpPlugin< T >::getClassName ( )
inline
Returns
the type of the objects constructed by this plugin

Definition at line 154 of file YarpPlugin.h.

◆ getFactory()

template<class T >
SharedLibraryClassFactory<T>* yarp::os::YarpPlugin< T >::getFactory ( ) const
inline
Returns
the factory object associated with the plugin

Definition at line 180 of file YarpPlugin.h.

◆ getName()

template<class T >
std::string yarp::os::YarpPlugin< T >::getName ( )
inline
Returns
the name of the objects constructed by this plugin

Definition at line 141 of file YarpPlugin.h.

◆ isValid()

template<class T >
bool yarp::os::YarpPlugin< T >::isValid ( ) const
inline
Returns
true if the plugin is correctly loaded

Definition at line 100 of file YarpPlugin.h.

◆ open()

template<class T >
bool yarp::os::YarpPlugin< T >::open ( YarpPluginSettings settings)
inline

Load a library and prepare an object factory, based on the hints supplied.

Parameters
settingsthe hints to use in finding the library
Returns
true on success

Definition at line 59 of file YarpPlugin.h.


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