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

#include <SrcFinfo.h>

+ Inheritance diagram for SrcFinfo:
+ Collaboration diagram for SrcFinfo:

Public Member Functions

bool addMsg (const Finfo *target, ObjId mid, Element *src) const
 
bool checkTarget (const Finfo *target) const
 
BindIndex getBindIndex () const
 
void registerFinfo (Cinfo *c)
 
virtual void sendBuffer (const Eref &e, double *buf) const =0
 
void setBindIndex (BindIndex b)
 
 SrcFinfo (const string &name, const string &doc)
 
bool strGet (const Eref &tgt, const string &field, string &returnValue) const
 
bool strSet (const Eref &tgt, const string &field, const string &arg) const
 
 ~SrcFinfo ()
 
- Public Member Functions inherited from Finfo
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 void postCreationFunc (Id newId, Element *newElm) const
 
virtual string rttiType () const
 
virtual ~Finfo ()
 

Static Public Attributes

static const BindIndex BadBindIndex = 65535
 

Private Attributes

unsigned short bindIndex_
 

Additional Inherited Members

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

Detailed Description

This set of classes define Message Sources. Their main job is to supply a type-safe send operation, and to provide typechecking for it.

Definition at line 24 of file SrcFinfo.h.

Constructor & Destructor Documentation

SrcFinfo::SrcFinfo ( const string &  name,
const string &  doc 
)

Definition at line 18 of file SrcFinfo.cpp.

19  : Finfo( name, doc ), bindIndex_( BadBindIndex )
20 { ; }
const string & name() const
Definition: Finfo.cpp:80
unsigned short bindIndex_
Definition: SrcFinfo.h:70
Finfo(const string &name, const string &doc)
Definition: Finfo.cpp:13
static const BindIndex BadBindIndex
Definition: SrcFinfo.h:65
SrcFinfo::~SrcFinfo ( )
inline

Definition at line 29 of file SrcFinfo.h.

29 {;}

Member Function Documentation

bool SrcFinfo::addMsg ( const Finfo target,
ObjId  mid,
Element src 
) const
virtual

First checks that the target will work, then adds the Msg.

Reimplemented from Finfo.

Definition at line 50 of file SrcFinfo.cpp.

References Element::addMsgAndFunc(), bindIndex_, OpFunc::checkFinfo(), DestFinfo::getFid(), and DestFinfo::getOpFunc().

51 {
52  const DestFinfo* d = dynamic_cast< const DestFinfo* >( target );
53  if ( d ) {
54  if ( d->getOpFunc()->checkFinfo( this ) ) {
55  src->addMsgAndFunc( mid, d->getFid(), bindIndex_ );
56  return 1;
57  }
58  }
59  return 0;
60 }
void addMsgAndFunc(ObjId mid, FuncId fid, BindIndex bindIndex)
Definition: Element.cpp:128
virtual bool checkFinfo(const Finfo *s) const =0
unsigned short bindIndex_
Definition: SrcFinfo.h:70
FuncId getFid() const
Definition: DestFinfo.cpp:45
const OpFunc * getOpFunc() const
Definition: DestFinfo.cpp:40

+ Here is the call graph for this function:

bool SrcFinfo::checkTarget ( const Finfo target) const
virtual

Checks that the target will work for this Msg.

Reimplemented from Finfo.

Definition at line 41 of file SrcFinfo.cpp.

References OpFunc::checkFinfo(), and DestFinfo::getOpFunc().

42 {
43  const DestFinfo* d = dynamic_cast< const DestFinfo* >( target );
44  if ( d ) {
45  return d->getOpFunc()->checkFinfo( this );
46  }
47  return 0;
48 }
virtual bool checkFinfo(const Finfo *s) const =0
const OpFunc * getOpFunc() const
Definition: DestFinfo.cpp:40

+ Here is the call graph for this function:

BindIndex SrcFinfo::getBindIndex ( ) const

Definition at line 28 of file SrcFinfo.cpp.

References BadBindIndex, and bindIndex_.

Referenced by Neutral::child(), Neutral::children(), convertConcToNumRateUsingVol(), Element::getMsgTargetAndFunctions(), Element::getMsgTargets(), Element::getOutputs(), getReactantVols(), innerCopyMsgs(), SrcFinfo0::send(), SrcFinfo1< T >::send(), SrcFinfo2< T1, T2 >::send(), SrcFinfo3< T1, T2, T3 >::send(), SrcFinfo4< T1, T2, T3, T4 >::send(), SrcFinfo5< T1, T2, T3, T4, T5 >::send(), SrcFinfo6< T1, T2, T3, T4, T5, T6 >::send(), SrcFinfo1< T >::sendTo(), SrcFinfo2< T1, T2 >::sendTo(), SrcFinfo1< T >::sendVec(), Element::showMsg(), Cinfo::srcFinfoName(), and testSendMsg().

29 {
30  // Treat this assertion as a warning that the SrcFinfo is being used
31  // without initialization.
32  assert( bindIndex_ != BadBindIndex );
33  return bindIndex_;
34 }
unsigned short bindIndex_
Definition: SrcFinfo.h:70
static const BindIndex BadBindIndex
Definition: SrcFinfo.h:65

+ Here is the caller graph for this function:

void SrcFinfo::registerFinfo ( Cinfo c)
virtual

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 22 of file SrcFinfo.cpp.

References bindIndex_, and Cinfo::registerBindIndex().

23 {
25 }
BindIndex registerBindIndex()
Definition: Cinfo.cpp:109
unsigned short bindIndex_
Definition: SrcFinfo.h:70

+ Here is the call graph for this function:

virtual void SrcFinfo::sendBuffer ( const Eref e,
double *  buf 
) const
pure virtual

Sends contents of buffer on to msg targets Buffer has a header with the TgtInfo.

Implemented in SrcFinfo6< T1, T2, T3, T4, T5, T6 >, SrcFinfo5< T1, T2, T3, T4, T5 >, SrcFinfo4< T1, T2, T3, T4 >, SrcFinfo3< T1, T2, T3 >, SrcFinfo2< T1, T2 >, SrcFinfo1< T >, and SrcFinfo0.

Referenced by PostMaster::clearPendingRecv().

+ Here is the caller graph for this function:

void SrcFinfo::setBindIndex ( BindIndex  b)

Definition at line 36 of file SrcFinfo.cpp.

References bindIndex_.

Referenced by testSendMsg().

37 {
38  bindIndex_ = b;
39 }
unsigned short bindIndex_
Definition: SrcFinfo.h:70

+ Here is the caller graph for this function:

bool SrcFinfo::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 40 of file SrcFinfo.h.

41  {
42  return 0; // always fails
43  }
bool SrcFinfo::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 35 of file SrcFinfo.h.

36  {
37  return 0; // always fails
38  }

Member Data Documentation

const BindIndex SrcFinfo::BadBindIndex = 65535
static

This set of classes define Message Sources. Their main job is to supply a type-safe send operation, and to provide typechecking for it.

Definition at line 65 of file SrcFinfo.h.

Referenced by getBindIndex().

unsigned short SrcFinfo::bindIndex_
private

Index into the msgBinding_ vector.

Definition at line 70 of file SrcFinfo.h.

Referenced by addMsg(), getBindIndex(), registerFinfo(), and setBindIndex().


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