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

#include <Cinfo.h>

+ Collaboration diagram for Cinfo:

Public Member Functions

bool banCreation () const
 
const CinfobaseCinfo () const
 
 Cinfo (const std::string &name, const Cinfo *baseCinfo, Finfo **finfoArray, unsigned int nFinfos, DinfoBase *d, const string *doc=0, unsigned int numDoc=0, bool banCreation=false)
 
 Cinfo ()
 
 Cinfo (const Cinfo &other)
 
const string & destFinfoName (FuncId fid) const
 
const DinfoBasedinfo () const
 
const FinfofindFinfo (const string &name) const
 
const map< string, Finfo * > & finfoMap () const
 
string getBaseClass () const
 
FinfogetDestFinfo (unsigned int i) const
 
string getDocs () const
 
FinfogetFieldElementFinfo (unsigned int i) const
 
FinfogetLookupFinfo (unsigned int i) const
 
unsigned int getNumDestFinfo () const
 
unsigned int getNumFieldElementFinfo () const
 
unsigned int getNumLookupFinfo () const
 
unsigned int getNumSharedFinfo () const
 
unsigned int getNumSrcFinfo () const
 
unsigned int getNumValueFinfo () const
 
const OpFuncgetOpFunc (FuncId fid) const
 
FinfogetSharedFinfo (unsigned int i)
 
FinfogetSrcFinfo (unsigned int i) const
 
FinfogetValueFinfo (unsigned int i) const
 
void init (Finfo **finfoArray, unsigned int nFinfos)
 
bool isA (const string &ancestor) const
 
const std::string & name () const
 
unsigned int numBindIndex () const
 
void overrideFunc (FuncId fid, const OpFunc *f)
 
void postCreationFunc (Id newId, Element *newElm) const
 
BindIndex registerBindIndex ()
 
void registerFinfo (Finfo *f)
 
FuncId registerOpFunc (const OpFunc *f)
 
void registerPostCreationFinfo (const Finfo *f)
 
void reportFids () const
 
void setNumFinfo (unsigned int v)
 
const string & srcFinfoName (BindIndex bid) const
 
 ~Cinfo ()
 

Static Public Member Functions

static const Cinfofind (const std::string &name)
 
static const CinfoinitCinfo ()
 
static void makeCinfoElements (Id parent)
 
static void rebuildOpIndex ()
 

Static Private Member Functions

static map< string, Cinfo * > & cinfoMap ()
 

Private Attributes

bool banCreation_
 
const CinfobaseCinfo_
 
vector< Finfo * > destFinfos_
 Keep track of all DestFinfos. More...
 
const DinfoBasedinfo_
 
std::map< std::string,
std::string > 
doc_
 
vector< Finfo * > fieldElementFinfos_
 Keep track of all FieldElementFinfos. More...
 
map< string, Finfo * > finfoMap_
 
vector< const OpFunc * > funcs_
 
vector< Finfo * > lookupFinfos_
 Keep track of all LookupFinfos. More...
 
string name_
 
BindIndex numBindIndex_
 
vector< const Finfo * > postCreationFinfos_
 
vector< Finfo * > sharedFinfos_
 Keep track of all SharedFinfos. More...
 
vector< Finfo * > srcFinfos_
 Keep track of all SrcFinfos. More...
 
vector< Finfo * > valueFinfos_
 Keep track of all ValueFinfos. More...
 

Static Private Attributes

static unsigned int numCoreOpFunc_ = 0
 

Detailed Description

Class to manage class information for all the other classes.

Definition at line 18 of file Cinfo.h.

Constructor & Destructor Documentation

Cinfo::Cinfo ( const std::string &  name,
const Cinfo baseCinfo,
Finfo **  finfoArray,
unsigned int  nFinfos,
DinfoBase d,
const string *  doc = 0,
unsigned int  numDoc = 0,
bool  banCreation = false 
)

The Cinfo intializer is used for static initialization of all the MOOSE Cinfos. Each MOOSE class must set up a function to build its Cinfo. This function must be called statically in the MOOSE class .cpp file. Note how it takes the base *Cinfo as an argument. This lets us call the base Cinfo initializer when making each Cinfo class, thus ensuring the correct static initialization sequence, despite the somewhat loose semantics for this sequence in most C++ compilers.

Cinfo::Cinfo ( )

This initializer is used only as a dummy, to keep Dinfo happy

Definition at line 50 of file Cinfo.cpp.

51  : name_( "dummy" ), baseCinfo_( 0 ), dinfo_( 0 ),
52  numBindIndex_( 0 ), banCreation_( false )
53 {;}
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
string name_
Definition: Cinfo.h:278
bool banCreation_
Definition: Cinfo.h:288
const DinfoBase * dinfo_
Definition: Cinfo.h:283
BindIndex numBindIndex_
Definition: Cinfo.h:285
Cinfo::Cinfo ( const Cinfo other)

This is also a dummy initializer for Dinfo.

Definition at line 55 of file Cinfo.cpp.

56  : name_( "dummy" ), baseCinfo_( 0 ), dinfo_( 0 ),
57  numBindIndex_( 0 ), banCreation_( false )
58 {;}
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
string name_
Definition: Cinfo.h:278
bool banCreation_
Definition: Cinfo.h:288
const DinfoBase * dinfo_
Definition: Cinfo.h:283
BindIndex numBindIndex_
Definition: Cinfo.h:285
Cinfo::~Cinfo ( )

Definition at line 72 of file Cinfo.cpp.

73 {;} // The dinfos are statically allocated, we don't free them.

Member Function Documentation

bool Cinfo::banCreation ( ) const

True if this class should never be instantiated in MOOSE. This may happen if it is a pure virtual class, or if this Cinfo is for a FieldElement which cannot be created in isolation but only as a child of another class.

Definition at line 232 of file Cinfo.cpp.

References banCreation_.

Referenced by Shell::doCreate().

233 {
234  return banCreation_;
235 }
bool banCreation_
Definition: Cinfo.h:288

+ Here is the caller graph for this function:

const Cinfo * Cinfo::baseCinfo ( ) const

Definition at line 216 of file Cinfo.cpp.

References baseCinfo_.

Referenced by defineClass(), and DestFinfo::registerFinfo().

217 {
218  return baseCinfo_;
219 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282

+ Here is the caller graph for this function:

map< string, Cinfo * > & Cinfo::cinfoMap ( )
staticprivate

Definition at line 307 of file Cinfo.cpp.

Referenced by find(), makeCinfoElements(), and rebuildOpIndex().

308 {
309  static map<std::string, Cinfo*> lookup_;
310  return lookup_;
311 }

+ Here is the caller graph for this function:

const string & Cinfo::destFinfoName ( FuncId  fid) const

Returns the name of the DestFinfo having the specified FuncId, on this Cinfo. Returns "" on failure.

Definition at line 569 of file Cinfo.cpp.

References baseCinfo_, destFinfoName(), destFinfos_, DestFinfo::getFid(), and Finfo::name().

Referenced by destFinfoName(), Msg::getDestFieldsOnE1(), Msg::getDestFieldsOnE2(), and Element::getMsgTargetAndFunctions().

570 {
571  static const string err = "";
572  for ( vector< Finfo* >::const_iterator i = destFinfos_.begin();
573  i != destFinfos_.end(); ++i ) {
574  const DestFinfo* df = dynamic_cast< const DestFinfo* >( *i );
575  assert( df );
576  if ( df->getFid() == fid ) {
577  return df->name();
578  }
579  }
580  if ( baseCinfo_ )
581  return baseCinfo_->destFinfoName( fid );
582  cout << "Error: Cinfo::destFinfoName( " << fid << " ): not found\n";
583  return err;
584 }
vector< Finfo * > destFinfos_
Keep track of all DestFinfos.
Definition: Cinfo.h:299
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
const string & name() const
Definition: Finfo.cpp:80
FuncId getFid() const
Definition: DestFinfo.cpp:45
const string & destFinfoName(FuncId fid) const
Definition: Cinfo.cpp:569

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const DinfoBase * Cinfo::dinfo ( ) const

Returns the Dinfo, which manages creation and destruction of the data, and knows about its size.

Definition at line 275 of file Cinfo.cpp.

References dinfo_.

Referenced by buildFinfoElement(), DataElement::DataElement(), initCinfo(), makeCinfoElements(), DataElement::resize(), DataElement::zombieSwap(), and DataElement::~DataElement().

276 {
277  return dinfo_;
278 }
const DinfoBase * dinfo_
Definition: Cinfo.h:283

+ Here is the caller graph for this function:

const Cinfo * Cinfo::find ( const std::string &  name)
static

Finds the Cinfo with the specified name.

Definition at line 200 of file Cinfo.cpp.

References cinfoMap().

Referenced by Stoich::allocateModelObject(), defineAllClasses(), Shell::doCreate(), Dsolve::fillConcChans(), findAllConnectedCompartments(), Cell::findCompt(), getComptParent(), getFieldDict(), getFieldNames(), getFieldType(), Shell::innerCreate(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), ZombieEnz::setSolver(), testSyncSynapseSize(), Stoich::unZombifyModel(), Stoich::unZombifyPools(), Pool::vSetIsBuffered(), Stoich::zombifyModel(), and Stoich::zombifyPoolFuncWithScaling().

201 {
202  map<string, Cinfo*>::iterator i = cinfoMap().find(name);
203  if ( i != cinfoMap().end() )
204  return i->second;
205 
206 #ifdef RESULT_CHECK
207  stringstream ss;
208  ss << "+ " << name << " not found. Available names are " << endl;
209  ss << mapToString<string, Cinfo*>( cinfoMap() );
210  dump(ss.str(), "DEBUG");
211 #endif /* ----- not RESULT_CHECK ----- */
212 
213  return 0;
214 }
static map< string, Cinfo * > & cinfoMap()
Definition: Cinfo.cpp:307
const std::string & name() const
Definition: Cinfo.cpp:260

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Finfo * Cinfo::findFinfo ( const string &  name) const

Finds Finfo by name in the list for this class, ignoring any element-specific fields. Returns 0 on failure.

Looks up Finfo from name.

Definition at line 224 of file Cinfo.cpp.

References finfoMap_.

Referenced by addClockMsg(), Shell::adopt(), Stoich::allocateModelObject(), ReadCell::buildCompartment(), SetGet::checkSet(), Neutral::child(), Neutral::children(), convertConcToNumRateUsingMesh(), HSolve::deleteIncomingMessages(), Shell::doAddMsg(), enzDest(), Dsolve::fillConcChans(), findAllConnectedCompartments(), findFuncMsgSrc(), findMeshOfEnz(), findParentComptOfReac(), getComptParent(), getFieldType(), Neutral::getMsgDestFunctions(), Neutral::getMsgDests(), Neutral::getNeighbors(), getSlaveEnable(), Shell::innerAddMsg(), innerCopyMsgs(), Shell::innerMove(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), Neutral::isDescendant(), isOffSolverReac(), localGet(), Neutral::parent(), Neutral::path(), FieldElementFinfoBase::postCreationFunc(), HSolveActive::readSynapses(), DestFinfo::registerFinfo(), ZombieMMenz::setSolver(), ZombieEnz::setSolver(), Element::setTick(), SetGet::strGet(), SetGet::strSet(), HSolveUtils::targets(), testAssortedMsg(), testCreateMsg(), testFibonacci(), testFinfoFields(), testMsgField(), testMsgSrcDestFields(), testSendMsg(), testSendSpike(), testSharedMsg(), testShellAddMsg(), testSparseMsg(), testSyncSynapseSize(), and FieldElement::zombieSwap().

225 {
226  map< string, Finfo*>::const_iterator i = finfoMap_.find( name );
227  if ( i != finfoMap_.end() )
228  return i->second;
229  return 0;
230 }
map< string, Finfo * > finfoMap_
Definition: Cinfo.h:293
const std::string & name() const
Definition: Cinfo.cpp:260
const map< string, Finfo * > & Cinfo::finfoMap ( ) const

Returns the map between name and field info

Definition at line 270 of file Cinfo.cpp.

References finfoMap_.

Referenced by Shell::doAddMsg(), Element::showFields(), and Element::showMsg().

271 {
272  return finfoMap_;
273 }
map< string, Finfo * > finfoMap_
Definition: Cinfo.h:293

+ Here is the caller graph for this function:

string Cinfo::getBaseClass ( ) const

Return the name of the base class

Definition at line 391 of file Cinfo.cpp.

References baseCinfo_, and name().

Referenced by defineClass(), and initCinfo().

392 {
393  if ( baseCinfo_ )
394  return baseCinfo_->name();
395  else
396  return "none";
397 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
const std::string & name() const
Definition: Cinfo.cpp:260

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Finfo * Cinfo::getDestFinfo ( unsigned int  i) const

Return the specified DestFinfo

Definition at line 430 of file Cinfo.cpp.

References baseCinfo_, destFinfos_, dummy, and getNumDestFinfo().

Referenced by Neutral::getDestFields(), getFieldDict(), and getFieldNames().

431 {
432  if ( i >= getNumDestFinfo() )
433  return &dummy;
434  if ( baseCinfo_ ) {
435  if ( i >= baseCinfo_->getNumDestFinfo() )
436  return destFinfos_[ i - baseCinfo_->getNumDestFinfo() ];
437  else
438  return const_cast< Cinfo* >( baseCinfo_ )->getDestFinfo( i );
439  }
440 
441  return destFinfos_[i];
442 }
Finfo * getDestFinfo(unsigned int i) const
Definition: Cinfo.cpp:430
unsigned int getNumDestFinfo() const
Definition: Cinfo.cpp:444
vector< Finfo * > destFinfos_
Keep track of all DestFinfos.
Definition: Cinfo.h:299
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string Cinfo::getDocs ( ) const

Return the documentation string

Definition at line 376 of file Cinfo.cpp.

References doc_.

Referenced by initCinfo().

377 {
378  ostringstream doc;
379  for (map <string, string>::const_iterator ii = doc_.begin(); ii != doc_.end(); ++ii){
380  doc << '\n' << ii->first << ":\t\t" << ii->second << endl;
381  }
382  return doc.str();
383 }
std::map< std::string, std::string > doc_
Definition: Cinfo.h:286

+ Here is the caller graph for this function:

Finfo * Cinfo::getFieldElementFinfo ( unsigned int  i) const

Return the specified FieldElementFinfo

Definition at line 523 of file Cinfo.cpp.

References baseCinfo_, dummy, fieldElementFinfos_, and getNumFieldElementFinfo().

Referenced by getFieldDict(), and getFieldNames().

524 {
525  if ( i >= getNumFieldElementFinfo() )
526  return &dummy;
527  if ( baseCinfo_ ) {
528  if ( i >= baseCinfo_->getNumFieldElementFinfo() )
530  else
531  return const_cast< Cinfo* >( baseCinfo_ )->getFieldElementFinfo( i );
532  }
533 
534  return fieldElementFinfos_[i];
535 }
Finfo * getFieldElementFinfo(unsigned int i) const
Definition: Cinfo.cpp:523
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > fieldElementFinfos_
Keep track of all FieldElementFinfos.
Definition: Cinfo.h:311
unsigned int getNumFieldElementFinfo() const
Definition: Cinfo.cpp:537
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Finfo * Cinfo::getLookupFinfo ( unsigned int  i) const

Return the specified LookupFinfo

Definition at line 477 of file Cinfo.cpp.

References baseCinfo_, dummy, getNumLookupFinfo(), and lookupFinfos_.

Referenced by getFieldDict(), and getFieldNames().

478 {
479  if ( i >= getNumLookupFinfo() )
480  return &dummy;
481  if ( baseCinfo_ ) {
482  if ( i >= baseCinfo_->getNumLookupFinfo() )
483  return lookupFinfos_[ i - baseCinfo_->getNumLookupFinfo() ];
484  else
485  return const_cast< Cinfo* >(baseCinfo_)->getLookupFinfo( i );
486  }
487 
488  return lookupFinfos_[i];
489 }
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
Finfo * getLookupFinfo(unsigned int i) const
Definition: Cinfo.cpp:477
vector< Finfo * > lookupFinfos_
Keep track of all LookupFinfos.
Definition: Cinfo.h:305
unsigned int getNumLookupFinfo() const
Definition: Cinfo.cpp:491
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumDestFinfo ( ) const

Return number of DestFinfo

Definition at line 444 of file Cinfo.cpp.

References baseCinfo_, destFinfos_, and getNumDestFinfo().

Referenced by defineDestFinfos(), Neutral::getDestFields(), getDestFinfo(), getFieldDict(), getFieldNames(), getNumDestFinfo(), and testCinfoFields().

445 {
446  if ( baseCinfo_ )
447  return destFinfos_.size() + baseCinfo_->getNumDestFinfo();
448  else
449  return destFinfos_.size();
450 }
unsigned int getNumDestFinfo() const
Definition: Cinfo.cpp:444
vector< Finfo * > destFinfos_
Keep track of all DestFinfos.
Definition: Cinfo.h:299
const Cinfo * baseCinfo_
Definition: Cinfo.h:282

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumFieldElementFinfo ( ) const

Return number of FieldElementFinfos

Definition at line 537 of file Cinfo.cpp.

References baseCinfo_, fieldElementFinfos_, and getNumFieldElementFinfo().

Referenced by defineElementFinfos(), getFieldDict(), getFieldElementFinfo(), getFieldNames(), and getNumFieldElementFinfo().

538 {
539  if ( baseCinfo_ )
541  else
542  return fieldElementFinfos_.size();
543 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > fieldElementFinfos_
Keep track of all FieldElementFinfos.
Definition: Cinfo.h:311
unsigned int getNumFieldElementFinfo() const
Definition: Cinfo.cpp:537

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumLookupFinfo ( ) const

Return number of LookupFinfo

Definition at line 491 of file Cinfo.cpp.

References baseCinfo_, getNumLookupFinfo(), and lookupFinfos_.

Referenced by defineLookupFinfos(), getFieldDict(), getFieldNames(), getLookupFinfo(), getNumLookupFinfo(), and testCinfoFields().

492 {
493  if ( baseCinfo_ )
494  return lookupFinfos_.size() + baseCinfo_->getNumLookupFinfo();
495  else
496  return lookupFinfos_.size();
497 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > lookupFinfos_
Keep track of all LookupFinfos.
Definition: Cinfo.h:305
unsigned int getNumLookupFinfo() const
Definition: Cinfo.cpp:491

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumSharedFinfo ( ) const

Return number of SharedFinfos

Definition at line 514 of file Cinfo.cpp.

References baseCinfo_, getNumSharedFinfo(), and sharedFinfos_.

Referenced by getNumSharedFinfo(), getSharedFinfo(), and testCinfoFields().

515 {
516  if ( baseCinfo_ )
517  return sharedFinfos_.size() + baseCinfo_->getNumSharedFinfo();
518  else
519  return sharedFinfos_.size();
520 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > sharedFinfos_
Keep track of all SharedFinfos.
Definition: Cinfo.h:308
unsigned int getNumSharedFinfo() const
Definition: Cinfo.cpp:514

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumSrcFinfo ( ) const

Return number of SrcFinfos

Definition at line 421 of file Cinfo.cpp.

References baseCinfo_, getNumSrcFinfo(), and srcFinfos_.

Referenced by getFieldDict(), getFieldNames(), getNumSrcFinfo(), Neutral::getSourceFields(), getSrcFinfo(), and testCinfoFields().

422 {
423  if ( baseCinfo_ )
424  return srcFinfos_.size() + baseCinfo_->getNumSrcFinfo();
425  else
426  return srcFinfos_.size();
427 }
unsigned int getNumSrcFinfo() const
Definition: Cinfo.cpp:421
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > srcFinfos_
Keep track of all SrcFinfos.
Definition: Cinfo.h:296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Cinfo::getNumValueFinfo ( ) const

Return number of ValueFinfo

Definition at line 467 of file Cinfo.cpp.

References baseCinfo_, getNumValueFinfo(), and valueFinfos_.

Referenced by getFieldDict(), getFieldNames(), getNumValueFinfo(), Neutral::getValueFields(), getValueFinfo(), and testCinfoFields().

468 {
469  if ( baseCinfo_ )
470  return valueFinfos_.size() + baseCinfo_->getNumValueFinfo();
471  else
472  return valueFinfos_.size();
473 }
vector< Finfo * > valueFinfos_
Keep track of all ValueFinfos.
Definition: Cinfo.h:302
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
unsigned int getNumValueFinfo() const
Definition: Cinfo.cpp:467

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const OpFunc * Cinfo::getOpFunc ( FuncId  fid) const

looks up OpFunc by FuncId

Definition at line 240 of file Cinfo.cpp.

References funcs_.

Referenced by GetOpFunc1< T, L, A >::op(), GetEpFunc1< T, L, A >::op(), putFuncsInOrder(), and Element::putOffNodeTargetsInDigest().

240  {
241  if ( fid < funcs_.size () )
242  return funcs_[ fid ];
243  return 0;
244 }
vector< const OpFunc * > funcs_
Definition: Cinfo.h:319

+ Here is the caller graph for this function:

Finfo * Cinfo::getSharedFinfo ( unsigned int  i)

Return the specified SharedFinfo

Definition at line 500 of file Cinfo.cpp.

References baseCinfo_, dummy, getNumSharedFinfo(), and sharedFinfos_.

501 {
502  if ( i >= getNumSharedFinfo() )
503  return &dummy;
504  if ( baseCinfo_ ) {
505  if ( i >= baseCinfo_->getNumSharedFinfo() )
506  return sharedFinfos_[ i - baseCinfo_->getNumSharedFinfo() ];
507  else
508  return const_cast< Cinfo* >( baseCinfo_ )->getSharedFinfo( i );
509  }
510 
511  return sharedFinfos_[i];
512 }
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
vector< Finfo * > sharedFinfos_
Keep track of all SharedFinfos.
Definition: Cinfo.h:308
unsigned int getNumSharedFinfo() const
Definition: Cinfo.cpp:514
Finfo * getSharedFinfo(unsigned int i)
Definition: Cinfo.cpp:500
Definition: Cinfo.h:18

+ Here is the call graph for this function:

Finfo * Cinfo::getSrcFinfo ( unsigned int  i) const

Return the specified SrcFinfo

Definition at line 406 of file Cinfo.cpp.

References baseCinfo_, getNumSrcFinfo(), getSrcFinfo(), and srcFinfos_.

Referenced by PostMaster::clearPendingRecv(), getFieldDict(), getFieldNames(), Neutral::getSourceFields(), and getSrcFinfo().

407 {
408  if ( i >= getNumSrcFinfo() )
409  return 0;
410  if ( baseCinfo_ ) {
411  if ( i >= baseCinfo_->getNumSrcFinfo() )
412  return srcFinfos_[ i - baseCinfo_->getNumSrcFinfo() ];
413  else
414  return baseCinfo_->getSrcFinfo( i );
415  //return const_cast< Cinfo* >( baseCinfo_ )->getSrcFinfo( i );
416  }
417 
418  return srcFinfos_[i];
419 }
unsigned int getNumSrcFinfo() const
Definition: Cinfo.cpp:421
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
Finfo * getSrcFinfo(unsigned int i) const
Definition: Cinfo.cpp:406
vector< Finfo * > srcFinfos_
Keep track of all SrcFinfos.
Definition: Cinfo.h:296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Finfo * Cinfo::getValueFinfo ( unsigned int  i) const

Return the specified ValueFinfo

Definition at line 453 of file Cinfo.cpp.

References baseCinfo_, dummy, getNumValueFinfo(), and valueFinfos_.

Referenced by getFieldDict(), getFieldNames(), and Neutral::getValueFields().

454 {
455  if ( i >= getNumValueFinfo() )
456  return &dummy;
457  if ( baseCinfo_ ) {
458  if ( i >= baseCinfo_->getNumValueFinfo() )
459  return valueFinfos_[ i - baseCinfo_->getNumValueFinfo() ];
460  else
461  return const_cast< Cinfo* >(baseCinfo_)->getValueFinfo( i );
462  }
463 
464  return valueFinfos_[i];
465 }
vector< Finfo * > valueFinfos_
Keep track of all ValueFinfos.
Definition: Cinfo.h:302
Finfo * getValueFinfo(unsigned int i) const
Definition: Cinfo.cpp:453
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
unsigned int getNumValueFinfo() const
Definition: Cinfo.cpp:467
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Cinfo::init ( Finfo **  finfoArray,
unsigned int  nFinfos 
)

Initializes the Cinfo. Must be called exactly once for each Cinfo.

init: initializes the Cinfo. Must be called just once

Definition at line 82 of file Cinfo.cpp.

References baseCinfo_, finfoMap_, funcs_, numBindIndex_, postCreationFinfos_, and registerFinfo().

83 {
84  if ( baseCinfo_ ) {
85  // Copy over base Finfos.
90  }
91  for ( unsigned int i = 0; i < nFinfos; i++ ) {
92  registerFinfo( finfoArray[i] );
93  }
94 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
map< string, Finfo * > finfoMap_
Definition: Cinfo.h:293
void registerFinfo(Finfo *f)
Definition: Cinfo.cpp:114
vector< const Finfo * > postCreationFinfos_
Definition: Cinfo.h:318
vector< const OpFunc * > funcs_
Definition: Cinfo.h:319
BindIndex numBindIndex_
Definition: Cinfo.h:285

+ Here is the call graph for this function:

const Cinfo * Cinfo::initCinfo ( )
static

Initializer for the MOOSE fields for Cinfo

Definition at line 327 of file Cinfo.cpp.

References cinfoCinfo, dinfo(), getBaseClass(), getDocs(), and Neutral::initCinfo().

Referenced by makeCinfoElements().

328 {
330  // Field Definitions
333  "docs",
334  "Documentation",
336  );
337 
338  static ReadOnlyValueFinfo< Cinfo, string > baseClass(
339  "baseClass",
340  "Name of base class",
342  );
343 
344  static string doc[] =
345  {
346  "Name", "Cinfo",
347  "Author", "Upi Bhalla",
348  "Description", "Class information object."
349  };
350 
351  static Finfo* cinfoFinfos[] = {
352  &docs, // ReadOnlyValue
353  &baseClass, // ReadOnlyValue
354  };
355 
356  static Dinfo< Cinfo > dinfo;
357  static Cinfo cinfoCinfo (
358  "Cinfo",
360  cinfoFinfos,
361  sizeof( cinfoFinfos ) / sizeof ( Finfo* ),
362  &dinfo,
363  doc,
364  sizeof(doc)/sizeof(string)
365  );
366 
367  return &cinfoCinfo;
368 }
string getDocs() const
Definition: Cinfo.cpp:376
Definition: Dinfo.h:60
const DinfoBase * dinfo() const
Definition: Cinfo.cpp:275
string getBaseClass() const
Definition: Cinfo.cpp:391
static const Cinfo * cinfoCinfo
Definition: Cinfo.cpp:370
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
Definition: Cinfo.h:18
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Cinfo::isA ( const string &  ancestor) const

Returns true if the current Cinfo is derived from the ancestor

Definition at line 280 of file Cinfo.cpp.

References baseCinfo_, Neutral::initCinfo(), and name_.

Referenced by assignParam(), Dsolve::buildMeshJunctions(), Dsolve::buildNeuroMeshJunctions(), Dsolve::calcJunction(), HSolve::deepSearchForCompartment(), Neutral::destroy(), doClassSpecificMessaging(), Shell::doLoadModel(), fillSegIndex(), fillSegments(), VoxelPoolsBase::filterCrossRateTerms(), findAllConnectedCompartments(), getCompt(), Stoich::getProxyPools(), getReactantVols(), Neutral::isA(), isOffSolverReac(), isPartOfDend(), ReadKkit::loadTab(), Stoich::locateOffSolverReacs(), ReadCspace::makePlots(), ReadCspace::printMol(), ReadCell::read(), Gsolve::setCompartment(), Dsolve::setCompartment(), ZombiePoolInterface::setCompartment(), Stoich::setCompartment(), Ksolve::setDsolve(), Gsolve::setDsolve(), Stoich::setDsolve(), Stoich::setKsolve(), Gsolve::setN(), Gsolve::setNinit(), HSolve::setSeed(), ZombieFunction::setSolver(), ZombieReac::setSolver(), ZombieMMenz::setSolver(), ZombieEnz::setSolver(), Neuron::setSpineAndPsdMesh(), Gsolve::setStoich(), SteadyState::setStoich(), Ksolve::setStoich(), Dsolve::setStoich(), EndoMesh::setSurround(), ReadKkit::setupSlaveMsg(), testIsA(), ZombiePool::vSetSolver(), ZombieCaConc::vSetSolver(), ZombieHHChannel::vSetSolver(), and ZombieCompartment::vSetSolver().

281 {
282  if ( ancestor == "Neutral" ) return 1;
283  const Cinfo* base = this;
284  while( base && base != Neutral::initCinfo() ) {
285  if ( ancestor == base->name_ )
286  return 1;
287  base = base->baseCinfo_;
288  }
289  return 0;
290 }
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
string name_
Definition: Cinfo.h:278
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
Definition: Cinfo.h:18

+ Here is the call graph for this function:

void Cinfo::makeCinfoElements ( Id  parent)
static

Utility function used at init to create the inspection Elements for each of the Cinfos.

Definition at line 164 of file Cinfo.cpp.

References Shell::adopt(), DinfoBase::assignData(), buildFinfoElement(), cinfoMap(), Element::data(), dinfo(), dummy, initCinfo(), and Id::nextId().

Referenced by init().

165 {
166  static Dinfo< Cinfo > dummy;
167  vector< unsigned int > dims( 1, 0 );
168 
169  vector< Id > cinfoElements;
170  for ( map< string, Cinfo* >::iterator i = cinfoMap().begin();
171  i != cinfoMap().end(); ++i ) {
172  Id id = Id::nextId();
173  char* data = reinterpret_cast< char* >( i->second );
174  Element* e = new GlobalDataElement(
175  id, Cinfo::initCinfo(), i->first );
176  Cinfo::initCinfo()->dinfo()->assignData( e->data( 0 ), 1, data, 1 );
177  // Cinfo* temp = reinterpret_cast< Cinfo* >( e->data( 0 ) );
178 
179  Shell::adopt( parent, id, 0 );
180  cinfoElements.push_back( id );
181  // cout << "Cinfo::makeCinfoElements: parent= " << parent << ", Id = " << id << ", name = " << i->first << endl;
182  }
183  vector< Id >::iterator j = cinfoElements.begin();
184  for ( map< string, Cinfo* >::iterator i = cinfoMap().begin();
185  i != cinfoMap().end(); ++i ) {
186  buildFinfoElement( *j, i->second->srcFinfos_, "srcFinfo" );
187  buildFinfoElement( *j, i->second->destFinfos_, "destFinfo" );
188  buildFinfoElement( *j, i->second->valueFinfos_, "valueFinfo" );
189  buildFinfoElement( *j, i->second->lookupFinfos_, "lookupFinfo" );
190  buildFinfoElement( *j, i->second->sharedFinfos_, "sharedFinfo" );
191  buildFinfoElement( *j, i->second->fieldElementFinfos_, "fieldElementFinfo" );
192  j++;
193  }
194 }
Definition: Dinfo.h:60
static DestFinfo dummy("dummy","This Finfo is a dummy. If you are reading this you have used an invalid index", 0)
static const Cinfo * initCinfo()
Definition: Cinfo.cpp:327
void buildFinfoElement(Id parent, vector< Finfo * > &f, const string &name)
Definition: Cinfo.cpp:151
static map< string, Cinfo * > & cinfoMap()
Definition: Cinfo.cpp:307
const DinfoBase * dinfo() const
Definition: Cinfo.cpp:275
static Id nextId()
Definition: Id.cpp:132
virtual void assignData(char *copy, unsigned int copyEntries, const char *orig, unsigned int origEntries) const =0
virtual char * data(unsigned int rawIndex, unsigned int fieldIndex=0) const =0
static bool adopt(ObjId parent, Id child, unsigned int msgIndex)
Definition: Shell.cpp:654
Definition: Id.h:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string & Cinfo::name ( ) const
unsigned int Cinfo::numBindIndex ( ) const

Finds the funcId by name. Returns 0 on failure. const FuncId findFuncId( const string& name) const; Number of SrcMsgs in total. Each has a unique number to bind to an entry in the msgBinding vector in the Element.

Definition at line 265 of file Cinfo.cpp.

References numBindIndex_.

Referenced by Neutral::getOutgoingMsgs(), and Eref::msgDigest().

266 {
267  return numBindIndex_;
268 }
BindIndex numBindIndex_
Definition: Cinfo.h:285

+ Here is the caller graph for this function:

void Cinfo::overrideFunc ( FuncId  fid,
const OpFunc f 
)

Used in derived classes, to replace the original OpFunc with the new one.

Definition at line 103 of file Cinfo.cpp.

References funcs_.

Referenced by DestFinfo::registerFinfo().

104 {
105  assert ( funcs_.size() > fid );
106  funcs_[ fid ] = f;
107 }
vector< const OpFunc * > funcs_
Definition: Cinfo.h:319

+ Here is the caller graph for this function:

void Cinfo::postCreationFunc ( Id  newId,
Element newElm 
) const

Handles any operations that must be done after an Element is created. Scans through all Finfos as they are the ones to manage such requests. Examples are to create FieldElements.

Definition at line 143 of file Cinfo.cpp.

References postCreationFinfos_.

144 {
145  for ( vector< const Finfo* >::const_iterator i =
146  postCreationFinfos_.begin();
147  i != postCreationFinfos_.end(); ++i )
148  (*i)->postCreationFunc( newId, newElm );
149 }
vector< const Finfo * > postCreationFinfos_
Definition: Cinfo.h:318
void Cinfo::rebuildOpIndex ( )
static

Ensures that the Func Ids are always in a fixed order, regardless of the sequence of static initialization of Cinfos.

Definition at line 589 of file Cinfo.cpp.

References cinfoMap(), numCoreOpFunc_, OpFunc::rebuildOpIndex(), and OpFunc::setIndex().

Referenced by init().

590 {
592  unsigned int num = 0;
593  for ( map< string, Cinfo* >::iterator
594  i = cinfoMap().begin(); i != cinfoMap().end(); ++i )
595  {
596  vector< const OpFunc* >& vec = i->second->funcs_;
597  for( vector< const OpFunc* >::iterator
598  j = vec.begin(); j != vec.end(); ++j )
599  {
600  OpFunc* of = const_cast< OpFunc* >( *j );
601  num += of->setIndex( num );
602  }
603  }
604  // cout << "on node " << Shell::myNode() << ": oldNumOpFunc = " << numCoreOpFunc_ << ", new = " << num << endl;
605  numCoreOpFunc_ = num;
606 }
static unsigned int numCoreOpFunc_
Definition: Cinfo.h:323
bool setIndex(unsigned int i)
Used when rebuilding the Fid->OpFunc mapping.
Definition: OpFuncBase.cpp:58
static map< string, Cinfo * > & cinfoMap()
Definition: Cinfo.cpp:307
static unsigned int rebuildOpIndex()
cleans out the entire Ops vector. Returns size of orig vector.
Definition: OpFuncBase.cpp:49

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BindIndex Cinfo::registerBindIndex ( )

Returns the next free value for BindIndex, and keeps track of the total number set up.

Definition at line 109 of file Cinfo.cpp.

References numBindIndex_.

Referenced by SrcFinfo::registerFinfo().

110 {
111  return numBindIndex_++;
112 }
BindIndex numBindIndex_
Definition: Cinfo.h:285

+ Here is the caller graph for this function:

void Cinfo::registerFinfo ( Finfo f)

registerFinfo: Puts Finfo information into Cinfo, and updates fields on Finfo as necessary.

Definition at line 114 of file Cinfo.cpp.

References destFinfos_, fieldElementFinfos_, finfoMap_, lookupFinfos_, Finfo::name(), Finfo::registerFinfo(), sharedFinfos_, srcFinfos_, and valueFinfos_.

Referenced by init(), SharedFinfo::registerFinfo(), ElementValueFinfo< T, F >::registerFinfo(), LookupElementValueFinfo< T, L, F >::registerFinfo(), FieldElementFinfoBase::registerFinfo(), LookupValueFinfo< T, L, F >::registerFinfo(), ValueFinfo< T, F >::registerFinfo(), ReadOnlyElementValueFinfo< T, F >::registerFinfo(), ReadOnlyLookupElementValueFinfo< T, L, F >::registerFinfo(), ReadOnlyValueFinfo< T, F >::registerFinfo(), and ReadOnlyLookupValueFinfo< T, L, F >::registerFinfo().

115 {
116  finfoMap_[ f->name() ] = f;
117  f->registerFinfo( this );
118  if ( dynamic_cast< DestFinfo* >( f ) ) {
119  destFinfos_.push_back( f );
120  }
121  else if ( dynamic_cast< SrcFinfo* >( f ) ) {
122  srcFinfos_.push_back( f );
123  }
124  else if ( dynamic_cast< ValueFinfoBase* >( f ) ) {
125  valueFinfos_.push_back( f );
126  }
127  else if ( dynamic_cast< LookupValueFinfoBase* >( f ) ) {
128  lookupFinfos_.push_back( f );
129  }
130  else if ( dynamic_cast< SharedFinfo* >( f ) ) {
131  sharedFinfos_.push_back( f );
132  }
133  else if ( dynamic_cast< FieldElementFinfoBase* >( f ) ) {
134  fieldElementFinfos_.push_back( f );
135  }
136 }
vector< Finfo * > valueFinfos_
Keep track of all ValueFinfos.
Definition: Cinfo.h:302
virtual void registerFinfo(Cinfo *c)=0
vector< Finfo * > destFinfos_
Keep track of all DestFinfos.
Definition: Cinfo.h:299
map< string, Finfo * > finfoMap_
Definition: Cinfo.h:293
const string & name() const
Definition: Finfo.cpp:80
vector< Finfo * > fieldElementFinfos_
Keep track of all FieldElementFinfos.
Definition: Cinfo.h:311
vector< Finfo * > sharedFinfos_
Keep track of all SharedFinfos.
Definition: Cinfo.h:308
vector< Finfo * > lookupFinfos_
Keep track of all LookupFinfos.
Definition: Cinfo.h:305
vector< Finfo * > srcFinfos_
Keep track of all SrcFinfos.
Definition: Cinfo.h:296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FuncId Cinfo::registerOpFunc ( const OpFunc f)

Registers the OpFunc, assigns it a FuncId and returns the FuncId.

Definition at line 96 of file Cinfo.cpp.

References funcs_.

Referenced by DestFinfo::registerFinfo().

97 {
98  FuncId ret = funcs_.size();
99  funcs_.push_back( f );
100  return ret;
101 }
vector< const OpFunc * > funcs_
Definition: Cinfo.h:319
unsigned int FuncId
Definition: header.h:42

+ Here is the caller graph for this function:

void Cinfo::registerPostCreationFinfo ( const Finfo f)

Registers a finfo as needing post-creation work

Definition at line 138 of file Cinfo.cpp.

References postCreationFinfos_.

Referenced by FieldElementFinfoBase::registerFinfo().

139 {
140  postCreationFinfos_.push_back( f );
141 }
vector< const Finfo * > postCreationFinfos_
Definition: Cinfo.h:318

+ Here is the caller graph for this function:

void Cinfo::reportFids ( ) const

Utility function for debugging

Definition at line 292 of file Cinfo.cpp.

References finfoMap_, DestFinfo::getFid(), and Finfo::name().

293 {
294  for ( map< string, Finfo*>::const_iterator i = finfoMap_.begin();
295  i != finfoMap_.end(); ++i ) {
296  const DestFinfo* df = dynamic_cast< const DestFinfo* >(
297  i->second );
298  if ( df ) {
299  cout << df->getFid() << " " << df->name() << endl;
300  }
301  }
302 }
map< string, Finfo * > finfoMap_
Definition: Cinfo.h:293
const string & name() const
Definition: Finfo.cpp:80
FuncId getFid() const
Definition: DestFinfo.cpp:45

+ Here is the call graph for this function:

void Cinfo::setNumFinfo ( unsigned int  v)

Dummy function. We never allow this assignment.

Definition at line 546 of file Cinfo.cpp.

547 {
548  ;
549 }
const string & Cinfo::srcFinfoName ( BindIndex  bid) const

Returns the name of the SrcFinfo having the specified BindIndex, on this Cinfo. Returns "" on failure.

Definition at line 552 of file Cinfo.cpp.

References baseCinfo_, SrcFinfo::getBindIndex(), Finfo::name(), srcFinfoName(), and srcFinfos_.

Referenced by Element::getMsgSourceAndSender(), Msg::getSrcFieldsOnE1(), Msg::getSrcFieldsOnE2(), and srcFinfoName().

553 {
554  static const string err = "";
555  for ( vector< Finfo* >::const_iterator i = srcFinfos_.begin();
556  i != srcFinfos_.end(); ++i ) {
557  const SrcFinfo* sf = dynamic_cast< const SrcFinfo* >( *i );
558  assert( sf );
559  if ( sf->getBindIndex() == bid ) {
560  return sf->name();
561  }
562  }
563  if ( baseCinfo_ )
564  return baseCinfo_->srcFinfoName( bid );
565  cout << "Error: Cinfo::srcFinfoName( " << bid << " ): not found\n";
566  return err;
567 }
BindIndex getBindIndex() const
Definition: SrcFinfo.cpp:28
const Cinfo * baseCinfo_
Definition: Cinfo.h:282
const string & name() const
Definition: Finfo.cpp:80
const string & srcFinfoName(BindIndex bid) const
Definition: Cinfo.cpp:552
vector< Finfo * > srcFinfos_
Keep track of all SrcFinfos.
Definition: Cinfo.h:296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool Cinfo::banCreation_
private

Definition at line 288 of file Cinfo.h.

Referenced by banCreation().

vector< Finfo* > Cinfo::destFinfos_
private

Keep track of all DestFinfos.

Definition at line 299 of file Cinfo.h.

Referenced by destFinfoName(), getDestFinfo(), getNumDestFinfo(), and registerFinfo().

const DinfoBase* Cinfo::dinfo_
private

Definition at line 283 of file Cinfo.h.

Referenced by dinfo().

std::map< std::string, std::string > Cinfo::doc_
private

Definition at line 286 of file Cinfo.h.

Referenced by getDocs().

vector< Finfo* > Cinfo::fieldElementFinfos_
private

Keep track of all FieldElementFinfos.

Definition at line 311 of file Cinfo.h.

Referenced by getFieldElementFinfo(), getNumFieldElementFinfo(), and registerFinfo().

map< string, Finfo* > Cinfo::finfoMap_
private

This looks up Finfos by name.

Definition at line 293 of file Cinfo.h.

Referenced by findFinfo(), finfoMap(), init(), registerFinfo(), and reportFids().

vector< const OpFunc* > Cinfo::funcs_
private

Definition at line 319 of file Cinfo.h.

Referenced by getOpFunc(), init(), overrideFunc(), and registerOpFunc().

vector< Finfo* > Cinfo::lookupFinfos_
private

Keep track of all LookupFinfos.

Definition at line 305 of file Cinfo.h.

Referenced by getLookupFinfo(), getNumLookupFinfo(), and registerFinfo().

string Cinfo::name_
private

Definition at line 278 of file Cinfo.h.

Referenced by isA(), and name().

BindIndex Cinfo::numBindIndex_
private

Definition at line 285 of file Cinfo.h.

Referenced by init(), numBindIndex(), and registerBindIndex().

unsigned int Cinfo::numCoreOpFunc_ = 0
staticprivate

Definition at line 323 of file Cinfo.h.

Referenced by rebuildOpIndex().

vector< const Finfo* > Cinfo::postCreationFinfos_
private

These are special Finfos which have to be invoked after the Element is created, and their postCreationFuncs called. They are typically things like FieldElementFinfos.

Definition at line 318 of file Cinfo.h.

Referenced by init(), postCreationFunc(), and registerPostCreationFinfo().

vector< Finfo* > Cinfo::sharedFinfos_
private

Keep track of all SharedFinfos.

Definition at line 308 of file Cinfo.h.

Referenced by getNumSharedFinfo(), getSharedFinfo(), and registerFinfo().

vector< Finfo* > Cinfo::srcFinfos_
private

Keep track of all SrcFinfos.

Definition at line 296 of file Cinfo.h.

Referenced by getNumSrcFinfo(), getSrcFinfo(), registerFinfo(), and srcFinfoName().

vector< Finfo* > Cinfo::valueFinfos_
private

Keep track of all ValueFinfos.

Definition at line 302 of file Cinfo.h.

Referenced by getNumValueFinfo(), getValueFinfo(), and registerFinfo().


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