Public Member Functions | Static Public Member Functions | Protected Attributes
MAKLogger::DtLgrDynamicLibrary Class Reference

DtLgrDynamicLibrary provides an operating independent way to manipulate dynamically loaded libraries. More...

+ Collaboration diagram for MAKLogger::DtLgrDynamicLibrary:

List of all members.

Public Member Functions

 DtLgrDynamicLibrary (const DtString &libName, bool addPlatExt=true, bool useLazyEval=true)
 Constructs an instance of DtLgrDynamicLibrary for libname.
bool isValid () const
 returns true if this library is valid and open.
DtString libraryName () const
 returns the final library name which was opened (or attempted to open).
const char * error () const
 returns the last error reported.
virtual void * procAddress (const DtString &symName)
 Returns a pointer to the requested function found in the dynamic library libHandle.

Static Public Member Functions

static DtString standardExtension ()
 Returns the standard dynamic extension for this platform.
static DtString standardPrefix ()
 Returns a standard prefix for libraries on this platform.

Protected Attributes

void * myHandle
DtString myLibraryName
char * myLastError

Detailed Description

DtLgrDynamicLibrary provides an operating independent way to manipulate dynamically loaded libraries.


Constructor & Destructor Documentation

MAKLogger::DtLgrDynamicLibrary::DtLgrDynamicLibrary ( const DtString libName,
bool  addPlatExt = true,
bool  useLazyEval = true 
)

Constructs an instance of DtLgrDynamicLibrary for libname.

The library will be opened using lazyEvaluation if possible when the useLazyEval flag is set to true.

  • addPlatExt When true will add both the standard platform extension (.sl, .so, or .dll) as well as any standard platform prefix (like "lib" on UNIX)

Member Function Documentation

const char* MAKLogger::DtLgrDynamicLibrary::error ( ) const

returns the last error reported.

This is reset each time procAddress is called. A return value of NULL indicates that the operation succeeded.

bool MAKLogger::DtLgrDynamicLibrary::isValid ( ) const

returns true if this library is valid and open.

returns false if an error has occurred. Not virtual because it is called from the CTOR. To get a human readable error message call error(). Once a library is invalid, it will always be invalid.

DtString MAKLogger::DtLgrDynamicLibrary::libraryName ( ) const

returns the final library name which was opened (or attempted to open).

The string will include the platform extension which may have been added when this object was constructed.

virtual void* MAKLogger::DtLgrDynamicLibrary::procAddress ( const DtString symName) [virtual]

Returns a pointer to the requested function found in the dynamic library libHandle.

If no matching symbol is found null is returned, it is possible for NULL to be a valid matching symbol on some platforms. The correct way to check for an error is to look at the return value from error(). If an error has occurred the result of error() will be non NULL.

static DtString MAKLogger::DtLgrDynamicLibrary::standardPrefix ( ) [static]

Returns a standard prefix for libraries on this platform.

For example, linux prefixes "lib" to library names.


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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)