A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a particular super-class. More...
#include <yarp/os/SharedLibraryClassFactory.h>
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 24 of file SharedLibraryClassFactory.h.
Public Member Functions | |
SharedLibraryClassFactory ()=default | |
SharedLibraryClassFactory (const char *dll_name, const char *fn_name=nullptr) | |
T * | create () |
void | destroy (T *obj) const |
![]() | |
SharedLibraryFactory () | |
Constructor for unconfigured factory. More... | |
SharedLibraryFactory (const char *dll_name, const char *fn_name=nullptr) | |
Constructor. More... | |
virtual | ~SharedLibraryFactory () |
Destructor. More... | |
bool | open (const char *dll_name, const char *fn_name=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... | |
std::string | getError () const |
Get the latest error of the factory. More... | |
const SharedLibraryClassApi & | getApi () 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... | |
std::string | getName () const |
Get the name associated with this factory. More... | |
std::string | getClassName () const |
Get the type associated with this factory. More... | |
std::string | 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 | |
![]() | |
enum | { STATUS_NONE , STATUS_OK = yarp::os::createVocab('o', 'k') , STATUS_LIBRARY_NOT_FOUND = yarp::os::createVocab('f', 'o', 'u', 'n') , STATUS_LIBRARY_NOT_LOADED = yarp::os::createVocab('l', 'o', 'a', 'd') , STATUS_FACTORY_NOT_FOUND = yarp::os::createVocab('f', 'a', 'c', 't') , STATUS_FACTORY_NOT_FUNCTIONAL = yarp::os::createVocab('r', 'u', 'n') } |
The status of a factory can be: More... | |
|
default |
|
inline |
Definition at line 29 of file SharedLibraryClassFactory.h.
|
inline |
Definition at line 34 of file SharedLibraryClassFactory.h.
|
inline |
Definition at line 42 of file SharedLibraryClassFactory.h.