GClasses
GClasses::GLearnerLoader Class Reference

Detailed Description

This class is for loading various learning algorithms from a DOM. When any learning algorithm is saved, it calls baseDomNode, which creates (among other things) a field named "class" which specifies the class name of the algorithm. This class contains methods that will recognize any of the classes in this library and load them. If it doesn't recognize a class, it will either return NULL or throw and exception, depending on the flags you pass to the constructor. Obviously this loader won't recognize any classes that you make. Therefore, you should overload the corresponding method in this class with a new method that will first recognize and load your classes, and then call these methods to handle other types.

#include <GLearner.h>

Public Member Functions

 GLearnerLoader (bool throwIfClassNotFound=true)
 Constructor. If throwIfClassNotFound is true, then all of the methods in this class will throw an exception of the DOM refers to an unrecognized class. If throwIfClassNotFound is false, then NULL will be returned if the class is not recognized. More...
 
virtual ~GLearnerLoader ()
 
virtual GCollaborativeFilterloadCollaborativeFilter (const GDomNode *pNode)
 Loads a collaborative filtering algorithm from a DOM. More...
 
virtual GIncrementalTransformloadIncrementalTransform (const GDomNode *pNode)
 Loads an incremental transform (or a two-way incremental transform) from a DOM. More...
 
virtual GSupervisedLearnerloadLearner (const GDomNode *pNode)
 Loads a learning algorithm from a DOM. More...
 

Protected Attributes

bool m_throwIfClassNotFound
 

Constructor & Destructor Documentation

GClasses::GLearnerLoader::GLearnerLoader ( bool  throwIfClassNotFound = true)
inline

Constructor. If throwIfClassNotFound is true, then all of the methods in this class will throw an exception of the DOM refers to an unrecognized class. If throwIfClassNotFound is false, then NULL will be returned if the class is not recognized.

virtual GClasses::GLearnerLoader::~GLearnerLoader ( )
inlinevirtual

Member Function Documentation

virtual GCollaborativeFilter* GClasses::GLearnerLoader::loadCollaborativeFilter ( const GDomNode pNode)
virtual

Loads a collaborative filtering algorithm from a DOM.

virtual GIncrementalTransform* GClasses::GLearnerLoader::loadIncrementalTransform ( const GDomNode pNode)
virtual

Loads an incremental transform (or a two-way incremental transform) from a DOM.

virtual GSupervisedLearner* GClasses::GLearnerLoader::loadLearner ( const GDomNode pNode)
virtual

Loads a learning algorithm from a DOM.

Member Data Documentation

bool GClasses::GLearnerLoader::m_throwIfClassNotFound
protected