#include <cmessage.h>
Inheritance diagram for cMessage::
Miscellaneous. | |
virtual const char* | displayString () const |
int | cmpbydelivtime (cObject *one, cObject *other) |
int | cmpbypriority (cObject *one, cObject *other) |
unsigned long | totalMessageCount () |
unsigned long | liveMessageCount () |
void | resetMessageCounters () |
Public Methods | |
Constructors, destructor, assignment | |
cMessage (const cMessage &msg) | |
cMessage (const char *name=NULL, int k=0, long len=1, int pri=0, bool err=false) | |
virtual | ~cMessage () |
cMessage& | operator= (const cMessage &msg) |
Redefined cObject functions. | |
virtual const char* | className () const |
virtual cObject* | dup () const |
virtual void | info (char *buf) |
virtual const char* | inspectorFactoryName () const |
virtual void | forEach (ForeachFunc do_fn) |
virtual void | writeContents (ostream &os) |
virtual int | netPack () |
virtual int | netUnpack () |
Message attributes. | |
void | setKind (int k) |
void | setPriority (int p) |
void | setLength (long l) |
void | addLength (long l) |
void | setBitError (bool err) |
void | setTimestamp () |
void | setTimestamp (simtime_t t) |
void | setContextPointer (void *p) |
int | kind () const |
int | priority () const |
long | length () const |
bool | hasBitError () const |
simtime_t | timestamp () const |
unsigned long | insertOrder () const |
void* | contextPointer () const |
Parameter list. | |
cArray& | parList () |
cPar& | addPar (const char *s) |
cPar& | addPar (cPar *p) |
cPar& | addPar (cPar &p) |
cPar& | par (int n) |
cPar& | par (const char *s) |
int | findPar (const char *s) const |
bool | hasPar (const char *s) const |
Message encapsulation. | |
void | encapsulate (cMessage *msg) |
cMessage* | decapsulate () |
cMessage* | encapsulatedMsg () const |
Sending/arrival information. | |
bool | isSelfMessage () const |
bool | isScheduled () const |
cGate* | senderGate () const |
cGate* | arrivalGate () const |
int | senderModuleId () const |
int | senderGateId () const |
int | arrivalModuleId () const |
int | arrivalGateId () const |
simtime_t | creationTime () const |
simtime_t | sendingTime () const |
simtime_t | arrivalTime () const |
bool | arrivedOn (int g) const |
bool | arrivedOn (const char *s, int g=0) |
After being sent through a channel, cMessage also remembers the sending and delivery times and its source module. cMessage holds a cArray which means that a cMessage can be attached any number of objects. These objects will typically be of cPar type, but other types are also possible.
|
Copy constructor. |
|
Constructor. |
|
Destructor. |
|
Change message length by the given value. The value may be negative, but a negative resulting message length is an error. Useful for modeling encapsulation/decapsulation. (See also encapsulate() and decapsulate().) |
|
Add a parameter to the message's parameter list. DEPRECATED. |
|
Add a parameter to the message's parameter list. Convenience function. |
|
Add a parameter to the message's parameter list. Convenience function. |
|
Returns pointers to the gate from which the message was sent and on which gate it arrived. A NULL pointer is returned for new (unsent) messages and messages sent via scheduleAt(). |
|
Returns index of gate the message arrived on in the sender module or -1 if the message hasn't sent/scheduled yet. |
|
Returns receiver module's index in the module vector or -1 if the message hasn't been sent/scheduled yet. |
|
Returns time when the message has arrived or 0 if the message hasn't been sent/scheduled yet. |
|
Return true if the message has arrived through the gate given with its name and index (if multiple gate). |
|
Return true if the message has arrived through gate g. |
|
Returns pointer to a string containing the class name, "cMessage". Reimplemented from cObject. Reimplemented in cPacket. |
|
Static function that compares two messages by their delivery times, then by their priorities. Usable as cQeueue CompareFunc. |
|
Static function that compares two messages by their priority. It can be used to sort messages in a priority queue. Usable as cQeueue CompareFunc. |
|
Returns the context pointer. |
|
Returns time when the message was created. |
|
Decapsulates a message from the message object. The length of the message will be decreased accordingly, except if it was zero. If the length would become negative, an error occurs. |
|
Override to define a display string for the message. Display string affects message appearance in Tkenv. This default implementation returns "". |
|
Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject. Reimplemented in cPacket. |
|
Encapsulates msg in the message. msg->length() will be added to the length of the message. |
|
Returns a pointer to the encapsulated message, or NULL. |
|
Returns the index of the parameter with the given name in the message's parameter list, or -1 if it could not be found. Convenience function. |
|
Call the passed function for each contained object. See cObject for more details. Reimplemented from cObject. |
|
Returns true if bit error flag is set, false otherwise. |
|
Check if a parameter exists. |
|
Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cObject. Reimplemented in cPacket. |
|
FIXME: INTERNAL: Used by cMessageHeap. |
|
Returns the name of the inspector factory class associated with this class. See cObject for more details. Reimplemented from cObject. Reimplemented in cPacket. |
|
Return true if message is among future events. |
|
Return true if message was posted by scheduleAt(). |
|
Returns message kind. |
|
Returns message length. |
|
Returns the total number of messages that currently exist in the simulation. May be useful for detecting memory leaks caused by forgetting to delete messages. |
|
Serializes the object into a PVM or MPI send buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject. Reimplemented in cPacket. |
|
Deserializes the object from a PVM or MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cObject. Reimplemented in cPacket. |
|
Assignment operator. Duplication and the assignment operator work all right with cMessage. The name member doesn't get copied; see cObject's operator=() for more details. |
|
Returns the object with the given name in the message's parameter list, converting it to a cPar. Convenience function. |
|
Returns the nth object in the message's parameter list, converting it to a cPar. Convenience function. |
|
Returns the cArray member of the message which holds the parameters and other attached objects. Parameters can be inserted, retrieved, looked up or deleted through cArray's member functions. |
|
Returns message priority. |
|
Reset counters used by totalMessageCount() and liveMessageCount(). |
|
Returns pointers to the gate from which the message was sent and on which gate it arrived. A NULL pointer is returned for new (unsent) messages and messages sent via scheduleAt(). |
|
Returns index of gate sent through in the sender module or -1 if the message hasn't been sent/scheduled yet. |
|
Returns sender module's index in the module vector or -1 if the message hasn't been sent/scheduled yet. |
|
Returns time when the message was sent/scheduled or 0 if the message hasn't been sent yet. |
|
Set bit error flag. |
|
Set context pointer. |
|
Sets message kind. The message kind member is not used by OMNeT++, it can be used freely by the user. |
|
Sets message length. When the message is sent through a channel, message length affects transmission delay and the probability of setting the bit error flag. |
|
Sets message priority. The priority member is used when the simulator inserts messages in the message queue (FES) to order messages with identical arrival time values. |
|
Directly sets the message's time stamp. |
|
Sets the message's time stamp to the current simulation time. |
|
Returns the message's time stamp. |
|
Returns the total number of messages created so far during the current simulation run. May be useful for debugging, profiling, etc. |
|
Writes textual information about this object to the stream. See cObject for more details. Reimplemented from cObject. |