16 #ifndef __OMNETPP_CCHANNEL_H 17 #define __OMNETPP_CCHANNEL_H 19 #include "ccomponent.h" 20 #include "ccomponenttype.h" 22 #include "ctimestampedvalue.h" 38 int nedConnectionElementId;
42 void setSourceGate(
cGate *g) {srcGate=g;}
45 void setNedConnectionElementId(
int id) {nedConnectionElementId = id;}
46 int getNedConnectionElementId() {
return nedConnectionElementId;}
50 virtual bool initializeChannel(
int stage);
53 virtual void finalizeParameters()
override;
56 virtual void callRefreshDisplay()
override;
107 virtual bool boolValue(
simsignal_t signalID)
const override {error();
return false;}
108 virtual long longValue(
simsignal_t signalID)
const override {error();
return 0;}
109 virtual unsigned long unsignedLongValue(
simsignal_t signalID)
const override {error();
return 0;}
110 virtual double doubleValue(
simsignal_t signalID)
const override {error();
return 0;}
111 virtual SimTime simtimeValue(
simsignal_t signalID)
const override {error();
return timestamp;}
112 virtual const char *stringValue(
simsignal_t signalID)
const override {error();
return nullptr;}
122 explicit cChannel(
const char *name=
nullptr);
137 virtual std::string str()
const override;
142 virtual void parsimPack(
cCommBuffer *buffer)
const override;
147 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
160 virtual void callInitialize()
override;
166 virtual bool callInitialize(
int stage)
override;
171 virtual void callFinish()
override;
188 virtual cModule *getParentModule()
const override;
199 virtual cProperties *getProperties()
const override;
212 virtual bool isTransmissionChannel()
const = 0;
253 virtual double getNominalDatarate()
const = 0;
287 virtual simtime_t getTransmissionFinishTime()
const = 0;
296 virtual bool isBusy()
const;
316 virtual void forceTransmissionFinishTime(
simtime_t t) = 0;
381 virtual bool isBusy()
const override {
return false;}
virtual simtime_t calculateDuration(cMessage *msg) const override
Definition: cchannel.h:371
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition: cmessage.h:95
simtime_t delay
Propagation delay.
Definition: cchannel.h:67
Common base for module and channel classes.
Definition: ccomponent.h:48
Represents a module gate.
Definition: cgate.h:63
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
virtual ComponentKind getComponentKind() const override
Definition: cchannel.h:179
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
virtual bool isBusy() const override
Definition: cchannel.h:381
Channel with zero propagation delay, zero transmission delay (infinite datarate), and always enabled...
Definition: cchannel.h:327
Allows returning multiple values from the processMessage() method.
Definition: cchannel.h:64
cIdealChannel(const char *name=nullptr)
Definition: cchannel.h:337
cChannelType * getChannelType() const
Definition: cchannel.h:193
virtual cObject * objectValue(simsignal_t signalID) const override
Definition: cchannel.h:96
virtual simtime_t getTransmissionFinishTime() const override
Definition: cchannel.h:376
Signal value that accompanies the "messageSent" signal.
Definition: cchannel.h:75
virtual double getNominalDatarate() const override
Definition: cchannel.h:361
virtual cGate * getSourceGate() const
Definition: cchannel.h:204
cMessage * getMessage() const
Definition: cchannel.h:100
#define SIMTIME_ZERO
Zero simulation time.
Definition: simtime_t.h:73
This class represents modules in the simulation.
Definition: cmodule.h:47
virtual SimsignalType getValueType(simsignal_t signalID) const override
Definition: cchannel.h:93
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
virtual simtime_t_cref getTimestamp(simsignal_t signalID) const override
Definition: cchannel.h:90
MessageSentSignalValue(simtime_t_cref t, cMessage *m, result_t *r)
Definition: cchannel.h:85
virtual bool isTransmissionChannel() const override
Definition: cchannel.h:366
Interface for emitting timestamped values as signals, primarily for result recording.
Definition: ctimestampedvalue.h:35
Definition: cabstracthistogram.h:21
virtual void processMessage(cMessage *msg, simtime_t t, result_t &result) override
Definition: cchannel.h:356
A collection of properties (cProperty).
Definition: cproperties.h:34
SimsignalType
Signal data types.
Definition: clistener.h:44
Abstract base class for creating a channel of a given type.
Definition: ccomponenttype.h:312
virtual void forceTransmissionFinishTime(simtime_t t) override
Definition: cchannel.h:386
int simsignal_t
Signal handle.
Definition: clistener.h:24
virtual ~cIdealChannel()
Definition: cchannel.h:342
Base class for channels.
Definition: cchannel.h:34
simtime_t duration
Transmission duration.
Definition: cchannel.h:68
result_t * getChannelResult() const
Definition: cchannel.h:103
bool discard
Whether the channel has lost the message.
Definition: cchannel.h:69