MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FieldElementFinfoBase Class Referenceabstract

#include <FieldElementFinfo.h>

+ Inheritance diagram for FieldElementFinfoBase:
+ Collaboration diagram for FieldElementFinfoBase:

Public Member Functions

 FieldElementFinfoBase (const string &name, const string &doc, const Cinfo *fieldCinfo, bool deferCreate)
 
virtual unsigned int getNumField (const char *parent) const =0
 virtual func to get size of Field array, using char* for parent More...
 
virtual char * lookupField (char *parent, unsigned int fieldIndex) const =0
 
void postCreationFunc (Id parent, Element *parentElm) const
 
void registerFinfo (Cinfo *c)
 
virtual void setNumField (char *parent, unsigned int num) const =0
 virtual func to resize Field array, using char* for parent More...
 
bool strGet (const Eref &tgt, const string &field, string &returnValue) const
 
bool strSet (const Eref &tgt, const string &field, const string &arg) const
 
virtual ~FieldElementFinfoBase ()
 
- Public Member Functions inherited from Finfo
virtual bool addMsg (const Finfo *target, ObjId mid, Element *src) const
 
virtual bool checkTarget (const Finfo *target) const
 
const string & docs () const
 Returns documentation string. More...
 
 Finfo (const string &name, const string &doc)
 
virtual vector< string > innerDest () const
 
virtual vector< string > innerSrc () const
 
const string & name () const
 
virtual string rttiType () const
 
virtual ~Finfo ()
 

Protected Attributes

bool deferCreate_
 
const CinfofieldCinfo_
 
DestFinfogetNum_
 
DestFinfosetNum_
 

Additional Inherited Members

- Static Public Member Functions inherited from Finfo
static const CinfoinitCinfo ()
 

Detailed Description

This class sets up fields that should be accessed as independent FieldElements. These fields are typically complex ones with several sub-fields, and are also typically arranged in an array. Examples are Synapses on an IntFire Neuron.

The creation of this one Finfo sets up three things: First, the information for the FieldElement that will handle the class. Second, the set and get functions for the size of the array of Fields. Third, an automatic creation of the FieldElement whenever an Element of the Parent class is made. This defaults to a child, but can be moved.

Definition at line 26 of file FieldElementFinfo.h.

Constructor & Destructor Documentation

FieldElementFinfoBase::FieldElementFinfoBase ( const string &  name,
const string &  doc,
const Cinfo fieldCinfo,
bool  deferCreate 
)
inline

Definition at line 29 of file FieldElementFinfo.h.

35  : Finfo( name, doc),
36  setNum_( 0 ),
37  getNum_( 0 ),
38  fieldCinfo_( fieldCinfo ),
39  deferCreate_( deferCreate )
40  {
41  ;
42  }
const string & name() const
Definition: Finfo.cpp:80
Finfo(const string &name, const string &doc)
Definition: Finfo.cpp:13
virtual FieldElementFinfoBase::~FieldElementFinfoBase ( )
inlinevirtual

Definition at line 44 of file FieldElementFinfo.h.

References getNum_, and setNum_.

45  {
46  if ( setNum_ )
47  delete setNum_;
48  if ( getNum_ )
49  delete getNum_;
50  }

Member Function Documentation

virtual unsigned int FieldElementFinfoBase::getNumField ( const char *  parent) const
pure virtual

virtual func to get size of Field array, using char* for parent

Implemented in FieldElementFinfo< T, F >.

Referenced by FieldElement::numField().

+ Here is the caller graph for this function:

virtual char* FieldElementFinfoBase::lookupField ( char *  parent,
unsigned int  fieldIndex 
) const
pure virtual

virtual function to look up pointer for Field object. This casts everything down to chars so that the FieldElement can use it.

Implemented in FieldElementFinfo< T, F >.

Referenced by FieldElement::data().

+ Here is the caller graph for this function:

void FieldElementFinfoBase::postCreationFunc ( Id  parent,
Element parentElm 
) const
virtual

Virtual function, defined in Finfo.h and overridden here.

Reimplemented from Finfo.

Definition at line 14 of file FieldElementFinfo.cpp.

References Finfo::addMsg(), deferCreate_, Id::element(), Id::eref(), fieldCinfo_, Cinfo::findFinfo(), Element::getName(), Neutral::initCinfo(), Msg::mid(), Finfo::name(), and Id::nextId().

16 {
17  static const Finfo* pf = Neutral::initCinfo()->findFinfo( "parentMsg" );
18  static const Finfo* f1 = Neutral::initCinfo()->findFinfo( "childOut" );
19 
20  if ( deferCreate_ )
21  return;
22  Id kid = Id::nextId();
23  Element* e = new FieldElement( parent, kid, fieldCinfo_, name(), this );
24  Msg* m = new OneToOneDataIndexMsg( parent.eref(), Eref( e, 0 ), 0 );
25  assert( m );
26  if ( !f1->addMsg( pf, m->mid(), parent.element() ) ) {
27  cout << "FieldElementFinfoBase::postCreationFunc: Error: \n" <<
28  " unable to add parent->child msg from " <<
29  parent.element()->getName() << " to " << name() << "\n";
30  return;
31  }
32 }
ObjId mid() const
Definition: Msg.h:106
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
Eref eref() const
Definition: Id.cpp:125
const string & name() const
Definition: Finfo.cpp:80
static Id nextId()
Definition: Id.cpp:132
virtual bool addMsg(const Finfo *target, ObjId mid, Element *src) const
Definition: Finfo.h:92
Definition: Eref.h:26
Definition: Msg.h:18
Definition: Id.h:17
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
const string & getName() const
Definition: Element.cpp:56
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224
Definition: Finfo.h:12

+ Here is the call graph for this function:

void FieldElementFinfoBase::registerFinfo ( Cinfo c)
inlinevirtual

Returns string-ified form to handle template expectations for name field string getName() const; Assign function Ids, bindIndex and so on.

Implements Finfo.

Definition at line 52 of file FieldElementFinfo.h.

References getNum_, Cinfo::registerFinfo(), Cinfo::registerPostCreationFinfo(), and setNum_.

53  {
54  c->registerFinfo( setNum_ );
55  c->registerFinfo( getNum_ );
56  c->registerPostCreationFinfo( this );
57  }
void registerFinfo(Finfo *f)
Definition: Cinfo.cpp:114
void registerPostCreationFinfo(const Finfo *f)
Definition: Cinfo.cpp:138

+ Here is the call graph for this function:

virtual void FieldElementFinfoBase::setNumField ( char *  parent,
unsigned int  num 
) const
pure virtual

virtual func to resize Field array, using char* for parent

Implemented in FieldElementFinfo< T, F >.

Referenced by FieldElement::resizeField().

+ Here is the caller graph for this function:

bool FieldElementFinfoBase::strGet ( const Eref tgt,
const string &  field,
string &  returnValue 
) const
inlinevirtual

Function to return value of field into a string argument. Returns true on success. Normally called only from SetGet::strGet.

Implements Finfo.

Definition at line 65 of file FieldElementFinfo.h.

67  {
68  return 0; // always fails
69  }
bool FieldElementFinfoBase::strSet ( const Eref tgt,
const string &  field,
const string &  arg 
) const
inlinevirtual

Function to set this field using a string argument. Returns true on success. Normally called only from SetGet::strSet.

Implements Finfo.

Definition at line 59 of file FieldElementFinfo.h.

61  {
62  return 0; // always fails
63  }

Member Data Documentation

bool FieldElementFinfoBase::deferCreate_
protected

Definition at line 100 of file FieldElementFinfo.h.

Referenced by postCreationFunc().

const Cinfo* FieldElementFinfoBase::fieldCinfo_
protected

Definition at line 99 of file FieldElementFinfo.h.

Referenced by postCreationFunc().

DestFinfo* FieldElementFinfoBase::getNum_
protected
DestFinfo* FieldElementFinfoBase::setNum_
protected

The documentation for this class was generated from the following files: