22#ifndef ROBOTTESTINGFRAMEWORK_SHAREDLIBRARYFACTORY_H
23#define ROBOTTESTINGFRAMEWORK_SHAREDLIBRARYFACTORY_H
33class SharedLibraryFactory;
76 const char* fn_name =
nullptr);
90 bool open(
const char* dll_name,
const char* fn_name =
nullptr);
A wrapper for a named factory method in a named shared library.
bool open(const char *dll_name, const char *fn_name=nullptr)
Configure the factory.
bool useFactoryFunction(void *factory)
Specify function to use as factory.
int addRef()
Increment the reference count of this factory.
SharedLibraryClassApi api
SharedLibraryFactory(const char *dll_name, const char *fn_name=nullptr)
Constructor.
bool isValid() const
Check if factory is configured and present.
virtual ~SharedLibraryFactory()
Destructor.
std::string getName() const
Get the name associated with this factory.
int getStatus() const
Get the status of the factory.
std::string getClassName() const
Get the type associated with this factory.
std::string getError() const
Get the latest error of the factory.
int removeRef()
Decrement the reference count of this factory.
@ STATUS_LIBRARY_NOT_LOADED
Named shared library failed to load.
@ STATUS_FACTORY_NOT_FOUND
Named method wasn't present in library.
@ STATUS_LIBRARY_NOT_FOUND
Named shared library was not found.
@ STATUS_NONE
Not configured yet.
@ STATUS_FACTORY_NOT_FUNCTIONAL
Named method is not working right.
@ STATUS_OK
Present and sane.
std::string getBaseClassName() const
Get the base type associated with this factory.
SharedLibraryFactory()
Constructor for unconfigured factory.
std::string baseClassName
int getReferenceCount() const
Get the current reference count of this factory.
const SharedLibraryClassApi & getApi() const
Get the factory API, which has creation/deletion methods.
Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it.
constexpr int32_t VOCAB(char a, char b=0, char c=0, char d=0)
Collection of hooks for creating/destroying a plugin.