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

TcpAppString Class Reference

Inheritance diagram for TcpAppString:

Inheritance graph
[legend]
Collaboration diagram for TcpAppString:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Private Attributes

int size_
char * str_

Constructor & Destructor Documentation

TcpAppString::TcpAppString  )  [inline]
 

Definition at line 86 of file tcpapp.cc.

References size_, str_, and TCPAPP_STRING.

Referenced by copy().

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

TcpAppString::TcpAppString TcpAppString d  )  [inline]
 

Definition at line 87 of file tcpapp.cc.

References size_, and str_.

00087                                       : AppData(d) {
00088                 size_ = d.size_;
00089                 if (size_ > 0) {
00090                         str_ = new char[size_];
00091                         strcpy(str_, d.str_);
00092                 } else
00093                         str_ = NULL;
00094         }

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

Definition at line 95 of file tcpapp.cc.

References str_.

00095                                 { 
00096                 if (str_ != NULL) 
00097                         delete []str_; 
00098         }


Member Function Documentation

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

Implements AppData.

Definition at line 114 of file tcpapp.cc.

References TcpAppString().

00114                                 {
00115                 return new TcpAppString(*this);
00116         }

Here is the call graph for this function:

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

Definition at line 104 of file tcpapp.cc.

References size_, and str_.

Referenced by TcpApp::command().

00104                                        {
00105                 if ((s == NULL) || (*s == 0)) 
00106                         str_ = NULL, size_ = 0;
00107                 else {
00108                         size_ = strlen(s) + 1;
00109                         str_ = new char[size_];
00110                         assert(str_ != NULL);
00111                         strcpy(str_, s);
00112                 }
00113         }

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

Reimplemented from AppData.

Definition at line 101 of file tcpapp.cc.

References AppData::size(), and size_.

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

Here is the call graph for this function:

char* TcpAppString::str  )  [inline]
 

Definition at line 100 of file tcpapp.cc.

References str_.

Referenced by TcpApp::process_data().

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

Definition at line 83 of file tcpapp.cc.

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

char* TcpAppString::str_ [private]
 

Definition at line 84 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 Apr 20 13:28:53 2004 for NS2.26SourcesOriginal by doxygen 1.3.3