RobotTestingFramework
2.0.1
Robot Testing Framework
|
A wrapper for a named factory method in a named shared library. More...
#include <robottestingframework/dll/SharedLibraryFactory.h>
Public Types | |
enum | { STATUS_NONE, STATUS_OK = VOCAB('o', 'k'), STATUS_LIBRARY_NOT_FOUND = VOCAB('f', 'o', 'u', 'n'), STATUS_LIBRARY_NOT_LOADED = VOCAB('l', 'o', 'a', 'd'), STATUS_FACTORY_NOT_FOUND = VOCAB('f', 'a', 'c', 't'), STATUS_FACTORY_NOT_FUNCTIONAL = VOCAB('r', 'u', 'n') } |
The status of a factory can be: More... | |
Public Member Functions | |
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... | |
Private Attributes | |
SharedLibrary | lib |
int | status |
SharedLibraryClassApi | api |
int | returnValue |
int | rct |
std::string | name |
std::string | className |
std::string | baseClassName |
std::string | error |
A wrapper for a named factory method in a named shared library.
This wrapper will do some basic checks that the named method does indeed behave like a YARP plugin hook before offering access to it. This is to avoid accidents, it is not a security mechanism.
Definition at line 42 of file SharedLibraryFactory.h.
anonymous enum |
The status of a factory can be:
Definition at line 54 of file SharedLibraryFactory.h.
|
explicit |
Constructor for unconfigured factory.
shlibpp::SharedLibraryFactory::SharedLibraryFactory | ( | const char * | dll_name, |
const char * | fn_name = nullptr |
||
) |
Constructor.
dll_name | name/path of shared library. |
fn_name | name of factory method, a symbol within the shared library. |
|
virtual |
Destructor.
int shlibpp::SharedLibraryFactory::addRef | ( | ) |
Increment the reference count of this factory.
const SharedLibraryClassApi& shlibpp::SharedLibraryFactory::getApi | ( | ) | const |
Get the factory API, which has creation/deletion methods.
std::string shlibpp::SharedLibraryFactory::getBaseClassName | ( | ) | const |
Get the base type associated with this factory.
std::string shlibpp::SharedLibraryFactory::getClassName | ( | ) | const |
Get the type associated with this factory.
std::string shlibpp::SharedLibraryFactory::getError | ( | ) | const |
Get the latest error of the factory.
std::string shlibpp::SharedLibraryFactory::getName | ( | ) | const |
Get the name associated with this factory.
int shlibpp::SharedLibraryFactory::getReferenceCount | ( | ) | const |
Get the current reference count of this factory.
int shlibpp::SharedLibraryFactory::getStatus | ( | ) | const |
Get the status of the factory.
bool shlibpp::SharedLibraryFactory::isValid | ( | ) | const |
Check if factory is configured and present.
bool shlibpp::SharedLibraryFactory::open | ( | const char * | dll_name, |
const char * | fn_name = nullptr |
||
) |
Configure the factory.
dll_name | name/path of shared library. |
fn_name | name of factory method, a symbol within the shared library. |
int shlibpp::SharedLibraryFactory::removeRef | ( | ) |
Decrement the reference count of this factory.
bool shlibpp::SharedLibraryFactory::useFactoryFunction | ( | void * | factory | ) |
Specify function to use as factory.
factory | function to use as factory. |
|
private |
Definition at line 177 of file SharedLibraryFactory.h.
|
private |
Definition at line 182 of file SharedLibraryFactory.h.
|
private |
Definition at line 181 of file SharedLibraryFactory.h.
|
private |
Definition at line 183 of file SharedLibraryFactory.h.
|
private |
Definition at line 175 of file SharedLibraryFactory.h.
|
private |
Definition at line 180 of file SharedLibraryFactory.h.
|
private |
Definition at line 179 of file SharedLibraryFactory.h.
|
private |
Definition at line 178 of file SharedLibraryFactory.h.
|
private |
Definition at line 176 of file SharedLibraryFactory.h.