YARP  2.3.68+272-20170522.1+git50f0ae7
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...
 
ConstString getName ()
 
ConstString getClassName ()
 
ConstString getBaseClassName ()
 
SharedLibraryClassFactory< T > * getFactory () const
 

Private Attributes

SharedLibraryClassFactory< T > * factory
 
SharedLibraryClass< T > content
 
YarpPluginSettings settings
 

Detailed Description

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

Type-safe access to a plugin.

Definition at line 15 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 46 of file YarpPlugin.h.

Member Function Documentation

◆ close()

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

End this use of the plugin.

Returns
true on success

Definition at line 80 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 (YARP_NULLPTR on failure)

Definition at line 109 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 123 of file YarpPlugin.h.

◆ getBaseClassName()

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

Definition at line 159 of file YarpPlugin.h.

◆ getClassName()

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

Definition at line 147 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 171 of file YarpPlugin.h.

◆ getName()

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

Definition at line 135 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 97 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 60 of file YarpPlugin.h.

Member Data Documentation

◆ content

template<class T>
SharedLibraryClass<T> yarp::os::YarpPlugin< T >::content
private

Definition at line 28 of file YarpPlugin.h.

◆ factory

template<class T>
SharedLibraryClassFactory<T>* yarp::os::YarpPlugin< T >::factory
private

Definition at line 27 of file YarpPlugin.h.

◆ settings

template<class T>
YarpPluginSettings yarp::os::YarpPlugin< T >::settings
private

Definition at line 29 of file YarpPlugin.h.


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