Public Member Functions | Protected Attributes

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.

Definition at line 131 of file sdes.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 108 of file sdes.cc.

Referenced by dup().

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

SDESChunk::SDESChunk ( const SDESChunk sdesChunk  ) 

Copy constructor.

Definition at line 114 of file sdes.cc.

                                               : cArray(sdesChunk) {
    setName(sdesChunk.getName());
    operator=(sdesChunk);
};

SDESChunk::~SDESChunk (  )  [virtual]

Destructor.

Definition at line 120 of file sdes.cc.

                      {
};


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.

Definition at line 155 of file sdes.cc.

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.

Definition at line 144 of file sdes.cc.

                                   {
    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.

Definition at line 132 of file sdes.cc.

                                {
    return new SDESChunk(*this);
};

int SDESChunk::getLength (  )  [virtual]

Returns the length in bytes of this SDESChunk.

Definition at line 184 of file sdes.cc.

Referenced by RTCPSDESPacket::addSDESChunk().

                         {
    return _length;
};

uint32 SDESChunk::getSSRC (  )  [virtual]

Returns the ssrc identifier this SDESChunk is for.

Definition at line 174 of file sdes.cc.

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.

Definition at line 137 of file sdes.cc.

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

SDESChunk & SDESChunk::operator= ( const SDESChunk sdesChunk  ) 

Operator equal.

Definition at line 124 of file sdes.cc.

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.

Definition at line 179 of file sdes.cc.

Referenced by RTPParticipantInfo::setSSRC().

                                   {
    _ssrc = ssrc;
};


Member Data Documentation

int SDESChunk::_length [protected]

The length in bytes of this SDESChunk.

Definition at line 201 of file sdes.h.

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

uint32 SDESChunk::_ssrc [protected]

The ssrc identifier this SDESChunk is for.

Definition at line 196 of file sdes.h.

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


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