MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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:

Public Member Functions

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

Static Public Member Functions

static DtString standardPrefix ()
 Returns a standard prefix for libraries on this platform. More...
 
static DtString debugModifier ()
 Returns a standard debug modifier for libraries on this build. More...
 
static DtString standardExtension ()
 Returns the standard dynamic extension for this platform. More...
 
static DtString sharedLibraryName (const DtString &moduleName)
 Given the module name, returns the appropriately formated shared library filename. More...
 

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) and a debug modifier ("d")
virtual MAKLogger::DtLgrDynamicLibrary::~DtLgrDynamicLibrary ( )
virtual

Member Function Documentation

static DtString MAKLogger::DtLgrDynamicLibrary::debugModifier ( )
static

Returns a standard debug modifier for libraries on this build.

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::sharedLibraryName ( const DtString &  moduleName)
static

Given the module name, returns the appropriately formated shared library filename.

static DtString MAKLogger::DtLgrDynamicLibrary::standardExtension ( )
static

Returns the standard dynamic extension for this platform.

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

Returns a standard prefix for libraries on this platform.

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

Member Data Documentation

void* MAKLogger::DtLgrDynamicLibrary::myHandle
protected
char* MAKLogger::DtLgrDynamicLibrary::myLastError
protected
DtString MAKLogger::DtLgrDynamicLibrary::myLibraryName
protected

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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)