#include <TransportAddress.h>
Inheritance diagram for TransportAddress:
It covers the complete node information, like IP-Address, and port. 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< TransportAddress, hashFcn > | Set |
Public Member Functions | |
TransportAddress () | |
Constructs a unspecified TransportAddress. | |
virtual | ~TransportAddress () |
Standard destructor. | |
TransportAddress (const TransportAddress &handle) | |
Copy constructor. | |
TransportAddress (const IPvXAddress &ip, int port=-1) | |
Complete constructor. | |
bool | operator== (const TransportAddress &rhs) const |
bool | operator!= (const TransportAddress &rhs) const |
bool | operator< (const TransportAddress &rhs) const |
bool | operator> (const TransportAddress &rhs) const |
bool | operator<= (const TransportAddress &rhs) const |
bool | operator>= (const TransportAddress &rhs) const |
TransportAddress & | operator= (const TransportAddress &rhs) |
void | setAddress (const IPvXAddress &ip, int port=-1) |
void | setPort (int port) |
const IPvXAddress & | getAddress () const |
int | getPort () const |
bool | isUnspecified () const |
size_t | hash () const |
virtual void | netPack (cCommBuffer *b) |
virtual void | netUnpack (cCommBuffer *b) |
Public Attributes | |
IPvXAddress | ip |
int | port |
Static Public Attributes | |
static const TransportAddress | UNSPECIFIED_NODE |
Private Member Functions | |
void | assertUnspecified (const TransportAddress &handle) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const TransportAddress &n) |
Classes | |
class | hashFcn |
typedef hash_set<TransportAddress, hashFcn> TransportAddress::Set |
Reimplemented in NodeHandle.
TransportAddress::TransportAddress | ( | ) |
TransportAddress::TransportAddress | ( | const TransportAddress & | handle | ) |
TransportAddress::TransportAddress | ( | const IPvXAddress & | ip, | |
int | port = -1 | |||
) |
void TransportAddress::assertUnspecified | ( | const TransportAddress & | handle | ) | const [inline, private] |
00170 { 00171 if ( this->isUnspecified() || handle.isUnspecified() ) 00172 opp_error("TransportAddress: Trying to compare unspecified nodeHandle!"); 00173 }
const IPvXAddress & TransportAddress::getAddress | ( | ) | const |
int TransportAddress::getPort | ( | ) | const |
size_t TransportAddress::hash | ( | ) | const |
bool TransportAddress::isUnspecified | ( | ) | const |
void TransportAddress::netPack | ( | cCommBuffer * | b | ) | [virtual] |
Reimplemented in NodeHandle.
00216 { 00217 //cMessage::netPack(b); 00218 doPacking(b,this->ip); 00219 doPacking(b,this->port); 00220 }
void TransportAddress::netUnpack | ( | cCommBuffer * | b | ) | [virtual] |
Reimplemented in NodeHandle.
00223 { 00224 //cMessage::netUnpack(b); 00225 doUnpacking(b,this->ip); 00226 doUnpacking(b,this->port); 00227 }
bool TransportAddress::operator!= | ( | const TransportAddress & | rhs | ) | const |
00094 { 00095 assertUnspecified(rhs); 00096 return !(this->ip == rhs.ip && this->port == rhs.port ); 00097 }
bool TransportAddress::operator< | ( | const TransportAddress & | rhs | ) | const |
bool TransportAddress::operator<= | ( | const TransportAddress & | rhs | ) | const |
TransportAddress & TransportAddress::operator= | ( | const TransportAddress & | rhs | ) |
bool TransportAddress::operator== | ( | const TransportAddress & | rhs | ) | const |
00087 { 00088 assertUnspecified(rhs); 00089 return (this->ip == rhs.ip && this->port == rhs.port); 00090 }
bool TransportAddress::operator> | ( | const TransportAddress & | rhs | ) | const |
00108 { 00109 assertUnspecified(rhs); 00110 return !(this->ip < rhs.ip || this->ip == rhs.ip); 00111 }
bool TransportAddress::operator>= | ( | const TransportAddress & | rhs | ) | const |
void TransportAddress::setAddress | ( | const IPvXAddress & | ip, | |
int | port = -1 | |||
) |
std::ostream& operator<< | ( | std::ostream & | os, | |
const TransportAddress & | n | |||
) | [friend] |
00038 { 00039 if (n.isUnspecified()) { 00040 os << "<unspec>"; 00041 } else { 00042 os << n.ip << ":" << n.port; 00043 } 00044 00045 return os; 00046 };
IPvXAddress TransportAddress::ip |
const TransportAddress TransportAddress::UNSPECIFIED_NODE [static] |
Reimplemented in NodeHandle, and BrooseHandle.