INET Framework for OMNeT++/OMNEST
inet::tcp::Sack_Base Class Reference

Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:122 by nedtool. More...

#include <TCPSegment_m.h>

Inheritance diagram for inet::tcp::Sack_Base:
inet::tcp::SackItem inet::tcp::Sack

Public Member Functions

virtual ~Sack_Base ()
 
virtual Sack_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
- Public Member Functions inherited from inet::tcp::SackItem
 SackItem ()
 
 SackItem (const SackItem &other)
 
virtual ~SackItem ()
 
SackItemoperator= (const SackItem &other)
 
virtual unsigned int getStart () const
 
virtual void setStart (unsigned int start)
 
virtual unsigned int getEnd () const
 
virtual void setEnd (unsigned int end)
 

Protected Member Functions

bool operator== (const Sack_Base &)
 
 Sack_Base ()
 
 Sack_Base (const Sack_Base &other)
 
Sack_Baseoperator= (const Sack_Base &other)
 
- Protected Member Functions inherited from inet::tcp::SackItem
bool operator== (const SackItem &)
 

Private Member Functions

void copy (const Sack_Base &other)
 

Additional Inherited Members

- Protected Attributes inherited from inet::tcp::SackItem
unsigned int start
 
unsigned int end
 

Detailed Description

Class generated from inet/transportlayer/tcp_common/TCPSegment.msg:122 by nedtool.

class Sack extends SackItem
{
    @customize(true);
}

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

class INET_API Sack : public Sack_Base
{
  private:
    void copy(const Sack& other) { ... }
  public:
    Sack() : Sack_Base() {}
    Sack(const Sack& other) : Sack_Base(other) {copy(other);}
    Sack& operator=(const Sack& other) {if (this==&other) return *this; Sack_Base::operator=(other); copy(other); return *this;}
    virtual Sack *dup() const override {return new Sack(*this);}
    // ADD CODE HERE to redefine and implement pure virtual functions from Sack_Base
};

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

Register_Class(Sack)

Constructor & Destructor Documentation

inet::tcp::Sack_Base::Sack_Base ( )
protected
inet::tcp::Sack_Base::Sack_Base ( const Sack_Base other)
protected
virtual inet::tcp::Sack_Base::~Sack_Base ( )
virtual

Member Function Documentation

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

Reimplemented from inet::tcp::SackItem.

Reimplemented in inet::tcp::Sack.

217 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class Sack");}
Sack_Base& inet::tcp::Sack_Base::operator= ( const Sack_Base other)
protected
bool inet::tcp::Sack_Base::operator== ( const Sack_Base )
protected
virtual void inet::tcp::Sack_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual

Reimplemented from inet::tcp::SackItem.

virtual void inet::tcp::Sack_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual

Reimplemented from inet::tcp::SackItem.


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