Sink Class Reference

List of all members.

Detailed Description

A module that just deletes every packet it receives, and collects basic statistics (packet count, bit count, packet rate, bit rate).


Protected Member Functions

virtual void initialize ()
virtual void handleMessage (cMessage *msg)
virtual void finish ()

Protected Attributes

int numPackets
long numBits
double throughput
double packetPerSec


Member Function Documentation

void Sink::finish (  )  [protected, virtual]

00067 {
00068     recordScalar("numPackets", numPackets);
00069     recordScalar("numBits", numBits);
00070     recordScalar("throughput", throughput);
00071     recordScalar("packetPerSec", packetPerSec);
00072 }

void Sink::handleMessage ( cMessage *  msg  )  [protected, virtual]

00056 {
00057     numPackets++;
00058     numBits += msg->length();
00059 
00060     throughput = numBits / simTime();
00061     packetPerSec = numPackets / simTime();
00062 
00063     delete msg;
00064 }

void Sink::initialize (  )  [protected, virtual]

00043 {
00044     numPackets = 0;
00045     numBits = 0;
00046     throughput = 0;
00047     packetPerSec = 0;
00048 
00049     WATCH(numPackets);
00050     WATCH(numBits);
00051     WATCH(throughput);
00052     WATCH(packetPerSec);
00053 }


Member Data Documentation

long Sink::numBits [protected]

int Sink::numPackets [protected]

double Sink::packetPerSec [protected]

double Sink::throughput [protected]


The documentation for this class was generated from the following file:
Generated on Wed Apr 4 13:20:24 2007 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.7