CBufList Class Reference

#include <tcpapp.h>

Collaboration diagram for CBufList:

Collaboration graph
[legend]

Detailed Description

Definition at line 85 of file tcpapp.h.

Public Member Functions

 CBufList ()
CBufdetach ()
void insert (CBuf *cbuf)
 ~CBufList ()

Protected Attributes

CBufhead_
CBuftail_


Constructor & Destructor Documentation

CBufList::CBufList  )  [inline]
 

Definition at line 90 of file tcpapp.h.

00090 : head_(NULL), tail_(NULL) {}

CBufList::~CBufList  ) 
 

Definition at line 68 of file tcpapp.cc.

References head_, CBuf::next_, and tail_.

00069 {
00070     while (head_ != NULL) {
00071         tail_ = head_;
00072         head_ = head_->next_;
00073         delete tail_;
00074     }
00075 }


Member Function Documentation

CBuf * CBufList::detach  ) 
 

Definition at line 90 of file tcpapp.cc.

References head_, CBuf::next_, and tail_.

Referenced by TcpApp::rcvr_retrieve_data().

00091 {
00092     if (head_ == NULL)
00093         return NULL;
00094     CBuf *p = head_;
00095     if ((head_ = head_->next_) == NULL)
00096         tail_ = NULL;
00097 #ifdef TCPAPP_DEBUG
00098     num_--;
00099 #endif
00100     return p;
00101 }

void CBufList::insert CBuf cbuf  ) 
 

Definition at line 77 of file tcpapp.cc.

References head_, CBuf::next_, and tail_.

Referenced by TcpApp::send().

00078 {
00079     if (tail_ == NULL) 
00080         head_ = tail_ = cbuf;
00081     else {
00082         tail_->next_ = cbuf;
00083         tail_ = cbuf;
00084     }
00085 #ifdef TCPAPP_DEBUG
00086     num_++;
00087 #endif
00088 }


Field Documentation

CBuf* CBufList::head_ [protected]
 

Definition at line 98 of file tcpapp.h.

Referenced by detach(), insert(), and ~CBufList().

CBuf* CBufList::tail_ [protected]
 

Definition at line 99 of file tcpapp.h.

Referenced by detach(), insert(), and ~CBufList().


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