Realistic 3D camera system
3D camera system components
Public Types | Public Member Functions | Friends | Related Functions | List of all members
asio::ip::basic_endpoint< InternetProtocol > Class Template Reference

Describes an endpoint for a version-independent IP socket. More...

#include <basic_endpoint.hpp>

Public Types

typedef InternetProtocol protocol_type
 The protocol type associated with the endpoint. More...
 
typedef asio::detail::socket_addr_type data_type
 

Public Member Functions

 basic_endpoint ()
 Default constructor. More...
 
 basic_endpoint (const InternetProtocol &internet_protocol, unsigned short port_num)
 
 basic_endpoint (const asio::ip::address &addr, unsigned short port_num)
 
 basic_endpoint (const basic_endpoint &other)
 Copy constructor. More...
 
basic_endpointoperator= (const basic_endpoint &other)
 Assign from another endpoint. More...
 
protocol_type protocol () const
 The protocol associated with the endpoint. More...
 
data_typedata ()
 Get the underlying endpoint in the native type. More...
 
const data_typedata () const
 Get the underlying endpoint in the native type. More...
 
std::size_t size () const
 Get the underlying size of the endpoint in the native type. More...
 
void resize (std::size_t new_size)
 Set the underlying size of the endpoint in the native type. More...
 
std::size_t capacity () const
 Get the capacity of the endpoint in the native type. More...
 
unsigned short port () const
 
void port (unsigned short port_num)
 
asio::ip::address address () const
 Get the IP address associated with the endpoint. More...
 
void address (const asio::ip::address &addr)
 Set the IP address associated with the endpoint. More...
 

Friends

bool operator== (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare two endpoints for equality. More...
 
bool operator!= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare two endpoints for inequality. More...
 
bool operator< (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare endpoints for ordering. More...
 
bool operator> (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare endpoints for ordering. More...
 
bool operator<= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare endpoints for ordering. More...
 
bool operator>= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2)
 Compare endpoints for ordering. More...
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

template<typename InternetProtocol>
class asio::ip::basic_endpoint< InternetProtocol >

Describes an endpoint for a version-independent IP socket.

The asio::ip::basic_endpoint class template describes an endpoint that may be associated with a particular socket.

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

Definition at line 44 of file basic_endpoint.hpp.

Member Typedef Documentation

template<typename InternetProtocol>
typedef asio::detail::socket_addr_type asio::ip::basic_endpoint< InternetProtocol >::data_type

The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.

Definition at line 55 of file basic_endpoint.hpp.

template<typename InternetProtocol>
typedef InternetProtocol asio::ip::basic_endpoint< InternetProtocol >::protocol_type

The protocol type associated with the endpoint.

Definition at line 48 of file basic_endpoint.hpp.

Constructor & Destructor Documentation

template<typename InternetProtocol>
asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( )
inline

Default constructor.

Definition at line 59 of file basic_endpoint.hpp.

template<typename InternetProtocol>
asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( const InternetProtocol &  internet_protocol,
unsigned short  port_num 
)
inline

Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.

Examples
To initialise an IPv4 TCP endpoint for port 1234, use:

To specify an IPv6 UDP endpoint for port 9876, use:

Definition at line 80 of file basic_endpoint.hpp.

template<typename InternetProtocol>
asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( const asio::ip::address addr,
unsigned short  port_num 
)
inline

Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.

Definition at line 89 of file basic_endpoint.hpp.

template<typename InternetProtocol>
asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint ( const basic_endpoint< InternetProtocol > &  other)
inline

Copy constructor.

Definition at line 95 of file basic_endpoint.hpp.

Member Function Documentation

template<typename InternetProtocol>
asio::ip::address asio::ip::basic_endpoint< InternetProtocol >::address ( ) const
inline

Get the IP address associated with the endpoint.

Definition at line 177 of file basic_endpoint.hpp.

template<typename InternetProtocol>
void asio::ip::basic_endpoint< InternetProtocol >::address ( const asio::ip::address addr)
inline

Set the IP address associated with the endpoint.

Definition at line 183 of file basic_endpoint.hpp.

template<typename InternetProtocol>
std::size_t asio::ip::basic_endpoint< InternetProtocol >::capacity ( ) const
inline

Get the capacity of the endpoint in the native type.

Definition at line 157 of file basic_endpoint.hpp.

template<typename InternetProtocol>
data_type* asio::ip::basic_endpoint< InternetProtocol >::data ( )
inline

Get the underlying endpoint in the native type.

Definition at line 133 of file basic_endpoint.hpp.

template<typename InternetProtocol>
const data_type* asio::ip::basic_endpoint< InternetProtocol >::data ( ) const
inline

Get the underlying endpoint in the native type.

Definition at line 139 of file basic_endpoint.hpp.

template<typename InternetProtocol>
basic_endpoint& asio::ip::basic_endpoint< InternetProtocol >::operator= ( const basic_endpoint< InternetProtocol > &  other)
inline

Assign from another endpoint.

Definition at line 109 of file basic_endpoint.hpp.

template<typename InternetProtocol>
unsigned short asio::ip::basic_endpoint< InternetProtocol >::port ( ) const
inline

Get the port associated with the endpoint. The port number is always in the host's byte order.

Definition at line 164 of file basic_endpoint.hpp.

template<typename InternetProtocol>
void asio::ip::basic_endpoint< InternetProtocol >::port ( unsigned short  port_num)
inline

Set the port associated with the endpoint. The port number is always in the host's byte order.

Definition at line 171 of file basic_endpoint.hpp.

template<typename InternetProtocol>
protocol_type asio::ip::basic_endpoint< InternetProtocol >::protocol ( ) const
inline

The protocol associated with the endpoint.

Definition at line 125 of file basic_endpoint.hpp.

template<typename InternetProtocol>
void asio::ip::basic_endpoint< InternetProtocol >::resize ( std::size_t  new_size)
inline

Set the underlying size of the endpoint in the native type.

Definition at line 151 of file basic_endpoint.hpp.

template<typename InternetProtocol>
std::size_t asio::ip::basic_endpoint< InternetProtocol >::size ( ) const
inline

Get the underlying size of the endpoint in the native type.

Definition at line 145 of file basic_endpoint.hpp.

Friends And Related Function Documentation

template<typename InternetProtocol>
bool operator!= ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare two endpoints for inequality.

Definition at line 196 of file basic_endpoint.hpp.

template<typename InternetProtocol>
bool operator< ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare endpoints for ordering.

Definition at line 203 of file basic_endpoint.hpp.

template<typename Elem , typename Traits , typename InternetProtocol >
std::basic_ostream< Elem, Traits > & operator<< ( std::basic_ostream< Elem, Traits > &  os,
const basic_endpoint< InternetProtocol > &  endpoint 
)
related

Output an endpoint as a string.

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

Parameters
osThe output stream to which the string will be written.
endpointThe endpoint to be written.
Returns
The output stream.

Definition at line 28 of file basic_endpoint.hpp.

template<typename InternetProtocol>
bool operator<= ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare endpoints for ordering.

Definition at line 217 of file basic_endpoint.hpp.

template<typename InternetProtocol>
bool operator== ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare two endpoints for equality.

Definition at line 189 of file basic_endpoint.hpp.

template<typename InternetProtocol>
bool operator> ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare endpoints for ordering.

Definition at line 210 of file basic_endpoint.hpp.

template<typename InternetProtocol>
bool operator>= ( const basic_endpoint< InternetProtocol > &  e1,
const basic_endpoint< InternetProtocol > &  e2 
)
friend

Compare endpoints for ordering.

Definition at line 224 of file basic_endpoint.hpp.


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