Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::ObjectGenerator Class Reference

#include <ObjectGenerator.h>

Inheritance diagram for PLearn::ObjectGenerator:

Inheritance graph
[legend]
Collaboration diagram for PLearn::ObjectGenerator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ObjectGenerator ()
 Default constructor.

virtual PP< ObjectgenerateNextObject ()=0
 This will generate the next object in the list of all options MUST be define by a subclass.

virtual TVec< PP< Object > > generateAllObjects ()
 This will generate a list of all possible Objects.

virtual void build ()
 simply calls inherited::build() then build_()

virtual void forget ()
 PLEARN_DECLARE_ABSTRACT_OBJECT (ObjectGenerator)
 Declares name and deepCopy methods.


Public Attributes

PP< Objecttemplate_object
 The template Object from which we will generate other Objects.


Static Protected Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Protected Attributes

bool generation_began
 Did we begin to generate new Objects???


Private Types

typedef Object inherited

Private Member Functions

void build_ ()

Member Typedef Documentation

typedef Object PLearn::ObjectGenerator::inherited [private]
 

Reimplemented from PLearn::Object.

Definition at line 50 of file ObjectGenerator.h.


Constructor & Destructor Documentation

PLearn::ObjectGenerator::ObjectGenerator  ) 
 

Default constructor.

Definition at line 48 of file ObjectGenerator.cc.


Member Function Documentation

void PLearn::ObjectGenerator::build  )  [virtual]
 

simply calls inherited::build() then build_()

Reimplemented from PLearn::Object.

Definition at line 57 of file ObjectGenerator.cc.

References build_().

void PLearn::ObjectGenerator::build_  )  [private]
 

This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build() method, and possibly the public virtual read method (which calls its parent's read). build_() can assume that it's parent's build_ has already been called.

Reimplemented from PLearn::Object.

Definition at line 51 of file ObjectGenerator.cc.

References PLearn::PP< Object >::isNull(), PLERROR, and template_object.

Referenced by build().

void PLearn::ObjectGenerator::declareOptions OptionList ol  )  [static, protected]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::Object.

Definition at line 68 of file ObjectGenerator.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::ObjectGenerator::forget  )  [virtual]
 

Definition at line 63 of file ObjectGenerator.cc.

References generation_began.

Referenced by generateAllObjects().

TVec< PP< Object > > PLearn::ObjectGenerator::generateAllObjects  )  [virtual]
 

This will generate a list of all possible Objects.

By default, just loop over generateNextObject()

Definition at line 76 of file ObjectGenerator.cc.

References PLearn::TVec< T >::append(), forget(), generateNextObject(), generation_began, and PLearn::PP< T >::isNull().

virtual PP<Object> PLearn::ObjectGenerator::generateNextObject  )  [pure virtual]
 

This will generate the next object in the list of all options MUST be define by a subclass.

Referenced by generateAllObjects().

PLearn::ObjectGenerator::PLEARN_DECLARE_ABSTRACT_OBJECT ObjectGenerator   ) 
 

Declares name and deepCopy methods.


Member Data Documentation

bool PLearn::ObjectGenerator::generation_began [protected]
 

Did we begin to generate new Objects???

Definition at line 55 of file ObjectGenerator.h.

Referenced by forget(), and generateAllObjects().

PP<Object> PLearn::ObjectGenerator::template_object
 

The template Object from which we will generate other Objects.

Definition at line 60 of file ObjectGenerator.h.

Referenced by build_().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:24:09 2004 for PLearn by doxygen 1.3.7