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

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

#include <yarp/os/YarpPlugin.h>

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 24 of file YarpPlugin.h.

Constructor & Destructor Documentation

◆ YarpPlugin()

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

Constructor.

Definition at line 37 of file YarpPlugin.h.

◆ ~YarpPlugin()

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

Destructor.

Definition at line 47 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 84 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 115 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 130 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 169 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 156 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 182 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 143 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 102 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 62 of file YarpPlugin.h.


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