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

In_List Class Reference

#include <iflist.h>

Inheritance diagram for In_List:

Inheritance graph
[legend]
Collaboration diagram for In_List:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 In_List ()
In_ListFindMaxIn ()
void InsertFront (Agent_List **, Agent_List *)
void Remove (Agent_List **, Agent_List *)
PrvCurPtr Find (Agent_List **, ns_addr_t)
void FreeAll (Agent_List **)
void Union (Agent_List **, Agent_List *)
virtual void print ()

Public Attributes

double avg_delay
double var_delay
int total_received
int prev_received
int num_loss
int num_neg_send
int num_pos_send
int total_new_org_recv
int total_old_org_recv
int total_new_sub_recv
int new_org_recv
int old_org_recv
int new_sub_recv
double last_ts_new_sub
ns_addr_t agent_addr
Agent_Listnext

Constructor & Destructor Documentation

In_List::In_List  )  [inline]
 

Definition at line 160 of file iflist.h.

References avg_delay, last_ts_new_sub, new_org_recv, new_sub_recv, num_loss, num_neg_send, num_pos_send, old_org_recv, prev_received, total_new_org_recv, total_new_sub_recv, total_old_org_recv, total_received, and var_delay.

00160             : Agent_List() { 
00161     avg_delay =0; 
00162     var_delay =0; 
00163     total_received=0;
00164     prev_received =0; 
00165     num_loss =0; 
00166     num_neg_send = 0;
00167     num_pos_send = 0;
00168 
00169     total_new_org_recv=0;
00170     total_old_org_recv=0;
00171     total_new_sub_recv=0; 
00172 
00173     new_org_recv=0;
00174     old_org_recv=0;
00175     new_sub_recv=0; 
00176 
00177     last_ts_new_sub = -1.0;
00178   }


Member Function Documentation

PrvCurPtr Agent_List::Find Agent_List **  ,
ns_addr_t 
[inherited]
 

Definition at line 70 of file iflist.cc.

References ns_addr_t::addr_, PrvCurPtr::cur, Agent_List::next, NODE_ADDR, PORT, ns_addr_t::port_, and PrvCurPtr::prv.

Referenced by Agent_List::Union().

00071 {
00072   PrvCurPtr RetVal;
00073   Agent_List **prv, *cur;
00074 
00075   for (prv= start, cur=*start; cur != NULL; prv= &(cur->next), cur=cur->next) {
00076     if ( NODE_ADDR(cur) == addr.addr_ && PORT(cur)==addr.port_) 
00077       break;
00078   }
00079  
00080   RetVal.prv = prv;
00081   RetVal.cur = cur;
00082 
00083   return RetVal;
00084 }

In_List * In_List::FindMaxIn  ) 
 

Definition at line 114 of file iflist.cc.

References IN_NEXT, PREV_RECV, and TOTAL_RECV.

00115 {
00116   In_List *cur_in, *max_in;
00117   int     max_diff;
00118 
00119   max_in = NULL;
00120   max_diff = 0;
00121 
00122   for (cur_in = this; cur_in != NULL;
00123        cur_in = IN_NEXT(cur_in) ) {
00124     if ( TOTAL_RECV(cur_in) - PREV_RECV(cur_in) > max_diff) {
00125       max_diff = TOTAL_RECV(cur_in) - PREV_RECV(cur_in);
00126       max_in = cur_in;
00127     }
00128   }
00129 
00130   return max_in;
00131 }

void Agent_List::FreeAll Agent_List **   )  [inherited]
 

Definition at line 56 of file iflist.cc.

References Agent_List::next.

00057 {
00058   Agent_List *temp;
00059   Agent_List *next;
00060 
00061   for (temp = *prev; temp != NULL; temp=next) {
00062     next = temp->next;
00063     delete temp;
00064   }
00065 
00066   *prev = NULL;
00067 }

void Agent_List::InsertFront Agent_List **  ,
Agent_List
[inherited]
 

Definition at line 37 of file iflist.cc.

References Agent_List::next.

Referenced by Agent_List::Union().

00038 {
00039   if (cur == NULL)
00040      return;
00041 
00042   cur->next = *start;
00043   *start = cur;
00044 }

void Agent_List::print  )  [virtual, inherited]
 

Definition at line 104 of file iflist.cc.

References ns_addr_t::addr_, Agent_List::agent_addr, Agent_List::next, and ns_addr_t::port_.

00105 {
00106   Agent_List *cur;
00107 
00108   for (cur=this; cur!=NULL; cur=cur->next) {
00109     printf("(%d,%d)\n", cur->agent_addr.addr_, cur->agent_addr.port_);
00110   }
00111 }

void Agent_List::Remove Agent_List **  ,
Agent_List
[inherited]
 

Definition at line 47 of file iflist.cc.

References Agent_List::next.

00048 {
00049   if (cur == NULL)
00050     return;
00051 
00052   *prev = cur->next;  
00053 }

void Agent_List::Union Agent_List **  ,
Agent_List
[inherited]
 

Definition at line 89 of file iflist.cc.

References AGENT_NEXT, AGT_ADDR, PrvCurPtr::cur, Agent_List::Find(), and Agent_List::InsertFront().

00090 {
00091   PrvCurPtr RetVal;
00092   Agent_List *dupAgent;
00093   
00094   for (Agent_List *cur=list1; cur != NULL; cur=AGENT_NEXT(cur)) {
00095     RetVal = Find(result, AGT_ADDR(cur));
00096     if (RetVal.cur == NULL) {
00097       dupAgent = new Agent_List;
00098       *dupAgent = *cur;
00099       InsertFront(result, dupAgent);
00100     }
00101   }
00102 }

Here is the call graph for this function:


Member Data Documentation

ns_addr_t Agent_List::agent_addr [inherited]
 

Definition at line 95 of file iflist.h.

Referenced by Agent_List::Agent_List(), and Agent_List::print().

double In_List::avg_delay
 

Definition at line 144 of file iflist.h.

Referenced by In_List().

double In_List::last_ts_new_sub
 

Definition at line 158 of file iflist.h.

Referenced by In_List().

int In_List::new_org_recv
 

Definition at line 155 of file iflist.h.

Referenced by In_List().

int In_List::new_sub_recv
 

Definition at line 157 of file iflist.h.

Referenced by In_List().

Agent_List* Agent_List::next [inherited]
 

Definition at line 96 of file iflist.h.

Referenced by Agent_List::Agent_List(), DiffusionRate::consider_new(), DiffusionProb::consider_new(), DiffusionProb::consider_old(), OmniMcastAgent::ConsiderNew(), FloodingAgent::ConsiderNew(), Agent_List::Find(), Agent_List::FreeAll(), DiffusionRate::GradientTimeOut(), Agent_List::InsertFront(), Agent_List::print(), and Agent_List::Remove().

int In_List::num_loss
 

Definition at line 148 of file iflist.h.

Referenced by In_List().

int In_List::num_neg_send
 

Definition at line 149 of file iflist.h.

Referenced by DiffusionRate::GenNeg(), and In_List().

int In_List::num_pos_send
 

Definition at line 150 of file iflist.h.

Referenced by In_List().

int In_List::old_org_recv
 

Definition at line 156 of file iflist.h.

Referenced by In_List().

int In_List::prev_received
 

Definition at line 147 of file iflist.h.

Referenced by DiffusionProb::FwdPosReinf(), DiffusionProb::GenPosReinf(), and In_List().

int In_List::total_new_org_recv
 

Definition at line 152 of file iflist.h.

Referenced by In_List().

int In_List::total_new_sub_recv
 

Definition at line 154 of file iflist.h.

Referenced by In_List().

int In_List::total_old_org_recv
 

Definition at line 153 of file iflist.h.

Referenced by In_List().

int In_List::total_received
 

Definition at line 146 of file iflist.h.

Referenced by DiffusionProb::FwdPosReinf(), DiffusionProb::GenPosReinf(), In_List(), and DiffusionProb::Print_IOlist().

double In_List::var_delay
 

Definition at line 145 of file iflist.h.

Referenced by In_List().


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