#include <MsgElement.h>
Public Member Functions | |
MsgElement (Id id, const Cinfo *c, const string &name, unsigned int(*numMsg)(), char *(*lookupMsg)(unsigned int)) | |
~MsgElement () | |
Element * | copyElement (Id newParent, Id newId, unsigned int n, bool toGlobal) const |
unsigned int | numData () const |
Inherited virtual. Returns number of data entries. | |
unsigned int | numLocalData () const |
Inherited virtual. Returns number of data entries. | |
unsigned int | localDataStart () const |
Inherited virtual. Returns index of first data entry on node. | |
unsigned int | numField (unsigned int rawIndex) const |
Inherited virtual. Returns number of field entries for specified data. | |
unsigned int | totNumLocalField () const |
unsigned int | getNode (unsigned int dataIndex) const |
Inherited virtual. Just returns current node. | |
unsigned int | startDataIndex (unsigned int node) const |
Inherited virtual. As this is a global we always return zero. | |
unsigned int | rawIndex (unsigned int dataIndex) const |
Inherited virtual. Just returns index. | |
bool | hasFields () const |
bool | isGlobal () const |
True if there is a copy of every dataEntry on all nodes. | |
unsigned int | getNumOnNode (unsigned int node) const |
char * | data (unsigned int rawIndex, unsigned int fieldIndex=0) const |
void | resize (unsigned int newNumData) |
void | resizeField (unsigned int rawIndex, unsigned int newNumField) |
void | zombieSwap (const Cinfo *newCinfo) |
This is a specialized Element class for managing Msg data. Basically it just gives a wrapper for the vectors managed by each of the Msg classes.
MsgElement::~MsgElement | ( | ) | [inline] |
Virtual Destructor. Nothing to do here.
Element* MsgElement::copyElement | ( | Id | newParent, | |
Id | newId, | |||
unsigned int | n, | |||
bool | toGlobal | |||
) | const [inline, virtual] |
Virtual copier. Doesn't do anything. The copy happens at the lower level, involving the Msg classes and the MsgElement just manages them.
Implements Element.
char* MsgElement::data | ( | unsigned int | rawIndex, | |
unsigned int | fieldIndex = 0 | |||
) | const [inline, virtual] |
Inherited virtual. Looks up specified field data entry. On regular objects just returns the data entry specified by the rawIndex. On FieldElements like synapses, does a second lookup on the field index. Note that the index is NOT a DataIndex: it is instead the raw index of the data on the current node. Index is also NOT the character offset, but the index to the data array in whatever type the data may be.
The DataIndex has to be filtered through the nodeMap to find a) if the entry is here, and b) what its raw index is.
Returns 0 if either index is out of range.
Implements Element.
unsigned int MsgElement::getNode | ( | unsigned int | dataIndex | ) | const [inline, virtual] |
Inherited virtual. Just returns current node.
Implements Element.
References Shell::myNode().
unsigned int MsgElement::getNumOnNode | ( | unsigned int | node | ) | const [inline, virtual] |
Returns number of data (or, if relevant, field) entries on specified node.
Implements Element.
bool MsgElement::hasFields | ( | ) | const [inline, virtual] |
Inherited virtual True if this is a FieldElement having an array of fields on each data entry. Clearly not true for the MsgElement.
Implements Element.
bool MsgElement::isGlobal | ( | ) | const [inline, virtual] |
True if there is a copy of every dataEntry on all nodes.
Implements Element.
unsigned int MsgElement::localDataStart | ( | ) | const [inline, virtual] |
Inherited virtual. Returns index of first data entry on node.
Implements Element.
unsigned int MsgElement::numData | ( | ) | const [inline, virtual] |
Inherited virtual. Returns number of data entries.
Implements Element.
unsigned int MsgElement::numField | ( | unsigned int | rawIndex | ) | const [inline, virtual] |
Inherited virtual. Returns number of field entries for specified data.
Implements Element.
unsigned int MsgElement::numLocalData | ( | ) | const [inline, virtual] |
Inherited virtual. Returns number of data entries.
Implements Element.
unsigned int MsgElement::rawIndex | ( | unsigned int | dataIndex | ) | const [inline, virtual] |
Inherited virtual. Just returns index.
Implements Element.
void MsgElement::resize | ( | unsigned int | newNumData | ) | [inline, virtual] |
Inherited virtual Changes the number of entries in the data. Doesn't do anything for the MsgElement.
Implements Element.
void MsgElement::resizeField | ( | unsigned int | rawIndex, | |
unsigned int | newNumField | |||
) | [inline, virtual] |
Inherited virtual. Changes the number of fields on the specified data entry. Doesn't do anything for the MsgElement.
Implements Element.
unsigned int MsgElement::startDataIndex | ( | unsigned int | node | ) | const [inline, virtual] |
Inherited virtual. As this is a global we always return zero.
Implements Element.
unsigned int MsgElement::totNumLocalField | ( | ) | const [inline, virtual] |
Returns number of field entries on local node. If this is not a FieldElement, returns numLocalData, assuming 1 field per data.
Implements Element.
void MsgElement::zombieSwap | ( | const Cinfo * | newCinfo | ) | [inline, virtual] |
Virtual func. The parent does the data swap part, so here it is just the Cinfo we replace.
Reimplemented from Element.
References Element::replaceCinfo().