GiaNode Class Reference

This class represents a node in gia overlay network. More...

#include <GiaNode.h>

Inheritance diagram for GiaNode:
NodeHandle TransportAddress

List of all members.

Public Member Functions

 GiaNode ()
virtual ~GiaNode ()
 GiaNode (const NodeHandle &handle)
 GiaNode (const NodeHandle &handle, double cap, int degree)
GiaNodeoperator= (const NodeHandle &handle)
 an unspecified node
void setCapacity (double capacity)
 Set capacity (function of bandwidth, cpu power and HDD-fitness.
double getCapacity () const
 Get capacity.

Static Public Attributes

static const GiaNode UNSPECIFIED_NODE
 the unspecified NodeHandle

Protected Attributes

double capacity

Friends

std::ostream & operator<< (std::ostream &os, const GiaNode &n)

Detailed Description

This class represents a node in gia overlay network.

Definition at line 38 of file GiaNode.h.


Constructor & Destructor Documentation

GiaNode::GiaNode (  ) 

Definition at line 31 of file GiaNode.cc.

00032 {
00033     //...
00034 }

virtual GiaNode::~GiaNode (  )  [inline, virtual]

Definition at line 43 of file GiaNode.h.

00043 {};

GiaNode::GiaNode ( const NodeHandle handle  ) 

Definition at line 36 of file GiaNode.cc.

00036                                          : NodeHandle(handle)
00037 {
00038     //...
00039 }

GiaNode::GiaNode ( const NodeHandle handle,
double  cap,
int  degree 
)

Definition at line 42 of file GiaNode.cc.

00042                                                                  : NodeHandle(handle)
00043 {
00044     capacity = cap;
00045 }


Member Function Documentation

double GiaNode::getCapacity (  )  const
GiaNode & GiaNode::operator= ( const NodeHandle handle  ) 

an unspecified node

Reimplemented from NodeHandle.

Definition at line 47 of file GiaNode.cc.

00048 {
00049     ip = handle.getAddress();
00050     port = handle.getPort();
00051     key = handle.getKey();
00052     capacity = 0;
00053 
00054     return *this;
00055 }

void GiaNode::setCapacity ( double  capacity  ) 

Set capacity (function of bandwidth, cpu power and HDD-fitness.

Parameters:
capacity Capacity to set

Definition at line 57 of file GiaNode.cc.

Referenced by Gia::changeState().

00058 {
00059     capacity = cap;
00060 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const GiaNode n 
) [friend]

Definition at line 67 of file GiaNode.cc.

00068 {
00069     if(node.ip.isUnspecified() == true && node.key.isUnspecified() && node.port == -1) {
00070         os << "<unspec>";
00071     } else {
00072         os << node.ip << ":" << node.port << " "
00073            << node.key.toString() << " with capacity: "
00074            << node.capacity //<< " , degree: " << node.connectionDegree
00075             //<< " , sentTokens: " << node.sentTokens << " , receivedTokens: " << node.receivedTokens;
00076             ;
00077     }
00078     return os;
00079 }


Member Data Documentation

double GiaNode::capacity [protected]

Definition at line 70 of file GiaNode.h.

Referenced by getCapacity(), GiaNode(), operator<<(), operator=(), and setCapacity().

the unspecified NodeHandle

Reimplemented from NodeHandle.

Definition at line 49 of file GiaNode.h.

Referenced by GiaNeighbors::get(), and GiaNeighbors::getDropCandidate().


The documentation for this class was generated from the following files:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3