blocxx
BLOCXX_NAMESPACE::SharedLibrary Class Referenceabstract

SharedLibrary is a base class for platform classes that implement the functionality of loading and querying shared libraries. More...

#include <SharedLibrary.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::SharedLibrary:
BLOCXX_NAMESPACE::IntrusiveCountableBase

Public Member Functions

virtual ~SharedLibrary ()
 
template<class fptype>
bool getFunctionPointer (const String &functionName, fptype &retval)
 given a symbol name, getFunctionPointer will store a pointer to the function in retval.
 

Protected Member Functions

virtual bool doGetFunctionPointer (const String &functionName, void **fp) const =0
 Derived classes have to override this function to implement the symbol loading.
 
- Protected Member Functions inherited from BLOCXX_NAMESPACE::IntrusiveCountableBase
 IntrusiveCountableBase ()
 
 IntrusiveCountableBase (const IntrusiveCountableBase &)
 
IntrusiveCountableBaseoperator= (const IntrusiveCountableBase &)
 
virtual ~IntrusiveCountableBase ()
 

Detailed Description

SharedLibrary is a base class for platform classes that implement the functionality of loading and querying shared libraries.

Definition at line 52 of file SharedLibrary.hpp.

Constructor & Destructor Documentation

◆ ~SharedLibrary()

BLOCXX_NAMESPACE::SharedLibrary::~SharedLibrary ( )
virtual

Definition at line 45 of file SharedLibrary.cpp.

Member Function Documentation

◆ doGetFunctionPointer()

virtual bool BLOCXX_NAMESPACE::SharedLibrary::doGetFunctionPointer ( const String & functionName,
void ** fp ) const
protectedpure virtual

Derived classes have to override this function to implement the symbol loading.

The symbol to be looked up is contained in functionName, and the pointer to the function should be written into *fp. Return true if the function succeeded, false otherwise.

Parameters
functionNameThe name of the function to resolve.
fpWhere to store the function pointer.
Returns
true if function succeeded, false otherwise.

Referenced by getFunctionPointer().

◆ getFunctionPointer()

template<class fptype>
bool BLOCXX_NAMESPACE::SharedLibrary::getFunctionPointer ( const String & functionName,
fptype & retval )
inline

given a symbol name, getFunctionPointer will store a pointer to the function in retval.

If the symbol is found the function returns true, otherwise false. This function should be called like this: typedef ReturnType (*func_t)(param_t p1, ...); func_t theFunction; sharedLibrary->getFunctionPointer(sharedLibrary, "FunctionName", theFunction);

Parameters
functionNameThe name of the function to resolve.
retvalWill be set to the function pointer.
Returns
true if function succeeded, false otherwise.

Definition at line 70 of file SharedLibrary.hpp.

References doGetFunctionPointer().


The documentation for this class was generated from the following files: