Msg Class Reference

#include <Msg.h>

Inheritance diagram for Msg:
Inheritance graph
[legend]
Collaboration diagram for Msg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Msg (ObjId mid, Element *e1, Element *e2)
 Constructor.
virtual ~Msg ()
 Destructor.
virtual Eref firstTgt (const Eref &src) const =0
virtual void sources (vector< vector< Eref > > &v) const =0
virtual void targets (vector< vector< Eref > > &v) const =0
Elemente1 () const
Elemente2 () const
Id getE1 () const
Id getE2 () const
vector< string > getSrcFieldsOnE1 () const
vector< string > getDestFieldsOnE2 () const
vector< string > getSrcFieldsOnE2 () const
vector< string > getDestFieldsOnE1 () const
ObjId mid () const
virtual ObjId findOtherEnd (ObjId) const =0
ObjId getAdjacent (ObjId) const
virtual Msgcopy (Id origSrc, Id newSrc, Id newTgt, FuncId fid, unsigned int b, unsigned int n) const =0
bool isForward (const Element *src) const

Static Public Member Functions

static void deleteMsg (ObjId mid)
static const MsggetMsg (ObjId m)
static const CinfoinitCinfo ()
static unsigned int initMsgManagers ()
static void clearAllMsgs ()
static const MsglastMsg ()
static bool isLastTrump ()
 True when MOOSE has been terminated and is being cleaned up.

Protected Attributes

ObjId mid_
Elemente1_
 Index of this Msg on the msg_ vector.
Elemente2_
 Element 1 attached to Msg.

Static Protected Attributes

static Id msgManagerId_
 Element 2 attached to Msg.
static bool lastTrump_ = false
 Flag to indicate termination of program.

Detailed Description

Manages data flow between two elements. Is always many-to-many, with assorted variants.


Constructor & Destructor Documentation

Msg::Msg ( ObjId  mid,
Element e1,
Element e2 
)

Constructor.

References Element::addMsg(), and mid_.

Here is the call graph for this function:

Msg::~Msg (  )  [virtual]

Destructor.

References Element::dropMsg(), e1_, e2_, lastTrump_, and mid_.

Here is the call graph for this function:


Member Function Documentation

void Msg::clearAllMsgs (  )  [static]
virtual Msg* Msg::copy ( Id  origSrc,
Id  newSrc,
Id  newTgt,
FuncId  fid,
unsigned int  b,
unsigned int  n 
) const [pure virtual]

Make a copy of this Msg. The original msg was on origSrc. The new Msg should go from newSrc to newTgt, and have the function fid, on bindIndex b. The copy may have to be a higher-order Msg type to handle arrays if n > 1. Note that n is not the number of msgs, but the multiplier by which numData will be scaled.

Implemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

Referenced by innerCopyMsgs().

void Msg::deleteMsg ( ObjId  mid  )  [static]

Deletes a message identified by its mid.

References getMsg().

Referenced by Element::clearBinding(), Neutral::destroy(), Element::dropAllMsgsFromSrc(), Shell::innerMove(), and Element::~Element().

Here is the call graph for this function:

Element* Msg::e1 (  )  const [inline]
Element* Msg::e2 (  )  const [inline]
virtual ObjId Msg::findOtherEnd ( ObjId   )  const [pure virtual]

Find the other end of this Msg. In most cases this is a straightforward return of e1 or e2, plus perhaps a DataId. But in some complex msgs we need to figure out DataIds that match with the target. In many-to-one cases we just return the first entry. If no Element match, return ObjId( Id(), DataId::bad() ) If Element e matches but not DataId, return ObjId( e.id(), DataId::bad() )

Implemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

Referenced by getAdjacent(), Neutral::isDescendant(), Neutral::parent(), Neutral::path(), and testAssortedMsg().

virtual Eref Msg::firstTgt ( const Eref src  )  const [pure virtual]

Obtain the first target Eref for the specified Src Eref It is really meant only to work with messages with a single target ObjId for each given src, typically OneToOne.

Implemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

ObjId Msg::getAdjacent ( ObjId  obj  )  const

Wrapper for findOtherEnd - to expose it as a LookupFinfo.

References findOtherEnd().

Referenced by initCinfo().

Here is the call graph for this function:

vector< string > Msg::getDestFieldsOnE1 (  )  const

Return names of DestFinfos for messages going from e2 to e1.

References Element::cinfo(), Cinfo::destFinfoName(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), and mid_.

Referenced by initCinfo(), and testMsgSrcDestFields().

Here is the call graph for this function:

vector< string > Msg::getDestFieldsOnE2 (  )  const

Return names of DestFinfos for messages going from e1 to e2.

References Element::cinfo(), Cinfo::destFinfoName(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), and mid_.

Referenced by initCinfo(), and testMsgSrcDestFields().

Here is the call graph for this function:

Id Msg::getE1 (  )  const

Return the first element id

References e1_, and Element::id().

Referenced by initCinfo().

Here is the call graph for this function:

Id Msg::getE2 (  )  const

Return the second element id

References e2_, and Element::id().

Referenced by initCinfo().

Here is the call graph for this function:

const Msg * Msg::getMsg ( ObjId  m  )  [static]
vector< string > Msg::getSrcFieldsOnE1 (  )  const

Return names of SrcFinfos for messages going from e1 to e2.

References Element::cinfo(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, and Cinfo::srcFinfoName().

Referenced by initCinfo(), and testMsgSrcDestFields().

Here is the call graph for this function:

vector< string > Msg::getSrcFieldsOnE2 (  )  const

Return names of SrcFinfos for messages going from e2 to e1.

References Element::cinfo(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, and Cinfo::srcFinfoName().

Referenced by initCinfo(), and testMsgSrcDestFields().

Here is the call graph for this function:

const Cinfo * Msg::initCinfo (  )  [static]

Set up the Msg to be accessed like an Element Although the bare Msg class is never seen, we will use it as a base class and set up some common fields here.

Reimplemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

References e1(), e2(), getAdjacent(), getDestFieldsOnE1(), getDestFieldsOnE2(), getE1(), getE2(), getSrcFieldsOnE1(), getSrcFieldsOnE2(), and Neutral::initCinfo().

Referenced by SparseMsg::initCinfo(), SingleMsg::initCinfo(), OneToOneMsg::initCinfo(), OneToOneDataIndexMsg::initCinfo(), OneToAllMsg::initCinfo(), and DiagonalMsg::initCinfo().

Here is the call graph for this function:

unsigned int Msg::initMsgManagers (  )  [static]
bool Msg::isForward ( const Element src  )  const [inline]

Checks if the message is going forward. Now merged into Msg::addToQ for most cases.

References e1_.

bool Msg::isLastTrump (  )  [static]

True when MOOSE has been terminated and is being cleaned up.

References lastTrump_.

Referenced by Clock::~Clock().

const Msg * Msg::lastMsg (  )  [static]

Returns the most recently constructed msg.

Static utility function, provided so that the shell function doing message creation can retrieve the most recent message made.

ObjId Msg::mid (  )  const [inline]
virtual void Msg::sources ( vector< vector< Eref > > &  v  )  const [pure virtual]

Return all the sources of e2 from e1, that is, all the msgs coming into specified entries on e2 from e1.

ALLDATA used when the sources include all data entries on a source. Indexing is v[dataId in range e2.numData][src list]

Implemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

virtual void Msg::targets ( vector< vector< Eref > > &  v  )  const [pure virtual]

Return all the targets of e1 on e2, that is, all the msgs going from specified entries on e1 to e2. ALLDATA used when the targets include all data entries on a target. Indexing is v[dataId in range e1.numData][tgt list]

Implemented in DiagonalMsg, OneToAllMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and SparseMsg.

Referenced by testSendMsg().


Member Data Documentation

Element* Msg::e1_ [protected]
Element* Msg::e2_ [protected]
bool Msg::lastTrump_ = false [static, protected]

Flag to indicate termination of program.

Referenced by clearAllMsgs(), isLastTrump(), and ~Msg().

ObjId Msg::mid_ [protected]
Id Msg::msgManagerId_ [static, protected]

Element 2 attached to Msg.

Keeps track of the Id of the parent of all the MsgManager Elms.

Referenced by initMsgManagers().


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

Generated on 1 Jul 2015 for MOOSE by  doxygen 1.6.1