Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

Txc4 Class Reference

Inheritance diagram for Txc4:

cSimpleModule cModule cDefaultList cObject cPolymorphic List of all members.

Detailed Description

In this step you'll learn how to add input parameters to the simulation: we'll turn the "magic number" 10 into a parameter.


Public Member Functions

 Module_Class_Members (Txc4, cSimpleModule, 0)
virtual void initialize ()
virtual void handleMessage (cMessage *msg)

Protected Attributes

int counter


Member Function Documentation

void Txc4::handleMessage (  cMessage *  msg  )  [virtual]
 

Reimplemented from cSimpleModule.

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

void Txc4::initialize (   )  [virtual]
 

Reimplemented from cModule.

00034 {
00035     // Initialize the counter with the "limit" module parameter, declared
00036     // in the NED file (tictoc4.ned).
00037     counter = par("limit");
00038 
00039     if (strcmp("tic", name()) == 0)
00040     {
00041         ev << "Sending initial message\n";
00042         cMessage *msg = new cMessage("tictocMsg");
00043         send(msg, "out");
00044     }
00045 }

Txc4::Module_Class_Members (  Txc4  ,
cSimpleModule  ,
0 
) 
 


Member Data Documentation

int Txc4::counter [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Apr 1 12:25:42 2005 for Tictoc Tutorial by  doxygen 1.3.9.1