Txc5 Class Reference

Inheritance diagram for Txc5:
cSimpleModule cModule cComponent cDefaultList cNoncopyableOwnedObject cOwnedObject noncopyable cNamedObject cObject

List of all members.

Protected Member Functions

virtual void initialize ()
virtual void handleMessage (cMessage *msg)

Private Attributes

int counter

Detailed Description

Same as Txc4.


Member Function Documentation

void Txc5::handleMessage ( cMessage msg  )  [protected, virtual]

Reimplemented from cSimpleModule.

00047 {
00048     counter--;
00049     if (counter==0)
00050     {
00051         EV << getName() << "'s counter reached zero, deleting message\n";
00052         delete msg;
00053     }
00054     else
00055     {
00056         EV << getName() << "'s counter is " << counter << ", sending back message\n";
00057         send(msg, "out");
00058     }
00059 }

void Txc5::initialize (  )  [protected, virtual]

Reimplemented from cComponent.

00031 {
00032     // Initialize the counter with the "limit" module parameter, declared
00033     // in the NED file (tictoc4.ned).
00034     counter = par("limit");
00035 
00036     // we no longer depend on the name of the module to decide
00037     // whether to send an initial message
00038     if (par("sendMsgOnInit").boolValue() == true)
00039     {
00040         EV << "Sending initial message\n";
00041         cMessage *msg = new cMessage("tictocMsg");
00042         send(msg, "out");
00043     }
00044 }


Member Data Documentation

int Txc5::counter [private]

Referenced by handleMessage(), and initialize().


The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:33 2014 for Tictoc Tutorial by  doxygen 1.6.3