INET Framework for OMNeT++/OMNEST
inet::rtp::RTPPacket_Base Class Referenceabstract

Class generated from inet/transportlayer/rtp/RTPPacket.msg:40 by nedtool. More...

#include <RTPPacket_m.h>

Inheritance diagram for inet::rtp::RTPPacket_Base:
inet::rtp::RTPPacket

Public Member Functions

virtual ~RTPPacket_Base ()
 
virtual RTPPacket_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual uint8_t getVersion () const
 
virtual void setVersion (uint8_t version)
 
virtual bool getPadding () const
 
virtual void setPadding (bool padding)
 
virtual bool getExtension () const
 
virtual void setExtension (bool extension)
 
virtual bool getMarker () const
 
virtual void setMarker (bool marker)
 
virtual int8_t getPayloadType () const
 
virtual void setPayloadType (int8_t payloadType)
 
virtual uint16_t getSequenceNumber () const
 
virtual void setSequenceNumber (uint16_t sequenceNumber)
 
virtual uint32_t getTimeStamp () const
 
virtual void setTimeStamp (uint32_t timeStamp)
 
virtual uint32_t getSsrc () const
 
virtual void setSsrc (uint32_t ssrc)
 
virtual void setCsrcArraySize (unsigned int size)
 
virtual unsigned int getCsrcArraySize () const
 
virtual uint32_t getCsrc (unsigned int k) const
 
virtual void setCsrc (unsigned int k, uint32_t csrc)
 
virtual int getHeaderLength () const =0
 
virtual void setHeaderLength (int headerLength)=0
 
virtual int getPayloadLength () const =0
 
virtual void setPayloadLength (int payloadLength)=0
 

Protected Member Functions

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

Protected Attributes

uint8_t version
 
bool padding
 
bool extension
 
bool marker
 
int8_t payloadType
 
uint16_t sequenceNumber
 
uint32_t timeStamp
 
uint32_t ssrc
 
uint32_t * csrc
 
unsigned int csrc_arraysize
 

Private Member Functions

void copy (const RTPPacket_Base &other)
 

Detailed Description

Class generated from inet/transportlayer/rtp/RTPPacket.msg:40 by nedtool.

//
// This class represents an RTP data packet. Real data can either
// be encapsulated, or simulated by adding length.
//
// The following RTP header fields exist but aren't used:
// padding, extension, csrcCount. The csrcList can't be used
// because csrcCount is always 0.
//
packet RTPPacket
{
    @customize(true);  // see the generated C++ header for more info
    byteLength = RTPPACKET_FIX_HEADERLENGTH;  // 12-byte fixed header
    // The rtp version of this ~RTPPacket.
    uint8 version = 2;
    // Set to 1 if padding is used in this ~RTPPacket, 0 otherwise.
    // This implementation doesn't use padding bytes, so it is always 0.
    bool padding = false;
    // Set to 1, if this ~RTPPacket contains an rtp header extension, 0 otherwise.
    // This implementation doesn't support rtp header extensions, so it is always 0.
    bool extension = false;
    // The marker.
    bool marker = false;
    // The type of payload carried in this ~RTPPacket.
    int8 payloadType;
    // The sequence number of this ~RTPPacket.
    uint16 sequenceNumber;
    // The rtp time stamp of this ~RTPPacket.
    uint32 timeStamp;
    // The ssrc identifier of the creator of this ~RTPPacket.
    uint32 ssrc;
    // no mixers, no contributing sources
    uint32 csrc[];
    abstract int headerLength;
    abstract int payloadLength;
}

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

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

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

Register_Class(RTPPacket)

Constructor & Destructor Documentation

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

Member Function Documentation

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

Reimplemented in inet::rtp::RTPPacket.

156 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class RTPPacket");}
virtual uint32_t inet::rtp::RTPPacket_Base::getCsrc ( unsigned int  k) const
virtual
virtual unsigned int inet::rtp::RTPPacket_Base::getCsrcArraySize ( ) const
virtual
virtual bool inet::rtp::RTPPacket_Base::getExtension ( ) const
virtual
virtual int inet::rtp::RTPPacket_Base::getHeaderLength ( ) const
pure virtual

Implemented in inet::rtp::RTPPacket.

virtual bool inet::rtp::RTPPacket_Base::getMarker ( ) const
virtual
virtual bool inet::rtp::RTPPacket_Base::getPadding ( ) const
virtual
virtual int inet::rtp::RTPPacket_Base::getPayloadLength ( ) const
pure virtual

Implemented in inet::rtp::RTPPacket.

virtual int8_t inet::rtp::RTPPacket_Base::getPayloadType ( ) const
virtual
virtual uint16_t inet::rtp::RTPPacket_Base::getSequenceNumber ( ) const
virtual
virtual uint32_t inet::rtp::RTPPacket_Base::getSsrc ( ) const
virtual
virtual uint32_t inet::rtp::RTPPacket_Base::getTimeStamp ( ) const
virtual
virtual uint8_t inet::rtp::RTPPacket_Base::getVersion ( ) const
virtual
RTPPacket_Base& inet::rtp::RTPPacket_Base::operator= ( const RTPPacket_Base other)
protected
bool inet::rtp::RTPPacket_Base::operator== ( const RTPPacket_Base )
protected
virtual void inet::rtp::RTPPacket_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual
virtual void inet::rtp::RTPPacket_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual
virtual void inet::rtp::RTPPacket_Base::setCsrc ( unsigned int  k,
uint32_t  csrc 
)
virtual
virtual void inet::rtp::RTPPacket_Base::setCsrcArraySize ( unsigned int  size)
virtual
virtual void inet::rtp::RTPPacket_Base::setExtension ( bool  extension)
virtual
virtual void inet::rtp::RTPPacket_Base::setHeaderLength ( int  headerLength)
pure virtual

Implemented in inet::rtp::RTPPacket.

virtual void inet::rtp::RTPPacket_Base::setMarker ( bool  marker)
virtual
virtual void inet::rtp::RTPPacket_Base::setPadding ( bool  padding)
virtual
virtual void inet::rtp::RTPPacket_Base::setPayloadLength ( int  payloadLength)
pure virtual

Implemented in inet::rtp::RTPPacket.

virtual void inet::rtp::RTPPacket_Base::setPayloadType ( int8_t  payloadType)
virtual
virtual void inet::rtp::RTPPacket_Base::setSequenceNumber ( uint16_t  sequenceNumber)
virtual
virtual void inet::rtp::RTPPacket_Base::setSsrc ( uint32_t  ssrc)
virtual
virtual void inet::rtp::RTPPacket_Base::setTimeStamp ( uint32_t  timeStamp)
virtual
virtual void inet::rtp::RTPPacket_Base::setVersion ( uint8_t  version)
virtual

Member Data Documentation

uint32_t* inet::rtp::RTPPacket_Base::csrc
protected
unsigned int inet::rtp::RTPPacket_Base::csrc_arraysize
protected
bool inet::rtp::RTPPacket_Base::extension
protected
bool inet::rtp::RTPPacket_Base::marker
protected
bool inet::rtp::RTPPacket_Base::padding
protected
int8_t inet::rtp::RTPPacket_Base::payloadType
protected
uint16_t inet::rtp::RTPPacket_Base::sequenceNumber
protected
uint32_t inet::rtp::RTPPacket_Base::ssrc
protected
uint32_t inet::rtp::RTPPacket_Base::timeStamp
protected
uint8_t inet::rtp::RTPPacket_Base::version
protected

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