GL Studio C++ Runtime API
LiveComponentLibRef Class Reference

#include <live_component_lib_ref.h>

Public Member Functions

virtual void DeleteInstance ()
 
void LoadLibrary (const char *fileName, const bool searchLibraryPath=false)
 
bool Loaded () const
 
const char * ErrorString () const
 
const char * LoadedFilePath () const
 
const GlsBuiltVersionInfoBuiltVersionInfo (const char *className) const
 
const char * DefaultClassName () const
 
ComponentBaseCreateLiveComponent (const char *className) const
 
void DeleteLiveComponent (const char *className, ComponentBase *comp) const
 
RsoImplBaseInterfaceCreateRSOInterface (const char *className, unsigned int &RSOVersion) const
 

Static Public Member Functions

static LiveComponentLibRefCreateInstance (const LiveComponentLibRef &)
 
static LiveComponentLibRefCreateInstance (const char *filePath=NULL)
 

Protected Member Functions

 LiveComponentLibRef (const char *filePath=NULL)
 
virtual ~LiveComponentLibRef ()
 

Detailed Description

This class is used to load a live component DLL (or .so) and allow easy calling of the live component library functions through the class methods. The library remains loaded until the reference is changed to another file or object destruction.

Constructor & Destructor Documentation

LiveComponentLibRef ( const char *  filePath = NULL)
protected

Constructs a LiveComponentLibRef. Private - call CreateInstance instead

Parameters
filePathIf a file path is specified, it will attempt a load immediatly.
virtual ~LiveComponentLibRef ( )
protectedvirtual

Destructor Private - call DeleteInstance instead.

Member Function Documentation

const GlsBuiltVersionInfo& BuiltVersionInfo ( const char *  className) const

Returns the built version info for the given class.

Parameters
classNameThe name of the class to check.
Returns
If Loaded() is true and the className is valid, returns the compiler version associated with the given class. Otherwise, the return value is undefined.
static LiveComponentLibRef* CreateInstance ( const LiveComponentLibRef )
static

Constructs a LiveComponentLibRef.

static LiveComponentLibRef* CreateInstance ( const char *  filePath = NULL)
static

Constructs a LiveComponentLibRef.

Parameters
filePathIf a file path is specified, it will attempt a load immediatly.
ComponentBase* CreateLiveComponent ( const char *  className) const

Attempts to create a LiveComponent instance of the given class. Call Destroy() on the object to delete it safely. Objects returned by this method may not be safe to use if the GlsBuiltVersionInfo for the LiveComponent Library does not match that of the container.

Parameters
classNameThe name of the class to instanciate.
Returns
Pointer to the new instance if successful, NULL otherwise.
RsoImplBaseInterface* CreateRSOInterface ( const char *  className,
unsigned int &  RSOVersion 
) const

Attempts to create a LiveComponent instance of the given class using the safe interface. Call DestroyInstance() on the object to delete it safely.

Parameters
classNameThe name of the class to instanciate.
[out]RSOVersionThe version number of the RSO and the returned interface
Returns
Pointer to the new instance if successful, NULL otherwise.
const char* DefaultClassName ( ) const
Returns
The DefaultClassName for the current LiveComponent Library if it is provided or NULL if it is unavailable.
virtual void DeleteInstance ( )
virtual

Delete a LiveComponentLibRef instance using the correct delete operator.

void DeleteLiveComponent ( const char *  className,
ComponentBase comp 
) const

Safely delete an object that was returned from CreateLiveComponent.

Parameters
classNameMust be the same name that was passed to CreateLiveComponent
compThe component to delete
const char* ErrorString ( ) const

Returns the last error string or NULL if no error has occured.

bool Loaded ( ) const

Returns true if the library was sucessfully loaded.

const char* LoadedFilePath ( ) const

Returns the path to the library or NULL if no library is loaded.

void LoadLibrary ( const char *  fileName,
const bool  searchLibraryPath = false 
)

Sets the desired file name (.DLL or .so). Set to NULL to unload the current library.


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