RINASim
October 2016
Documentation of framework for OMNeT++
|
Go to the source code of this file.
Classes | |
class | SDU_Base |
Macros | |
#define | MSGC_VERSION 0x0500 |
Typedefs | |
typedef std::vector< cPacket * > | mUserDataType |
Enumerations | |
enum | FragmentType { SDU_FRAG_FIRST = 0x01, SDU_FRAG_MIDDLE = 0x00, SDU_FRAG_LAST = 0x02 } |
typedef std::vector<cPacket*> mUserDataType |
enum FragmentType |
Enum generated from Common/SDU.msg:33
by nedtool.
enum FragmentType {SDU_FRAG_FIRST = 0x01; SDU_FRAG_MIDDLE = 0x00; SDU_FRAG_LAST = 0x02;}
Class generated from Common/SDU.msg:39
by nedtool.
packet SDU extends Data { (true); unsigned int size = 0; unsigned int offset = 0;
unsigned int fSize = 0; unsigned int fOffset = 0;
unsigned int seqNum = 0; unsigned int fSeqNum = 0;
int fragType) = 0; schedulingPriority = -1; byteLength = 10; }
SDU_Base is only useful if it gets subclassed, and SDU is derived from it. The minimum code to be written for SDU is the following:
class SDU : public SDU_Base { private: void copy(const SDU& other) { ... }
public: SDU(const char *name=nullptr, int kind=0) : SDU_Base(name,kind) {} SDU(const SDU& other) : SDU_Base(other) {copy(other);} SDU& operator=(const SDU& other) {if (this==&other) return *this; SDU_Base::operator=(other); copy(other); return *this;} virtual SDU *dup() const {return new SDU(*this);} // ADD CODE HERE to redefine and implement pure virtual functions from SDU_Base };
The following should go into a .cc (.cpp) file:
Register_Class(SDU);
Enumerator | |
---|---|
SDU_FRAG_FIRST | |
SDU_FRAG_MIDDLE | |
SDU_FRAG_LAST |