|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_OS_SHAREDLIBRARYCLASS_H
10 #define YARP_OS_SHAREDLIBRARYCLASS_H
58 content = factory.
create();
62 return content !=
nullptr;
72 if (content !=
nullptr) {
73 pfactory->destroy(content);
75 if (pfactory->removeRef() == 0) {
128 return content !=
nullptr;
177 #endif // YARP_OS_SHAREDLIBRARYCLASS_H
const T & getContent() const
Gives access to the created instance (const version).
static void lock()
Call wait() on a global mutual-exclusion semaphore allocated by YARP.
SharedLibraryClass(SharedLibraryClassFactory< T > &factory)
Constructor for valid instance of a class from a shared library.
const T * operator->() const
A pointer version of SharedLibraryClass::getContent (const version)
virtual bool close()
Destroy an instance if one has been created.
bool open(SharedLibraryClassFactory< T > &factory)
Construct an instance using the specified factory.
const T & operator*() const
Shorthand for SharedLibraryClass::getContent (const version)
SharedLibraryClass()=default
Constructor for empty instance.
virtual ~SharedLibraryClass()
Destructor.
bool isValid() const
Check whether a valid instance has been created.
A type-safe wrapper for SharedLibraryFactory, committing to creation/destruction of instances of a pa...
T & getContent()
Gives access to the created instance.
static void unlock()
Call post() on a global mutual-exclusion semaphore allocated by YARP.
The main, catch-all namespace for YARP.
Container for an object created using a factory provided by a shared library.
T * operator->()
A pointer version of SharedLibraryClass::getContent.
int addRef()
Increment the reference count of this factory.
T & operator*()
Shorthand for SharedLibraryClass::getContent.