21 const char* fn_name) :
26 open(dll_name, fn_name);
40 if (!lib.open(dll_name)) {
42 status = STATUS_LIBRARY_NOT_FOUND;
44 status = STATUS_LIBRARY_NOT_LOADED;
51 status = STATUS_FACTORY_NOT_FOUND;
56 if (!useFactoryFunction(fn)) {
57 status = STATUS_FACTORY_NOT_FUNCTIONAL;
58 error =
"YARP hook in shared library misbehaved";
65 api.getClassName(buf, 256);
67 api.getBaseClassName(buf, 256);
84 if (api.systemVersion != 5) {
138 return baseClassName;
#define YARP_DEFAULT_FACTORY_NAME
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
int addRef()
Increment the reference count of this factory.
std::string getBaseClassName() const
Get the base type associated with this factory.
int getReferenceCount() const
Get the current reference count of this factory.
SharedLibraryFactory()
Constructor for unconfigured factory.
bool useFactoryFunction(void *factory)
Specify function to use as factory.
virtual ~SharedLibraryFactory()
Destructor.
std::string getClassName() const
Get the type associated with this factory.
std::string getName() const
Get the name associated with this factory.
bool isValid() const
Check if factory is configured and present.
bool open(const char *dll_name, const char *fn_name=nullptr)
Configure the factory.
const SharedLibraryClassApi & getApi() const
Get the factory API, which has creation/deletion methods.
int getStatus() const
Get the status of the factory.
int removeRef()
Decrement the reference count of this factory.
std::string getError() const
Get the latest error of the factory.
DumpObj * factory(Bottle &obj)
int stat(const char *path)
Portable wrapper for the stat() function.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Collection of hooks for creating/destroying a plugin.