C12Adapter Opensource C++ Interface
MDynamicLibrary Class Reference

Wrapper for shared object (dll) API. More...

Inheritance diagram for MDynamicLibrary:

Public Types

typedef void(* GlobalProcedureType) ()
 Generic procedure type. More...
 

Public Member Functions

 ~MDynamicLibrary ()
 Destructor unloads the shared object from the process memory space (in fact, the behavior depends on OS: for instance Windows just decrements a reference counter for this DLL and unloads it only if the counter is equal to zero)
 
const MStdStringGetName () const
 Returns name of the shared object.
 
MStdString GetPath () const
 Returns system path to the shared object.
 
GlobalProcedureType GetProcedureAddress (MConstChars procedureName)
 Get the address of the global procedure within the dynamic library. More...
 

Static Public Member Functions

static MDynamicLibraryLoad (const MStdString &name)
 Loads the specified MeteringSDK library into the address space of the current process. More...
 
static MDynamicLibraryLoadExact (const MStdString &name, const MStdString &shortName)
 Loads the specified shared object into the address space of the current process.
 
static void EnsureLibraryIsLoaded (const MStdString &name)
 Make sure the given library is loaded. More...
 

Detailed Description

Wrapper for shared object (dll) API.

Member Typedef Documentation

typedef void(* MDynamicLibrary::GlobalProcedureType) ()

Generic procedure type.

See also
GetProcedureAddress

Member Function Documentation

static void MDynamicLibrary::EnsureLibraryIsLoaded ( const MStdString name)
static

Make sure the given library is loaded.

Parameters
nameIf library with this name is not already loaded it will be loaded.
GlobalProcedureType MDynamicLibrary::GetProcedureAddress ( MConstChars  procedureName)

Get the address of the global procedure within the dynamic library.

Precondition
Library shall be created, and procedure with such name shall exist, or an exception is thrown.
static MDynamicLibrary* MDynamicLibrary::Load ( const MStdString name)
static

Loads the specified MeteringSDK library into the address space of the current process.

The Load function translates its parameter by appending the following information: underline vc[u][d]|cb .dll.