Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
OSD_SharedLibrary Class Reference

Interface to dynamic library loader. Provides tools to load a shared library and retrieve the address of an entry point. More...

#include <OSD_SharedLibrary.hxx>

Public Member Functions

 OSD_SharedLibrary ()
 Creates a SharedLibrary object with name NULL.
 
 OSD_SharedLibrary (const char *const aFilename)
 Creates a SharedLibrary object with name aFilename.
 
void SetName (const char *const aName)
 Sets a name associated to the shared object.
 
const charName () const
 Returns the name associated to the shared object.
 
bool DlOpen (const OSD_LoadMode Mode)
 The DlOpen method provides an interface to the dynamic library loader to allow shared libraries to be loaded and called at runtime. The DlOpen function attempts to load Filename, in the address space of the process, resolving symbols as appropriate. Any libraries that Filename depends upon are also loaded. If MODE is RTLD_LAZY, then the runtime loader does symbol resolution only as needed. Typically, this means that the first call to a function in the newly loaded library will cause the resolution of the address of that function to occur. If Mode is RTLD_NOW, then the runtime loader must do all symbol binding during the DlOpen call. The DlOpen method returns a handle that is used by DlSym or DlClose. If there is an error, false is returned, true otherwise. If a NULL Filename is specified, DlOpen returns a handle for the main executable, which allows access to dynamic symbols in the running program.
 
OSD_Function DlSymb (const char *const Name) const
 The dlsym function returns the address of the symbol name found in the shared library. If the symbol is not found, a NULL pointer is returned.
 
void DlClose () const
 Deallocates the address space for the library corresponding to the shared object. If any user function continues to call a symbol resolved in the address space of a library that has been since been deallocated by DlClose, the results are undefined.
 
const charDlError () const
 The dlerror function returns a string describing the last error that occurred from a call to DlOpen, DlClose or DlSym.
 
void Destroy ()
 Frees memory allocated.
 
 ~OSD_SharedLibrary ()
 

Detailed Description

Interface to dynamic library loader. Provides tools to load a shared library and retrieve the address of an entry point.

Constructor & Destructor Documentation

◆ OSD_SharedLibrary() [1/2]

OSD_SharedLibrary::OSD_SharedLibrary ( )

Creates a SharedLibrary object with name NULL.

◆ OSD_SharedLibrary() [2/2]

OSD_SharedLibrary::OSD_SharedLibrary ( const char *const aFilename)

Creates a SharedLibrary object with name aFilename.

◆ ~OSD_SharedLibrary()

OSD_SharedLibrary::~OSD_SharedLibrary ( )
inline

Member Function Documentation

◆ Destroy()

void OSD_SharedLibrary::Destroy ( )

Frees memory allocated.

◆ DlClose()

void OSD_SharedLibrary::DlClose ( ) const

Deallocates the address space for the library corresponding to the shared object. If any user function continues to call a symbol resolved in the address space of a library that has been since been deallocated by DlClose, the results are undefined.

◆ DlError()

const char * OSD_SharedLibrary::DlError ( ) const

The dlerror function returns a string describing the last error that occurred from a call to DlOpen, DlClose or DlSym.

◆ DlOpen()

bool OSD_SharedLibrary::DlOpen ( const OSD_LoadMode Mode)

The DlOpen method provides an interface to the dynamic library loader to allow shared libraries to be loaded and called at runtime. The DlOpen function attempts to load Filename, in the address space of the process, resolving symbols as appropriate. Any libraries that Filename depends upon are also loaded. If MODE is RTLD_LAZY, then the runtime loader does symbol resolution only as needed. Typically, this means that the first call to a function in the newly loaded library will cause the resolution of the address of that function to occur. If Mode is RTLD_NOW, then the runtime loader must do all symbol binding during the DlOpen call. The DlOpen method returns a handle that is used by DlSym or DlClose. If there is an error, false is returned, true otherwise. If a NULL Filename is specified, DlOpen returns a handle for the main executable, which allows access to dynamic symbols in the running program.

◆ DlSymb()

OSD_Function OSD_SharedLibrary::DlSymb ( const char *const Name) const

The dlsym function returns the address of the symbol name found in the shared library. If the symbol is not found, a NULL pointer is returned.

◆ Name()

const char * OSD_SharedLibrary::Name ( ) const

Returns the name associated to the shared object.

◆ SetName()

void OSD_SharedLibrary::SetName ( const char *const aName)

Sets a name associated to the shared object.


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