Protected Member Functions | |
virtual void | initialize () |
virtual void | handleMessage (cMessage *msg) |
Private Attributes | |
int | counter |
In this step you'll learn how to add input parameters to the simulation: we'll turn the "magic number" 10 into a parameter.
void Txc4::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
Reimplemented from cSimpleModule.
void Txc4::initialize | ( | ) | [protected, virtual] |
Reimplemented from cComponent.
00032 { 00033 // Initialize the counter with the "limit" module parameter, declared 00034 // in the NED file (tictoc4.ned). 00035 counter = par("limit"); 00036 00037 // we no longer depend on the name of the module to decide 00038 // whether to send an initial message 00039 if (par("sendMsgOnInit").boolValue() == true) 00040 { 00041 EV << "Sending initial message\n"; 00042 cMessage *msg = new cMessage("tictocMsg"); 00043 send(msg, "out"); 00044 } 00045 }
int Txc4::counter [private] |
Referenced by handleMessage(), and initialize().