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

#include <SignalSource.h>

Inheritance diagram for inet::SignalSource:

Public Member Functions

 SignalSource ()
 

Protected Member Functions

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

Protected Attributes

simtime_t startTime
 
simtime_t endTime
 
simsignal_t signal = -1
 

Constructor & Destructor Documentation

inet::SignalSource::SignalSource ( )
inline
32 {}

Member Function Documentation

void inet::SignalSource::finish ( )
overrideprotected
45 {
46 }
void inet::SignalSource::handleMessage ( cMessage *  msg)
overrideprotected
33 {
34  if (endTime < 0 || simTime() < endTime) {
35  double value = par("value");
36  emit(signal, value);
37  scheduleAt(simTime()+par("interval"), msg);
38  }
39  else {
40  delete msg;
41  }
42 }
simsignal_t signal
Definition: SignalSource.h:29
simtime_t endTime
Definition: SignalSource.h:28
void inet::SignalSource::initialize ( )
overrideprotected
25 {
26  startTime = par("startTime");
27  endTime = par("endTime");
28  signal = registerSignal(par("signalName"));
29  scheduleAt(startTime, new cMessage("timer"));
30 }
simtime_t startTime
Definition: SignalSource.h:28
simsignal_t signal
Definition: SignalSource.h:29
simtime_t endTime
Definition: SignalSource.h:28

Member Data Documentation

simtime_t inet::SignalSource::endTime
protected

Referenced by handleMessage(), and initialize().

simsignal_t inet::SignalSource::signal = -1
protected

Referenced by handleMessage(), and initialize().

simtime_t inet::SignalSource::startTime
protected

Referenced by initialize().


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