neo::network::AddressIP Class Reference

#include <network/ip.h>

Inheritance diagram for neo::network::AddressIP:

Inheritance graph
[legend]
Collaboration diagram for neo::network::AddressIP:

Collaboration graph
[legend]
List of all members.

Detailed Description

Internet Protocol address class encapsulating methods for address resolving and reverse lookup, supporting both IPv4 and IPv6.
Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 AddressIP ()
 Setup address.
 AddressIP (const AddressIP &addr)
 Copy address.
virtual ~AddressIP ()
 Free resources.
virtual const sockaddr * getAddress () const
 Get socket address.
virtual socklen_t getAddressSize () const
 Get address size.
virtual std::string getAddressAsString () const
 Get address as string.
std::string getHost () const
 Get address host.
void setPort (unsigned int port)
 Set address port.
unsigned int getPort () const
 Get address port.
AddressIPoperator= (const AddressIP &addr)
 Copy address.
bool operator== (const AddressIP &addr) const
 Compare address.
virtual AddressIPclone () const
 Clone address.

Static Public Member Functions

static AddressIPresolveAddress (const std::string &host, unsigned int port=0)
 Resolve address.
static AddressIPcreateAddress (sockaddr_in *p_saddr)
 Create address.

Protected Attributes

sockaddr_in * _p_addr
 Socket address.


Constructor & Destructor Documentation

neo::network::AddressIP::AddressIP ( const AddressIP addr  ) 

Parameters:
addr Address


Member Function Documentation

virtual const sockaddr* neo::network::AddressIP::getAddress (  )  const [virtual]

Returns:
Socket address

Implements neo::network::Address.

virtual socklen_t neo::network::AddressIP::getAddressSize (  )  const [virtual]

Returns:
Address size

Implements neo::network::Address.

virtual std::string neo::network::AddressIP::getAddressAsString (  )  const [virtual]

Returns:
Socket address

Implements neo::network::Address.

std::string neo::network::AddressIP::getHost (  )  const

Returns:
Host

void neo::network::AddressIP::setPort ( unsigned int  port  ) 

Parameters:
port Port

unsigned int neo::network::AddressIP::getPort (  )  const

Returns:
Port

static AddressIP* neo::network::AddressIP::resolveAddress ( const std::string &  host,
unsigned int  port = 0 
) [static]

Resolve hostname or address string

Parameters:
host Hostname or address string
port Port
Returns:
Resolved address (should be deleted)

static AddressIP* neo::network::AddressIP::createAddress ( sockaddr_in *  p_saddr  )  [static]

Create address from socket layer address data

Parameters:
p_saddr Socket address
Returns:
Address (should be deleted)

AddressIP& neo::network::AddressIP::operator= ( const AddressIP addr  ) 

Parameters:
addr Address
Returns:
Self-reference

bool neo::network::AddressIP::operator== ( const AddressIP addr  )  const

Parameters:
addr Address to compare with
Returns:
true if equal

virtual AddressIP* neo::network::AddressIP::clone (  )  const [virtual]

Returns:
Copy of address

Implements neo::network::Address.


The documentation for this class was generated from the following file:
Generated on Sat Feb 17 20:51:06 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1