All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
asio::basic_socket_streambuf< Protocol, StreamSocketService > Class Template Reference

Iostream streambuf for a socket. More...

#include <basic_socket_streambuf.hpp>

Inheritance diagram for asio::basic_socket_streambuf< Protocol, StreamSocketService >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Protocol::endpoint endpoint_type
 The endpoint type.

Public Member Functions

 basic_socket_streambuf ()
 Construct a basic_socket_streambuf without establishing a connection.
 BOOST_PP_REPEAT_FROM_TO (1, BOOST_PP_INC(ASIO_SOCKET_STREAMBUF_MAX_ARITY), ASIO_PRIVATE_CONNECT_DEF, _) basic_socket_streambuf< Protocol
 Close the connection.
StreamSocketService * close ()
 Close the socket.
basic_socket_streambuf
< Protocol,
StreamSocketService > * 
connect (const endpoint_type &endpoint)
 Establish a connection.
virtual ~basic_socket_streambuf ()
 Destructor flushes buffered data.

Protected Member Functions

int_type overflow (int_type c)
std::streambuf * setbuf (char_type *s, std::streamsize n)
int sync ()
int_type underflow ()

Private Types

enum  { putback_max = 8 }
enum  { buffer_size = 512 }

Private Member Functions

void init_buffers ()
void resolve_and_connect (const typename Protocol::resolver_query &query, asio::error_code &ec)

Private Attributes

boost::array< char, buffer_sizeget_buffer_
boost::array< char, buffer_sizeput_buffer_
bool unbuffered_

Detailed Description

template<typename Protocol, typename StreamSocketService = stream_socket_service<Protocol>>
class asio::basic_socket_streambuf< Protocol, StreamSocketService >

Iostream streambuf for a socket.

Definition at line 74 of file basic_socket_streambuf.hpp.


Member Typedef Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
typedef Protocol::endpoint asio::basic_socket_streambuf< Protocol, StreamSocketService >::endpoint_type

The endpoint type.

Reimplemented from asio::basic_socket< Protocol, StreamSocketService >.

Definition at line 81 of file basic_socket_streambuf.hpp.


Member Enumeration Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
anonymous enum [private]
Enumerator:
putback_max 

Definition at line 271 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
anonymous enum [private]
Enumerator:
buffer_size 

Definition at line 272 of file basic_socket_streambuf.hpp.


Constructor & Destructor Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
asio::basic_socket_streambuf< Protocol, StreamSocketService >::basic_socket_streambuf ( ) [inline]

Construct a basic_socket_streambuf without establishing a connection.

Definition at line 84 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
virtual asio::basic_socket_streambuf< Protocol, StreamSocketService >::~basic_socket_streambuf ( ) [inline, virtual]

Destructor flushes buffered data.

Definition at line 93 of file basic_socket_streambuf.hpp.


Member Function Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
asio::basic_socket_streambuf< Protocol, StreamSocketService >::BOOST_PP_REPEAT_FROM_TO ( ,
BOOST_PP_INC(ASIO_SOCKET_STREAMBUF_MAX_ARITY ,
ASIO_PRIVATE_CONNECT_DEF  ,
 
)

Close the connection.

Returns:
this if a connection was successfully established, a null pointer otherwise.
template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
StreamSocketService* asio::basic_socket_streambuf< Protocol, StreamSocketService >::close ( ) [inline]

Close the socket.

This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the asio::error::operation_aborted error.

Exceptions:
asio::system_errorThrown on failure.
Note:
For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.

Reimplemented from asio::basic_socket< Protocol, StreamSocketService >.

Definition at line 140 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
basic_socket_streambuf<Protocol, StreamSocketService>* asio::basic_socket_streambuf< Protocol, StreamSocketService >::connect ( const endpoint_type endpoint) [inline]

Establish a connection.

This function establishes a connection to the specified endpoint.

Returns:
this if a connection was successfully established, a null pointer otherwise.

Reimplemented from asio::basic_socket< Protocol, StreamSocketService >.

Definition at line 106 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
void asio::basic_socket_streambuf< Protocol, StreamSocketService >::init_buffers ( ) [inline, private]

Definition at line 239 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
int_type asio::basic_socket_streambuf< Protocol, StreamSocketService >::overflow ( int_type  c) [inline, protected]

Definition at line 172 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
void asio::basic_socket_streambuf< Protocol, StreamSocketService >::resolve_and_connect ( const typename Protocol::resolver_query &  query,
asio::error_code ec 
) [inline, private]

Definition at line 250 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
std::streambuf* asio::basic_socket_streambuf< Protocol, StreamSocketService >::setbuf ( char_type *  s,
std::streamsize  n 
) [inline, protected]

Definition at line 226 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
int asio::basic_socket_streambuf< Protocol, StreamSocketService >::sync ( ) [inline, protected]

Definition at line 221 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
int_type asio::basic_socket_streambuf< Protocol, StreamSocketService >::underflow ( ) [inline, protected]

Definition at line 151 of file basic_socket_streambuf.hpp.


Member Data Documentation

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
boost::array<char, buffer_size> asio::basic_socket_streambuf< Protocol, StreamSocketService >::get_buffer_ [private]

Definition at line 273 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
boost::array<char, buffer_size> asio::basic_socket_streambuf< Protocol, StreamSocketService >::put_buffer_ [private]

Definition at line 274 of file basic_socket_streambuf.hpp.

template<typename Protocol , typename StreamSocketService = stream_socket_service<Protocol>>
bool asio::basic_socket_streambuf< Protocol, StreamSocketService >::unbuffered_ [private]

Definition at line 275 of file basic_socket_streambuf.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Nov 8 2013 11:05:40