This class represents a node in gia overlay network. More...
#include <GiaNode.h>
Public Member Functions | |
GiaNode () | |
virtual | ~GiaNode () |
GiaNode (const NodeHandle &handle) | |
GiaNode (const NodeHandle &handle, double cap, int degree) | |
GiaNode & | operator= (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) |
This class represents a node in gia overlay network.
Definition at line 38 of file GiaNode.h.
GiaNode::GiaNode | ( | ) |
Definition at line 31 of file GiaNode.cc.
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 }
double GiaNode::getCapacity | ( | ) | const |
Get capacity.
Definition at line 62 of file GiaNode.cc.
Referenced by Gia::acceptNode(), Gia::calculateLevelOfSatisfaction(), Gia::changeState(), Gia::forwardMessage(), Gia::getRoute(), Gia::handleAppMessage(), GiaTokenFactory::tokenCompareGiaNode::operator()(), GiaMessageBookkeeping::GiaNodeQueueCompare::operator()(), Gia::sendKeyListToNeighbor(), Gia::sendMessage_DISCONNECT(), Gia::sendMessage_JOIN_ACK(), Gia::sendMessage_JOIN_DNY(), Gia::sendMessage_JOIN_REQ(), Gia::sendMessage_JOIN_RSP(), Gia::sendMessage_UPDATE(), Gia::sendSearchResponseMessage(), and Gia::sendToken().
00063 { 00064 return capacity; 00065 }
GiaNode & GiaNode::operator= | ( | const NodeHandle & | handle | ) |
void GiaNode::setCapacity | ( | double | capacity | ) |
Set capacity (function of bandwidth, cpu power and HDD-fitness.
capacity | Capacity to set |
Definition at line 57 of file GiaNode.cc.
Referenced by Gia::changeState().
00058 { 00059 capacity = cap; 00060 }
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 }
double GiaNode::capacity [protected] |
Definition at line 70 of file GiaNode.h.
Referenced by getCapacity(), GiaNode(), operator<<(), operator=(), and setCapacity().
const GiaNode GiaNode::UNSPECIFIED_NODE [static] |
the unspecified NodeHandle
Reimplemented from NodeHandle.
Definition at line 49 of file GiaNode.h.
Referenced by GiaNeighbors::get(), and GiaNeighbors::getDropCandidate().