Public Member Functions | Static Public Attributes | Protected Attributes | Friends

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.

{
    //...
}

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

Definition at line 43 of file GiaNode.h.

{};

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;
}


Member Function Documentation

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

an unspecified node

Reimplemented from NodeHandle.

Definition at line 47 of file GiaNode.cc.

{
    ip = handle.getIp();
    port = handle.getPort();
    key = handle.getKey();
    capacity = 0;

    return *this;
}

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

{
    capacity = cap;
}


Friends And Related Function Documentation

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;
}


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: