Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GObjectLoader Class Reference

Loads objects from plugins. More...

#include <gauge3d/plugins/objectloader.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Methods

 GObjectLoader ()
 ~GObjectLoader ()
pGObject LoadObject (const GString &className)
 Find an object with the given class name and create it. More...

pGObject LoadObjectOfType (const GString &baseClass)
 Find an object derived from the specified class and create it. More...

pGObject LoadObjectWithKeyword (const GString &keyWord,const GString &baseClass)
 Find an object with the given keyword and create it. More...

pGObject LoadObjectForFile (pGFile file,const GString &baseClass)
 Find an object that can load the given file and that is derived from the given base class and create it. More...

void AddPlugin (pGFile library)
 Add a library to the list of plugins to search for objects.


Detailed Description

Loads objects from plugins.

This class acts sort of like a CORBA ORB, except for GAUGE plugin objects. (Disclaimer: I've never used CORBA, so I don't actually know how a CORBA ORB works. Let me know if that last statement was wrong.) The class loads plugins and queries them to see what objects can be loaded from them, and what functions those objects can perform. It then fields requests for objects that perform certain types of functions by matching the request with a plugin object that performs the task and getting an instance of the object from the corresponding plugin.


Member Function Documentation

pGObject GAUGE3D::GObjectLoader::LoadObject ( const GString & className )
 

Find an object with the given class name and create it.

Returns:
A pointer to the object, or NULL if an obect with the given name could not be found.

pGObject GAUGE3D::GObjectLoader::LoadObjectOfType ( const GString & baseClass )
 

Find an object derived from the specified class and create it.

Returns:
A pointer to the object, or NULL if an obect derived from the given class could not be found.

pGObject GAUGE3D::GObjectLoader::LoadObjectWithKeyword ( const GString & keyWord,
const GString & baseClass )
 

Find an object with the given keyword and create it.

Returns:
A pointer to the object, or NULL if an obect with the given keyword could not be found.

Each object can have several keywords. See GPlugin::ObjectInfo::mKeywords for more info on them.

pGObject GAUGE3D::GObjectLoader::LoadObjectForFile ( pGFile file,
const GString & baseClass )
 

Find an object that can load the given file and that is derived from the given base class and create it.

Parameters:
file   The file that the object should load.
baseClass   The class that the object should be derived from.

So, if you have a jpeg image file "jpegFile", you might say:
  • objectLoader.LoadObject(jpegFile, "GImage");


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