PLearn 0.1
|
#include <Option.h>
Public Member Functions | |
TVecOption (const string &optionname, TVec< VecElementType > ObjectType::*member_ptr, OptionBase::flag_t flags, const string &optiontype, const string &defaultval, const string &description, const OptionBase::OptionLevel &level) | |
virtual void | readIntoIndex (Object *o, PStream &in, const string &index) |
Read into index "i" of the object's option; the index is a string for generality (i.e. | |
virtual void | writeAtIndex (const Object *o, PStream &out, const string &index) const |
Write from index "i" of the object's option; the index is a string for generality (i.e. | |
Private Types | |
typedef Option< ObjectType, TVec< VecElementType > > | inherited |
typedef Option<ObjectType, TVec<VecElementType> > PLearn::TVecOption< ObjectType, VecElementType >::inherited [private] |
Reimplemented from PLearn::Option< ObjectType, TVec< VecElementType > >.
PLearn::TVecOption< ObjectType, VecElementType >::TVecOption | ( | const string & | optionname, |
TVec< VecElementType > ObjectType::* | member_ptr, | ||
OptionBase::flag_t | flags, | ||
const string & | optiontype, | ||
const string & | defaultval, | ||
const string & | description, | ||
const OptionBase::OptionLevel & | level | ||
) | [inline] |
Definition at line 302 of file Option.h.
: inherited(optionname, member_ptr, flags, optiontype, defaultval, description, level) { }
virtual void PLearn::TVecOption< ObjectType, VecElementType >::readIntoIndex | ( | Object * | o, |
PStream & | in, | ||
const string & | index | ||
) | [inline, virtual] |
Read into index "i" of the object's option; the index is a string for generality (i.e.
applies to both vectors and maps)
Reimplemented from PLearn::OptionBase.
Definition at line 309 of file Option.h.
References i, PLearn::Option< ObjectType, TVec< VecElementType > >::ptr, and PLearn::tolong().
{ int i = tolong(index); in >> (dynamic_cast<ObjectType*>(o)->*(this->ptr))[i]; }
virtual void PLearn::TVecOption< ObjectType, VecElementType >::writeAtIndex | ( | const Object * | o, |
PStream & | out, | ||
const string & | index | ||
) | const [inline, virtual] |
Write from index "i" of the object's option; the index is a string for generality (i.e.
applies to both vectors and maps)
Reimplemented from PLearn::OptionBase.
Definition at line 315 of file Option.h.
References i, PLearn::Option< ObjectType, TVec< VecElementType > >::ptr, and PLearn::tolong().
{ int i = tolong(index); out << (dynamic_cast<ObjectType*>(const_cast<Object*>(o))->*(this->ptr))[i]; }