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

- Class List
- Class Hierarchy
- Class Members

# Txc4 Class Reference

Inheritance diagram for Txc4:

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.

## Protected Member Functions
virtual void | initialize ()
virtual void | handleMessage (cMessage *msg)
## Private Attributes
int | counter

## Member Function Documentation

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

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

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

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

## Member Data Documentation

int Txc4::counter`[private]`

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

- txc4.cc