All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
PLMD::DLLoader Class Reference

Class taking care of dynamic loading. More...

#include <DLLoader.h>

Public Member Functions

 DLLoader ()
 Default constructor. More...
 
 ~DLLoader ()
 Cleanup. More...
 
void * load (const std::string &)
 Load a library, returning its handle. More...
 
const std::string & error ()
 Returns the last error in dynamic loader. More...
 

Static Public Member Functions

static bool installed ()
 Returns true if the dynamic loader is available (on some systems it may not). More...
 

Private Member Functions

 DLLoader (const DLLoader &)
 Private copy constructor. More...
 
DLLoaderoperator= (const DLLoader &)
 Private assignment. More...
 

Private Attributes

std::stack< void * > handles
 
std::string lastError
 

Detailed Description

Class taking care of dynamic loading.

It contains wrappers to the dlopen() routine. It is designed so that when an object of this class goes out of scope all the libraries loaded by it are unloaded. In this manner, loaded libraries are automatically unloaded at the end of execution. Libraries are loaded with RTDL_LOCAL option, which means that they are not accessible from outside. Still, if they contain self-registering classes, they will register themselves to the ActionRegister object.

Definition at line 40 of file DLLoader.h.

Constructor & Destructor Documentation

PLMD::DLLoader::DLLoader ( const DLLoader )
private

Private copy constructor.

PLMD::DLLoader::DLLoader ( )

Default constructor.

Definition at line 67 of file DLLoader.cpp.

PLMD::DLLoader::~DLLoader ( )

Cleanup.

Definition at line 58 of file DLLoader.cpp.

Member Function Documentation

const std::string & PLMD::DLLoader::error ( )

Returns the last error in dynamic loader.

Definition at line 54 of file DLLoader.cpp.

bool PLMD::DLLoader::installed ( )
static

Returns true if the dynamic loader is available (on some systems it may not).

Definition at line 30 of file DLLoader.cpp.

void * PLMD::DLLoader::load ( const std::string &  s)

Load a library, returning its handle.

Definition at line 39 of file DLLoader.cpp.

DLLoader& PLMD::DLLoader::operator= ( const DLLoader )
private

Private assignment.

Member Data Documentation

std::stack<void*> PLMD::DLLoader::handles
private

Definition at line 41 of file DLLoader.h.

std::string PLMD::DLLoader::lastError
private

Definition at line 42 of file DLLoader.h.


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