INET Framework for OMNeT++/OMNEST
inet::PIMHello_Base Class Referenceabstract

Class generated from inet/routing/pim/PIMPacket.msg:125 by nedtool. More...

#include <PIMPacket_m.h>

Inheritance diagram for inet::PIMHello_Base:
inet::PIMPacket inet::PIMHello

Public Member Functions

virtual ~PIMHello_Base ()
 
virtual PIMHello_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual void setOptionsArraySize (unsigned int size)=0
 
virtual unsigned int getOptionsArraySize () const =0
 
virtual HelloOptionPtrgetOptions (unsigned int k)=0
 
virtual const HelloOptionPtrgetOptions (unsigned int k) const
 
virtual void setOptions (unsigned int k, const HelloOptionPtr &options)=0
 
- Public Member Functions inherited from inet::PIMPacket
 PIMPacket (const char *name=nullptr, short kind=0)
 
 PIMPacket (const PIMPacket &other)
 
virtual ~PIMPacket ()
 
PIMPacketoperator= (const PIMPacket &other)
 
virtual short getVersion () const
 
virtual void setVersion (short version)
 
virtual short getType () const
 
virtual void setType (short type)
 

Protected Member Functions

bool operator== (const PIMHello_Base &)
 
 PIMHello_Base (const char *name=nullptr, short kind=0)
 
 PIMHello_Base (const PIMHello_Base &other)
 
PIMHello_Baseoperator= (const PIMHello_Base &other)
 
- Protected Member Functions inherited from inet::PIMPacket
bool operator== (const PIMPacket &)
 

Private Member Functions

void copy (const PIMHello_Base &other)
 

Additional Inherited Members

- Protected Attributes inherited from inet::PIMPacket
short version
 
short type
 

Detailed Description

Class generated from inet/routing/pim/PIMPacket.msg:125 by nedtool.

// Hello message
// DM, SM
packet PIMHello extends PIMPacket
{
    @customize(true);
    type = Hello;
    abstract HelloOptionPtr options[];
}

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

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

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

Register_Class(PIMHello)

Constructor & Destructor Documentation

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

Member Function Documentation

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

Reimplemented from inet::PIMPacket.

Reimplemented in inet::PIMHello.

480 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class PIMHello");}
virtual HelloOptionPtr& inet::PIMHello_Base::getOptions ( unsigned int  k)
pure virtual

Implemented in inet::PIMHello.

virtual const HelloOptionPtr& inet::PIMHello_Base::getOptions ( unsigned int  k) const
inlinevirtual

Reimplemented in inet::PIMHello.

Referenced by getOptions().

488 {return const_cast<PIMHello_Base*>(this)->getOptions(k);}
virtual HelloOptionPtr & getOptions(unsigned int k)=0
PIMHello_Base(const char *name=nullptr, short kind=0)
const double k
Definition: QAM16Modulation.cc:24
virtual unsigned int inet::PIMHello_Base::getOptionsArraySize ( ) const
pure virtual

Implemented in inet::PIMHello.

PIMHello_Base& inet::PIMHello_Base::operator= ( const PIMHello_Base other)
protected
bool inet::PIMHello_Base::operator== ( const PIMHello_Base )
protected
virtual void inet::PIMHello_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual

Reimplemented from inet::PIMPacket.

Referenced by inet::PIMHello::parsimPack().

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

Reimplemented from inet::PIMPacket.

Referenced by inet::PIMHello::parsimUnpack().

virtual void inet::PIMHello_Base::setOptions ( unsigned int  k,
const HelloOptionPtr options 
)
pure virtual

Implemented in inet::PIMHello.

virtual void inet::PIMHello_Base::setOptionsArraySize ( unsigned int  size)
pure virtual

Implemented in inet::PIMHello.


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