Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

HttpNormalData Class Reference

#include <http-aux.h>

Inheritance diagram for HttpNormalData:

Inheritance graph
[legend]
Collaboration diagram for HttpNormalData:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Private Attributes

char * str_
int strlen_
int cost_

Constructor & Destructor Documentation

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

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

References cost_, HTTP_NORMAL, str(), str_, and strlen_.

Referenced by copy().

00176                                                           : 
00177                 HttpData(HTTP_NORMAL, id) {
00178                 if ((str == NULL) || (*str == 0))
00179                         strlen_ = 0;
00180                 else
00181                         strlen_ = strlen(str) + 1;
00182                 if (strlen_ > 0) {
00183                         str_ = new char[strlen_];
00184                         strcpy(str_, str);
00185                 } else
00186                         str_ = NULL;
00187                 cost_ = cost;
00188         }

Here is the call graph for this function:

HttpNormalData::HttpNormalData HttpNormalData d  )  [inline]
 

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

References cost_, str_, and strlen_.

00189                                           : HttpData(d) {
00190                 cost_ = d.cost_;
00191                 strlen_ = d.strlen_;
00192                 if (strlen_ > 0) {
00193                         str_ = new char[strlen_];
00194                         strcpy(str_, d.str_);
00195                 } else
00196                         str_ = NULL;
00197         }

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

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

References str_.

00198                                   {
00199                 if (str_ != NULL)
00200                         delete []str_;
00201         }


Member Function Documentation

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

Reimplemented from HttpData.

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

References HttpNormalData().

00209                                 {
00210                 return (new HttpNormalData(*this));
00211         }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References cost_.

00207 { return cost_; }

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

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

References HttpData::id_.

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

00159 { return id_; }

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

Reimplemented from HttpData.

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

References strlen_.

00203                                  {
00204                 // Intentially use sizeof(int) instead of 2*sizeof(int)
00205                 return (sizeof(HttpData)+sizeof(int)+strlen_);
00206         }

char* HttpNormalData::str  )  const [inline]
 

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

References str_.

Referenced by HttpNormalData(), and HttpApp::process_data().

00208 { return str_; }

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

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

References AppDataType, and AppData::type_.

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

00084 { return type_; }


Member Data Documentation

int HttpNormalData::cost_ [private]
 

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

Referenced by cost(), and HttpNormalData().

char* HttpNormalData::str_ [private]
 

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

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

int HttpNormalData::strlen_ [private]
 

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

Referenced by HttpNormalData(), and size().


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 12:51:48 2004 for NS2.26SourcesOriginal by doxygen 1.3.3