- Main Page
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# Txc1 Class Reference

Inheritance diagram for Txc1:

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.

## Protected Member Functions
virtual void | initialize ()
virtual void | handleMessage (cMessage *msg)

## Member Function Documentation

void Txc1::handleMessage | ( | cMessage * | msg | ) | `[protected, virtual]`

| 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 }

void Txc1::initialize | ( |  | ) | `[protected, virtual]`

| 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 }

The documentation for this class was generated from the following file:

- txc1.cc