#include <Sink.h>
Protected Member Functions | |
virtual void | initialize () |
virtual void | handleMessage (cMessage *msg) |
virtual void | finish () |
Protected Attributes | |
int | numPackets |
long | numBits |
double | throughput |
double | packetPerSec |
void Sink::initialize | ( | ) | [protected, virtual] |
00025 { 00026 numPackets = 0; 00027 numBits = 0; 00028 throughput = 0; 00029 packetPerSec = 0; 00030 00031 WATCH(numPackets); 00032 WATCH(numBits); 00033 WATCH(throughput); 00034 WATCH(packetPerSec); 00035 }
void Sink::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
00038 { 00039 numPackets++; 00040 numBits += PK(msg)->getBitLength(); 00041 00042 throughput = numBits / simTime(); 00043 packetPerSec = numPackets / simTime(); 00044 00045 delete msg; 00046 }
void Sink::finish | ( | ) | [protected, virtual] |
00049 { 00050 recordScalar("numPackets", numPackets); 00051 recordScalar("numBits", numBits); 00052 recordScalar("throughput", throughput); 00053 recordScalar("packetPerSec", packetPerSec); 00054 }
int Sink::numPackets [protected] |
Referenced by finish(), handleMessage(), and initialize().
long Sink::numBits [protected] |
Referenced by finish(), handleMessage(), and initialize().
double Sink::throughput [protected] |
Referenced by finish(), handleMessage(), and initialize().
double Sink::packetPerSec [protected] |
Referenced by finish(), handleMessage(), and initialize().