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

Class generated from inet/linklayer/ethernet/EtherFrame.msg:69 by nedtool. More...

#include <EtherFrame_m.h>

Inheritance diagram for inet::EtherPhyFrame_Base:
inet::EtherTraffic inet::EtherPhyFrame

Public Member Functions

virtual ~EtherPhyFrame_Base ()
 
virtual EtherPhyFrame_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual bool getSrcMacFullDuplex () const
 
virtual void setSrcMacFullDuplex (bool srcMacFullDuplex)
 
- Public Member Functions inherited from inet::EtherTraffic
 EtherTraffic (const char *name=nullptr, short kind=0)
 
 EtherTraffic (const EtherTraffic &other)
 
virtual ~EtherTraffic ()
 
EtherTrafficoperator= (const EtherTraffic &other)
 

Protected Member Functions

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

Protected Attributes

bool srcMacFullDuplex
 

Private Member Functions

void copy (const EtherPhyFrame_Base &other)
 

Detailed Description

Class generated from inet/linklayer/ethernet/EtherFrame.msg:69 by nedtool.

//
// Represents an Ethernet PHY frame.
//
// Contains:
//  - preamble: not stored (only contributes to length)
//  - SFD: not stored (only contributes to length)
//  - encapsulated EtherFrame with padding and FCS
//
packet EtherPhyFrame extends EtherTraffic
{
    @customize(true);
    byteLength = PREAMBLE_BYTES + SFD_BYTES;
    bool srcMacFullDuplex;  // meta-info, for detecting model misconfiguration 
}

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

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

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

Register_Class(EtherPhyFrame)

Constructor & Destructor Documentation

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

Member Function Documentation

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

Reimplemented from inet::EtherTraffic.

Reimplemented in inet::EtherPhyFrame.

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

Reimplemented from inet::EtherTraffic.

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

Reimplemented from inet::EtherTraffic.

virtual void inet::EtherPhyFrame_Base::setSrcMacFullDuplex ( bool  srcMacFullDuplex)
virtual

Member Data Documentation

bool inet::EtherPhyFrame_Base::srcMacFullDuplex
protected

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