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

Friends

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

Constructor & Destructor Documentation

BrooseHandle::BrooseHandle (  ) 

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

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

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

BrooseHandle::BrooseHandle ( const NodeHandle node  ) 

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


Member Function Documentation

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

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

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

00085 {
00086 
00087     this->key = rhs.key;
00088     this->ip = rhs.ip;
00089     this->port = rhs.port;
00090     this->failedResponses = rhs.failedResponses;
00091     this->rtt = rhs.rtt;
00092     this->lastSeen = rhs.lastSeen;
00093     return *this;
00094 }

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

00097 {
00098     if(this->isUnspecified() || rhs.isUnspecified())
00099         opp_error("BrooseHandle: Trying to compare unspecified nodeHandle!");
00100 
00101     if( this->key != rhs.key )
00102         return false;
00103     if( this->ip != rhs.ip )
00104         return false;
00105     if( this->port != rhs.port )
00106         return false;
00107     return true;
00108 }


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;
00039     }
00040 
00041     return os;
00042 };


Member Data Documentation

int BrooseHandle::failedResponses

simtime_t BrooseHandle::lastSeen

simtime_t BrooseHandle::rtt

const BrooseHandle BrooseHandle::UNSPECIFIED_NODE [static]

Reimplemented from NodeHandle.


The documentation for this class was generated from the following files:
Generated on Fri May 11 14:52:39 2007 for ITM OverSim by  doxygen 1.4.7