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

A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a particular super-class. More...

#include <yarp/os/SharedLibraryClassFactory.h>

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

Public Member Functions

 SharedLibraryClassFactory ()
 
 SharedLibraryClassFactory (const char *dll_name, const char *fn_name=YARP_NULLPTR)
 
T * create ()
 
void destroy (T *obj)
 
- Public Member Functions inherited from yarp::os::SharedLibraryFactory
 SharedLibraryFactory ()
 Constructor for unconfigured factory. More...
 
 SharedLibraryFactory (const char *dll_name, const char *fn_name=YARP_NULLPTR)
 Constructor. More...
 
virtual ~SharedLibraryFactory ()
 Destructor. More...
 
bool open (const char *dll_name, const char *fn_name=YARP_NULLPTR)
 Configure the factory. More...
 
bool isValid () const
 Check if factory is configured and present. More...
 
int getStatus () const
 Get the status of the factory. More...
 
ConstString getError () const
 Get the latest error of the factory. More...
 
const SharedLibraryClassApigetApi () const
 Get the factory API, which has creation/deletion methods. More...
 
int getReferenceCount () const
 Get the current reference count of this factory. More...
 
int addRef ()
 Increment the reference count of this factory. More...
 
int removeRef ()
 Decrement the reference count of this factory. More...
 
ConstString getName () const
 Get the name associated with this factory. More...
 
ConstString getClassName () const
 Get the type associated with this factory. More...
 
ConstString getBaseClassName () const
 Get the base type associated with this factory. More...
 
bool useFactoryFunction (void *factory)
 Specify function to use as factory. More...
 

Additional Inherited Members

- Public Types inherited from yarp::os::SharedLibraryFactory
enum  {
  STATUS_NONE,
  STATUS_OK = VOCAB2('o', 'k'),
  STATUS_LIBRARY_NOT_FOUND = VOCAB4('f', 'o', 'u', 'n'),
  STATUS_LIBRARY_NOT_LOADED = VOCAB4('l', 'o', 'a', 'd'),
  STATUS_FACTORY_NOT_FOUND = VOCAB4('f', 'a', 'c', 't'),
  STATUS_FACTORY_NOT_FUNCTIONAL = VOCAB3('r', 'u', 'n')
}
 The status of a factory can be: More...
 

Detailed Description

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

A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a particular super-class.

Note that we take on faith that the named factory method in the named shared library does in fact create the named type.

Definition at line 15 of file SharedLibraryClassFactory.h.

Constructor & Destructor Documentation

◆ SharedLibraryClassFactory() [1/2]

Definition at line 29 of file SharedLibraryClassFactory.h.

◆ SharedLibraryClassFactory() [2/2]

template<class T>
yarp::os::SharedLibraryClassFactory< T >::SharedLibraryClassFactory ( const char *  dll_name,
const char *  fn_name = YARP_NULLPTR 
)
inline

Definition at line 32 of file SharedLibraryClassFactory.h.

Member Function Documentation

◆ create()

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

Definition at line 35 of file SharedLibraryClassFactory.h.

◆ destroy()

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

Definition at line 40 of file SharedLibraryClassFactory.h.


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