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

HttpHbData Class Reference

#include <http-aux.h>

Inheritance diagram for HttpHbData:

Inheritance graph
[legend]
Collaboration diagram for HttpHbData:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HttpHbData (int id, int n)
 HttpHbData (HttpHbData &d)
virtual ~HttpHbData ()
virtual int size () const
virtual int cost () const
virtual AppDatacopy ()
int & num_inv ()
void add (int i, InvalidationRec *r)
char * rec_pg (int i)
double & rec_mtime (int i)
void extract (InvalidationRec *&ivlist)
int & id ()
AppDataType type () const

Private Member Functions

InvalRecinv_rec ()

Private Attributes

int num_inv_
InvalRecinv_rec_

Constructor & Destructor Documentation

HttpHbData::HttpHbData int  id,
int  n
[inline]
 

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

References HTTP_INVALIDATION, inv_rec_, and num_inv_.

Referenced by copy().

00246                                   : 
00247                 HttpData(HTTP_INVALIDATION, id), num_inv_(n) {
00248                 if (num_inv_ > 0)
00249                         inv_rec_ = new InvalRec[num_inv_];
00250                 else
00251                         inv_rec_ = NULL;
00252         }

HttpHbData::HttpHbData HttpHbData d  )  [inline]
 

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

References inv_rec_, and num_inv_.

00253                                   : HttpData(d) {
00254                 num_inv_ = d.num_inv_;
00255                 if (num_inv_ > 0) {
00256                         inv_rec_ = new InvalRec[num_inv_];
00257                         memcpy(inv_rec_, d.inv_rec_,num_inv_*sizeof(InvalRec));
00258                 } else
00259                         inv_rec_ = NULL;
00260         }

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

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

References inv_rec_.

00261                               { 
00262                 if (inv_rec_ != NULL)
00263                         delete []inv_rec_; 
00264         }


Member Function Documentation

void HttpHbData::add int  i,
InvalidationRec r
[inline]
 

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

References HttpHbData::InvalRec::copy(), and inv_rec().

Referenced by HttpMInvalCache::pack_heartbeat(), and HttpYucInvalServer::pack_heartbeat().

00279                                                    {
00280                 inv_rec()[i].copy(r);
00281         }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References HttpHbData().

00274                                 {
00275                 return (new HttpHbData(*this));
00276         }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References HTTPHBDATA_COST, and num_inv_.

Referenced by HttpMInvalCache::send_heartbeat(), and HttpYucInvalServer::send_heartbeat().

00270                                  { 
00271                 // Minimum size 1 so that TCP will send a packet
00272                 return (num_inv_ == 0) ? 1 : (num_inv_*HTTPHBDATA_COST); 
00273         }

void HttpHbData::extract InvalidationRec *&  ivlist  ) 
 

Definition at line 40 of file http-aux.cc.

References HttpHbData::InvalRec::copyto(), InvalidationRec::insert(), inv_rec(), and num_inv().

Referenced by HttpMInvalCache::recv_inv().

00041 {
00042         // XXX head must be passed in from outside, because the 
00043         // InvalidationRec list will obtain the address of head
00044         head = NULL;
00045         InvalidationRec *q = NULL;
00046         // reconstruct a list of invalidation records.
00047         // We keep the updating record 
00048         for (int i = 0; i < num_inv(); i++) {
00049                 // Used only to mark that this page will be send in 
00050                 // the next multicast update. The updating field in 
00051                 // this agent will only be set after it gets the real 
00052                 // update. Here we set this field temporarily so that
00053                 // recv_inv can find out the 
00054                 q = inv_rec()[i].copyto();
00055                 q->insert(&head);
00056         }
00057 }

Here is the call graph for this function:

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_; }

InvalRec* HttpHbData::inv_rec  )  [inline, private]
 

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

References inv_rec_.

Referenced by add(), extract(), rec_mtime(), and rec_pg().

00243 { return inv_rec_; }

int& HttpHbData::num_inv  )  [inline]
 

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

References num_inv_.

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

00278 { return num_inv_; }

double& HttpHbData::rec_mtime int  i  )  [inline]
 

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

References inv_rec(), and HttpHbData::InvalRec::mtime_.

Referenced by HttpMInvalCache::command().

00283 { return inv_rec()[i].mtime_; }

Here is the call graph for this function:

char* HttpHbData::rec_pg int  i  )  [inline]
 

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

References inv_rec(), and HttpHbData::InvalRec::pg_.

Referenced by HttpMInvalCache::command().

00282 { return inv_rec()[i].pg_; }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References num_inv_, and HttpData::size().

00266                                  {
00267                 return HttpData::size() + num_inv_*sizeof(InvalRec);
00268         }

Here is the call graph for this function:

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

InvalRec* HttpHbData::inv_rec_ [private]
 

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

Referenced by HttpHbData(), inv_rec(), and ~HttpHbData().

int HttpHbData::num_inv_ [private]
 

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

Referenced by cost(), HttpHbData(), num_inv(), and size().


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