#include <OneToAllMsg.h>
Public Member Functions | |
OneToAllMsg (Eref e1, Element *e2, unsigned int msgIndex) | |
~OneToAllMsg () | |
Eref | firstTgt (const Eref &src) const |
void | sources (vector< vector< Eref > > &v) const |
void | targets (vector< vector< Eref > > &v) const |
Id | managerId () const |
ObjId | findOtherEnd (ObjId end) const |
Msg * | copy (Id origSrc, Id newSrc, Id newTgt, FuncId fid, unsigned int b, unsigned int n) const |
DataId | getI1 () const |
Return the first DataId. | |
void | setI1 (DataId i1) |
Static Public Member Functions | |
static unsigned int | numMsg () |
Assign the first DataId. | |
static char * | lookupMsg (unsigned int index) |
Static function for Msg access. | |
static const Cinfo * | initCinfo () |
Setup function for Element-style access to Msg fields. | |
Friends | |
unsigned int | Msg::initMsgManagers () |
void | testGetMsgs () |
Manages projection from a single entry in e1 to all array entries in e2.
OneToAllMsg::~OneToAllMsg | ( | ) |
References ObjId::dataIndex, and Msg::mid_.
Msg * OneToAllMsg::copy | ( | Id | origSrc, | |
Id | newSrc, | |||
Id | newTgt, | |||
FuncId | fid, | |||
unsigned int | b, | |||
unsigned int | n | |||
) | const [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.
Implements Msg.
References Element::addMsgAndFunc(), Msg::e1(), Msg::e2(), Id::element(), Msg::mid(), and OneToAllMsg().
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() )
Implements Msg.
References BADINDEX, ObjId::dataIndex, Msg::e1(), Msg::e2(), and ObjId::element().
DataId OneToAllMsg::getI1 | ( | ) | const |
const Cinfo * OneToAllMsg::initCinfo | ( | ) | [static] |
Setup function for Element-style access to Msg fields.
Reimplemented from Msg.
References getI1(), Msg::initCinfo(), and setI1().
Referenced by Msg::initMsgManagers().
char * OneToAllMsg::lookupMsg | ( | unsigned int | index | ) | [static] |
Static function for Msg access.
Referenced by Msg::clearAllMsgs(), and Msg::initMsgManagers().
Id OneToAllMsg::managerId | ( | ) | const |
unsigned int OneToAllMsg::numMsg | ( | ) | [static] |
Assign the first DataId.
Static function for Msg access.
Msg lookup functions
Referenced by Msg::clearAllMsgs(), and Msg::initMsgManagers().
void OneToAllMsg::setI1 | ( | DataId | i1 | ) |
References Msg::e1(), Msg::e2(), and Element::markRewired().
Referenced by initCinfo().
void OneToAllMsg::sources | ( | vector< vector< Eref > > & | v | ) | const [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]
Implements Msg.
void OneToAllMsg::targets | ( | vector< vector< Eref > > & | v | ) | const [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]
Implements Msg.
unsigned int Msg::initMsgManagers | ( | ) | [friend] |
void testGetMsgs | ( | ) | [friend] |
Tests message inspection fields on Neutral. These include msgOut: all outgoing Msgs, reported as ObjId of their managers msgIn: all incoming Msgs, reported as ObjId of their managers msgSrc: All source Ids of messages coming into specified field msgDest: All dest Ids of messages going out of specified field