Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GPlugin Class Reference

Base class for objects that tell GAUGE what a plugin can do. More...

#include <gauge3d/plugins/plugin.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Methods

virtual ~GPlugin ()
virtual GString Name ()=0
 Returns the human-readable name of the plugin.

virtual GString Description ()=0
 Returns a human-readable description of the plugin.

virtual bool InUse ()=0
 Returns true if the plugin is in use. More...

virtual pGObject CreateObject (const GString &className)=0
 Creates an instance of the class with the given name.

virtual pGObject CreateObject (const GString &className,pGFile file)=0
 Creates an object of the class with the given name using the given file. More...

virtual GArray<ObjectInfoObjectList ()=0
 Gets ObjectInfos for every object available from this plugin.


Detailed Description

Base class for objects that tell GAUGE what a plugin can do.

You only need to know about this class if you are writing a plugin, not if you are only using them.

Derivatives of GPlugin are used to describe what sort of objects a plugin contains, and create those objects for the object loader.

Here is what happens when a plugin is opened:

  1. GObjectLoader uses GLibrary to load a shared library on disk.
  2. The shared library exports an object derived from GPlugin. GObjectLoader imports this object.
  3. GObjectLoader calls GPlugin::ObjectList() on the imported plugin object to find out what other types of objects the plugin contains.
  4. Later on, when an object is requested, GObjectLoader finds a plugin that contains a suitable object. It calls one of this plugin's GPlugin::CreateObject() functions to create the object.
  5. The plugin creates the object and returns a pointer to it.


Member Function Documentation

bool GAUGE3D::GPlugin::InUse ( ) [pure virtual]
 

Returns true if the plugin is in use.

Remarks:
GObjectLoader uses this to determine when it is safe to unload the library from RAM. It should return true as long as an instance of any class in the plugin exists.

pGObject GAUGE3D::GPlugin::CreateObject ( const GString & className,
pGFile file ) [pure virtual]
 

Creates an object of the class with the given name using the given file.

For example, if the class loads jpeg images, the file would be a jpeg image to load.

Returns:
A pointer to the created object, or NULL if the file could not be loaded for some reason.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000