GL Studio C++ Runtime API
LiveComponentLibRef Class Reference

#include <live_component_lib_ref.h>

Public Member Functions

virtual LiveComponentLibRefCloneObject () const
 
virtual void DeleteInstance ()
 
const LiveComponentLibRefoperator= (const LiveComponentLibRef &)
 
void LoadLibrary (const char *fileName, const bool searchLibraryPath=false)
 
void UnloadLibrary ()
 Unloads the file.
 
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)
 
 LiveComponentLibRef (const LiveComponentLibRef &)
 Copy constructor.
 
virtual ~LiveComponentLibRef ()
 
void DeleteLibrary ()
 Unused, kept for backward compatibility.
 
bool UpdateLoad ()
 
void SetErrorString (const char *value)
 
void EnableDialogs (const char *className, bool value) const
 

Protected Attributes

std::string _loadedFilePath
 The path to the file that is currently loaded.
 
DynamicLibrary_lib
 Pointer to the underlying library reference.
 
char * _errorString
 String of the last error encountered.
 

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()

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.

◆ ~LiveComponentLibRef()

virtual ~LiveComponentLibRef ( )
protectedvirtual

Destructor Private - call DeleteInstance instead.

Member Function Documentation

◆ BuiltVersionInfo()

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.

◆ CloneObject()

virtual LiveComponentLibRef * CloneObject ( ) const
virtual
Returns
A pointer to a new clone of this object.

◆ CreateInstance() [1/2]

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

Constructs a LiveComponentLibRef.

Parameters
filePathIf a file path is specified, it will attempt a load immediatly.
Returns
A pointer to a new LiveComponentLibRef object.

◆ CreateInstance() [2/2]

static LiveComponentLibRef * CreateInstance ( const LiveComponentLibRef )
static

Constructs a LiveComponentLibRef.

Returns
A pointer to a new LiveComponentLibRef object.

◆ CreateLiveComponent()

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.

◆ CreateRSOInterface()

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.

◆ DefaultClassName()

const char * DefaultClassName ( ) const
Returns
The DefaultClassName for the current LiveComponent Library if it is provided or NULL if it is unavailable.

◆ DeleteInstance()

virtual void DeleteInstance ( )
virtual

Delete a LiveComponentLibRef instance using the correct delete operator.

◆ DeleteLiveComponent()

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

◆ EnableDialogs()

void EnableDialogs ( const char *  className,
bool  value 
) const
protected

Allow or disallow version compatibility popups.

Parameters
classNameThe generated class name.
valueThe new dialog enabled flag.

◆ ErrorString()

const char * ErrorString ( ) const
Returns
The last error string or NULL if no error has occured.

◆ Loaded()

bool Loaded ( ) const
Returns
True if the library was sucessfully loaded.

◆ LoadedFilePath()

const char * LoadedFilePath ( ) const
Returns
The path to the library or NULL if no library is loaded.

◆ LoadLibrary()

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

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

Parameters
fileNameThe name of the library to load.
searchLibraryPathUnused, kept for backward compatibility.

◆ operator=()

const LiveComponentLibRef & operator= ( const LiveComponentLibRef )

Assignment operator

Returns
The resulting object (this).

◆ SetErrorString()

void SetErrorString ( const char *  value)
protected

Set the underlying error string signifying the last error encountered.

Parameters
valueThe new error string to set.

◆ UpdateLoad()

bool UpdateLoad ( )
protected

Unused, kept for backward compatibility.

Returns
Not implemented.

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