I3IPAddress Struct Reference

#include <I3IPAddress.h>

Inheritance diagram for I3IPAddress:

TransportAddress

List of all members.


Detailed Description

A simple wrapper around an IPvXAddress and a port.

Author:
Antonio Zea

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.

Constructor & Destructor Documentation

I3IPAddress::I3IPAddress (  ) 

Constructor.

Author:
Antonio Zea
00024 {
00025     port = 0;
00026 }

I3IPAddress::I3IPAddress ( IPvXAddress  add,
int  port 
)

Constructor.

00029 {
00030     ip = add;
00031     port = p;
00032 }


Member Function Documentation

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

"Less than" operator

Parameters:
a Address to be compared
00035 {
00036     return ip < a.ip || (ip == a.ip && port < a.port);
00037 }

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

"Equals" operator (takes port in account)

Parameters:
a Address to be compared
00040 {
00041     return ip == a.ip && port == a.port;
00042 }

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

"Greater than" operator (takes port in account)

Parameters:
a Address to be compared
00045 {
00046     return a < *this;
00047 }

int I3IPAddress::length (  )  const

Referenced by I3SubIdentifier::length().

00049                               {
00050     //return sizeof(address) + sizeof(port);
00051     return (ip.isIPv6() ? 128 : 32) + 16; // 16 = port length
00052 }


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
00054                                                               {
00055     os << ip.ip << ':' << ip.port;
00056     return os;
00057 }


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

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