HttpNormalData Class Reference

#include <http-aux.h>

Inheritance diagram for HttpNormalData:

HttpData AppData Collaboration diagram for HttpNormalData:

Collaboration graph
[legend]

Detailed Description

Definition at line 193 of file http-aux.h.

Public Member Functions

virtual AppDatacopy ()
virtual int cost () const
 HttpNormalData (HttpNormalData &d)
 HttpNormalData (int id, int cost, const char *str)
int & id ()
virtual int size () const
char * str () const
AppDataType type () const
virtual ~HttpNormalData ()

Private Attributes

int cost_
char * str_
int strlen_


Constructor & Destructor Documentation

HttpNormalData::HttpNormalData int  id,
int  cost,
const char *  str
[inline]
 

Definition at line 201 of file http-aux.h.

References cost_, str_, and strlen_.

Referenced by copy().

00201                                                       : 
00202         HttpData(HTTP_NORMAL, id) {
00203         if ((str == NULL) || (*str == 0))
00204             strlen_ = 0;
00205         else
00206             strlen_ = strlen(str) + 1;
00207         if (strlen_ > 0) {
00208             str_ = new char[strlen_];
00209             strcpy(str_, str);
00210         } else
00211             str_ = NULL;
00212         cost_ = cost;
00213     }

HttpNormalData::HttpNormalData HttpNormalData d  )  [inline]
 

Definition at line 214 of file http-aux.h.

References cost_, str_, and strlen_.

00214                                       : HttpData(d) {
00215         cost_ = d.cost_;
00216         strlen_ = d.strlen_;
00217         if (strlen_ > 0) {
00218             str_ = new char[strlen_];
00219             strcpy(str_, d.str_);
00220         } else
00221             str_ = NULL;
00222     }

virtual HttpNormalData::~HttpNormalData  )  [inline, virtual]
 

Definition at line 223 of file http-aux.h.

References str_.

00223                               {
00224         if (str_ != NULL)
00225             delete []str_;
00226     }


Member Function Documentation

virtual AppData* HttpNormalData::copy  )  [inline, virtual]
 

Reimplemented from HttpData.

Definition at line 234 of file http-aux.h.

References HttpNormalData().

00234                             {
00235         return (new HttpNormalData(*this));
00236     }

Here is the call graph for this function:

virtual int HttpNormalData::cost  )  const [inline, virtual]
 

Reimplemented from HttpData.

Definition at line 232 of file http-aux.h.

References cost_.

00232 { return cost_; }

int& HttpData::id  )  [inline, inherited]
 

Definition at line 184 of file http-aux.h.

References HttpData::id_.

Referenced by HttpMInvalCache::recv_inv(), and HttpMInvalCache::recv_leave().

00184 { return id_; }

virtual int HttpNormalData::size  )  const [inline, virtual]
 

Reimplemented from HttpData.

Definition at line 228 of file http-aux.h.

References strlen_.

00228                              {
00229         // Intentially use sizeof(int) instead of 2*sizeof(int)
00230         return (sizeof(HttpData)+sizeof(int)+strlen_);
00231     }

char* HttpNormalData::str  )  const [inline]
 

Definition at line 233 of file http-aux.h.

References str_.

00233 { return str_; }

AppDataType AppData::type  )  const [inline, inherited]
 

Definition at line 105 of file ns-process.h.

References AppData::type_.

Referenced by Packet::accessdata(), TcpApp::process_data(), MediaClient::process_data(), MediaCache::process_data(), HttpMInvalCache::process_data(), HttpApp::process_data(), UdpAgent::recv(), and MessagePassingAgent::recv().

00105 { return type_; }


Field Documentation

int HttpNormalData::cost_ [private]
 

Definition at line 197 of file http-aux.h.

Referenced by cost(), and HttpNormalData().

char* HttpNormalData::str_ [private]
 

Definition at line 195 of file http-aux.h.

Referenced by HttpNormalData(), str(), and ~HttpNormalData().

int HttpNormalData::strlen_ [private]
 

Definition at line 196 of file http-aux.h.

Referenced by HttpNormalData(), and size().


The documentation for this class was generated from the following file:
Generated on Tue Mar 6 17:10:51 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6