NodeID Class Reference

Represents a unique identifier for each Fountain node in the system. More...

#include <NodeID.h>

List of all members.

Public Member Functions

 NodeID (const std::string &ID)
 Constructor.
 NodeID (const std::string &hostname, int listenPort)
 Constructor for hostname and listen ports.
 NodeID (const NodeID &rhs)
 copy constructor
const NodeIDoperator= (const NodeID &rhs)
 Assignment operator.
 operator std::string () const
 Implicit conversion operator to std::string.
 operator const char * () const
 Implicit conversion operator to std::string.
const std::string & getHostname () const
 Get the hostname portion of this object.
int getListenPort () const
 Get the listen port portion of this object.
bool operator== (const NodeID &rhs) const
 equality operator
bool operator!= (const NodeID &rhs) const
 inequality operator
bool operator< (const NodeID &rhs) const
 less than operator

Private Attributes

std::string ID_
 The ID in the form of hostname_port.
std::string hostname_
 The hostname.
int listenPort_
 The listen port.

Friends

std::ostream & operator<< (std::ostream &output, const NodeID &_node)
 ostream operator


Detailed Description

Represents a unique identifier for each Fountain node in the system.

handles Fountain node identifcation in the form of hostname_listenport where hostname is the hostname truncated to the first period and listenport is the listening socket number that the Fountain node is using to accept new connections.


Constructor & Destructor Documentation

NodeID::NodeID const std::string &  ID  ) 
 

Constructor.

Exceptions:
FountainException if the ID parameter could not be parsed
Parameters:
ID The identifier string of a FountainNode

NodeID::NodeID const std::string &  hostname,
int  listenPort
 

Constructor for hostname and listen ports.

Parameters:
hostname The hostname portion of the NodeID
listenPort The port portion of the NodeID


Member Function Documentation

const std::string& NodeID::getHostname  )  const [inline]
 

Get the hostname portion of this object.

Returns:
A std::string containing the hostname portion of the NodeID

int NodeID::getListenPort  )  const [inline]
 

Get the listen port portion of this object.

Returns:
The listening port of the NodeID

bool NodeID::operator!= const NodeID rhs  )  const [inline]
 

inequality operator

Parameters:
rhs The NodeID object to compare with
Returns:
false if the two NodeID objects are lexicographically equal

true otherwise

bool NodeID::operator< const NodeID rhs  )  const [inline]
 

less than operator

Parameters:
rhs The NodeID object to compare with
Returns:
true if the this NodeID is lexicographically less than the rhs NodeID

false otherwise

bool NodeID::operator== const NodeID rhs  )  const [inline]
 

equality operator

Parameters:
rhs The NodeID object to compare with
Returns:
true if the two NodeID objects are lexicographically equal

false otherwise


The documentation for this class was generated from the following files:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6