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

From_List Class Reference

#include <iflist.h>

Inheritance diagram for From_List:

Inheritance graph
[legend]
Collaboration diagram for From_List:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 From_List ()
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

int rank
bool is_sink
ns_addr_t agent_addr
Agent_Listnext

Constructor & Destructor Documentation

From_List::From_List  )  [inline]
 

Definition at line 119 of file iflist.h.

References is_sink, and rank.

00119 : Agent_List() { rank = 0; is_sink = false; }


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 }

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().

bool From_List::is_sink
 

Definition at line 117 of file iflist.h.

Referenced by DiffusionProb::add_outlist(), DiffusionProb::consider_new(), DiffusionProb::consider_old(), and From_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 From_List::rank
 

Definition at line 116 of file iflist.h.

Referenced by DiffusionProb::add_outlist(), DiffusionProb::CalGradient(), DiffusionProb::consider_new(), DiffusionProb::consider_old(), and From_List().


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