TcpAppString Class Reference

Inheritance diagram for TcpAppString:

AppData Collaboration diagram for TcpAppString:

Collaboration graph
[legend]

Detailed Description

Definition at line 106 of file tcpapp.cc.

Public Member Functions

virtual AppDatacopy ()
void set_string (const char *s)
virtual int size () const
char * str ()
 TcpAppString (TcpAppString &d)
 TcpAppString ()
AppDataType type () const
virtual ~TcpAppString ()

Private Attributes

int size_
char * str_


Constructor & Destructor Documentation

TcpAppString::TcpAppString  )  [inline]
 

Definition at line 111 of file tcpapp.cc.

Referenced by copy().

00111 : AppData(TCPAPP_STRING), size_(0), str_(NULL) {}

TcpAppString::TcpAppString TcpAppString d  )  [inline]
 

Definition at line 112 of file tcpapp.cc.

References size_, and str_.

00112                                   : AppData(d) {
00113         size_ = d.size_;
00114         if (size_ > 0) {
00115             str_ = new char[size_];
00116             strcpy(str_, d.str_);
00117         } else
00118             str_ = NULL;
00119     }

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

Definition at line 120 of file tcpapp.cc.

References str_.

00120                             { 
00121         if (str_ != NULL) 
00122             delete []str_; 
00123     }


Member Function Documentation

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

Implements AppData.

Definition at line 139 of file tcpapp.cc.

References TcpAppString().

00139                             {
00140         return new TcpAppString(*this);
00141     }

Here is the call graph for this function:

void TcpAppString::set_string const char *  s  )  [inline]
 

Definition at line 129 of file tcpapp.cc.

References size_, and str_.

Referenced by TcpApp::command().

00129                                    {
00130         if ((s == NULL) || (*s == 0)) 
00131             str_ = NULL, size_ = 0;
00132         else {
00133             size_ = strlen(s) + 1;
00134             str_ = new char[size_];
00135             assert(str_ != NULL);
00136             strcpy(str_, s);
00137         }
00138     }

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

Reimplemented from AppData.

Definition at line 126 of file tcpapp.cc.

References AppData::size(), and size_.

00126 { return AppData::size() + size_; }

Here is the call graph for this function:

char* TcpAppString::str  )  [inline]
 

Definition at line 125 of file tcpapp.cc.

References str_.

00125 { 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 TcpAppString::size_ [private]
 

Definition at line 108 of file tcpapp.cc.

Referenced by set_string(), size(), and TcpAppString().

char* TcpAppString::str_ [private]
 

Definition at line 109 of file tcpapp.cc.

Referenced by set_string(), str(), TcpAppString(), and ~TcpAppString().


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