Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Address Class Reference

Inherited by InetAddress.

List of all members.


Detailed Description

A network Address (e.g., an IPv4 or IPv6 Address and port, or a UNIX-domain Socket path).

Addresses, like STL strings, may be passed and copied by value.


Public Methods

 Address ()
 Constructs an empty Address.

 Address (const void *addr, socklen_t len)
 Constructs an Address from a block of data.

const sockaddr * data () const
 Returns a pointer to the data as a sockaddr.

socklen_t length () const
 Returns the length of the Address structure.

const string & data_as_string () const
 Returns the Address structure as a string.

 operator const void * () const
 Returns a non-null pointer if and only if this Address is non-empty.

string as_string () const
 Returns a human-readable version of the string.

 NMSTL_ARITH_OPS (Address, data_as_string())
 NMSTL_SIMPLY_SERIALIZABLE (Address,<< addr)

Protected Attributes

string addr


Constructor & Destructor Documentation

Address::Address  
 

Constructs an empty Address.

Address::Address const void *    addr,
socklen_t    len
 

Constructs an Address from a block of data.


Member Function Documentation

string Address::as_string  
 

Returns a human-readable version of the string.

Reimplemented in InetAddress.

const sockaddr* Address::data   const
 

Returns a pointer to the data as a sockaddr.

const string& Address::data_as_string   const
 

Returns the Address structure as a string.

The string is not human-readable; rather it is a string equal to string(this->data(), this->length()).

socklen_t Address::length   const
 

Returns the length of the Address structure.

Address::NMSTL_ARITH_OPS Address   ,
data_as_string()   
 

Address::NMSTL_SIMPLY_SERIALIZABLE Address   ,
<<    addr
 

Address::operator const void *   const
 

Returns a non-null pointer if and only if this Address is non-empty.

This exists primarily to enable the "if (Address) { ... }" metaphor.


Member Data Documentation

string Address::addr [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL