INET Framework for OMNeT++/OMNEST
RTCPCompoundPacket Class Reference

#include <RTCPPacket.h>

List of all members.

Public Member Functions

 RTCPCompoundPacket (const char *name=NULL)
 RTCPCompoundPacket (const RTCPCompoundPacket &rtcpCompoundPacket)
virtual ~RTCPCompoundPacket ()
RTCPCompoundPacketoperator= (const RTCPCompoundPacket &rtcpCompoundPacket)
virtual RTCPCompoundPacketdup () const
virtual std::string info ()
virtual void dump (std::ostream &os) const
virtual void addRTCPPacket (RTCPPacket *rtcpPacket)
virtual cArray * getRtcpPackets ()

Protected Attributes

cArray * _rtcpPackets

Detailed Description

An rtcp compound packet acts as container for rtcp packets, which are transmitted in an RTCPCompoundPacket. Every RTCPCompoundPacket must consist at least one RTCPSenderReportPacketof RTCPReceiverReportPacket and one RTCPSDESPacket. This class doesn't check if these requirements are met.


Constructor & Destructor Documentation

RTCPCompoundPacket::RTCPCompoundPacket ( const char *  name = NULL)

Default constructor.

Referenced by dup().

                                                       : cPacket(name) {
    _rtcpPackets = new cArray("RTCPPackets");
    // an empty rtcp compound packet has length 0 bytes
    setByteLength(0);
};
RTCPCompoundPacket::RTCPCompoundPacket ( const RTCPCompoundPacket rtcpCompoundPacket)

Copy constructor.

                                                                                   : cPacket() {
    setName(rtcpCompoundPacket.getName());
    operator=(rtcpCompoundPacket);
};
RTCPCompoundPacket::~RTCPCompoundPacket ( ) [virtual]

Destructor.

                                        {
    delete _rtcpPackets;
};

Member Function Documentation

void RTCPCompoundPacket::addRTCPPacket ( RTCPPacket rtcpPacket) [virtual]

Adds an RTCPPacket to this RTCPCompoundPacket.

Referenced by RTCP::createPacket().

                                                             {
    //rtcpPacket->setOwner(_rtcpPackets);
    _rtcpPackets->add(rtcpPacket);
    // the size of the rtcp compound packet increases
    // by the size of the added rtcp packet
    addByteLength(rtcpPacket->getByteLength());
};
void RTCPCompoundPacket::dump ( std::ostream &  os) const [virtual]

Writes a longer info about this RTCPCompoundPacket into the given stream.

                                                  {
    os << "RTCPCompoundPacket:" << endl;
    for (int i = 0; i < _rtcpPackets->size(); i++) {
        if (_rtcpPackets->exist(i)) {
            //FIXME _rtcpPackets->get(i)->dump(os);
        }
    }
};
RTCPCompoundPacket * RTCPCompoundPacket::dup ( ) const [virtual]

Duplicates the RTCPCompoundPacket by calling the copy constructor.

                                                  {
    return new RTCPCompoundPacket(*this);
};
cArray * RTCPCompoundPacket::getRtcpPackets ( ) [virtual]

Returns a copy of the cArray in which the rtcp packets are stored.

Referenced by RTCP::processIncomingRTCPPacket().

                                           {
    return new cArray(*_rtcpPackets);
}
std::string RTCPCompoundPacket::info ( ) [virtual]

Writes a short info about this RTCPCompoundPacket into the given string.

                                   {
    std::stringstream out;
    out << "RTCPCompoundPacket: number of rtcp packets=" << _rtcpPackets->size();
    return out.str();
};
RTCPCompoundPacket & RTCPCompoundPacket::operator= ( const RTCPCompoundPacket rtcpCompoundPacket)

Assignment operator.

Referenced by RTCPCompoundPacket().

                                                                                              {
    cPacket::operator=(rtcpCompoundPacket);
    setByteLength(rtcpCompoundPacket.getByteLength());
    _rtcpPackets = new cArray(*(rtcpCompoundPacket._rtcpPackets));
    return *this;
};

Member Data Documentation

cArray* RTCPCompoundPacket::_rtcpPackets [protected]

The cArray in which the rtcp packets are stored.

Referenced by addRTCPPacket(), dump(), getRtcpPackets(), info(), operator=(), RTCPCompoundPacket(), and ~RTCPCompoundPacket().


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