DataDirector API
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
DDD_DynamicLibraryPlugin Class Reference

The DynamicLibrary class. A cross-platform class for loading dynamic link libraries and shared objects. More...

#include <DDD_DynamicLibrary.h>

Inheritance diagram for DDD_DynamicLibraryPlugin:
DDD_LogFacade

Public Types

enum  ErrorEnum { , ERROR_UNKNOWN }
 

Public Member Functions

 DDD_DynamicLibraryPlugin (const char *lib_name_arg)
 
virtual ~DDD_DynamicLibraryPlugin ()
 
virtual FunctionPointer DynamicFunction (const char *function_name)
 
virtual bool Loaded (void) const
 
ErrorEnum LastError () const
 
const char * ErrorString () const
 

Static Public Member Functions

static bool Exists (const char *libName)
 
static void RemoveExtension (std::string &libpath)
 
- Static Public Member Functions inherited from DDD_LogFacade
static void LogDebug (const char *format,...)
 
static void LogInfo (const char *format,...)
 
static void LogWarning (const char *format,...)
 
static void LogError (const char *format,...)
 

Static Public Attributes

static const std::string LIB_EXT_STRING
 

Detailed Description

The DynamicLibrary class. A cross-platform class for loading dynamic link libraries and shared objects.

Note
This class is very similar to GL Studio's "DynamicLibrary" class. It has been moved here to remove the DataDirector's GLStudio runtime DLL dependency. It has also been tweaked and renamed to avoid collisions with libraries that load both Data Director and GL Studio runtime DLLs and modified to use the DDD_Logger for error reporting

Member Enumeration Documentation

enum ErrorEnum
Enumerator
ERROR_UNKNOWN 

Load failed for unknown reason (see DynamicLibrary::ErrorString())

Constructor & Destructor Documentation

DDD_DynamicLibraryPlugin ( const char *  lib_name_arg)

UNIX uses a pointer to the Open Dynamic Library Constructor for dynamic library object. Causes the dynamic library which is passed in by filename to be opened.

Parameters
lib_nameA pointer to a string which is a library name to be opened, may include the path, can not be NULL
virtual ~DDD_DynamicLibraryPlugin ( )
virtual

Destructor for dynamic library object. Closes the library so the OS can cleanup.

Member Function Documentation

virtual FunctionPointer DynamicFunction ( const char *  function_name)
virtual

Dynamically resolves a function from the library. The name of the function is passed in.

Parameters
function_nameA pointer to a string, which represents the Name of a Function to find.
Returns
Returns a pointer to the function if it is found or NULL otherwise
const char* ErrorString ( ) const

Returns the last error string or NULL if no error has occured. When tryStandardExtensions == true, this may be a very long string since it contains the error information for each attempted filename.

static bool Exists ( const char *  libName)
static
Returns
True if the library can be found somewhere on the system, false otherwise
ErrorEnum LastError ( ) const

Call LastError() when Loaded() is false to determine to determine if load failure occured due to a version mismatch.

virtual bool Loaded ( void  ) const
virtual
Returns
True if the library successfully loaded, false otherwise
static void RemoveExtension ( std::string &  libpath)
static

Removes the extension, if any, from the specified path

Member Data Documentation

const std::string LIB_EXT_STRING
static

The default extension for this library


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