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

SDESItem Class Reference

#include <sdes.h>

List of all members.


Detailed Description

The class SDESItem is used for storing a source description item (type of description, description string) for an rtp end system.


Public Types

enum  SDES_ITEM_TYPE {
  SDES_UNDEF = 0, SDES_CNAME = 1, SDES_NAME = 2, SDES_EMAIL = 3,
  SDES_PHONE = 4, SDES_LOC = 5, SDES_TOOL = 6, SDES_NOTE = 7,
  SDES_PRIV = 8
}

Public Member Functions

 SDESItem (const char *name=NULL)
 SDESItem (SDES_ITEM_TYPE type, const char *content)
 SDESItem (const SDESItem &sdesItem)
virtual ~SDESItem ()
SDESItemoperator= (const SDESItem &sdesItem)
virtual cObject * dup () const
virtual const char * className () const
virtual std::string info ()
virtual void writeContents (std::ostream &os)
virtual SDES_ITEM_TYPE type ()
virtual const char * content ()
virtual int length ()

Protected Attributes

SDES_ITEM_TYPE _type
int _length
const char * _content


Member Enumeration Documentation

enum SDESItem::SDES_ITEM_TYPE
 

This enumeration holds the types of source description items as defined in the rfc. In this implementation only SDES_UNDEF and SDES_CNAME are usable.

Enumeration values:
SDES_UNDEF 
SDES_CNAME 
SDES_NAME 
SDES_EMAIL 
SDES_PHONE 
SDES_LOC 
SDES_TOOL 
SDES_NOTE 
SDES_PRIV 
00042                             {
00043             SDES_UNDEF = 0,
00044             SDES_CNAME = 1,
00045             SDES_NAME = 2,
00046             SDES_EMAIL = 3,
00047             SDES_PHONE = 4,
00048             SDES_LOC = 5,
00049             SDES_TOOL = 6,
00050             SDES_NOTE = 7,
00051             SDES_PRIV = 8
00052         };


Constructor & Destructor Documentation

SDESItem::SDESItem const char *  name = NULL  ) 
 

Default constructor.

00031                                    : cObject(name) {
00032     _type = SDES_UNDEF;
00033     _length = 2;
00034     _content = "";
00035 };

SDESItem::SDESItem SDES_ITEM_TYPE  type,
const char *  content
 

Constructor which sets the entry.

00038                                                            : cObject() {
00039     _type = type;
00040     _content = content;
00041     // an sdes item requires one byte for the type field,
00042     // one byte for the length field and bytes for
00043     // the content string
00044     _length = 2 + strlen(_content);
00045 };

SDESItem::SDESItem const SDESItem sdesItem  ) 
 

Copy constructor.

00048                                            : cObject() {
00049     setName(sdesItem.name());
00050     operator=(sdesItem);
00051 };

SDESItem::~SDESItem  )  [virtual]
 

Destructor.

00054                     {
00055 };


Member Function Documentation

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

Returns the class name "SDESItem".

00072                                       {
00073     return "SDESItem";
00074 };

const char * SDESItem::content  )  [virtual]
 

Returns the stored sdes string.

00096                               {
00097     return opp_strdup(_content);
00098 };

cObject * SDESItem::dup  )  const [virtual]
 

Duplicates theis SDESItem by calling the copy constructor.

00067                              {
00068     return new SDESItem(*this);
00069 };

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

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

00077                          {
00078     std::stringstream out;
00079     out << "SDESItem=" << _content;
00080     return out.str();
00081 };

int SDESItem::length  )  [virtual]
 

This method returns the size of this SDESItem in bytes as it would be in the real world.

00101                      {
00102     // bytes needed for this sdes item are
00103     // one byte for type, one for length
00104     // and the string
00105     return _length + 2;
00106 };

SDESItem & SDESItem::operator= const SDESItem sdesItem  ) 
 

Assignment operator.

00058                                                       {
00059     cObject::operator=(sdesItem);
00060     _type = sdesItem._type;
00061     _length = sdesItem._length;
00062     _content = opp_strdup(sdesItem._content);
00063     return *this;
00064 };

SDESItem::SDES_ITEM_TYPE SDESItem::type  )  [virtual]
 

Returns the type of this sdes item.

00091                                       {
00092     return _type;
00093 };

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

Writes an info about this SDESItem into the give output stream.

00084                                            {
00085     os << "SDESItem:" << endl;
00086     os << "  type = " << _type << endl;
00087     os << "  content = " << _content << endl;
00088 };


Member Data Documentation

const char* SDESItem::_content [protected]
 

The sdes string.

int SDESItem::_length [protected]
 

The length of this SDESItem.

SDES_ITEM_TYPE SDESItem::_type [protected]
 

The type of this SDESItem.


The documentation for this class was generated from the following files:
Generated on Sat Apr 1 20:52:24 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1