#include <clmessage.h>
Inheritance diagram for ClMessage:
Public Member Functions | |
ClMessage (int verbosity, ClMessage_t type) | |
ClMessage (ClMessage *m) | |
ClMessage (int verbosity, ClMessage_t type, DestinationType dtype, int value) | |
virtual | ~ClMessage () |
DestinationType | getDestType () |
int | getDest () |
int | getSource () |
void | setSource (int src) |
void | setDest (int dst) |
virtual ClMessage * | copy () |
int | verbosity () |
ClMessage_t | type () |
ClDirection | direction () |
void | direction (ClDirection dir) |
unsigned int | uid () |
ClMessage (int verbosity, ClMessage_t type, DestinationType dtype, int source, int value) | |
Static Public Member Functions | |
static ClMessage_t | addClMessage () |
Protected Attributes | |
ClMessage_t | type_ |
DestinationType | destType_ |
int | source_ |
int | dest_ |
int | verbosity_ |
ClDirection | direction_ |
unsigned int | uid_ |
Static Protected Attributes | |
static ClMessage_t | nType_ = 0 |
Definition at line 128 of file clmessage.h.
ClMessage::ClMessage | ( | int | verbosity, | |
ClMessage_t | type | |||
) |
Broadcast ClMessage constructor.
This is the parent constructor that should be called by a class inheriting from ClMessage and implementing a broadcast message.
verbosity | define the level of verbosity of the cross-layer message | |
type | define the type of the cross-layer message (this parameter is given by the simulator during the initialization phase, i.e., it is the value returned by the addClMessage method) |
Definition at line 52 of file clmessage.cc.
References uid_.
ClMessage::ClMessage | ( | ClMessage * | m | ) |
Copy-by-reference constructor.
m | a cross-layer message thas has to initialize the new one |
Definition at line 84 of file clmessage.cc.
References dest_, destType_, source_, type_, uid_, and verbosity_.
ClMessage::ClMessage | ( | int | verbosity, | |
ClMessage_t | type, | |||
DestinationType | dtype, | |||
int | value | |||
) |
Standard ClMessage constructor.
This constructor allows settings all the relevant parameters of ClMessage, and therefore can be used to create all types of messages (unicast, broadcast, layercast).
verbosity | define the level of verbosity of the cross-layer message | |
type | define the type of the cross-layer message (this parameter is given by the simulator during the initialization phase, i.e., it is the value returned by the addClMessage method) | |
dtype | define the type of the destination (UNICAST or BROADCAST) | |
value | its intepretation is function of the dtype paramter:
|
Definition at line 73 of file clmessage.cc.
References uid_.
ClMessage::~ClMessage | ( | ) | [virtual] |
ClMessage destructor
Definition at line 94 of file clmessage.cc.
ClMessage::ClMessage | ( | int | verbosity, | |
ClMessage_t | type, | |||
DestinationType | dtype, | |||
int | source, | |||
int | value | |||
) |
verbosity | ||
type | ||
dtype | ||
source | ||
value |
Definition at line 62 of file clmessage.cc.
References PRINT_WARNING_DEPRECATED_FUNCTION, and uid_.
DestinationType ClMessage::getDestType | ( | ) |
Return the destination type of the cross layer message (i.e., UNICAST or BROADCAST)
Definition at line 99 of file clmessage.cc.
References destType_.
Referenced by NodeCore::crLayCommand(), VerboseClCmnTracer::format(), ClCommonTracer::format(), Module::sendAsyncClMsgDown(), Module::sendAsyncClMsgUp(), Module::sendSyncClMsgDown(), Module::sendSyncClMsgUp(), and NodeCore::synchronousCrLayCommand().
int ClMessage::getDest | ( | ) |
Return the destination of the cross layer message. According to its destination-type it is the id of the destination module/plugin in case of UNICAST messase, while it is the layer id or the broadcast address in case of BROADCAST message
Definition at line 105 of file clmessage.cc.
References dest_.
Referenced by NodeCore::crLayCommand(), VerboseClCmnTracer::format(), ClCommonTracer::format(), Module::sendAsyncClMsgDown(), Module::sendAsyncClMsgUp(), Module::sendSyncClMsgDown(), Module::sendSyncClMsgUp(), and NodeCore::synchronousCrLayCommand().
int ClMessage::getSource | ( | ) |
Return the source id of the cross layer message
Definition at line 140 of file clmessage.cc.
References source_.
Referenced by NodeCore::crLayCommand(), VerboseClCmnTracer::format(), ClCommonTracer::format(), MrclRouting::recvSyncClMsg(), IPModule::recvSyncClMsg(), and NodeCore::synchronousCrLayCommand().
void ClMessage::setSource | ( | int | src | ) |
Set the source id of the cross layer message
src | the source id of the cross layer message |
Definition at line 145 of file clmessage.cc.
References source_.
Referenced by RouteReachable::RouteReachable(), PlugIn::sendAsyncClMsg(), Module::sendAsyncClMsgDown(), Module::sendAsyncClMsgUp(), PlugIn::sendSyncClMsg(), Module::sendSyncClMsgDown(), and Module::sendSyncClMsgUp().
void ClMessage::setDest | ( | int | dst | ) |
Set the destination id of the cross layer message
src | the destination id of the cross layer message |
Definition at line 151 of file clmessage.cc.
References dest_.
Referenced by MLLModule::fillNetAddrTable(), MrclRouting::getConfiguration(), Module::sendDown(), Module::sendSynchronousDown(), Module::sendSynchronousUp(), and Module::sendUp().
ClMessage * ClMessage::copy | ( | ) | [virtual] |
Return a copy of the message
Reimplemented in ClMsgDiscovery, ClMsgPositionGetDist, IPClMsgReqAddr, IPClMsgSendAddr, ClMsgPhyOnOffSwitch, ClMsgPhyOnOffSwitchStatus, ClMsgPhy2MacEndTx, ClMsgPhy2MacStartRx, ClMsgPhy2MacCCA, ClMsgMac2PhyGetTxDuration, and MacClMsgGetAddr.
Definition at line 111 of file clmessage.cc.
Referenced by NodeCore::crLayCommand(), Module::sendAsyncClMsgDown(), and Module::sendAsyncClMsgUp().
int ClMessage::verbosity | ( | ) |
Return the verbosity of the cross layer message
Definition at line 120 of file clmessage.cc.
References verbosity_.
Referenced by ClSAP::handle(), ClSAP::sendClLayer(), SAP::sendDown(), ClSAP::sendModule(), ClSAP::sendSynchronousClLayer(), SAP::sendSynchronousDown(), ClSAP::sendSynchronousModule(), SAP::sendSynchronousUp(), and SAP::sendUp().
ClMessage_t ClMessage::type | ( | ) |
Return the type of the cross layer message (i.e., its own unique id returned from addClMessage method during the initialization phase)
Definition at line 125 of file clmessage.cc.
References type_.
Referenced by MLLModule::crLayCommand(), CbrModule::crLayCommand(), MMacModule::crLaySynchronousCommand(), MLLModule::recvAsyncClMsg(), MrclRouting::recvSyncClMsg(), PlugIn::recvSyncClMsg(), MPhy::recvSyncClMsg(), PositionDB::recvSyncClMsg(), MMac::recvSyncClMsg(), MMacModule::recvSyncClMsg(), and IPModule::recvSyncClMsg().
ClDirection ClMessage::direction | ( | ) |
Return the direction of the cross layer message, in detail:
Definition at line 130 of file clmessage.cc.
References direction_.
Referenced by VerboseClCmnTracer::format(), ClCommonTracer::format(), ClSAP::handle(), ClSAP::sendClLayer(), SAP::sendDown(), ClSAP::sendModule(), ClSAP::sendSynchronousClLayer(), SAP::sendSynchronousDown(), ClSAP::sendSynchronousModule(), SAP::sendSynchronousUp(), SAP::sendUp(), ConnectorTrace::trace(), and ConnectorTrace::traceSync().
void ClMessage::direction | ( | ClDirection | dir | ) |
Set the direction of the cross layer message
dir | the direction requested (i.e., TOMODULE or TONODECORE) |
Definition at line 135 of file clmessage.cc.
References direction_.
unsigned int ClMessage::uid | ( | ) |
Return the unique id of the cross layer message (each message generated has an integer id unique in the simulation)
Definition at line 157 of file clmessage.cc.
References uid_.
Referenced by VerboseClCmnTracer::format(), and ClCommonTracer::format().
ClMessage_t ClMessage::addClMessage | ( | ) | [static] |
Static method to add a new type of cross layer message during the initialization phase
Definition at line 41 of file clmessage.cc.
References nType_.
ClMessage_t ClMessage::nType_ = 0 [static, protected] |
Static variable used to generate the id of all the cross layer message used in the simulation
Definition at line 290 of file clmessage.h.
Referenced by addClMessage().
ClMessage_t ClMessage::type_ [protected] |
Define the type of the message (i.e., unique id returned from the addClMessage during the initialization phase)
Definition at line 294 of file clmessage.h.
Referenced by ClMessage(), and type().
DestinationType ClMessage::destType_ [protected] |
Define the destination type of the message (i.e., UNICAST or BROADCAST) to correctly codify the dest_ address
Definition at line 298 of file clmessage.h.
Referenced by ClMessage(), and getDestType().
int ClMessage::source_ [protected] |
Define the source id)
Definition at line 301 of file clmessage.h.
Referenced by ClMessage(), getSource(), and setSource().
int ClMessage::dest_ [protected] |
Define the destination id (it has to be codified according to destType_ attribute)
Definition at line 304 of file clmessage.h.
Referenced by ClMessage(), getDest(), and setDest().
int ClMessage::verbosity_ [protected] |
Define the verbosity of the message (i.e., the depht of tracing requested for this message)
Definition at line 307 of file clmessage.h.
Referenced by ClMessage(), and verbosity().
ClDirection ClMessage::direction_ [protected] |
Define the direction of the message (i.e., TOMODULE or TONODECORE)
Definition at line 310 of file clmessage.h.
Referenced by direction().
unsigned int ClMessage::uid_ [protected] |
Define the unique id of the message
Definition at line 313 of file clmessage.h.
Referenced by ClMessage(), and uid().