libcommonc++  0.7
PluginLoader Class Reference

A convenience class for loading Plugin objects. More...

#include <PluginLoader.h++>

Public Member Functions

 PluginLoader (const String &path=String::null)
 Construct a new PluginLoader with the specified path. More...
 
 ~PluginLoader ()
 Destructor. More...
 
void setPath (const String &path)
 Set the plugin file path. More...
 
String getPath () const
 Get the plugin file path. More...
 
void load ()
 Load the plugin. More...
 
void unload ()
 Unload the plugin. More...
 
bool isLoaded () const
 Determine if the plugin is loaded. More...
 
String getName ()
 Get the plugin name. More...
 
String getVersion ()
 Get the plugin version number. More...
 
String getAuthor ()
 Get the plugin author information. More...
 
String getClassName ()
 Get the plugin class name. More...
 
String getBuildDate ()
 Get the plugin build date & time. More...
 
template<class T >
T * newInstance ()
 Construct a new instance of a plugin of type T, where T is a subclass of Plugin. More...
 

Detailed Description

A convenience class for loading Plugin objects.

The template parameter T should be a suitable subclass of Plugin.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ PluginLoader()

PluginLoader ( const String path = String::null)

Construct a new PluginLoader with the specified path.

Parameters
pathThe path to the loadable object file from which the plugin will be loaded.

◆ ~PluginLoader()

Destructor.

Unloads the plugin.

Member Function Documentation

◆ getAuthor()

String getAuthor ( )

Get the plugin author information.

Returns
The author information, or String::null if the author information could not be determined, or if the plugin has not yet been loaded via load().

◆ getBuildDate()

String getBuildDate ( )

Get the plugin build date & time.

Returns
The build date and time, or String::null if the build date and time could not be determined, or if the plugin has not yet been loaded via load().

◆ getClassName()

String getClassName ( )

Get the plugin class name.

Returns
The plugin class name, or String::null if the class name could not be determined, or if the plugin has not yet been loaded via load().

◆ getName()

String getName ( )

Get the plugin name.

Returns
The name, or String::null if the name could not be determined, or if the plugin has not yet been loaded via load().

◆ getPath()

String getPath ( ) const
inline

Get the plugin file path.

◆ getVersion()

String getVersion ( )

Get the plugin version number.

Returns
The version number, or String::null if the version number could not be determined, or if the plugin has not yet been loaded via load().

◆ isLoaded()

bool isLoaded ( ) const
inline

Determine if the plugin is loaded.

◆ load()

void load ( )
inline

Load the plugin.

If the plugin is already loaded, the method has no effect.

Exceptions
IOExceptionIf the object could not be loaded, or if no path has been specified.

◆ newInstance()

T* newInstance ( )
inline

Construct a new instance of a plugin of type T, where T is a subclass of Plugin.

Returns
The new instance, or NULL if the plugin could not be instantiated, if the plugin has not yet been loaded via load(), or if the cast to type T failed.

◆ setPath()

void setPath ( const String path)
inline

Set the plugin file path.

If the plugin is loaded, the call has no effect.

◆ unload()

void unload ( )
inline

Unload the plugin.

If the plugin has not been loaded, the method has no effect.


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