VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtDynamicLibrary Class Reference

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

+ Collaboration diagram for DtDynamicLibrary:

Public Member Functions

virtual ~DtDynamicLibrary ()
 Default Dtor. More...
 
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 standardExtension ()
 returns the standard dynamic extension for this platform More...
 
static DtDynamicLibrarycreate (const DtString &libName, bool addPlatExt=true, bool useLazyEval=false, bool useGlobal=false)
 Constructs an instance of DtDynamicLibrary for libname. More...
 

Protected Member Functions

 DtDynamicLibrary (const DtString &libName)
 Do not use ctor, use the factory method create instead. More...
 
virtual void open (bool addPlatExt, bool useLazyEval, bool useGlobal)
 Open is called from the static create() function. More...
 

Protected Attributes

void * myHandle
 
DtString myLibraryName
 
char * myLastError
 

Private Member Functions

 DtDynamicLibrary (const DtDynamicLibrary &other)
 Copy CTOR not implemented - Do Not copy. More...
 
DtDynamicLibraryoperator= (const DtDynamicLibrary &other)
 Assignment Operator not implemented - Do Not copy. More...
 

Detailed Description

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

Constructor & Destructor Documentation

virtual DtDynamicLibrary::~DtDynamicLibrary ( )
virtual

Default Dtor.

DtDynamicLibrary::DtDynamicLibrary ( const DtString libName)
protected

Do not use ctor, use the factory method create instead.

DtDynamicLibrary::DtDynamicLibrary ( const DtDynamicLibrary other)
private

Copy CTOR not implemented - Do Not copy.

Member Function Documentation

static DtDynamicLibrary* DtDynamicLibrary::create ( const DtString libName,
bool  addPlatExt = true,
bool  useLazyEval = false,
bool  useGlobal = false 
)
static

Constructs an instance of DtDynamicLibrary for libname.

Will add a platform dependent file extension to libname if addPlatExt is true. The library will be opened using lazyEvaluation if possible when the useLazyEval flag is set to true.

const char* DtDynamicLibrary::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 DtDynamicLibrary::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 DtDynamicLibrary::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 DtDynamicLibrary::open ( bool  addPlatExt,
bool  useLazyEval,
bool  useGlobal 
)
protectedvirtual

Open is called from the static create() function.

It needs to be called after the CTOR. This function is responsible for opening the shared library and saving the handle for it. Users should override this function if they wish to use special flags for opening the library.

DtDynamicLibrary& DtDynamicLibrary::operator= ( const DtDynamicLibrary other)
private

Assignment Operator not implemented - Do Not copy.

virtual void* DtDynamicLibrary::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 DtDynamicLibrary::standardExtension ( )
static

returns the standard dynamic extension for this platform

Member Data Documentation

void* DtDynamicLibrary::myHandle
protected
char* DtDynamicLibrary::myLastError
protected
DtString DtDynamicLibrary::myLibraryName
protected

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

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)