Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::generic::stream_protocol Class Reference

Encapsulates the flags needed for a generic stream-oriented socket. More...

#include <stream_protocol.hpp>

Public Types

typedef basic_endpoint
< stream_protocol
endpoint
 The type of an endpoint. More...
 
typedef basic_stream_socket
< stream_protocol
socket
 The generic socket type. More...
 
typedef basic_socket_iostream
< stream_protocol
iostream
 The generic socket iostream type. More...
 

Public Member Functions

 stream_protocol (int address_family, int socket_protocol)
 Construct a protocol object for a specific address family and protocol. More...
 
template<typename Protocol >
 stream_protocol (const Protocol &source_protocol)
 Construct a generic protocol object from a specific protocol. More...
 
int type () const
 Obtain an identifier for the type of the protocol. More...
 
int protocol () const
 Obtain an identifier for the protocol. More...
 
int family () const
 Obtain an identifier for the protocol family. More...
 

Friends

bool operator== (const stream_protocol &p1, const stream_protocol &p2)
 Compare two protocols for equality. More...
 
bool operator!= (const stream_protocol &p1, const stream_protocol &p2)
 Compare two protocols for inequality. More...
 

Detailed Description

Encapsulates the flags needed for a generic stream-oriented socket.

The boost::asio::generic::stream_protocol class contains flags necessary for stream-oriented sockets of any address family and protocol.

Examples
Constructing using a native address family and socket protocol:
stream_protocol p(AF_INET, IPPROTO_TCP);
Constructing from a specific protocol type:
Thread Safety
Distinct objects: Safe.
Shared objects: Safe.
Concepts:
Protocol.

Member Typedef Documentation

Constructor & Destructor Documentation

boost::asio::generic::stream_protocol::stream_protocol ( int  address_family,
int  socket_protocol 
)
inline

Construct a protocol object for a specific address family and protocol.

template<typename Protocol >
boost::asio::generic::stream_protocol::stream_protocol ( const Protocol &  source_protocol)
inline

Construct a generic protocol object from a specific protocol.

Exceptions
c bad_cast Thrown if the source protocol is not stream-oriented.

References boost::lambda::throw_exception(), and type().

Member Function Documentation

int boost::asio::generic::stream_protocol::family ( ) const
inline

Obtain an identifier for the protocol family.

int boost::asio::generic::stream_protocol::protocol ( ) const
inline

Obtain an identifier for the protocol.

int boost::asio::generic::stream_protocol::type ( ) const
inline

Obtain an identifier for the type of the protocol.

Referenced by stream_protocol().

Friends And Related Function Documentation

bool operator!= ( const stream_protocol p1,
const stream_protocol p2 
)
friend

Compare two protocols for inequality.

bool operator== ( const stream_protocol p1,
const stream_protocol p2 
)
friend

Compare two protocols for equality.


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