Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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, u_int32 ssrc=0)
 SDESChunk (const SDESChunk &sdesChunk)
virtual ~SDESChunk ()
SDESChunkoperator= (const SDESChunk &sdesChunk)
virtual cObject * dup () const
virtual const char * className () const
virtual std::string info ()
virtual void writeContents (std::ostream &os)
virtual void addSDESItem (SDESItem *item)
virtual u_int32 ssrc ()
virtual void setSSRC (u_int32 ssrc)
virtual int length ()

Protected Attributes

u_int32 _ssrc
int _length


Constructor & Destructor Documentation

SDESChunk::SDESChunk const char *  name = NULL,
u_int32  ssrc = 0
 

Default constructor.

00116                                                    : cArray(name) {
00117     _ssrc = ssrc;
00118     _length = 4;
00119 };

SDESChunk::SDESChunk const SDESChunk sdesChunk  ) 
 

Copy constructor.

00122                                                : cArray(sdesChunk) {
00123     setName(sdesChunk.name());
00124     operator=(sdesChunk);
00125 };

SDESChunk::~SDESChunk  )  [virtual]
 

Destructor.

00128                       {
00129 };


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.

00168                                               {
00169     for (int i = 0; i < items(); i++) {
00170         if (exist(i)) {
00171             SDESItem *compareItem = (SDESItem *)(get(i));
00172             if (compareItem->type() == sdesItem->type()) {
00173                 remove(compareItem);
00174                 _length = _length - compareItem->length();
00175                 delete compareItem;
00176             };
00177         }
00178     };
00179 
00180     //sdesItem->setOwner(this);
00181     add(sdesItem);
00182     _length = _length + (sdesItem->length());
00183 
00184 };

const char * SDESChunk::className  )  const [virtual]
 

Returns the class name "SDESChunk".

00145                                        {
00146     return "SDESChunk";
00147 };

cObject * SDESChunk::dup  )  const [virtual]
 

Duplicates this SDESChunk by calling the copy constructor.

00140                               {
00141     return new SDESChunk(*this);
00142 };

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

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

00150                           {
00151     std::stringstream out;
00152     out << "SDESChunk.ssrc=" << _ssrc << " items=" << items();
00153     return out.str();
00154 };

int SDESChunk::length  )  [virtual]
 

Returns the length in bytes of this SDESChunk.

00197                       {
00198     return _length;
00199 };

SDESChunk & SDESChunk::operator= const SDESChunk sdesChunk  ) 
 

Operator equal.

00132                                                           {
00133     cArray::operator=(sdesChunk);
00134     _ssrc = sdesChunk._ssrc;
00135     _length = sdesChunk._length;
00136     return *this;
00137 };

void SDESChunk::setSSRC u_int32  ssrc  )  [virtual]
 

Sets the ssrc identifier this SDESChunk is for.

00192                                     {
00193     _ssrc = ssrc;
00194 };

u_int32 SDESChunk::ssrc  )  [virtual]
 

Returns the ssrc identifier this SDESChunk is for.

00187                         {
00188     return _ssrc;
00189 };

void SDESChunk::writeContents std::ostream &  os  )  [virtual]
 

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

00157                                             {
00158     os << "SDESChunk:" << endl;
00159     os << "  ssrc = " << _ssrc << endl;
00160     for (int i = 0; i < items(); i++) {
00161         if (exist(i)) {
00162             get(i)->writeContents(os);
00163         };
00164     };
00165 };


Member Data Documentation

int SDESChunk::_length [protected]
 

The length in bytes of this SDESChunk.

u_int32 SDESChunk::_ssrc [protected]
 

The ssrc identifier this SDESChunk is for.


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 18:22:30 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.0