HttpHbData Class Reference

#include <http-aux.h>

Inheritance diagram for HttpHbData:

HttpData AppData Collaboration diagram for HttpHbData:

Collaboration graph
[legend]

Detailed Description

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

Public Member Functions

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

Private Member Functions

InvalRecinv_rec ()

Private Attributes

InvalRecinv_rec_
int num_inv_

Data Structures

struct  InvalRec


Constructor & Destructor Documentation

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

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

References inv_rec_, and num_inv_.

Referenced by copy().

00271                               : 
00272         HttpData(HTTP_INVALIDATION, id), num_inv_(n) {
00273         if (num_inv_ > 0)
00274             inv_rec_ = new InvalRec[num_inv_];
00275         else
00276             inv_rec_ = NULL;
00277     }

HttpHbData::HttpHbData HttpHbData d  )  [inline]
 

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

References inv_rec_, and num_inv_.

00278                               : HttpData(d) {
00279         num_inv_ = d.num_inv_;
00280         if (num_inv_ > 0) {
00281             inv_rec_ = new InvalRec[num_inv_];
00282             memcpy(inv_rec_, d.inv_rec_,num_inv_*sizeof(InvalRec));
00283         } else
00284             inv_rec_ = NULL;
00285     }

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

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

References inv_rec_.

00286                           { 
00287         if (inv_rec_ != NULL)
00288             delete []inv_rec_; 
00289     }


Member Function Documentation

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

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

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

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

00304                                                {
00305         inv_rec()[i].copy(r);
00306     }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References HttpHbData().

00299                             {
00300         return (new HttpHbData(*this));
00301     }

Here is the call graph for this function:

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

Reimplemented from HttpData.

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

References HTTPHBDATA_COST, and num_inv_.

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

00295                              { 
00296         // Minimum size 1 so that TCP will send a packet
00297         return (num_inv_ == 0) ? 1 : (num_inv_*HTTPHBDATA_COST); 
00298     }

void HttpHbData::extract InvalidationRec *&  ivlist  ) 
 

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

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

Referenced by HttpMInvalCache::recv_inv().

00065 {
00066     // XXX head must be passed in from outside, because the 
00067     // InvalidationRec list will obtain the address of head
00068     head = NULL;
00069     InvalidationRec *q = NULL;
00070     // reconstruct a list of invalidation records.
00071     // We keep the updating record 
00072     for (int i = 0; i < num_inv(); i++) {
00073         // Used only to mark that this page will be send in 
00074         // the next multicast update. The updating field in 
00075         // this agent will only be set after it gets the real 
00076         // update. Here we set this field temporarily so that
00077         // recv_inv can find out the 
00078         q = inv_rec()[i].copyto();
00079         q->insert(&head);
00080     }
00081 }

Here is the call graph for this function:

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

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

References HttpData::id_.

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

00184 { return id_; }

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

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

References inv_rec_.

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

00268 { return inv_rec_; }

int& HttpHbData::num_inv  )  [inline]
 

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

References num_inv_.

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

00303 { return num_inv_; }

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

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

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

Referenced by HttpMInvalCache::command().

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

Here is the call graph for this function:

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

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

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

Referenced by HttpMInvalCache::command().

00307 { 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 291 of file http-aux.h.

References num_inv_, and HttpData::size().

00291                              {
00292         return HttpData::size() + num_inv_*sizeof(InvalRec);
00293     }

Here is the call graph for this function:

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

InvalRec* HttpHbData::inv_rec_ [private]
 

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

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

int HttpHbData::num_inv_ [private]
 

Definition at line 266 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 Mar 6 17:10:40 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6