Inheritance diagram for Txc1:

Protected Member Functions | |
| virtual void | initialize () |
| virtual void | handleMessage (cMessage *msg) |
|
|
Reimplemented from cSimpleModule. 00048 {
00049 // The handleMessage() method is called whenever a message arrives
00050 // at the module. Here, we just send it to the other module, through
00051 // gate `out'. Because both `tic' and `toc' does the same, the message
00052 // will bounce between the two.
00053 send(msg, "out");
00054 }
|
|
|
Reimplemented from cModule. 00032 {
00033 // Initialize is called at the beginning of the simulation.
00034 // To bootstrap the tic-toc-tic-toc process, one of the modules needs
00035 // to send the first message. Let this be `tic'.
00036
00037 // Am I Tic or Toc?
00038 if (strcmp("tic", name()) == 0)
00039 {
00040 // create and send first message on gate "out". "tictocMsg" is an
00041 // arbitrary string which will be the name of the message object.
00042 cMessage *msg = new cMessage("tictocMsg");
00043 send(msg, "out");
00044 }
00045 }
|
1.4.1