BrooseHandle Class Reference

#include <BrooseHandle.h>

Inheritance diagram for BrooseHandle:

NodeHandle TransportAddress

List of all members.

Public Member Functions

 BrooseHandle ()
 BrooseHandle (OverlayKey initKey, IPvXAddress initIP, int initPort)
 BrooseHandle (const NodeHandle &node)
 BrooseHandle (const TransportAddress &node, const OverlayKey &destKey)
bool operator== (const BrooseHandle &rhs) const
bool operator!= (const BrooseHandle &rhs) const
BrooseHandleoperator= (const BrooseHandle &rhs)

Public Attributes

int failedResponses
simtime_t rtt
simtime_t lastSeen

Static Public Attributes

static const BrooseHandle UNSPECIFIED_NODE
 the unspecified NodeHandle

Friends

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


Constructor & Destructor Documentation

BrooseHandle::BrooseHandle (  ) 

00047 {
00048     //
00049     // Default-constructor.
00050     //
00051     port = -1;
00052     key = OverlayKey::UNSPECIFIED_KEY;
00053     failedResponses = 0;
00054     rtt = -1;
00055     lastSeen = -1;
00056 }

BrooseHandle::BrooseHandle ( OverlayKey  initKey,
IPvXAddress  initIP,
int  initPort 
)

00059 {
00060     //
00061     // Constructor. Initializes the node handle with the passed arguments.
00062     //
00063     ip = initIP;
00064     port = initPort;
00065     key = initKey;
00066     failedResponses = 0;
00067     rtt = -1;
00068     lastSeen = -1;
00069 }

BrooseHandle::BrooseHandle ( const NodeHandle node  ) 

00072 {
00073     //
00074     // Constructor. Initializes the node handle with the passed arguments.
00075     //
00076     ip = node.ip;
00077     port = node.port;
00078     key = node.key;
00079     failedResponses = 0;
00080     rtt = -1;
00081     lastSeen = -1;
00082 }

BrooseHandle::BrooseHandle ( const TransportAddress node,
const OverlayKey destKey 
)

00086 {
00087     //
00088     // Constructor. Initializes the node handle with the passed arguments.
00089     //
00090     ip = node.ip;
00091     port = node.port;
00092     key = destKey;
00093     rtt = -1;
00094     lastSeen = -1;
00095 }


Member Function Documentation

bool BrooseHandle::operator== ( const BrooseHandle rhs  )  const

00110 {
00111     if(this->isUnspecified() || rhs.isUnspecified())
00112         opp_error("BrooseHandle: Trying to compare unspecified nodeHandle!");
00113 
00114     if( this->key != rhs.key )
00115         return false;
00116     if( this->ip != rhs.ip )
00117         return false;
00118     if( this->port != rhs.port )
00119         return false;
00120     return true;
00121 }

bool BrooseHandle::operator!= ( const BrooseHandle rhs  )  const

00124 {
00125     if(this->isUnspecified() || rhs.isUnspecified())
00126         opp_error("BrooseHandle: Trying to compare unspecified nodeHandle!");
00127 
00128     if ( this->key == rhs.key &&
00129          this->ip == rhs.ip && this->port == rhs.port)
00130         return false;
00131     return true;
00132 }

BrooseHandle & BrooseHandle::operator= ( const BrooseHandle rhs  ) 

00098 {
00099 
00100     this->key = rhs.key;
00101     this->ip = rhs.ip;
00102     this->port = rhs.port;
00103     this->failedResponses = rhs.failedResponses;
00104     this->rtt = rhs.rtt;
00105     this->lastSeen = rhs.lastSeen;
00106     return *this;
00107 }


Friends And Related Function Documentation

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

00034 {
00035     if (n.isUnspecified()) {
00036         os << "<unspec>";
00037     } else {
00038         os << n.ip << ":" << n.port << " " << n.key << " last-seen: " << n.lastSeen
00039            << " failedResponses: " << n.failedResponses << " rtt: " << n.rtt;
00040     }
00041 
00042     return os;
00043 };


Member Data Documentation

Referenced by BrooseHandle(), operator<<(), and operator=().

simtime_t BrooseHandle::rtt

the unspecified NodeHandle

Reimplemented from NodeHandle.

Referenced by BrooseBucket::get().


The documentation for this class was generated from the following files:

Generated on Fri Sep 19 13:05:06 2008 for ITM OverSim by  doxygen 1.5.5