SDESChunk Class Reference

#include <sdes.h>

List of all members.


Detailed Description

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

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

Constructor & Destructor Documentation

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

Default constructor.

Referenced by dup().

00108                                                   : cArray(name) {
00109     _ssrc = ssrc;
00110     _length = 4;
00111 };

SDESChunk::SDESChunk ( const SDESChunk sdesChunk  ) 

Copy constructor.

00114                                                : cArray(sdesChunk) {
00115     setName(sdesChunk.getName());
00116     operator=(sdesChunk);
00117 };

SDESChunk::~SDESChunk (  )  [virtual]

Destructor.

00120                       {
00121 };


Member Function Documentation

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

Operator equal.

Referenced by SDESChunk().

00124                                                           {
00125     cArray::operator=(sdesChunk);
00126     _ssrc = sdesChunk._ssrc;
00127     _length = sdesChunk._length;
00128     return *this;
00129 };

SDESChunk * SDESChunk::dup (  )  const [virtual]

Duplicates this SDESChunk by calling the copy constructor.

00132                                 {
00133     return new SDESChunk(*this);
00134 };

std::string SDESChunk::info (  )  [virtual]

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

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

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

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

00144                                    {
00145     os << "SDESChunk:" << endl;
00146     os << "  ssrc = " << _ssrc << endl;
00147     for (int i = 0; i < size(); i++) {
00148         if (exist(i)) {
00149             //FIXME get(i)->dump(os);
00150         };
00151     };
00152 };

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().

00155                                               {
00156     for (int i = 0; i < size(); i++) {
00157         if (exist(i)) {
00158             SDESItem *compareItem = (SDESItem *)(get(i));
00159             if (compareItem->getType() == sdesItem->getType()) {
00160                 remove(compareItem);
00161                 _length = _length - compareItem->getLength();
00162                 delete compareItem;
00163             };
00164         }
00165     };
00166 
00167     //sdesItem->setOwner(this);
00168     add(sdesItem);
00169     _length = _length + (sdesItem->getLength());
00170 
00171 };

uint32 SDESChunk::getSSRC (  )  [virtual]

Returns the ssrc identifier this SDESChunk is for.

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

00174                           {
00175     return _ssrc;
00176 };

void SDESChunk::setSSRC ( uint32  ssrc  )  [virtual]

Sets the ssrc identifier this SDESChunk is for.

Referenced by RTPParticipantInfo::setSSRC().

00179                                    {
00180     _ssrc = ssrc;
00181 };

int SDESChunk::getLength (  )  [virtual]

Returns the length in bytes of this SDESChunk.

Referenced by RTCPSDESPacket::addSDESChunk().

00184                          {
00185     return _length;
00186 };


Member Data Documentation

uint32 SDESChunk::_ssrc [protected]

The ssrc identifier this SDESChunk is for.

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

int SDESChunk::_length [protected]

The length in bytes of this SDESChunk.

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


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

Generated on Fri Mar 20 18:51:21 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5