Realistic 3D camera system
3D camera system components
Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
asio::ip::address Class Reference

Implements version-independent IP addresses. More...

#include <address.hpp>

Public Member Functions

ASIO_DECL address ()
 Default constructor. More...
 
ASIO_DECL address (const asio::ip::address_v4 &ipv4_address)
 Construct an address from an IPv4 address. More...
 
ASIO_DECL address (const asio::ip::address_v6 &ipv6_address)
 Construct an address from an IPv6 address. More...
 
ASIO_DECL address (const address &other)
 Copy constructor. More...
 
ASIO_DECL addressoperator= (const address &other)
 Assign from another address. More...
 
ASIO_DECL addressoperator= (const asio::ip::address_v4 &ipv4_address)
 Assign from an IPv4 address. More...
 
ASIO_DECL addressoperator= (const asio::ip::address_v6 &ipv6_address)
 Assign from an IPv6 address. More...
 
bool is_v4 () const
 Get whether the address is an IP version 4 address. More...
 
bool is_v6 () const
 Get whether the address is an IP version 6 address. More...
 
ASIO_DECL asio::ip::address_v4 to_v4 () const
 Get the address as an IP version 4 address. More...
 
ASIO_DECL asio::ip::address_v6 to_v6 () const
 Get the address as an IP version 6 address. More...
 
ASIO_DECL std::string to_string () const
 Get the address as a string in dotted decimal format. More...
 
ASIO_DECL std::string to_string (asio::error_code &ec) const
 Get the address as a string in dotted decimal format. More...
 
ASIO_DECL bool is_loopback () const
 Determine whether the address is a loopback address. More...
 
ASIO_DECL bool is_unspecified () const
 Determine whether the address is unspecified. More...
 
ASIO_DECL bool is_multicast () const
 Determine whether the address is a multicast address. More...
 

Static Public Member Functions

static ASIO_DECL address from_string (const char *str)
 
static ASIO_DECL address from_string (const char *str, asio::error_code &ec)
 
static ASIO_DECL address from_string (const std::string &str)
 
static ASIO_DECL address from_string (const std::string &str, asio::error_code &ec)
 

Friends

ASIO_DECL friend bool operator== (const address &a1, const address &a2)
 Compare two addresses for equality. More...
 
bool operator!= (const address &a1, const address &a2)
 Compare two addresses for inequality. More...
 
ASIO_DECL friend bool operator< (const address &a1, const address &a2)
 Compare addresses for ordering. More...
 
bool operator> (const address &a1, const address &a2)
 Compare addresses for ordering. More...
 
bool operator<= (const address &a1, const address &a2)
 Compare addresses for ordering. More...
 
bool operator>= (const address &a1, const address &a2)
 Compare addresses for ordering. More...
 

Related Functions

(Note that these are not member functions.)

template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< (std::basic_ostream< Elem, Traits > &os, const address &addr)
 Output an address as a string. More...
 

Detailed Description

Implements version-independent IP addresses.

The asio::ip::address class provides the ability to use either IP version 4 or version 6 addresses.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Definition at line 42 of file address.hpp.

Constructor & Destructor Documentation

asio::ip::address::address ( )

Default constructor.

Definition at line 31 of file address.ipp.

asio::ip::address::address ( const asio::ip::address_v4 ipv4_address)

Construct an address from an IPv4 address.

Definition at line 38 of file address.ipp.

asio::ip::address::address ( const asio::ip::address_v6 ipv6_address)

Construct an address from an IPv6 address.

Definition at line 45 of file address.ipp.

asio::ip::address::address ( const address other)

Copy constructor.

Definition at line 52 of file address.ipp.

Member Function Documentation

address asio::ip::address::from_string ( const char *  str)
static

Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.

Definition at line 136 of file address.ipp.

address asio::ip::address::from_string ( const char *  str,
asio::error_code ec 
)
static

Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.

Definition at line 144 of file address.ipp.

address asio::ip::address::from_string ( const std::string &  str)
static

Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.

Definition at line 169 of file address.ipp.

address asio::ip::address::from_string ( const std::string &  str,
asio::error_code ec 
)
static

Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.

Definition at line 174 of file address.ipp.

bool asio::ip::address::is_loopback ( ) const

Determine whether the address is a loopback address.

Definition at line 180 of file address.ipp.

bool asio::ip::address::is_multicast ( ) const

Determine whether the address is a multicast address.

Definition at line 194 of file address.ipp.

bool asio::ip::address::is_unspecified ( ) const

Determine whether the address is unspecified.

Definition at line 187 of file address.ipp.

bool asio::ip::address::is_v4 ( ) const
inline

Get whether the address is an IP version 4 address.

Definition at line 79 of file address.hpp.

bool asio::ip::address::is_v6 ( ) const
inline

Get whether the address is an IP version 6 address.

Definition at line 85 of file address.hpp.

address & asio::ip::address::operator= ( const address other)

Assign from another address.

Definition at line 68 of file address.ipp.

address & asio::ip::address::operator= ( const asio::ip::address_v4 ipv4_address)

Assign from an IPv4 address.

Definition at line 86 of file address.ipp.

address & asio::ip::address::operator= ( const asio::ip::address_v6 ipv6_address)

Assign from an IPv6 address.

Definition at line 94 of file address.ipp.

std::string asio::ip::address::to_string ( ) const

Get the address as a string in dotted decimal format.

Definition at line 122 of file address.ipp.

std::string asio::ip::address::to_string ( asio::error_code ec) const

Get the address as a string in dotted decimal format.

Definition at line 129 of file address.ipp.

asio::ip::address_v4 asio::ip::address::to_v4 ( ) const

Get the address as an IP version 4 address.

Definition at line 102 of file address.ipp.

asio::ip::address_v6 asio::ip::address::to_v6 ( ) const

Get the address as an IP version 6 address.

Definition at line 112 of file address.ipp.

Friends And Related Function Documentation

bool operator!= ( const address a1,
const address a2 
)
friend

Compare two addresses for inequality.

Definition at line 133 of file address.hpp.

ASIO_DECL friend bool operator< ( const address a1,
const address a2 
)
friend

Compare addresses for ordering.

Definition at line 210 of file address.ipp.

template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< ( std::basic_ostream< Elem, Traits > &  os,
const address addr 
)
related

Output an address as a string.

Used to output a human-readable string for a specified address.

Parameters
osThe output stream to which the string will be written.
addrThe address to be written.
Returns
The output stream.

Definition at line 28 of file address.hpp.

bool operator<= ( const address a1,
const address a2 
)
friend

Compare addresses for ordering.

Definition at line 148 of file address.hpp.

ASIO_DECL friend bool operator== ( const address a1,
const address a2 
)
friend

Compare two addresses for equality.

Definition at line 201 of file address.ipp.

bool operator> ( const address a1,
const address a2 
)
friend

Compare addresses for ordering.

Definition at line 142 of file address.hpp.

bool operator>= ( const address a1,
const address a2 
)
friend

Compare addresses for ordering.

Definition at line 154 of file address.hpp.


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