#include <OptionBase.h>
Inheritance diagram for PLearn::OptionBase:
Public Types | |
typedef unsigned int | flag_t |
Public Member Functions | |
OptionBase (const string &optionname, flag_t flags, const string &optiontype, const string &defaultval, const string &description) | |
Most of these parameters only serve to provide the user with an informative help text. | |
virtual void | read (Object *o, PStream &in) const =0 |
virtual bool | shouldBeSkipped () const |
Should this option be skipped upon reading it? (i.e. don't read it in any variable). | |
virtual void | read_and_discard (PStream &in) const =0 |
virtual void | write (const Object *o, PStream &out) const =0 |
string | writeIntoString (const Object *o) const |
virtual Object * | getAsObject (Object *o) const =0 |
virtual const Object * | getAsObject (const Object *o) const =0 |
virtual Object * | getIndexedObject (Object *o, int i) const =0 |
virtual const Object * | getIndexedObject (const Object *o, int i) const =0 |
virtual string | optionHolderClassName (const Object *o) const =0 |
Returns the name of the class in to which this field belongs. | |
const string & | optionname () const |
The name of the option (field). | |
bool | isOptionNamed (string name) const |
const string & | optiontype () const |
const string & | defaultval () const |
const string & | description () const |
flag_t | flags () const |
void | setDefaultVal (const string &newdefaultval) |
Change the string representation of the default value. | |
Static Public Attributes | |
const flag_t | buildoption = 1 |
'buildoption' an option typically specified before calling the initial build (semantically similat to a constructor parameter) ex: the number of hidden units in a neural net | |
const flag_t | learntoption = 1<<1 |
'learntoption' a field whose proper value is computed by the class after construction (not to be set by the user before build) ex: the weights of a neural net | |
const flag_t | tuningoption = 1<<2 |
'tuningoption' an option typically set after the initial build, to tune the object | |
const flag_t | nosave = 1<<4 |
Do not include this option in the objet's serialisation (write method skips it). | |
Protected Attributes | |
string | optionname_ |
flag_t | flags_ |
string | optiontype_ |
string | defaultval_ |
string | description_ |
Definition at line 62 of file OptionBase.h.
|
Definition at line 65 of file OptionBase.h. Referenced by PLearn::declareOption(), flags(), and PLearn::Object::getOptionsToSave(). |
|
Most of these parameters only serve to provide the user with an informative help text. (only optionname and saveit are really important) Definition at line 92 of file OptionBase.h. References defaultval_, description_, flags_, optionname_, and optiontype_. |
|
Definition at line 124 of file OptionBase.h. References defaultval_. |
|
Definition at line 125 of file OptionBase.h. References description_. |
|
Definition at line 126 of file OptionBase.h. References flag_t, and flags_. Referenced by shouldBeSkipped(). |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Definition at line 121 of file OptionBase.h. References isOptionNamed(), and optionname(). Referenced by isOptionNamed(). |
|
Returns the name of the class in to which this field belongs.
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
The name of the option (field).
Definition at line 120 of file OptionBase.h. References optionname_. Referenced by isOptionNamed(). |
|
Definition at line 123 of file OptionBase.h. References optiontype_. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Change the string representation of the default value.
Definition at line 129 of file OptionBase.h. References defaultval_, and setDefaultVal(). Referenced by setDefaultVal(). |
|
Should this option be skipped upon reading it? (i.e. don't read it in any variable).
Definition at line 55 of file OptionBase.cc. References buildoption, flags(), learntoption, and tuningoption. |
|
Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >. |
|
Definition at line 60 of file OptionBase.cc. References PLearn::write(). |
|
'buildoption' an option typically specified before calling the initial build (semantically similat to a constructor parameter) ex: the number of hidden units in a neural net
Definition at line 49 of file OptionBase.cc. Referenced by shouldBeSkipped(). |
|
Definition at line 85 of file OptionBase.h. Referenced by defaultval(), OptionBase(), and setDefaultVal(). |
|
Definition at line 86 of file OptionBase.h. Referenced by description(), and OptionBase(). |
|
Definition at line 83 of file OptionBase.h. Referenced by flags(), and OptionBase(). |
|
'learntoption' a field whose proper value is computed by the class after construction (not to be set by the user before build) ex: the weights of a neural net
Definition at line 50 of file OptionBase.cc. Referenced by shouldBeSkipped(). |
|
Do not include this option in the objet's serialisation (write method skips it).
Definition at line 52 of file OptionBase.cc. |
|
Definition at line 82 of file OptionBase.h. Referenced by OptionBase(), and optionname(). |
|
Definition at line 84 of file OptionBase.h. Referenced by OptionBase(), and optiontype(). |
|
'tuningoption' an option typically set after the initial build, to tune the object
Definition at line 51 of file OptionBase.cc. Referenced by shouldBeSkipped(). |