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

PLearn::OptionBase Class Reference

Base class for option definitions. More...

#include <OptionBase.h>

Inheritance diagram for PLearn::OptionBase:

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

Collaboration graph
[legend]
List of all members.

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 ObjectgetAsObject (Object *o) const =0
virtual const ObjectgetAsObject (const Object *o) const =0
virtual ObjectgetIndexedObject (Object *o, int i) const =0
virtual const ObjectgetIndexedObject (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 stringoptionname () const
 The name of the option (field).

bool isOptionNamed (string name) const
const stringoptiontype () const
const stringdefaultval () const
const stringdescription () 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_

Detailed Description

Base class for option definitions.

Definition at line 62 of file OptionBase.h.


Member Typedef Documentation

typedef unsigned int PLearn::OptionBase::flag_t
 

Definition at line 65 of file OptionBase.h.

Referenced by PLearn::declareOption(), flags(), and PLearn::Object::getOptionsToSave().


Constructor & Destructor Documentation

PLearn::OptionBase::OptionBase const string optionname,
flag_t  flags,
const string optiontype,
const string defaultval,
const string description
[inline]
 

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_.


Member Function Documentation

const string& PLearn::OptionBase::defaultval  )  const [inline]
 

Definition at line 124 of file OptionBase.h.

References defaultval_.

const string& PLearn::OptionBase::description  )  const [inline]
 

Definition at line 125 of file OptionBase.h.

References description_.

flag_t PLearn::OptionBase::flags  )  const [inline]
 

Definition at line 126 of file OptionBase.h.

References flag_t, and flags_.

Referenced by shouldBeSkipped().

virtual const Object* PLearn::OptionBase::getAsObject const Object o  )  const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

virtual Object* PLearn::OptionBase::getAsObject Object o  )  const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

virtual const Object* PLearn::OptionBase::getIndexedObject const Object o,
int  i
const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

virtual Object* PLearn::OptionBase::getIndexedObject Object o,
int  i
const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

bool PLearn::OptionBase::isOptionNamed string  name  )  const [inline]
 

Definition at line 121 of file OptionBase.h.

References isOptionNamed(), and optionname().

Referenced by isOptionNamed().

virtual string PLearn::OptionBase::optionHolderClassName const Object o  )  const [pure virtual]
 

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 >.

const string& PLearn::OptionBase::optionname  )  const [inline]
 

The name of the option (field).

Definition at line 120 of file OptionBase.h.

References optionname_.

Referenced by isOptionNamed().

const string& PLearn::OptionBase::optiontype  )  const [inline]
 

Definition at line 123 of file OptionBase.h.

References optiontype_.

virtual void PLearn::OptionBase::read Object o,
PStream in
const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

virtual void PLearn::OptionBase::read_and_discard PStream in  )  const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

void PLearn::OptionBase::setDefaultVal const string newdefaultval  )  [inline]
 

Change the string representation of the default value.

Definition at line 129 of file OptionBase.h.

References defaultval_, and setDefaultVal().

Referenced by setDefaultVal().

bool PLearn::OptionBase::shouldBeSkipped  )  const [virtual]
 

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.

virtual void PLearn::OptionBase::write const Object o,
PStream out
const [pure virtual]
 

Implemented in PLearn::Option< T, Enclosing >, PLearn::Option< size_t, self >, and PLearn::Option< DeallocatorType, self >.

string PLearn::OptionBase::writeIntoString const Object o  )  const
 

Definition at line 60 of file OptionBase.cc.

References PLearn::write().


Member Data Documentation

const OptionBase::flag_t PLearn::OptionBase::buildoption = 1 [static]
 

'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().

string PLearn::OptionBase::defaultval_ [protected]
 

Definition at line 85 of file OptionBase.h.

Referenced by defaultval(), OptionBase(), and setDefaultVal().

string PLearn::OptionBase::description_ [protected]
 

Definition at line 86 of file OptionBase.h.

Referenced by description(), and OptionBase().

flag_t PLearn::OptionBase::flags_ [protected]
 

Definition at line 83 of file OptionBase.h.

Referenced by flags(), and OptionBase().

const OptionBase::flag_t PLearn::OptionBase::learntoption = 1<<1 [static]
 

'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().

const OptionBase::flag_t PLearn::OptionBase::nosave = 1<<4 [static]
 

Do not include this option in the objet's serialisation (write method skips it).

Definition at line 52 of file OptionBase.cc.

string PLearn::OptionBase::optionname_ [protected]
 

Definition at line 82 of file OptionBase.h.

Referenced by OptionBase(), and optionname().

string PLearn::OptionBase::optiontype_ [protected]
 

Definition at line 84 of file OptionBase.h.

Referenced by OptionBase(), and optiontype().

const OptionBase::flag_t PLearn::OptionBase::tuningoption = 1<<2 [static]
 

'tuningoption' an option typically set after the initial build, to tune the object

Definition at line 51 of file OptionBase.cc.

Referenced by shouldBeSkipped().


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