Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Static Public Member Functions | List of all members
datatools::detail::DynamicLoader Class Reference

Portable loading of dynamic libraries or dll's. More...

#include <bayeux/datatools/detail/DynamicLoader.h>

Public Types

typedef void * LibraryHandle
 
typedef void(* SymbolPointer) ()
 

Static Public Member Functions

static LibraryHandle OpenLibrary (const char *)
 
static int CloseLibrary (LibraryHandle)
 
static SymbolPointer GetSymbolAddress (LibraryHandle, const char *)
 
static const char * LibPrefix ()
 
static const char * LibExtension ()
 
static const char * LastError ()
 

Detailed Description

Portable loading of dynamic libraries or dll's.

DynamicLoader provides a portable interface to loading dynamic libraries or dll's into a process.

Directory currently works with Windows, Apple, HP-UX and Unix (POSIX) operating systems

Warning
dlopen on *nix system works the following way: If filename contains a slash ("/"), then it is interpreted as a (relative or absolute) pathname. Otherwise, the dynamic linker searches for the library as follows : see ld.so(8) for further details): Whereas this distinction does not exist on Win32. Therefore ideally you should be doing full path to garantee to have a consistent way of dealing with dynamic loading of shared library.
the Cygwin implementation do not use the Win32 HMODULE. Put extra condition so that we can include the correct declaration (POSIX)

Member Typedef Documentation

◆ LibraryHandle

◆ SymbolPointer

typedef void(* datatools::detail::DynamicLoader::SymbolPointer) ()

Member Function Documentation

◆ CloseLibrary()

static int datatools::detail::DynamicLoader::CloseLibrary ( LibraryHandle  )
static

Attempt to detach a dynamic library from the process. A value of true is returned if it is sucessful.

◆ GetSymbolAddress()

static SymbolPointer datatools::detail::DynamicLoader::GetSymbolAddress ( LibraryHandle  ,
const char *   
)
static

Find the address of the symbol in the given library.

◆ LastError()

static const char* datatools::detail::DynamicLoader::LastError ( )
static

Return the last error produced from a calls made on this class.

◆ LibExtension()

static const char* datatools::detail::DynamicLoader::LibExtension ( )
inlinestatic

Return the default module suffix for the current platform.

◆ LibPrefix()

static const char* datatools::detail::DynamicLoader::LibPrefix ( )
inlinestatic

Return the default module prefix for the current platform.

◆ OpenLibrary()

static LibraryHandle datatools::detail::DynamicLoader::OpenLibrary ( const char *  )
static

Load a dynamic library into the current process. The returned LibraryHandle can be used to access the symbols in the library.


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