#include <Finfo.h>
Public Member Functions | |
Finfo (const string &name, const string &doc) | |
virtual | ~Finfo () |
const string & | name () const |
const string & | docs () const |
Returns documentation string. | |
virtual void | registerFinfo (Cinfo *c)=0 |
virtual bool | strSet (const Eref &tgt, const string &field, const string &arg) const =0 |
virtual bool | strGet (const Eref &tgt, const string &field, string &returnValue) const =0 |
virtual void | postCreationFunc (Id newId, Element *newElm) const |
virtual bool | checkTarget (const Finfo *target) const |
virtual bool | addMsg (const Finfo *target, ObjId mid, Element *src) const |
virtual string | rttiType () const |
virtual vector< string > | innerSrc () const |
virtual vector< string > | innerDest () const |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Finfo::Finfo | ( | const string & | name, | |
const string & | doc | |||
) |
virtual Finfo::~Finfo | ( | ) | [inline, virtual] |
virtual bool Finfo::addMsg | ( | const Finfo * | target, | |
ObjId | mid, | |||
Element * | src | |||
) | const [inline, virtual] |
Sets up specified Msg between src and dest. Does all the type checking. Returns 1 on success. Defaults to 0 because many Finfo combinations won't work.
Referenced by Shell::adopt(), Shell::innerMove(), FieldElementFinfoBase::postCreationFunc(), testCreateMsg(), testFibonacci(), testSendSpike(), testSharedMsg(), and testSparseMsg().
virtual bool Finfo::checkTarget | ( | const Finfo * | target | ) | const [inline, virtual] |
Registers the Msg slot to be used for transmitting messages. SrcFinfos take the 'current' value and increment it, other msgs leave it alone. virtual BindIndex registerBindIndex( BindIndex current ) = 0; Checks that the type of target Finfo matches self, and is safe to exchange messages with. Is called only from msg src, so most Finfos return 0. SrcFinfo and SharedFinfo will need to implement this.
const string & Finfo::docs | ( | ) | const |
Returns documentation string.
Referenced by FinfoWrapper::docs(), and initCinfo().
const Cinfo * Finfo::initCinfo | ( | ) | [static] |
Returns the Class Info for this Finfo
References FinfoWrapper::dest(), FinfoWrapper::docs(), docs(), FinfoWrapper::getName(), Neutral::initCinfo(), FinfoWrapper::src(), and FinfoWrapper::type().
Referenced by buildFinfoElement(), and FieldElementFinfoBase::postCreationFunc().
vector< string > Finfo::innerDest | ( | ) | const [virtual] |
Returns subsidiary DestFinfos
Reimplemented in SharedFinfo, and ValueFinfoBase.
Referenced by FinfoWrapper::dest().
vector< string > Finfo::innerSrc | ( | ) | const [virtual] |
const string & Finfo::name | ( | ) | const |
Returns the Finfo name
Referenced by convertConcToNumRateUsingMesh(), Cinfo::destFinfoName(), Neutral::getDestFields(), FinfoWrapper::getName(), Neutral::getSourceFields(), Neutral::getValueFields(), ValueFinfoBase::innerDest(), FieldElementFinfoBase::postCreationFunc(), DestFinfo::registerFinfo(), Cinfo::registerFinfo(), Cinfo::reportFids(), Element::showMsg(), and Cinfo::srcFinfoName().
This function is called on each new Element after it is created, in case any stuff needs doing. Typical uses are to create FieldElements automatically as soon as the parent is made. Used in FieldElementFinfo.h
Reimplemented in FieldElementFinfoBase.
virtual void Finfo::registerFinfo | ( | Cinfo * | c | ) | [pure virtual] |
Returns string-ified form to handle template expectations for name field string getName() const; Assign function Ids, bindIndex and so on.
Implemented in DestFinfo, ElementValueFinfo< T, F >, ReadOnlyElementValueFinfo< T, F >, FieldElementFinfoBase, LookupElementValueFinfo< T, L, F >, ReadOnlyLookupElementValueFinfo< T, L, F >, LookupValueFinfo< T, L, F >, ReadOnlyLookupValueFinfo< T, L, F >, SharedFinfo, SrcFinfo, ValueFinfo< T, F >, and ReadOnlyValueFinfo< T, F >.
Referenced by Cinfo::registerFinfo().
string Finfo::rttiType | ( | ) | const [virtual] |
Returns the documentation string for the Finfo string docs() const; Returns the RTTI type string for the finfo by referring to an internal virtual function. string type() const; Returns the list of subsidiary SrcFinfos. Used in Shared Finfos, empty otherwise. Goes via internal virtual function. vector< string > src() const; Returns the list of subsidiary destFinfos. Used in SharedFinfos and ValueFinfos, empty otherwise. Goes via internal virtual function. vector< string > dest() const; Returns an RTTI type string for this Finfo.
Reimplemented in DestFinfo, ElementValueFinfo< T, F >, ReadOnlyElementValueFinfo< T, F >, FieldElementFinfo< T, F >, LookupElementValueFinfo< T, L, F >, ReadOnlyLookupElementValueFinfo< T, L, F >, LookupValueFinfo< T, L, F >, ReadOnlyLookupValueFinfo< T, L, F >, SharedFinfo, SrcFinfo0, SrcFinfo1< T >, SrcFinfo2< T1, T2 >, SrcFinfo3< T1, T2, T3 >, SrcFinfo4< T1, T2, T3, T4 >, SrcFinfo5< T1, T2, T3, T4, T5 >, SrcFinfo6< T1, T2, T3, T4, T5, T6 >, ValueFinfo< T, F >, and ReadOnlyValueFinfo< T, F >.
Referenced by FinfoWrapper::type().
virtual bool Finfo::strGet | ( | const Eref & | tgt, | |
const string & | field, | |||
string & | returnValue | |||
) | const [pure virtual] |
Function to return value of field into a string argument. Returns true on success. Normally called only from SetGet::strGet.
Implemented in DestFinfo, ElementValueFinfo< T, F >, ReadOnlyElementValueFinfo< T, F >, FieldElementFinfoBase, LookupElementValueFinfo< T, L, F >, ReadOnlyLookupElementValueFinfo< T, L, F >, LookupValueFinfo< T, L, F >, ReadOnlyLookupValueFinfo< T, L, F >, SharedFinfo, SrcFinfo, ValueFinfo< T, F >, and ReadOnlyValueFinfo< T, F >.
virtual bool Finfo::strSet | ( | const Eref & | tgt, | |
const string & | field, | |||
const string & | arg | |||
) | const [pure virtual] |
Function to set this field using a string argument. Returns true on success. Normally called only from SetGet::strSet.
Implemented in DestFinfo, ElementValueFinfo< T, F >, ReadOnlyElementValueFinfo< T, F >, FieldElementFinfoBase, LookupElementValueFinfo< T, L, F >, ReadOnlyLookupElementValueFinfo< T, L, F >, LookupValueFinfo< T, L, F >, ReadOnlyLookupValueFinfo< T, L, F >, SharedFinfo, SrcFinfo, ValueFinfo< T, F >, and ReadOnlyValueFinfo< T, F >.