INET Framework for OMNeT++/OMNEST
|
Class generated from inet/transportlayer/udp/UDPPacket.msg:33
by nedtool.
More...
#include <UDPPacket_m.h>
Public Member Functions | |
virtual | ~UDPPacket_Base () |
virtual UDPPacket_Base * | dup () const override |
virtual void | parsimPack (omnetpp::cCommBuffer *b) const override |
virtual void | parsimUnpack (omnetpp::cCommBuffer *b) override |
virtual unsigned short | getSrcPort () const |
virtual void | setSrcPort (unsigned short srcPort) |
virtual unsigned short | getDestPort () const |
virtual void | setDestPort (unsigned short destPort) |
virtual int | getTotalLengthField () const |
virtual void | setTotalLengthField (int totalLengthField) |
Protected Member Functions | |
bool | operator== (const UDPPacket_Base &) |
UDPPacket_Base (const char *name=nullptr, short kind=0) | |
UDPPacket_Base (const UDPPacket_Base &other) | |
UDPPacket_Base & | operator= (const UDPPacket_Base &other) |
Protected Attributes | |
unsigned short | srcPort |
unsigned short | destPort |
int | totalLengthField |
Private Member Functions | |
void | copy (const UDPPacket_Base &other) |
Class generated from inet/transportlayer/udp/UDPPacket.msg:33
by nedtool.
// // Represents an UDP packet, to be used with the ~UDP module. // packet UDPPacket { @customize(true); unsigned short srcPort; unsigned short destPort; byteLength = UDP_HEADER_BYTES; int totalLengthField = -1; // -1 means: getTotalLengthField() uses getByteLength() }
UDPPacket_Base is only useful if it gets subclassed, and UDPPacket is derived from it. The minimum code to be written for UDPPacket is the following:
class INET_API UDPPacket : public UDPPacket_Base { private: void copy(const UDPPacket& other) { ... }
public: UDPPacket(const char *name=nullptr, short kind=0) : UDPPacket_Base(name,kind) {} UDPPacket(const UDPPacket& other) : UDPPacket_Base(other) {copy(other);} UDPPacket& operator=(const UDPPacket& other) {if (this==&other) return *this; UDPPacket_Base::operator=(other); copy(other); return *this;} virtual UDPPacket *dup() const override {return new UDPPacket(*this);} // ADD CODE HERE to redefine and implement pure virtual functions from UDPPacket_Base };
The following should go into a .cc (.cpp) file:
Register_Class(UDPPacket)
|
protected |
|
protected |
|
virtual |
|
private |
|
inlineoverridevirtual |
Reimplemented in inet::UDPPacket.
|
virtual |
Referenced by inet::UDPPacket::getDestinationPort().
|
virtual |
Referenced by inet::UDPPacket::getSourcePort().
|
virtual |
Reimplemented in inet::UDPPacket.
|
protected |
Referenced by inet::UDPPacket::operator=().
|
protected |
|
overridevirtual |
|
overridevirtual |
|
virtual |
Referenced by inet::UDPPacket::setDestinationPort().
|
virtual |
Referenced by inet::UDPPacket::setSourcePort().
|
virtual |
|
protected |
|
protected |
|
protected |