44 return const_cast<char*
>(
"Unknown error");
46 return yarp::os::impl::dlerror();
51 ACE_DLL*
dll{
nullptr};
59 SharedLibrary::SharedLibrary() :
121 return (result == 0);
139 void* result = yarp::os::impl::dlsym(
implementation->dll, symbolName);
141 if (result ==
nullptr) {
RandScalar * implementation(void *t)
Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it.
bool open(const char *filename)
Load the named shared library / DLL.
std::string error()
Returns a human-readable string describing the most recent error that occurred from a call to one of ...
virtual ~SharedLibrary()
Destructor.
bool isValid() const
Check if the shared library is valid.
SharedLibrary()
Initialize, without opening a shared library yet.
bool close()
Shared library no longer needed, unload if not in use elsewhere.
void * getSymbol(const char *symbolName)
Look up a symbol in the shared library.
SharedLibraryImpl()=default