RINASim  October 2016
Documentation of framework for OMNeT++
Data_m.h File Reference
#include <omnetpp.h>

Go to the source code of this file.

Classes

class  Data_Base
 

Macros

#define MSGC_VERSION   0x0500
 

Enumerations

enum  DataType { DATA_SDU_COMPLETE = 1, DATA_FIRST_FRAG = 2, DATA_MIDDLE_FRAG = 4, DATA_LAST_FRAG = 8 }
 

Macro Definition Documentation

#define MSGC_VERSION   0x0500

Definition at line 11 of file Data_m.h.

Enumeration Type Documentation

enum DataType

Enum generated from DIF/Delimiting/Data.msg:27 by nedtool.

enum DataType
{

DATA_SDU_COMPLETE = 1;
DATA_FIRST_FRAG = 2;
DATA_MIDDLE_FRAG = 4;
DATA_LAST_FRAG = 8;

}

Class generated from DIF/Delimiting/Data.msg:35 by nedtool.

packet Data
{
    (true);
    int dataType) = DATA_SDU_COMPLETE;
    int64 encapMsgLength;
//    unsigned int startByte;
//    unsigned int endByte;
//    unsigned int sduSeqNum;
//    byteLength = 10;
}

Data_Base is only useful if it gets subclassed, and Data is derived from it. The minimum code to be written for Data is the following:

class Data : public Data_Base
{
  private:
    void copy(const Data& other) { ... }
  public:
    Data(const char *name=nullptr, int kind=0) : Data_Base(name,kind) {}
    Data(const Data& other) : Data_Base(other) {copy(other);}
    Data& operator=(const Data& other) {if (this==&other) return *this; Data_Base::operator=(other); copy(other); return *this;}
    virtual Data *dup() const {return new Data(*this);}
    // ADD CODE HERE to redefine and implement pure virtual functions from Data_Base
};

The following should go into a .cc (.cpp) file:

Register_Class(Data);
Enumerator
DATA_SDU_COMPLETE 
DATA_FIRST_FRAG 
DATA_MIDDLE_FRAG 
DATA_LAST_FRAG 

Definition at line 31 of file Data_m.h.