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.
: NodeHandle(handle) { //... }
GiaNode::GiaNode | ( | const NodeHandle & | handle, | |
double | cap, | |||
int | degree | |||
) |
Definition at line 42 of file GiaNode.cc.
: NodeHandle(handle) { capacity = cap; }
double GiaNode::getCapacity | ( | ) | const |
Get capacity.
Definition at line 62 of file GiaNode.cc.
Referenced by Gia::acceptNode(), Gia::calculateLevelOfSatisfaction(), Gia::changeState(), Gia::forwardMessage(), GiaNeighbors::getDropCandidate(), 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().
{ return capacity; }
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().
{ capacity = cap; }
std::ostream& operator<< | ( | std::ostream & | os, | |
const GiaNode & | n | |||
) | [friend] |
Definition at line 67 of file GiaNode.cc.
{ if(node.ip.isUnspecified() == true && node.key.isUnspecified() && node.port == -1) { os << "<unspec>"; } else { os << node.ip << ":" << node.port << " " << node.key.toString() << " with capacity: " << node.capacity //<< " , degree: " << node.connectionDegree //<< " , sentTokens: " << node.sentTokens << " , receivedTokens: " << node.receivedTokens; ; } return os; }
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().