MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Msg.h>
Public Member Functions | |
virtual Msg * | copy (Id origSrc, Id newSrc, Id newTgt, FuncId fid, unsigned int b, unsigned int n) const =0 |
Element * | e1 () const |
Element * | e2 () const |
virtual ObjId | findOtherEnd (ObjId) const =0 |
virtual Eref | firstTgt (const Eref &src) const =0 |
ObjId | getAdjacent (ObjId) const |
vector< string > | getDestFieldsOnE1 () const |
vector< string > | getDestFieldsOnE2 () const |
Id | getE1 () const |
Id | getE2 () const |
vector< string > | getSrcFieldsOnE1 () const |
vector< string > | getSrcFieldsOnE2 () const |
bool | isForward (const Element *src) const |
ObjId | mid () const |
Msg (ObjId mid, Element *e1, Element *e2) | |
Constructor. More... | |
virtual void | sources (vector< vector< Eref > > &v) const =0 |
virtual void | targets (vector< vector< Eref > > &v) const =0 |
virtual | ~Msg () |
Destructor. More... | |
Static Public Member Functions | |
static void | clearAllMsgs () |
static void | deleteMsg (ObjId mid) |
static const Msg * | getMsg (ObjId m) |
static const Cinfo * | initCinfo () |
static unsigned int | initMsgManagers () |
static bool | isLastTrump () |
True when MOOSE has been terminated and is being cleaned up. More... | |
static const Msg * | lastMsg () |
Protected Attributes | |
Element * | e1_ |
Index of this Msg on the msg_ vector. More... | |
Element * | e2_ |
Element 1 attached to Msg. More... | |
ObjId | mid_ |
Static Protected Attributes | |
static bool | lastTrump_ = false |
Flag to indicate termination of program. More... | |
static Id | msgManagerId_ |
Element 2 attached to Msg. More... | |
Static Private Attributes | |
static const Msg * | lastMsg_ = 0 |
Manages data flow between two elements. Is always many-to-many, with assorted variants.
Constructor.
Definition at line 30 of file Msg.cpp.
References Element::addMsg(), lastMsg_, and mid_.
|
virtual |
Destructor.
Definition at line 38 of file Msg.cpp.
References Element::dropMsg(), e1_, e2_, lastTrump_, and mid_.
|
static |
Clears out the Msg data stored in each Msg subtype.
Definition at line 286 of file Msg.cpp.
References lastTrump_, OneToOneMsg::lookupMsg(), OneToAllMsg::lookupMsg(), SingleMsg::lookupMsg(), DiagonalMsg::lookupMsg(), SparseMsg::lookupMsg(), OneToOneMsg::numMsg(), OneToAllMsg::numMsg(), SingleMsg::numMsg(), DiagonalMsg::numMsg(), and SparseMsg::numMsg().
Referenced by finalize(), and main().
|
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 SparseMsg, DiagonalMsg, SingleMsg, OneToOneDataIndexMsg, OneToOneMsg, and OneToAllMsg.
Referenced by innerCopyMsgs().
|
static |
Deletes a message identified by its mid.
Definition at line 52 of file Msg.cpp.
References getMsg().
Referenced by Element::clearBinding(), HSolve::deleteIncomingMessages(), Neutral::destroy(), Element::dropAllMsgsFromSrc(), Shell::dropClockMsgs(), Shell::innerMove(), HSolveActive::readSynapses(), and Element::~Element().
|
inline |
Return the first element
Definition at line 61 of file Msg.h.
References e1_.
Referenced by SharedFinfo::addMsg(), OneToAllMsg::copy(), OneToOneDataIndexMsg::copy(), OneToOneMsg::copy(), SingleMsg::copy(), DiagonalMsg::copy(), SparseMsg::copy(), Element::dropAllMsgsFromSrc(), Element::findCaller(), OneToAllMsg::findOtherEnd(), OneToOneDataIndexMsg::findOtherEnd(), OneToOneMsg::findOtherEnd(), SingleMsg::findOtherEnd(), DiagonalMsg::findOtherEnd(), SparseMsg::findOtherEnd(), Element::getInputMsgs(), Element::getInputs(), Element::getInputsWithTgtIndex(), Element::getMsgSourceAndSender(), Element::getMsgTargetAndFunctions(), Element::getOutputs(), initCinfo(), innerCopyMsgs(), SparseMsg::pairFill(), putFuncsInOrder(), Element::putOffNodeTargetsInDigest(), Element::putTargetsInDigest(), SparseMsg::randomConnect(), OneToAllMsg::setI1(), SingleMsg::setI1(), SingleMsg::setI2(), DiagonalMsg::setStride(), SingleMsg::setTargetField(), Element::showMsg(), SparseMsg::transpose(), and SparseMsg::updateAfterFill().
|
inline |
Return the second element
Definition at line 68 of file Msg.h.
References e2_.
Referenced by SharedFinfo::addMsg(), Neutral::child(), OneToAllMsg::copy(), OneToOneDataIndexMsg::copy(), OneToOneMsg::copy(), SingleMsg::copy(), DiagonalMsg::copy(), SparseMsg::copy(), Element::dropAllMsgsFromSrc(), Element::findCaller(), OneToAllMsg::findOtherEnd(), OneToOneDataIndexMsg::findOtherEnd(), OneToOneMsg::findOtherEnd(), SingleMsg::findOtherEnd(), DiagonalMsg::findOtherEnd(), SparseMsg::findOtherEnd(), Neutral::getIncomingMsgs(), Element::getInputMsgs(), Element::getInputs(), Element::getInputsWithTgtIndex(), Element::getMsgSourceAndSender(), Element::getMsgTargetAndFunctions(), Element::getOutputs(), getReactantVols(), initCinfo(), innerCopyMsgs(), SparseMsg::pairFill(), putFuncsInOrder(), Element::putOffNodeTargetsInDigest(), Element::putTargetsInDigest(), SparseMsg::randomConnect(), OneToAllMsg::setI1(), SingleMsg::setI1(), SingleMsg::setI2(), DiagonalMsg::setStride(), Element::showMsg(), SparseMsg::transpose(), and SparseMsg::updateAfterFill().
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 SparseMsg, DiagonalMsg, SingleMsg, OneToOneDataIndexMsg, OneToOneMsg, and OneToAllMsg.
Referenced by Neutral::child(), HSolve::deleteIncomingMessages(), getAdjacent(), Neutral::isDescendant(), Neutral::parent(), Neutral::path(), and testAssortedMsg().
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 SparseMsg, DiagonalMsg, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and OneToAllMsg.
Referenced by Element::getInputsWithTgtIndex().
Wrapper for findOtherEnd - to expose it as a LookupFinfo.
Definition at line 156 of file Msg.cpp.
References findOtherEnd().
Referenced by initCinfo().
vector< string > Msg::getDestFieldsOnE1 | ( | ) | const |
Return names of DestFinfos for messages going from e2 to e1.
Definition at line 137 of file Msg.cpp.
References Element::cinfo(), Cinfo::destFinfoName(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, and name.
Referenced by initCinfo(), and testMsgSrcDestFields().
vector< string > Msg::getDestFieldsOnE2 | ( | ) | const |
Return names of DestFinfos for messages going from e1 to e2.
Definition at line 99 of file Msg.cpp.
References Element::cinfo(), Cinfo::destFinfoName(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, and name.
Referenced by initCinfo(), and testMsgSrcDestFields().
Id Msg::getE1 | ( | ) | const |
Return the first element id
Definition at line 67 of file Msg.cpp.
References e1_, and Element::id().
Referenced by initCinfo().
Id Msg::getE2 | ( | ) | const |
Return the second element id
Definition at line 75 of file Msg.cpp.
References e2_, and Element::id().
Referenced by Neutral::child(), and initCinfo().
Looks up the message .
Definition at line 59 of file Msg.cpp.
References ObjId::data().
Referenced by SharedFinfo::addMsg(), Neutral::child(), Neutral::children(), HSolve::deleteIncomingMessages(), deleteMsg(), Element::dropAllMsgsFromSrc(), Element::findCaller(), Neutral::getIncomingMsgs(), Element::getInputMsgs(), Element::getInputs(), Element::getInputsWithTgtIndex(), Element::getMsgSourceAndSender(), Element::getMsgTargetAndFunctions(), Element::getOutputs(), getReactantVols(), innerCopyMsgs(), Neutral::isDescendant(), Neutral::parent(), Neutral::path(), putFuncsInOrder(), Element::putOffNodeTargetsInDigest(), Element::putTargetsInDigest(), Element::showMsg(), and testAssortedMsg().
vector< string > Msg::getSrcFieldsOnE1 | ( | ) | const |
Return names of SrcFinfos for messages going from e1 to e2.
Definition at line 80 of file Msg.cpp.
References Element::cinfo(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, name, and Cinfo::srcFinfoName().
Referenced by initCinfo(), and testMsgSrcDestFields().
vector< string > Msg::getSrcFieldsOnE2 | ( | ) | const |
Return names of SrcFinfos for messages going from e2 to e1.
Definition at line 118 of file Msg.cpp.
References Element::cinfo(), e1_, e2_, Element::getFieldsOfOutgoingMsg(), Element::getName(), mid_, name, and Cinfo::srcFinfoName().
Referenced by initCinfo(), and testMsgSrcDestFields().
|
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.
Definition at line 165 of file Msg.cpp.
References e1(), e2(), getAdjacent(), getDestFieldsOnE1(), getDestFieldsOnE2(), getE1(), getE2(), getSrcFieldsOnE1(), getSrcFieldsOnE2(), Neutral::initCinfo(), and msgCinfo.
Referenced by OneToOneDataIndexMsg::initCinfo(), OneToOneMsg::initCinfo(), OneToAllMsg::initCinfo(), SingleMsg::initCinfo(), DiagonalMsg::initCinfo(), and SparseMsg::initCinfo().
|
static |
Sets up the Element managers for each of the Msg classes
Definition at line 236 of file Msg.cpp.
References Shell::adopt(), OneToOneMsg::initCinfo(), OneToOneDataIndexMsg::initCinfo(), OneToAllMsg::initCinfo(), SingleMsg::initCinfo(), DiagonalMsg::initCinfo(), SparseMsg::initCinfo(), Neutral::initCinfo(), OneToOneMsg::lookupMsg(), OneToOneDataIndexMsg::lookupMsg(), OneToAllMsg::lookupMsg(), SingleMsg::lookupMsg(), DiagonalMsg::lookupMsg(), SparseMsg::lookupMsg(), OneToOneDataIndexMsg::managerId_, OneToOneMsg::managerId_, OneToAllMsg::managerId_, SingleMsg::managerId_, DiagonalMsg::managerId_, SparseMsg::managerId_, msgManagerId_, Id::nextId(), OneToOneDataIndexMsg::numMsg(), OneToOneMsg::numMsg(), OneToAllMsg::numMsg(), SingleMsg::numMsg(), DiagonalMsg::numMsg(), and SparseMsg::numMsg().
Referenced by init().
|
inline |
|
static |
True when MOOSE has been terminated and is being cleaned up.
Definition at line 320 of file Msg.cpp.
References lastTrump_.
Referenced by Clock::~Clock().
|
static |
|
inline |
Definition at line 106 of file Msg.h.
References mid_.
Referenced by addClockMsg(), Shell::adopt(), OneToAllMsg::copy(), OneToOneDataIndexMsg::copy(), OneToOneMsg::copy(), SingleMsg::copy(), DiagonalMsg::copy(), SparseMsg::copy(), Shell::doAddMsg(), Neutral::getIncomingMsgs(), Shell::innerMove(), FieldElementFinfoBase::postCreationFunc(), testCreateMsg(), testFibonacci(), testMsgField(), testMsgSrcDestFields(), testSendMsg(), testSendSpike(), testSharedMsg(), and testSparseMsg().
|
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, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and OneToAllMsg.
Referenced by Element::getMsgTargetAndFunctions(), and Element::putTargetsInDigest().
|
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, OneToOneDataIndexMsg, OneToOneMsg, SingleMsg, and OneToAllMsg.
Referenced by Neutral::children(), Element::getMsgTargetAndFunctions(), Element::putTargetsInDigest(), and testSendMsg().
|
protected |
Index of this Msg on the msg_ vector.
Definition at line 180 of file Msg.h.
Referenced by e1(), OneToAllMsg::firstTgt(), SingleMsg::firstTgt(), OneToOneMsg::firstTgt(), OneToOneDataIndexMsg::firstTgt(), DiagonalMsg::firstTgt(), SparseMsg::firstTgt(), getDestFieldsOnE1(), getDestFieldsOnE2(), getE1(), getSrcFieldsOnE1(), getSrcFieldsOnE2(), isForward(), OneToAllMsg::sources(), SingleMsg::sources(), OneToOneDataIndexMsg::sources(), OneToOneMsg::sources(), DiagonalMsg::sources(), SparseMsg::sources(), OneToAllMsg::targets(), SingleMsg::targets(), OneToOneMsg::targets(), OneToOneDataIndexMsg::targets(), DiagonalMsg::targets(), SparseMsg::targets(), and ~Msg().
|
protected |
Definition at line 181 of file Msg.h.
Referenced by e2(), OneToAllMsg::firstTgt(), SingleMsg::firstTgt(), OneToOneMsg::firstTgt(), OneToOneDataIndexMsg::firstTgt(), DiagonalMsg::firstTgt(), SparseMsg::firstTgt(), getDestFieldsOnE1(), getDestFieldsOnE2(), getE2(), getSrcFieldsOnE1(), getSrcFieldsOnE2(), SparseMsg::randomConnect(), OneToAllMsg::sources(), SingleMsg::sources(), OneToOneMsg::sources(), OneToOneDataIndexMsg::sources(), DiagonalMsg::sources(), SparseMsg::sources(), OneToAllMsg::targets(), SingleMsg::targets(), OneToOneMsg::targets(), OneToOneDataIndexMsg::targets(), DiagonalMsg::targets(), SparseMsg::targets(), SparseMsg::updateAfterFill(), and ~Msg().
|
staticprivate |
|
staticprotected |
Flag to indicate termination of program.
Definition at line 189 of file Msg.h.
Referenced by clearAllMsgs(), isLastTrump(), and ~Msg().
|
protected |
Definition at line 178 of file Msg.h.
Referenced by getDestFieldsOnE1(), getDestFieldsOnE2(), getSrcFieldsOnE1(), getSrcFieldsOnE2(), mid(), Msg(), DiagonalMsg::~DiagonalMsg(), ~Msg(), OneToAllMsg::~OneToAllMsg(), OneToOneDataIndexMsg::~OneToOneDataIndexMsg(), OneToOneMsg::~OneToOneMsg(), SingleMsg::~SingleMsg(), and SparseMsg::~SparseMsg().
|
staticprotected |