OMNeT++ Simulation Library
6.0.3
|
16 #ifndef __OMNETPP_CPACKET_H
17 #define __OMNETPP_CPACKET_H
57 FL_TXCHANNELSEEN = 16,
63 cPacket *encapsulatedPacket =
nullptr;
64 unsigned short shareCount = 0;
69 txid_t transmissionId = -1;
73 void copy(
const cPacket& packet);
77 void setDuration(
simtime_t d) {duration = d;}
78 void setRemainingDuration(
simtime_t d) {remainingDuration = d;}
79 void setTransmissionId(
txid_t id) {transmissionId = id;}
80 void setIsUpdate(
bool b) {setFlag(FL_ISUPDATE, b);}
81 void setTxChannelEncountered(
bool b) {setFlag(FL_TXCHANNELSEEN, b);}
82 void clearTxChannelEncountered() {flags &= ~FL_TXCHANNELSEEN;}
83 void setTxChannelEncountered() {flags |= FL_TXCHANNELSEEN;}
86 bool getTxChannelEncountered()
const {
return flags&FL_TXCHANNELSEEN;}
90 msgid_t getEncapsulationId()
const;
94 msgid_t getEncapsulationTreeId()
const;
96 cPacket *_getEncapMsg() {
return encapsulatedPacket; }
105 void _detachEncapMsg();
108 void _deleteEncapMsg();
111 int getShareCount()
const {
return shareCount;}
125 explicit cPacket(
const char *name=
nullptr,
short kind=0, int64_t bitLength=0);
151 virtual std::string str()
const override;
157 virtual void forEachChild(
cVisitor *v)
override;
164 virtual void parsimPack(
cCommBuffer *buffer)
const override;
171 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
176 virtual bool isPacket()
const override {
return true;}
182 virtual const char *getDisplayString()
const override;
192 virtual void setBitLength(int64_t l);
211 virtual void addBitLength(int64_t delta);
259 virtual void encapsulate(
cPacket *packet);
268 virtual cPacket *decapsulate();
277 virtual cPacket *getEncapsulatedPacket()
const;
285 virtual bool hasEncapsulatedPacket()
const;
txid_t getTransmissionId() const
Definition: cpacket.h:306
const typedef simtime_t & simtime_t_cref
Constant reference to a simtime_t.
Definition: simtime_t.h:48
simtime_t_cref getDuration() const
Definition: cpacket.h:322
int64_t msgid_t
Message ID. See cMessage::getId().
Definition: simkerneldefs.h:85
virtual bool isPacket() const override
Definition: cpacket.h:176
simtime_t_cref getRemainingDuration() const
Definition: cpacket.h:344
virtual void setBitError(bool e)
Definition: cpacket.h:235
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
virtual bool hasBitError() const
Definition: cpacket.h:240
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
void setByteLength(int64_t l)
Definition: cpacket.h:199
bool isZero() const
Definition: simtime.h:299
bool isReceptionStart() const
Definition: cpacket.h:350
void addByteLength(int64_t delta)
Definition: cpacket.h:219
int64_t txid_t
Transmission ID. See SendOptions::transmissionId(), cMessage::getTransmissionId().
Definition: simkerneldefs.h:92
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition: cmessage.h:95
bool isReceptionEnd() const
Definition: cpacket.h:355
virtual int64_t getBitLength() const
Definition: cpacket.h:224
A subclass of cMessage to represent packets, frames, datagrams, application messages,...
Definition: cpacket.h:52
int64_t getByteLength() const
Definition: cpacket.h:230
virtual cPacket * dup() const override
Definition: cpacket.h:145
bool isUpdate() const
Definition: cpacket.h:298
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41