#include <ObjectGenerator.h>
Inheritance diagram for PLearn::ObjectGenerator:
Public Member Functions | |
ObjectGenerator () | |
Default constructor. | |
virtual PP< Object > | generateNextObject ()=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< Object > | template_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_ () |
|
Reimplemented from PLearn::Object. Definition at line 50 of file ObjectGenerator.h. |
|
Default constructor.
Definition at line 48 of file ObjectGenerator.cc. |
|
simply calls inherited::build() then build_()
Reimplemented from PLearn::Object. Definition at line 57 of file ObjectGenerator.cc. References build_(). |
|
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(). |
|
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. |
|
Definition at line 63 of file ObjectGenerator.cc. References generation_began. Referenced by generateAllObjects(). |
|
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(). |
|
This will generate the next object in the list of all options MUST be define by a subclass.
Referenced by generateAllObjects(). |
|
Declares name and deepCopy methods.
|
|
Did we begin to generate new Objects???
Definition at line 55 of file ObjectGenerator.h. Referenced by forget(), and generateAllObjects(). |
|
The template Object from which we will generate other Objects.
Definition at line 60 of file ObjectGenerator.h. Referenced by build_(). |