INET Framework for OMNeT++/OMNEST
inet::Delayer Class Reference

Delayer module. More...

#include <Delayer.h>

Inheritance diagram for inet::Delayer:

Public Member Functions

 Delayer ()
 

Protected Member Functions

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

Protected Attributes

cPar * delayPar
 

Static Protected Attributes

static simsignal_t rcvdPkSignal = registerSignal("rcvdPk")
 
static simsignal_t sentPkSignal = registerSignal("sentPk")
 
static simsignal_t delaySignal = registerSignal("delay")
 

Detailed Description

Delayer module.

Constructor & Destructor Documentation

inet::Delayer::Delayer ( )
inline
33 { delayPar = nullptr; }
cPar * delayPar
Definition: Delayer.h:39

Member Function Documentation

void inet::Delayer::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
36 {
37  if (msg->isSelfMessage()) {
38  emit(sentPkSignal, msg);
39  send(msg, "out");
40  }
41  else {
42  emit(rcvdPkSignal, msg);
43 
44  simtime_t delay = delayPar->doubleValue();
45  emit(delaySignal, delay);
46  scheduleAt(simTime() + delay, msg);
47  }
48 }
static simsignal_t delaySignal
Definition: Delayer.h:43
static simsignal_t sentPkSignal
Definition: Delayer.h:42
static simsignal_t rcvdPkSignal
Definition: Delayer.h:41
cPar * delayPar
Definition: Delayer.h:39
void inet::Delayer::initialize ( )
overrideprotectedvirtual
31 {
32  delayPar = &par("delay");
33 }
cPar * delayPar
Definition: Delayer.h:39

Member Data Documentation

cPar* inet::Delayer::delayPar
protected

Referenced by handleMessage(), and initialize().

simsignal_t inet::Delayer::delaySignal = registerSignal("delay")
staticprotected

Referenced by handleMessage().

simsignal_t inet::Delayer::rcvdPkSignal = registerSignal("rcvdPk")
staticprotected

Referenced by handleMessage().

simsignal_t inet::Delayer::sentPkSignal = registerSignal("sentPk")
staticprotected

Referenced by handleMessage().


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