INET Framework for OMNeT++/OMNEST
SDESChunk Class Reference

#include <sdes.h>

List of all members.

Public Member Functions

 SDESChunk (const char *name=NULL, uint32 ssrc=0)
 SDESChunk (const SDESChunk &sdesChunk)
virtual ~SDESChunk ()
SDESChunkoperator= (const SDESChunk &sdesChunk)
virtual SDESChunkdup () const
virtual std::string info ()
virtual void dump (std::ostream &os)
virtual void addSDESItem (SDESItem *item)
virtual uint32 getSSRC ()
virtual void setSSRC (uint32 ssrc)
virtual int getLength ()

Protected Attributes

uint32 _ssrc
int _length

Detailed Description

The class SDESChunk is used for storing SDESItem objects for one rtp end system.


Constructor & Destructor Documentation

SDESChunk::SDESChunk ( const char *  name = NULL,
uint32  ssrc = 0 
)

Default constructor.

Referenced by dup().

                                                  : cArray(name) {
    _ssrc = ssrc;
    _length = 4;
};
SDESChunk::SDESChunk ( const SDESChunk sdesChunk)

Copy constructor.

                                               : cArray(sdesChunk) {
    setName(sdesChunk.getName());
    operator=(sdesChunk);
};
SDESChunk::~SDESChunk ( ) [virtual]

Destructor.

                      {
};

Member Function Documentation

void SDESChunk::addSDESItem ( SDESItem item) [virtual]

Adds an SDESItem to this SDESChunk. If there is already an SDESItem of the same type in this SDESChunk it is replaced by the new one.

Referenced by RTPParticipantInfo::addSDESItem().

                                              {
    for (int i = 0; i < size(); i++) {
        if (exist(i)) {
            SDESItem *compareItem = (SDESItem *)(get(i));
            if (compareItem->getType() == sdesItem->getType()) {
                remove(compareItem);
                _length = _length - compareItem->getLength();
                delete compareItem;
            };
        }
    };

    //sdesItem->setOwner(this);
    add(sdesItem);
    _length = _length + (sdesItem->getLength());

};
void SDESChunk::dump ( std::ostream &  os) [virtual]

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

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

Duplicates this SDESChunk by calling the copy constructor.

                                {
    return new SDESChunk(*this);
};
int SDESChunk::getLength ( ) [virtual]

Returns the length in bytes of this SDESChunk.

Referenced by RTCPSDESPacket::addSDESChunk().

                         {
    return _length;
};
uint32 SDESChunk::getSSRC ( ) [virtual]

Returns the ssrc identifier this SDESChunk is for.

Referenced by RTPParticipantInfo::getSSRC(), and RTCP::processIncomingRTCPPacket().

                          {
    return _ssrc;
};
std::string SDESChunk::info ( ) [virtual]

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

                          {
    std::stringstream out;
    out << "SDESChunk.ssrc=" << _ssrc << " items=" << size();
    return out.str();
};
SDESChunk & SDESChunk::operator= ( const SDESChunk sdesChunk)

Operator equal.

Referenced by SDESChunk().

                                                          {
    cArray::operator=(sdesChunk);
    _ssrc = sdesChunk._ssrc;
    _length = sdesChunk._length;
    return *this;
};
void SDESChunk::setSSRC ( uint32  ssrc) [virtual]

Sets the ssrc identifier this SDESChunk is for.

Referenced by RTPParticipantInfo::setSSRC().

                                   {
    _ssrc = ssrc;
};

Member Data Documentation

int SDESChunk::_length [protected]

The length in bytes of this SDESChunk.

Referenced by addSDESItem(), getLength(), operator=(), and SDESChunk().

uint32 SDESChunk::_ssrc [protected]

The ssrc identifier this SDESChunk is for.

Referenced by dump(), getSSRC(), info(), operator=(), SDESChunk(), and setSSRC().


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