I3IPAddress Struct Reference

A simple wrapper around an IPvXAddress and a port. More...

#include <I3IPAddress.h>

Inheritance diagram for I3IPAddress:
TransportAddress

List of all members.

Public Member Functions

 I3IPAddress ()
 Constructor.
 I3IPAddress (IPvXAddress add, int port)
 Constructor.
bool operator< (const I3IPAddress &a) const
 "Less than" operator
bool operator== (const I3IPAddress &a) const
 "Equals" operator (takes port in account)
bool operator> (const I3IPAddress &a) const
 "Greater than" operator (takes port in account)
int length () const

Friends

std::ostream & operator<< (std::ostream &os, const I3IPAddress &ip)
 String stream output operation.

Detailed Description

A simple wrapper around an IPvXAddress and a port.

Definition at line 32 of file I3IPAddress.h.


Constructor & Destructor Documentation

I3IPAddress::I3IPAddress (  ) 

Constructor.

Definition at line 26 of file I3IPAddress.cc.

00027 {
00028     port = 0;
00029 }

I3IPAddress::I3IPAddress ( IPvXAddress  add,
int  port 
)

Constructor.

Definition at line 31 of file I3IPAddress.cc.

00032 {
00033     ip = add;
00034     port = p;
00035 }


Member Function Documentation

int I3IPAddress::length (  )  const

Definition at line 52 of file I3IPAddress.cc.

Referenced by I3SubIdentifier::length().

00052                               {
00053     //return sizeof(address) + sizeof(port);
00054     return (ip.isIPv6() ? 128 : 32) + 16; // 16 = port length
00055 }

bool I3IPAddress::operator< ( const I3IPAddress a  )  const

"Less than" operator

Parameters:
a Address to be compared

Definition at line 37 of file I3IPAddress.cc.

00038 {
00039     return ip < a.ip || (ip == a.ip && port < a.port);
00040 }

bool I3IPAddress::operator== ( const I3IPAddress a  )  const

"Equals" operator (takes port in account)

Parameters:
a Address to be compared

Definition at line 42 of file I3IPAddress.cc.

00043 {
00044     return ip == a.ip && port == a.port;
00045 }

bool I3IPAddress::operator> ( const I3IPAddress a  )  const

"Greater than" operator (takes port in account)

Parameters:
a Address to be compared

Definition at line 47 of file I3IPAddress.cc.

00048 {
00049     return a < *this;
00050 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const I3IPAddress ip 
) [friend]

String stream output operation.

Parameters:
os String stream
ip Address to be output
Returns:
os parameter

Definition at line 57 of file I3IPAddress.cc.

00057                                                               {
00058     os << ip.ip << ':' << ip.port;
00059     return os;
00060 }


The documentation for this struct was generated from the following files:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3