INET Framework for OMNeT++/OMNEST
inet::RawPacket_Base Class Reference

Class generated from inet/common/RawPacket.msg:31 by nedtool. More...

#include <RawPacket_m.h>

Inheritance diagram for inet::RawPacket_Base:
inet::RawPacket

Public Member Functions

virtual ~RawPacket_Base ()
 
virtual RawPacket_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual ByteArraygetByteArray ()
 
virtual const ByteArraygetByteArray () const
 
virtual void setByteArray (const ByteArray &byteArray)
 

Protected Member Functions

bool operator== (const RawPacket_Base &)
 
 RawPacket_Base (const char *name=nullptr, short kind=0)
 
 RawPacket_Base (const RawPacket_Base &other)
 
RawPacket_Baseoperator= (const RawPacket_Base &other)
 

Protected Attributes

ByteArray byteArray
 

Private Member Functions

void copy (const RawPacket_Base &other)
 

Detailed Description

Class generated from inet/common/RawPacket.msg:31 by nedtool.

//
// Packet that carries raw network bytes.
// Used with emulation-related features.
//
packet RawPacket
{
    @customize(true);
    ByteArray byteArray;
}

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

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

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

Register_Class(RawPacket)

Constructor & Destructor Documentation

inet::RawPacket_Base::RawPacket_Base ( const char *  name = nullptr,
short  kind = 0 
)
protected
inet::RawPacket_Base::RawPacket_Base ( const RawPacket_Base other)
protected
virtual inet::RawPacket_Base::~RawPacket_Base ( )
virtual

Member Function Documentation

void inet::RawPacket_Base::copy ( const RawPacket_Base other)
private
virtual RawPacket_Base* inet::RawPacket_Base::dup ( ) const
inlineoverridevirtual

Reimplemented in inet::RawPacket.

96 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class RawPacket");}
virtual const ByteArray& inet::RawPacket_Base::getByteArray ( ) const
inlinevirtual

Referenced by getByteArray().

102 {return const_cast<RawPacket_Base*>(this)->getByteArray();}
virtual ByteArray & getByteArray()
RawPacket_Base(const char *name=nullptr, short kind=0)
RawPacket_Base& inet::RawPacket_Base::operator= ( const RawPacket_Base other)
protected
bool inet::RawPacket_Base::operator== ( const RawPacket_Base )
protected
virtual void inet::RawPacket_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual
virtual void inet::RawPacket_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual
virtual void inet::RawPacket_Base::setByteArray ( const ByteArray byteArray)
virtual

Member Data Documentation


The documentation for this class was generated from the following file: