#include <NodeHandle.h>
Inheritance diagram for NodeHandle:
It covers the complete node information, like IP-Address, port, NodeKey and some additional flags for Simulation behaviour. The information can be sparse, so parts can be omited by setting the property to an unspecified value.
Sebastian Mies
Public Types | |
typedef hash_set< NodeHandle, hashFcn > | Set |
Public Member Functions | |
NodeHandle () | |
Constructs a unspecified NodeHandle. | |
virtual | ~NodeHandle () |
Standard destructor. | |
NodeHandle (const NodeHandle &handle) | |
Copy constructor. | |
NodeHandle (const OverlayKey &key, const IPvXAddress &ip, int port) | |
Complete constructor. | |
bool | operator== (const NodeHandle &rhs) const |
bool | operator!= (const NodeHandle &rhs) const |
bool | operator< (const NodeHandle &rhs) const |
bool | operator> (const NodeHandle &rhs) const |
bool | operator<= (const NodeHandle &rhs) const |
bool | operator>= (const NodeHandle &rhs) const |
NodeHandle & | operator= (const NodeHandle &rhs) |
void | setKey (const OverlayKey &key) |
const OverlayKey & | getKey () const |
bool | isUnspecified () const |
virtual void | netPack (cCommBuffer *b) |
virtual void | netUnpack (cCommBuffer *b) |
Public Attributes | |
OverlayKey | key |
Static Public Attributes | |
static const NodeHandle | UNSPECIFIED_NODE |
Private Member Functions | |
void | assertUnspecified (const NodeHandle &handle) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const NodeHandle &n) |
typedef hash_set<NodeHandle, hashFcn> NodeHandle::Set |
Reimplemented from TransportAddress.
NodeHandle::NodeHandle | ( | ) |
Constructs a unspecified NodeHandle.
00044 { 00045 port = -1; 00046 key = OverlayKey::UNSPECIFIED_KEY; 00047 }
NodeHandle::NodeHandle | ( | const NodeHandle & | handle | ) |
NodeHandle::NodeHandle | ( | const OverlayKey & | key, | |
const IPvXAddress & | ip, | |||
int | port | |||
) |
void NodeHandle::assertUnspecified | ( | const NodeHandle & | handle | ) | const [inline, private] |
00142 { 00143 if ( this->isUnspecified() || handle.isUnspecified() ) 00144 opp_error("NodeHandle: Trying to compare unspecified NodeHandle!"); 00145 }
const OverlayKey & NodeHandle::getKey | ( | ) | const |
bool NodeHandle::isUnspecified | ( | ) | const |
Reimplemented from TransportAddress.
00069 { 00070 return (ip.isUnspecified() || key.isUnspecified()); 00071 }
void NodeHandle::netPack | ( | cCommBuffer * | b | ) | [virtual] |
Reimplemented from TransportAddress.
00189 { 00190 //cMessage::netPack(b); 00191 doPacking(b,this->ip); 00192 doPacking(b,this->key); 00193 doPacking(b,this->port); 00194 }
void NodeHandle::netUnpack | ( | cCommBuffer * | b | ) | [virtual] |
Reimplemented from TransportAddress.
00197 { 00198 //cMessage::netUnpack(b); 00199 doUnpacking(b,this->ip); 00200 doUnpacking(b,this->key); 00201 doUnpacking(b,this->port); 00202 }
bool NodeHandle::operator!= | ( | const NodeHandle & | rhs | ) | const |
bool NodeHandle::operator< | ( | const NodeHandle & | rhs | ) | const |
bool NodeHandle::operator<= | ( | const NodeHandle & | rhs | ) | const |
NodeHandle & NodeHandle::operator= | ( | const NodeHandle & | rhs | ) |
bool NodeHandle::operator== | ( | const NodeHandle & | rhs | ) | const |
00085 { 00086 assertUnspecified( rhs ); 00087 return ( this->key == rhs.key && 00088 this->ip == rhs.ip && this->port == rhs.port ); 00089 }
bool NodeHandle::operator> | ( | const NodeHandle & | rhs | ) | const |
bool NodeHandle::operator>= | ( | const NodeHandle & | rhs | ) | const |
void NodeHandle::setKey | ( | const OverlayKey & | key | ) |
std::ostream& operator<< | ( | std::ostream & | os, | |
const NodeHandle & | n | |||
) | [friend] |
00031 { 00032 if (n.isUnspecified()) { 00033 os << "<unspec>"; 00034 } else { 00035 os << n.ip << ":" << n.port << " " << n.key; 00036 } 00037 00038 return os; 00039 };
const NodeHandle NodeHandle::UNSPECIFIED_NODE [static] |