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

Txc1 Class Reference

Inheritance diagram for Txc1:

cSimpleModule cModule cDefaultList cObject cPolymorphic List of all members.

Detailed Description

Derive the Txc1 class from cSimpleModule. In the Tictoc1 network, both the `tic' and `toc' modules are Txc1 objects, created by OMNeT++ at the beginning of the simulation.


Private Member Functions

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


Member Function Documentation

void Txc1::handleMessage (  cMessage *  msg  )  [private, virtual]
 

Reimplemented from cSimpleModule.

00050 {
00051     // The handleMessage() method is called whenever a message arrives
00052     // at the module. Here, we just send it to the other module, through
00053     // gate `out'. Because both `tic' and `toc' does the same, the message
00054     // will bounce between the two.
00055     send(msg, "out");
00056 }

void Txc1::initialize (   )  [private, virtual]
 

Reimplemented from cModule.

00034 {
00035     // Initialize is called at the beginning of the simulation.
00036     // To bootstrap the tic-toc-tic-toc process, one of the modules needs
00037     // to send the first message. Let this be `tic'.
00038 
00039     // Am I Tic or Toc?
00040     if (strcmp("tic", name()) == 0)
00041     {
00042         // create and send first message on gate "out". "tictocMsg" is an
00043         // arbitrary string which will be the name of the message object.
00044         cMessage *msg = new cMessage("tictocMsg");
00045         send(msg, "out");
00046     }
00047 }

Txc1::Module_Class_Members (  Txc1  ,
cSimpleModule  ,
0 
)  [private]
 


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