diff --git a/asio/include/asio/basic_datagram_socket.hpp b/asio/include/asio/basic_datagram_socket.hpp index 491794f2..8f315166 100644 --- a/asio/include/asio/basic_datagram_socket.hpp +++ b/asio/include/asio/basic_datagram_socket.hpp @@ -37,18 +37,15 @@ namespace asio { * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Async_Object */ template > + typename DatagramSocketService = datagram_socket_service > class basic_datagram_socket - : public basic_socket + : public basic_socket { public: /// The native representation of a socket. - typedef typename Service::native_type native_type; + typedef typename DatagramSocketService::native_type native_type; /// The protocol type. typedef Protocol protocol_type; @@ -66,7 +63,7 @@ public: * socket. */ explicit basic_datagram_socket(asio::io_service& io_service) - : basic_socket(io_service) + : basic_socket(io_service) { } @@ -84,7 +81,7 @@ public: */ basic_datagram_socket(asio::io_service& io_service, const protocol_type& protocol) - : basic_socket(io_service, protocol) + : basic_socket(io_service, protocol) { } @@ -106,7 +103,7 @@ public: */ basic_datagram_socket(asio::io_service& io_service, const endpoint_type& endpoint) - : basic_socket(io_service, endpoint) + : basic_socket(io_service, endpoint) { } @@ -127,7 +124,8 @@ public: */ basic_datagram_socket(asio::io_service& io_service, const protocol_type& protocol, const native_type& native_socket) - : basic_socket(io_service, protocol, native_socket) + : basic_socket( + io_service, protocol, native_socket) { } @@ -153,8 +151,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t send(const Const_Buffers& buffers) + template + std::size_t send(const ConstBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.send(this->implementation, buffers, 0, ec); @@ -179,8 +177,8 @@ public: * @note The send operation can only be used with a connected socket. Use * the send_to function to send data on an unconnected datagram socket. */ - template - std::size_t send(const Const_Buffers& buffers, + template + std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags) { asio::error_code ec; @@ -207,8 +205,8 @@ public: * @note The send operation can only be used with a connected socket. Use * the send_to function to send data on an unconnected datagram socket. */ - template - std::size_t send(const Const_Buffers& buffers, + template + std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return this->service.send(this->implementation, buffers, flags, ec); @@ -250,8 +248,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_send(const Const_Buffers& buffers, Handler handler) + template + void async_send(const ConstBufferSequence& buffers, WriteHandler handler) { this->service.async_send(this->implementation, buffers, 0, handler); } @@ -285,9 +283,9 @@ public: * Use the async_send_to function to send data on an unconnected datagram * socket. */ - template - void async_send(const Const_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, WriteHandler handler) { this->service.async_send(this->implementation, buffers, flags, handler); } @@ -317,8 +315,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t send_to(const Const_Buffers& buffers, + template + std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination) { asio::error_code ec; @@ -344,8 +342,8 @@ public: * * @throws asio::system_error Thrown on failure. */ - template - std::size_t send_to(const Const_Buffers& buffers, + template + std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags) { asio::error_code ec; @@ -371,8 +369,8 @@ public: * * @returns The number of bytes sent. */ - template - std::size_t send_to(const Const_Buffers& buffers, + template + std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, asio::error_code& ec) { @@ -417,9 +415,9 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_send_to(const Const_Buffers& buffers, - const endpoint_type& destination, Handler handler) + template + void async_send_to(const ConstBufferSequence& buffers, + const endpoint_type& destination, WriteHandler handler) { this->service.async_send_to(this->implementation, buffers, destination, 0, handler); @@ -452,10 +450,10 @@ public: * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ - template - void async_send_to(const Const_Buffers& buffers, + template + void async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, - Handler handler) + WriteHandler handler) { this->service.async_send_to(this->implementation, buffers, destination, flags, handler); @@ -485,8 +483,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t receive(const Mutable_Buffers& buffers) + template + std::size_t receive(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.receive( @@ -513,8 +511,8 @@ public: * the receive_from function to receive data on an unconnected datagram * socket. */ - template - std::size_t receive(const Mutable_Buffers& buffers, + template + std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags) { asio::error_code ec; @@ -542,8 +540,8 @@ public: * the receive_from function to receive data on an unconnected datagram * socket. */ - template - std::size_t receive(const Mutable_Buffers& buffers, + template + std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return this->service.receive(this->implementation, buffers, flags, ec); @@ -585,8 +583,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_receive(const Mutable_Buffers& buffers, Handler handler) + template + void async_receive(const MutableBufferSequence& buffers, ReadHandler handler) { this->service.async_receive(this->implementation, buffers, 0, handler); } @@ -619,9 +617,9 @@ public: * Use the async_receive_from function to receive data on an unconnected * datagram socket. */ - template - void async_receive(const Mutable_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, ReadHandler handler) { this->service.async_receive(this->implementation, buffers, flags, handler); } @@ -652,8 +650,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t receive_from(const Mutable_Buffers& buffers, + template + std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint) { asio::error_code ec; @@ -679,8 +677,8 @@ public: * * @throws asio::system_error Thrown on failure. */ - template - std::size_t receive_from(const Mutable_Buffers& buffers, + template + std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags) { asio::error_code ec; @@ -706,8 +704,8 @@ public: * * @returns The number of bytes received. */ - template - std::size_t receive_from(const Mutable_Buffers& buffers, + template + std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, asio::error_code& ec) { @@ -751,9 +749,9 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_receive_from(const Mutable_Buffers& buffers, - endpoint_type& sender_endpoint, Handler handler) + template + void async_receive_from(const MutableBufferSequence& buffers, + endpoint_type& sender_endpoint, ReadHandler handler) { this->service.async_receive_from(this->implementation, buffers, sender_endpoint, 0, handler); @@ -788,10 +786,10 @@ public: * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ - template - void async_receive_from(const Mutable_Buffers& buffers, + template + void async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, - Handler handler) + ReadHandler handler) { this->service.async_receive_from(this->implementation, buffers, sender_endpoint, flags, handler); diff --git a/asio/include/asio/basic_deadline_timer.hpp b/asio/include/asio/basic_deadline_timer.hpp index da9ab013..0f62c0ea 100644 --- a/asio/include/asio/basic_deadline_timer.hpp +++ b/asio/include/asio/basic_deadline_timer.hpp @@ -75,15 +75,15 @@ namespace asio { * timer.async_wait(handler); * @endcode */ -template , - typename Service = deadline_timer_service > +template , + typename TimerService = deadline_timer_service > class basic_deadline_timer - : public basic_io_object + : public basic_io_object { public: /// The time traits type. - typedef Time_Traits traits_type; + typedef TimeTraits traits_type; /// The time type. typedef typename traits_type::time_type time_type; @@ -101,7 +101,7 @@ public: * handlers for any asynchronous operations performed on the timer. */ explicit basic_deadline_timer(asio::io_service& io_service) - : basic_io_object(io_service) + : basic_io_object(io_service) { } @@ -117,7 +117,7 @@ public: */ basic_deadline_timer(asio::io_service& io_service, const time_type& expiry_time) - : basic_io_object(io_service) + : basic_io_object(io_service) { this->service.expires_at(this->implementation, expiry_time); } @@ -134,7 +134,7 @@ public: */ basic_deadline_timer(asio::io_service& io_service, const duration_type& expiry_time) - : basic_io_object(io_service) + : basic_io_object(io_service) { this->service.expires_from_now(this->implementation, expiry_time); } @@ -246,8 +246,8 @@ public: * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ - template - void async_wait(Handler handler) + template + void async_wait(WaitHandler handler) { this->service.async_wait(this->implementation, handler); } diff --git a/asio/include/asio/basic_io_object.hpp b/asio/include/asio/basic_io_object.hpp index 99d8e567..73afcedd 100644 --- a/asio/include/asio/basic_io_object.hpp +++ b/asio/include/asio/basic_io_object.hpp @@ -23,13 +23,13 @@ namespace asio { /// Base class for all I/O objects. -template +template class basic_io_object : private noncopyable { public: /// The type of the service that will be used to provide I/O operations. - typedef Service service_type; + typedef IoObjectService service_type; /// The underlying implementation type of I/O object. typedef typename service_type::implementation_type implementation_type; @@ -50,7 +50,7 @@ public: protected: /// Construct a basic_io_object. explicit basic_io_object(asio::io_service& io_service) - : service(asio::use_service(io_service)) + : service(asio::use_service(io_service)) { service.construct(implementation); } diff --git a/asio/include/asio/basic_socket.hpp b/asio/include/asio/basic_socket.hpp index a345519d..8edb5b6a 100644 --- a/asio/include/asio/basic_socket.hpp +++ b/asio/include/asio/basic_socket.hpp @@ -32,18 +32,15 @@ namespace asio { * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * IO_Object. */ -template +template class basic_socket - : public basic_io_object, + : public basic_io_object, public socket_base { public: /// The native representation of a socket. - typedef typename Service::native_type native_type; + typedef typename SocketService::native_type native_type; /// The protocol type. typedef Protocol protocol_type; @@ -52,7 +49,7 @@ public: typedef typename Protocol::endpoint endpoint_type; /// A basic_socket is always the lowest layer. - typedef basic_socket lowest_layer_type; + typedef basic_socket lowest_layer_type; /// Construct a basic_socket without opening it. /** @@ -62,7 +59,7 @@ public: * dispatch handlers for any asynchronous operations performed on the socket. */ explicit basic_socket(asio::io_service& io_service) - : basic_io_object(io_service) + : basic_io_object(io_service) { } @@ -79,7 +76,7 @@ public: */ basic_socket(asio::io_service& io_service, const protocol_type& protocol) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.open(this->implementation, protocol, ec); @@ -103,7 +100,7 @@ public: */ basic_socket(asio::io_service& io_service, const endpoint_type& endpoint) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.open(this->implementation, endpoint.protocol(), ec); @@ -127,7 +124,7 @@ public: */ basic_socket(asio::io_service& io_service, const protocol_type& protocol, const native_type& native_socket) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.assign(this->implementation, protocol, native_socket, ec); @@ -466,8 +463,8 @@ public: * socket.async_connect(endpoint, connect_handler); * @endcode */ - template - void async_connect(const endpoint_type& peer_endpoint, Handler handler) + template + void async_connect(const endpoint_type& peer_endpoint, ConnectHandler handler) { this->service.async_connect(this->implementation, peer_endpoint, handler); } @@ -480,7 +477,7 @@ public: * * @throws asio::system_error Thrown on failure. * - * @sa Socket_Option @n + * @sa SettableSocketOption @n * asio::socket_base::broadcast @n * asio::socket_base::do_not_route @n * asio::socket_base::keep_alive @n @@ -506,8 +503,8 @@ public: * socket.set_option(option); * @endcode */ - template - void set_option(const Socket_Option& option) + template + void set_option(const SettableSocketOption& option) { asio::error_code ec; this->service.set_option(this->implementation, option, ec); @@ -522,7 +519,7 @@ public: * * @param ec Set to indicate what error occurred, if any. * - * @sa Socket_Option @n + * @sa SettableSocketOption @n * asio::socket_base::broadcast @n * asio::socket_base::do_not_route @n * asio::socket_base::keep_alive @n @@ -553,8 +550,8 @@ public: * } * @endcode */ - template - asio::error_code set_option(const Socket_Option& option, + template + asio::error_code set_option(const SettableSocketOption& option, asio::error_code& ec) { return this->service.set_option(this->implementation, option, ec); @@ -568,7 +565,7 @@ public: * * @throws asio::system_error Thrown on failure. * - * @sa Socket_Option @n + * @sa GettableSocketOption @n * asio::socket_base::broadcast @n * asio::socket_base::do_not_route @n * asio::socket_base::keep_alive @n @@ -595,8 +592,8 @@ public: * bool is_set = option.get(); * @endcode */ - template - void get_option(Socket_Option& option) const + template + void get_option(GettableSocketOption& option) const { asio::error_code ec; this->service.get_option(this->implementation, option, ec); @@ -611,7 +608,7 @@ public: * * @param ec Set to indicate what error occurred, if any. * - * @sa Socket_Option @n + * @sa GettableSocketOption @n * asio::socket_base::broadcast @n * asio::socket_base::do_not_route @n * asio::socket_base::keep_alive @n @@ -643,8 +640,8 @@ public: * bool is_set = option.get(); * @endcode */ - template - asio::error_code get_option(Socket_Option& option, + template + asio::error_code get_option(GettableSocketOption& option, asio::error_code& ec) const { return this->service.get_option(this->implementation, option, ec); @@ -658,7 +655,7 @@ public: * * @throws asio::system_error Thrown on failure. * - * @sa IO_Control_Command @n + * @sa IoControlCommand @n * asio::socket_base::bytes_readable @n * asio::socket_base::non_blocking_io * @@ -672,8 +669,8 @@ public: * std::size_t bytes_readable = command.get(); * @endcode */ - template - void io_control(IO_Control_Command& command) + template + void io_control(IoControlCommand& command) { asio::error_code ec; this->service.io_control(this->implementation, command, ec); @@ -688,7 +685,7 @@ public: * * @param ec Set to indicate what error occurred, if any. * - * @sa IO_Control_Command @n + * @sa IoControlCommand @n * asio::socket_base::bytes_readable @n * asio::socket_base::non_blocking_io * @@ -707,8 +704,8 @@ public: * std::size_t bytes_readable = command.get(); * @endcode */ - template - asio::error_code io_control(IO_Control_Command& command, + template + asio::error_code io_control(IoControlCommand& command, asio::error_code& ec) { return this->service.io_control(this->implementation, command, ec); diff --git a/asio/include/asio/basic_socket_acceptor.hpp b/asio/include/asio/basic_socket_acceptor.hpp index 9895c864..d11a562b 100644 --- a/asio/include/asio/basic_socket_acceptor.hpp +++ b/asio/include/asio/basic_socket_acceptor.hpp @@ -47,14 +47,14 @@ namespace asio { * @endcode */ template > + typename SocketAcceptorService = socket_acceptor_service > class basic_socket_acceptor - : public basic_io_object, + : public basic_io_object, public socket_base { public: /// The native representation of an acceptor. - typedef typename Service::native_type native_type; + typedef typename SocketAcceptorService::native_type native_type; /// The protocol type. typedef Protocol protocol_type; @@ -73,7 +73,7 @@ public: * acceptor. */ explicit basic_socket_acceptor(asio::io_service& io_service) - : basic_io_object(io_service) + : basic_io_object(io_service) { } @@ -91,7 +91,7 @@ public: */ basic_socket_acceptor(asio::io_service& io_service, const protocol_type& protocol) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.open(this->implementation, protocol, ec); @@ -127,7 +127,7 @@ public: */ basic_socket_acceptor(asio::io_service& io_service, const endpoint_type& endpoint, bool reuse_addr = true) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.open(this->implementation, endpoint.protocol(), ec); @@ -162,7 +162,7 @@ public: */ basic_socket_acceptor(asio::io_service& io_service, const protocol_type& protocol, const native_type& native_acceptor) - : basic_io_object(io_service) + : basic_io_object(io_service) { asio::error_code ec; this->service.assign(this->implementation, protocol, native_acceptor, ec); @@ -438,7 +438,7 @@ public: * * @throws asio::system_error Thrown on failure. * - * @sa Socket_Option @n + * @sa SettableSocketOption @n * asio::socket_base::reuse_address * asio::socket_base::enable_connection_aborted * @@ -451,8 +451,8 @@ public: * acceptor.set_option(option); * @endcode */ - template - void set_option(const Option& option) + template + void set_option(const SettableSocketOption& option) { asio::error_code ec; this->service.set_option(this->implementation, option, ec); @@ -467,7 +467,7 @@ public: * * @param ec Set to indicate what error occurred, if any. * - * @sa Socket_Option @n + * @sa SettableSocketOption @n * asio::socket_base::reuse_address * asio::socket_base::enable_connection_aborted * @@ -485,8 +485,8 @@ public: * } * @endcode */ - template - asio::error_code set_option(const Option& option, + template + asio::error_code set_option(const SettableSocketOption& option, asio::error_code& ec) { return this->service.set_option(this->implementation, option, ec); @@ -501,7 +501,7 @@ public: * * @throws asio::system_error Thrown on failure. * - * @sa Socket_Option @n + * @sa GettableSocketOption @n * asio::socket_base::reuse_address * * @par Example @@ -514,8 +514,8 @@ public: * bool is_set = option.get(); * @endcode */ - template - void get_option(Option& option) + template + void get_option(GettableSocketOption& option) { asio::error_code ec; this->service.get_option(this->implementation, option, ec); @@ -531,7 +531,7 @@ public: * * @param ec Set to indicate what error occurred, if any. * - * @sa Socket_Option @n + * @sa GettableSocketOption @n * asio::socket_base::reuse_address * * @par Example @@ -549,8 +549,8 @@ public: * bool is_set = option.get(); * @endcode */ - template - asio::error_code get_option(Option& option, + template + asio::error_code get_option(GettableSocketOption& option, asio::error_code& ec) { return this->service.get_option(this->implementation, option, ec); @@ -624,8 +624,8 @@ public: * acceptor.accept(socket); * @endcode */ - template - void accept(basic_socket& peer) + template + void accept(basic_socket& peer) { asio::error_code ec; this->service.accept(this->implementation, peer, ec); @@ -655,9 +655,9 @@ public: * } * @endcode */ - template + template asio::error_code accept( - basic_socket& peer, + basic_socket& peer, asio::error_code& ec) { return this->service.accept(this->implementation, peer, ec); @@ -701,9 +701,9 @@ public: * acceptor.async_accept(socket, accept_handler); * @endcode */ - template - void async_accept(basic_socket& peer, - Handler handler) + template + void async_accept(basic_socket& peer, + AcceptHandler handler) { this->service.async_accept(this->implementation, peer, handler); } @@ -731,8 +731,8 @@ public: * acceptor.accept_endpoint(socket, endpoint); * @endcode */ - template - void accept_endpoint(basic_socket& peer, + template + void accept_endpoint(basic_socket& peer, endpoint_type& peer_endpoint) { asio::error_code ec; @@ -769,9 +769,9 @@ public: * } * @endcode */ - template + template asio::error_code accept_endpoint( - basic_socket& peer, + basic_socket& peer, endpoint_type& peer_endpoint, asio::error_code& ec) { return this->service.accept_endpoint( @@ -804,9 +804,9 @@ public: * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ - template - void async_accept_endpoint(basic_socket& peer, - endpoint_type& peer_endpoint, Handler handler) + template + void async_accept_endpoint(basic_socket& peer, + endpoint_type& peer_endpoint, AcceptHandler handler) { this->service.async_accept_endpoint(this->implementation, peer, peer_endpoint, handler); diff --git a/asio/include/asio/basic_socket_iostream.hpp b/asio/include/asio/basic_socket_iostream.hpp index d5a08c89..b750b92c 100644 --- a/asio/include/asio/basic_socket_iostream.hpp +++ b/asio/include/asio/basic_socket_iostream.hpp @@ -36,7 +36,7 @@ // template < typename T1, ..., typename Tn > // explicit basic_socket_iostream( T1 x1, ..., Tn xn ) // : basic_iostream(&this->boost::base_from_member< -// basic_socket_streambuf >::member) +// basic_socket_streambuf >::member) // { // try // { @@ -55,7 +55,7 @@ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ explicit basic_socket_iostream( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ : std::basic_iostream(&this->boost::base_from_member< \ - basic_socket_streambuf >::member) \ + basic_socket_streambuf >::member) \ { \ try \ { \ @@ -108,16 +108,17 @@ namespace asio { /// Iostream interface for a socket. template > + typename StreamSocketService = stream_socket_service > class basic_socket_iostream - : public boost::base_from_member >, + : public boost::base_from_member< + basic_socket_streambuf >, public std::basic_iostream { public: /// Construct a basic_socket_iostream without establishing a connection. basic_socket_iostream() : std::basic_iostream(&this->boost::base_from_member< - basic_socket_streambuf >::member) + basic_socket_streambuf >::member) { } @@ -158,11 +159,11 @@ public: } /// Return a pointer to the underlying streambuf. - basic_socket_streambuf* rdbuf() const + basic_socket_streambuf* rdbuf() const { - return const_cast*>( + return const_cast*>( &this->boost::base_from_member< - basic_socket_streambuf >::member); + basic_socket_streambuf >::member); } }; diff --git a/asio/include/asio/basic_socket_streambuf.hpp b/asio/include/asio/basic_socket_streambuf.hpp index d055e350..225548e9 100644 --- a/asio/include/asio/basic_socket_streambuf.hpp +++ b/asio/include/asio/basic_socket_streambuf.hpp @@ -39,7 +39,7 @@ // A macro that should expand to: // template < typename T1, ..., typename Tn > // explicit basic_socket_streambuf( T1 x1, ..., Tn xn ) -// : basic_socket( +// : basic_socket( // boost::base_from_member::member) // { // init_buffers(); @@ -52,7 +52,7 @@ #define ASIO_PRIVATE_CTR_DEF( z, n, data ) \ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ explicit basic_socket_streambuf( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ - : basic_socket( \ + : basic_socket( \ boost::base_from_member::member) \ { \ init_buffers(); \ @@ -66,7 +66,7 @@ // template < typename T1, ..., typename Tn > // void connect( T1 x1, ..., Tn xn ) // { -// this->basic_socket::close(); +// this->basic_socket::close(); // init_buffers(); // typedef typename Protocol::resolver_query resolver_query; // resolver_query query( x1, ..., xn ); @@ -78,7 +78,7 @@ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \ void connect( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \ { \ - this->basic_socket::close(); \ + this->basic_socket::close(); \ init_buffers(); \ typedef typename Protocol::resolver_query resolver_query; \ resolver_query query( BOOST_PP_ENUM_PARAMS(n, x) ); \ @@ -90,11 +90,11 @@ namespace asio { /// Iostream streambuf for a socket. template > + typename StreamSocketService = stream_socket_service > class basic_socket_streambuf : public std::streambuf, private boost::base_from_member, - public basic_socket + public basic_socket { public: /// The endpoint type. @@ -102,7 +102,7 @@ public: /// Construct a basic_socket_streambuf without establishing a connection. basic_socket_streambuf() - : basic_socket( + : basic_socket( boost::base_from_member::member) { init_buffers(); @@ -110,11 +110,11 @@ public: /// Establish a connection to the specified endpoint. explicit basic_socket_streambuf(const endpoint_type& endpoint) - : basic_socket( + : basic_socket( boost::base_from_member::member) { init_buffers(); - this->basic_socket::connect(endpoint); + this->basic_socket::connect(endpoint); } #if defined(GENERATING_DOCUMENTATION) @@ -141,9 +141,9 @@ public: /// Establish a connection to the specified endpoint. void connect(const endpoint_type& endpoint) { - this->basic_socket::close(); + this->basic_socket::close(); init_buffers(); - this->basic_socket::connect(endpoint); + this->basic_socket::connect(endpoint); } #if defined(GENERATING_DOCUMENTATION) @@ -165,7 +165,7 @@ public: void close() { sync(); - this->basic_socket::close(); + this->basic_socket::close(); init_buffers(); } @@ -259,8 +259,8 @@ private: asio::error_code ec(asio::error::host_not_found); while (ec && iterator != iterator_type()) { - this->basic_socket::close(); - this->basic_socket::connect(*iterator, ec); + this->basic_socket::close(); + this->basic_socket::connect(*iterator, ec); ++iterator; } asio::detail::throw_error(ec); diff --git a/asio/include/asio/basic_stream_socket.hpp b/asio/include/asio/basic_stream_socket.hpp index 796df72f..f906843d 100644 --- a/asio/include/asio/basic_stream_socket.hpp +++ b/asio/include/asio/basic_stream_socket.hpp @@ -39,17 +39,16 @@ namespace asio { * @e Shared @e objects: Unsafe. * * @par Concepts: - * Async_Read_Stream, Async_Write_Stream, Stream, Sync_Read_Stream, - * Sync_Write_Stream. + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template > + typename StreamSocketService = stream_socket_service > class basic_stream_socket - : public basic_socket + : public basic_socket { public: /// The native representation of a socket. - typedef typename Service::native_type native_type; + typedef typename StreamSocketService::native_type native_type; /// The protocol type. typedef Protocol protocol_type; @@ -67,7 +66,7 @@ public: * dispatch handlers for any asynchronous operations performed on the socket. */ explicit basic_stream_socket(asio::io_service& io_service) - : basic_socket(io_service) + : basic_socket(io_service) { } @@ -85,7 +84,7 @@ public: */ basic_stream_socket(asio::io_service& io_service, const protocol_type& protocol) - : basic_socket(io_service, protocol) + : basic_socket(io_service, protocol) { } @@ -106,7 +105,7 @@ public: */ basic_stream_socket(asio::io_service& io_service, const endpoint_type& endpoint) - : basic_socket(io_service, endpoint) + : basic_socket(io_service, endpoint) { } @@ -126,7 +125,8 @@ public: */ basic_stream_socket(asio::io_service& io_service, const protocol_type& protocol, const native_type& native_socket) - : basic_socket(io_service, protocol, native_socket) + : basic_socket( + io_service, protocol, native_socket) { } @@ -155,8 +155,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t send(const Const_Buffers& buffers) + template + std::size_t send(const ConstBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.send( @@ -192,8 +192,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t send(const Const_Buffers& buffers, + template + std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags) { asio::error_code ec; @@ -221,8 +221,8 @@ public: * Consider using the @ref write function if you need to ensure that all data * is written before the blocking operation completes. */ - template - std::size_t send(const Const_Buffers& buffers, + template + std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return this->service.send(this->implementation, buffers, flags, ec); @@ -263,8 +263,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_send(const Const_Buffers& buffers, Handler handler) + template + void async_send(const ConstBufferSequence& buffers, WriteHandler handler) { this->service.async_send(this->implementation, buffers, 0, handler); } @@ -306,9 +306,9 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_send(const Const_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_send(const ConstBufferSequence& buffers, + socket_base::message_flags flags, WriteHandler handler) { this->service.async_send(this->implementation, buffers, flags, handler); } @@ -341,8 +341,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t receive(const Mutable_Buffers& buffers) + template + std::size_t receive(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.receive(this->implementation, buffers, 0, ec); @@ -380,8 +380,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t receive(const Mutable_Buffers& buffers, + template + std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags) { asio::error_code ec; @@ -409,8 +409,8 @@ public: * bytes. Consider using the @ref read function if you need to ensure that the * requested amount of data is read before the blocking operation completes. */ - template - std::size_t receive(const Mutable_Buffers& buffers, + template + std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return this->service.receive(this->implementation, buffers, flags, ec); @@ -453,8 +453,8 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_receive(const Mutable_Buffers& buffers, Handler handler) + template + void async_receive(const MutableBufferSequence& buffers, ReadHandler handler) { this->service.async_receive(this->implementation, buffers, 0, handler); } @@ -498,9 +498,9 @@ public: * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_receive(const Mutable_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_receive(const MutableBufferSequence& buffers, + socket_base::message_flags flags, ReadHandler handler) { this->service.async_receive(this->implementation, buffers, flags, handler); } @@ -532,8 +532,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t write_some(const Const_Buffers& buffers) + template + std::size_t write_some(const ConstBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.send(this->implementation, buffers, 0, ec); @@ -557,8 +557,8 @@ public: * peer. Consider using the @ref write function if you need to ensure that * all data is written before the blocking operation completes. */ - template - std::size_t write_some(const Const_Buffers& buffers, + template + std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec) { return this->service.send(this->implementation, buffers, 0, ec); @@ -599,8 +599,9 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_write_some(const Const_Buffers& buffers, Handler handler) + template + void async_write_some(const ConstBufferSequence& buffers, + WriteHandler handler) { this->service.async_send(this->implementation, buffers, 0, handler); } @@ -633,8 +634,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t read_some(const Mutable_Buffers& buffers) + template + std::size_t read_some(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.receive(this->implementation, buffers, 0, ec); @@ -659,8 +660,8 @@ public: * the requested amount of data is read before the blocking operation * completes. */ - template - std::size_t read_some(const Mutable_Buffers& buffers, + template + std::size_t read_some(const MutableBufferSequence& buffers, asio::error_code& ec) { return this->service.receive(this->implementation, buffers, 0, ec); @@ -702,8 +703,9 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - void async_read_some(const Mutable_Buffers& buffers, Handler handler) + template + void async_read_some(const MutableBufferSequence& buffers, + ReadHandler handler) { this->service.async_receive(this->implementation, buffers, 0, handler); } @@ -728,8 +730,8 @@ public: * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ - template - std::size_t peek(const Mutable_Buffers& buffers) + template + std::size_t peek(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = this->service.receive(this->implementation, buffers, @@ -750,8 +752,8 @@ public: * * @returns The number of bytes read. Returns 0 if an error occurred. */ - template - std::size_t peek(const Mutable_Buffers& buffers, + template + std::size_t peek(const MutableBufferSequence& buffers, asio::error_code& ec) { return this->service.receive(this->implementation, buffers, diff --git a/asio/include/asio/buffer.hpp b/asio/include/asio/buffer.hpp index 4169a2d4..911c36a6 100644 --- a/asio/include/asio/buffer.hpp +++ b/asio/include/asio/buffer.hpp @@ -126,10 +126,10 @@ inline std::size_t buffer_size_helper(const mutable_buffer& b) /** * @relates mutable_buffer */ -template -inline Pointer_To_Pod_Type buffer_cast(const mutable_buffer& b) +template +inline PointerToPodType buffer_cast(const mutable_buffer& b) { - return static_cast(detail::buffer_cast_helper(b)); + return static_cast(detail::buffer_cast_helper(b)); } /// Get the number of bytes in a non-modifiable buffer. @@ -176,7 +176,7 @@ inline mutable_buffer operator+(std::size_t start, const mutable_buffer& b) } /// Adapts a single modifiable buffer so that it meets the requirements of the -/// Mutable_Buffers concept. +/// MutableBufferSequence concept. class mutable_buffer_container_1 : public mutable_buffer { @@ -290,10 +290,10 @@ inline std::size_t buffer_size_helper(const const_buffer& b) /** * @relates const_buffer */ -template -inline Pointer_To_Pod_Type buffer_cast(const const_buffer& b) +template +inline PointerToPodType buffer_cast(const const_buffer& b) { - return static_cast(detail::buffer_cast_helper(b)); + return static_cast(detail::buffer_cast_helper(b)); } /// Get the number of bytes in a non-modifiable buffer. @@ -340,7 +340,7 @@ inline const_buffer operator+(std::size_t start, const const_buffer& b) } /// Adapts a single non-modifiable buffer so that it meets the requirements of -/// the Const_Buffers concept. +/// the ConstBufferSequence concept. class const_buffer_container_1 : public const_buffer { @@ -405,9 +405,9 @@ private: * @code sock.write(asio::buffer(data, size)); @endcode * * In the above example, the return value of asio::buffer meets the - * requirements of the Const_Buffers concept so that it may be directly passed - * to the socket's write function. A buffer created for modifiable memory also - * meets the requirements of the Mutable_Buffers concept. + * requirements of the ConstBufferSequence concept so that it may be directly + * passed to the socket's write function. A buffer created for modifiable + * memory also meets the requirements of the MutableBufferSequence concept. * * An individual buffer may be created from a builtin array, std::vector or * boost::array of POD elements. This helps prevent buffer overruns by @@ -424,7 +424,7 @@ private: * * To read or write using multiple buffers (i.e. scatter-gather I/O), multiple * buffer objects may be assigned into a container that supports the - * Mutable_Buffers (for read) or Const_Buffers (for write) concepts: + * MutableBufferSequence (for read) or ConstBufferSequence (for write) concepts: * * @code * char d1[128]; @@ -499,54 +499,54 @@ inline const_buffer_container_1 buffer(const void* data, } /// Create a new modifiable buffer that represents the given POD array. -template -inline mutable_buffer_container_1 buffer(Pod_Type (&data)[N]) +template +inline mutable_buffer_container_1 buffer(PodType (&data)[N]) { - return mutable_buffer_container_1(mutable_buffer(data, N * sizeof(Pod_Type))); + return mutable_buffer_container_1(mutable_buffer(data, N * sizeof(PodType))); } /// Create a new modifiable buffer that represents the given POD array. -template -inline mutable_buffer_container_1 buffer(Pod_Type (&data)[N], +template +inline mutable_buffer_container_1 buffer(PodType (&data)[N], std::size_t max_size_in_bytes) { return mutable_buffer_container_1( mutable_buffer(data, - N * sizeof(Pod_Type) < max_size_in_bytes - ? N * sizeof(Pod_Type) : max_size_in_bytes)); + N * sizeof(PodType) < max_size_in_bytes + ? N * sizeof(PodType) : max_size_in_bytes)); } /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(const Pod_Type (&data)[N]) +template +inline const_buffer_container_1 buffer(const PodType (&data)[N]) { - return const_buffer_container_1(const_buffer(data, N * sizeof(Pod_Type))); + return const_buffer_container_1(const_buffer(data, N * sizeof(PodType))); } /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(const Pod_Type (&data)[N], +template +inline const_buffer_container_1 buffer(const PodType (&data)[N], std::size_t max_size_in_bytes) { return const_buffer_container_1( const_buffer(data, - N * sizeof(Pod_Type) < max_size_in_bytes - ? N * sizeof(Pod_Type) : max_size_in_bytes)); + N * sizeof(PodType) < max_size_in_bytes + ? N * sizeof(PodType) : max_size_in_bytes)); } #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // Borland C++ thinks the overloads: // -// unspecified buffer(boost::array& array ...); +// unspecified buffer(boost::array& array ...); // // and // -// unspecified buffer(boost::array& array ...); +// unspecified buffer(boost::array& array ...); // // are ambiguous. This will be worked around by using a buffer_types traits // class that contains typedefs for the appropriate buffer and container -// classes, based on whether Pod_Type is const or non-const. +// classes, based on whether PodType is const or non-const. namespace detail { @@ -567,99 +567,99 @@ struct buffer_types_base typedef const_buffer_container_1 container_type; }; -template +template struct buffer_types - : public buffer_types_base::value> + : public buffer_types_base::value> { }; } // namespace detail -template -inline typename detail::buffer_types::container_type -buffer(boost::array& data) +template +inline typename detail::buffer_types::container_type +buffer(boost::array& data) { - typedef typename asio::detail::buffer_types::buffer_type + typedef typename asio::detail::buffer_types::buffer_type buffer_type; - typedef typename asio::detail::buffer_types::container_type + typedef typename asio::detail::buffer_types::container_type container_type; return container_type( - buffer_type(data.c_array(), data.size() * sizeof(Pod_Type))); + buffer_type(data.c_array(), data.size() * sizeof(PodType))); } -template -inline typename detail::buffer_types::container_type -buffer(boost::array& data, std::size_t max_size_in_bytes) +template +inline typename detail::buffer_types::container_type +buffer(boost::array& data, std::size_t max_size_in_bytes) { - typedef typename asio::detail::buffer_types::buffer_type + typedef typename asio::detail::buffer_types::buffer_type buffer_type; - typedef typename asio::detail::buffer_types::container_type + typedef typename asio::detail::buffer_types::container_type container_type; return container_type( buffer_type(data.c_array(), - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes)); + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes)); } #else // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) /// Create a new modifiable buffer that represents the given POD array. -template -inline mutable_buffer_container_1 buffer(boost::array& data) +template +inline mutable_buffer_container_1 buffer(boost::array& data) { return mutable_buffer_container_1( - mutable_buffer(data.c_array(), data.size() * sizeof(Pod_Type))); + mutable_buffer(data.c_array(), data.size() * sizeof(PodType))); } /// Create a new modifiable buffer that represents the given POD array. -template -inline mutable_buffer_container_1 buffer(boost::array& data, +template +inline mutable_buffer_container_1 buffer(boost::array& data, std::size_t max_size_in_bytes) { return mutable_buffer_container_1( mutable_buffer(data.c_array(), - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes)); + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes)); } /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(boost::array& data) +template +inline const_buffer_container_1 buffer(boost::array& data) { return const_buffer_container_1( - const_buffer(data.data(), data.size() * sizeof(Pod_Type))); + const_buffer(data.data(), data.size() * sizeof(PodType))); } /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(boost::array& data, +template +inline const_buffer_container_1 buffer(boost::array& data, std::size_t max_size_in_bytes) { return const_buffer_container_1( const_buffer(data.data(), - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes)); + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes)); } #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(const boost::array& data) +template +inline const_buffer_container_1 buffer(const boost::array& data) { return const_buffer_container_1( - const_buffer(data.data(), data.size() * sizeof(Pod_Type))); + const_buffer(data.data(), data.size() * sizeof(PodType))); } /// Create a new non-modifiable buffer that represents the given POD array. -template -inline const_buffer_container_1 buffer(const boost::array& data, +template +inline const_buffer_container_1 buffer(const boost::array& data, std::size_t max_size_in_bytes) { return const_buffer_container_1( const_buffer(data.data(), - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes)); + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes)); } /// Create a new modifiable buffer that represents the given POD vector. @@ -667,14 +667,14 @@ inline const_buffer_container_1 buffer(const boost::array& data, * @note The buffer is invalidated by any vector operation that would also * invalidate iterators. */ -template -inline mutable_buffer_container_1 buffer(std::vector& data) +template +inline mutable_buffer_container_1 buffer(std::vector& data) { return mutable_buffer_container_1( - mutable_buffer(&data[0], data.size() * sizeof(Pod_Type) + mutable_buffer(&data[0], data.size() * sizeof(PodType) #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) , detail::buffer_debug_check< - typename std::vector::iterator + typename std::vector::iterator >(data.begin()) #endif // ASIO_ENABLE_BUFFER_DEBUGGING )); @@ -685,17 +685,17 @@ inline mutable_buffer_container_1 buffer(std::vector& data) * @note The buffer is invalidated by any vector operation that would also * invalidate iterators. */ -template -inline mutable_buffer_container_1 buffer(std::vector& data, +template +inline mutable_buffer_container_1 buffer(std::vector& data, std::size_t max_size_in_bytes) { return mutable_buffer_container_1( mutable_buffer(&data[0], - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) , detail::buffer_debug_check< - typename std::vector::iterator + typename std::vector::iterator >(data.begin()) #endif // ASIO_ENABLE_BUFFER_DEBUGGING )); @@ -706,15 +706,15 @@ inline mutable_buffer_container_1 buffer(std::vector& data, * @note The buffer is invalidated by any vector operation that would also * invalidate iterators. */ -template +template inline const_buffer_container_1 buffer( - const std::vector& data) + const std::vector& data) { return const_buffer_container_1( - const_buffer(&data[0], data.size() * sizeof(Pod_Type) + const_buffer(&data[0], data.size() * sizeof(PodType) #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) , detail::buffer_debug_check< - typename std::vector::const_iterator + typename std::vector::const_iterator >(data.begin()) #endif // ASIO_ENABLE_BUFFER_DEBUGGING )); @@ -725,17 +725,17 @@ inline const_buffer_container_1 buffer( * @note The buffer is invalidated by any vector operation that would also * invalidate iterators. */ -template +template inline const_buffer_container_1 buffer( - const std::vector& data, std::size_t max_size_in_bytes) + const std::vector& data, std::size_t max_size_in_bytes) { return const_buffer_container_1( const_buffer(&data[0], - data.size() * sizeof(Pod_Type) < max_size_in_bytes - ? data.size() * sizeof(Pod_Type) : max_size_in_bytes + data.size() * sizeof(PodType) < max_size_in_bytes + ? data.size() * sizeof(PodType) : max_size_in_bytes #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) , detail::buffer_debug_check< - typename std::vector::const_iterator + typename std::vector::const_iterator >(data.begin()) #endif // ASIO_ENABLE_BUFFER_DEBUGGING )); diff --git a/asio/include/asio/buffered_read_stream.hpp b/asio/include/asio/buffered_read_stream.hpp index d35c4ff0..a9520cee 100644 --- a/asio/include/asio/buffered_read_stream.hpp +++ b/asio/include/asio/buffered_read_stream.hpp @@ -45,8 +45,7 @@ namespace asio { * @e Shared @e objects: Unsafe. * * @par Concepts: - * Async_Object, Async_Read_Stream, Async_Write_Stream, Stream, - * Sync_Read_Stream, Sync_Write_Stream. + * AsyncReadStream, AsyncWriteStream, Stream, Sync_Read_Stream, SyncWriteStream. */ template class buffered_read_stream @@ -114,16 +113,16 @@ public: /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. - template - std::size_t write_some(const Const_Buffers& buffers) + template + std::size_t write_some(const ConstBufferSequence& buffers) { return next_layer_.write_some(buffers); } /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred. - template - std::size_t write_some(const Const_Buffers& buffers, + template + std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec) { return next_layer_.write_some(buffers, ec); @@ -131,8 +130,9 @@ public: /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. - template - void async_write_some(const Const_Buffers& buffers, Handler handler) + template + void async_write_some(const ConstBufferSequence& buffers, + WriteHandler handler) { next_layer_.async_write_some(buffers, handler); } @@ -168,13 +168,13 @@ public: return storage_.size() - previous_size; } - template + template class fill_handler { public: fill_handler(asio::io_service& io_service, detail::buffered_stream_storage& storage, - std::size_t previous_size, Handler handler) + std::size_t previous_size, ReadHandler handler) : io_service_(io_service), storage_(storage), previous_size_(previous_size), @@ -194,12 +194,12 @@ public: asio::io_service& io_service_; detail::buffered_stream_storage& storage_; std::size_t previous_size_; - Handler handler_; + ReadHandler handler_; }; /// Start an asynchronous fill. - template - void async_fill(Handler handler) + template + void async_fill(ReadHandler handler) { std::size_t previous_size = storage_.size(); storage_.resize(storage_.capacity()); @@ -207,13 +207,14 @@ public: buffer( storage_.data() + previous_size, storage_.size() - previous_size), - fill_handler(io_service(), storage_, previous_size, handler)); + fill_handler(io_service(), + storage_, previous_size, handler)); } /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. - template - std::size_t read_some(const Mutable_Buffers& buffers) + template + std::size_t read_some(const MutableBufferSequence& buffers) { if (storage_.empty()) fill(); @@ -222,8 +223,8 @@ public: /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. - template - std::size_t read_some(const Mutable_Buffers& buffers, + template + std::size_t read_some(const MutableBufferSequence& buffers, asio::error_code& ec) { ec = asio::error_code(); @@ -232,13 +233,13 @@ public: return copy(buffers); } - template + template class read_some_handler { public: read_some_handler(asio::io_service& io_service, detail::buffered_stream_storage& storage, - const Mutable_Buffers& buffers, Handler handler) + const MutableBufferSequence& buffers, ReadHandler handler) : io_service_(io_service), storage_(storage), buffers_(buffers), @@ -260,8 +261,8 @@ public: std::size_t bytes_avail = storage_.size(); std::size_t bytes_copied = 0; - typename Mutable_Buffers::const_iterator iter = buffers_.begin(); - typename Mutable_Buffers::const_iterator end = buffers_.end(); + typename MutableBufferSequence::const_iterator iter = buffers_.begin(); + typename MutableBufferSequence::const_iterator end = buffers_.end(); for (; iter != end && bytes_avail > 0; ++iter) { std::size_t max_length = buffer_size(*iter); @@ -281,18 +282,19 @@ public: private: asio::io_service& io_service_; detail::buffered_stream_storage& storage_; - Mutable_Buffers buffers_; - Handler handler_; + MutableBufferSequence buffers_; + ReadHandler handler_; }; /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. - template - void async_read_some(const Mutable_Buffers& buffers, Handler handler) + template + void async_read_some(const MutableBufferSequence& buffers, + ReadHandler handler) { if (storage_.empty()) { - async_fill(read_some_handler( + async_fill(read_some_handler( io_service(), storage_, buffers, handler)); } else @@ -305,8 +307,8 @@ public: /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. - template - std::size_t peek(const Mutable_Buffers& buffers) + template + std::size_t peek(const MutableBufferSequence& buffers) { if (storage_.empty()) fill(); @@ -315,8 +317,8 @@ public: /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. - template - std::size_t peek(const Mutable_Buffers& buffers, + template + std::size_t peek(const MutableBufferSequence& buffers, asio::error_code& ec) { ec = asio::error_code(); @@ -341,16 +343,16 @@ public: private: /// Copy data out of the internal buffer to the specified target buffer. /// Returns the number of bytes copied. - template - std::size_t copy(const Mutable_Buffers& buffers) + template + std::size_t copy(const MutableBufferSequence& buffers) { using namespace std; // For memcpy. std::size_t bytes_avail = storage_.size(); std::size_t bytes_copied = 0; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); for (; iter != end && bytes_avail > 0; ++iter) { std::size_t max_length = buffer_size(*iter); @@ -368,16 +370,16 @@ private: /// Copy data from the internal buffer to the specified target buffer, without /// removing the data from the internal buffer. Returns the number of bytes /// copied. - template - std::size_t peek_copy(const Mutable_Buffers& buffers) + template + std::size_t peek_copy(const MutableBufferSequence& buffers) { using namespace std; // For memcpy. std::size_t bytes_avail = storage_.size(); std::size_t bytes_copied = 0; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); for (; iter != end && bytes_avail > 0; ++iter) { std::size_t max_length = buffer_size(*iter); diff --git a/asio/include/asio/buffered_stream.hpp b/asio/include/asio/buffered_stream.hpp index a90de7e0..6e53f0f3 100644 --- a/asio/include/asio/buffered_stream.hpp +++ b/asio/include/asio/buffered_stream.hpp @@ -41,8 +41,7 @@ namespace asio { * @e Shared @e objects: Unsafe. * * @par Concepts: - * Async_Object, Async_Read_Stream, Async_Write_Stream, Stream, - * Sync_Read_Stream, Sync_Write_Stream. + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template class buffered_stream @@ -119,24 +118,24 @@ public: } /// Start an asynchronous flush. - template - void async_flush(Handler handler) + template + void async_flush(WriteHandler handler) { return stream_impl_.next_layer().async_flush(handler); } /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. - template - std::size_t write_some(const Const_Buffers& buffers) + template + std::size_t write_some(const ConstBufferSequence& buffers) { return stream_impl_.write_some(buffers); } /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred. - template - std::size_t write_some(const Const_Buffers& buffers, + template + std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec) { return stream_impl_.write_some(buffers, ec); @@ -144,8 +143,9 @@ public: /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. - template - void async_write_some(const Const_Buffers& buffers, Handler handler) + template + void async_write_some(const ConstBufferSequence& buffers, + WriteHandler handler) { stream_impl_.async_write_some(buffers, handler); } @@ -165,24 +165,24 @@ public: } /// Start an asynchronous fill. - template - void async_fill(Handler handler) + template + void async_fill(ReadHandler handler) { stream_impl_.async_fill(handler); } /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. - template - std::size_t read_some(const Mutable_Buffers& buffers) + template + std::size_t read_some(const MutableBufferSequence& buffers) { return stream_impl_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. - template - std::size_t read_some(const Mutable_Buffers& buffers, + template + std::size_t read_some(const MutableBufferSequence& buffers, asio::error_code& ec) { return stream_impl_.read_some(buffers, ec); @@ -190,24 +190,25 @@ public: /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. - template - void async_read_some(const Mutable_Buffers& buffers, Handler handler) + template + void async_read_some(const MutableBufferSequence& buffers, + ReadHandler handler) { stream_impl_.async_read_some(buffers, handler); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. - template - std::size_t peek(const Mutable_Buffers& buffers) + template + std::size_t peek(const MutableBufferSequence& buffers) { return stream_impl_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. - template - std::size_t peek(const Mutable_Buffers& buffers, + template + std::size_t peek(const MutableBufferSequence& buffers, asio::error_code& ec) { return stream_impl_.peek(buffers, ec); diff --git a/asio/include/asio/buffered_write_stream.hpp b/asio/include/asio/buffered_write_stream.hpp index b5d5f3e2..5eed9fa6 100644 --- a/asio/include/asio/buffered_write_stream.hpp +++ b/asio/include/asio/buffered_write_stream.hpp @@ -46,8 +46,7 @@ namespace asio { * @e Shared @e objects: Unsafe. * * @par Concepts: - * Async_Read_Stream, Async_Write_Stream, Stream, Sync_Read_Stream, - * Sync_Write_Stream. + * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template class buffered_write_stream @@ -136,12 +135,12 @@ public: return bytes_written; } - template + template class flush_handler { public: flush_handler(asio::io_service& io_service, - detail::buffered_stream_storage& storage, Handler handler) + detail::buffered_stream_storage& storage, WriteHandler handler) : io_service_(io_service), storage_(storage), handler_(handler) @@ -158,21 +157,21 @@ public: private: asio::io_service& io_service_; detail::buffered_stream_storage& storage_; - Handler handler_; + WriteHandler handler_; }; /// Start an asynchronous flush. - template - void async_flush(Handler handler) + template + void async_flush(WriteHandler handler) { async_write(next_layer_, buffer(storage_.data(), storage_.size()), - flush_handler(io_service(), storage_, handler)); + flush_handler(io_service(), storage_, handler)); } /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. - template - std::size_t write_some(const Const_Buffers& buffers) + template + std::size_t write_some(const ConstBufferSequence& buffers) { if (storage_.size() == storage_.capacity()) flush(); @@ -181,8 +180,8 @@ public: /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred and the error handler did not throw. - template - std::size_t write_some(const Const_Buffers& buffers, + template + std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec) { ec = asio::error_code(); @@ -191,13 +190,13 @@ public: return copy(buffers); } - template + template class write_some_handler { public: write_some_handler(asio::io_service& io_service, detail::buffered_stream_storage& storage, - const Const_Buffers& buffers, Handler handler) + const ConstBufferSequence& buffers, WriteHandler handler) : io_service_(io_service), storage_(storage), buffers_(buffers), @@ -220,8 +219,8 @@ public: std::size_t space_avail = storage_.capacity() - orig_size; std::size_t bytes_copied = 0; - typename Const_Buffers::const_iterator iter = buffers_.begin(); - typename Const_Buffers::const_iterator end = buffers_.end(); + typename ConstBufferSequence::const_iterator iter = buffers_.begin(); + typename ConstBufferSequence::const_iterator end = buffers_.end(); for (; iter != end && space_avail > 0; ++iter) { std::size_t bytes_avail = buffer_size(*iter); @@ -241,18 +240,19 @@ public: private: asio::io_service& io_service_; detail::buffered_stream_storage& storage_; - Const_Buffers buffers_; - Handler handler_; + ConstBufferSequence buffers_; + WriteHandler handler_; }; /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. - template - void async_write_some(const Const_Buffers& buffers, Handler handler) + template + void async_write_some(const ConstBufferSequence& buffers, + WriteHandler handler) { if (storage_.size() == storage_.capacity()) { - async_flush(write_some_handler( + async_flush(write_some_handler( io_service(), storage_, buffers, handler)); } else @@ -265,16 +265,16 @@ public: /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. - template - std::size_t read_some(const Mutable_Buffers& buffers) + template + std::size_t read_some(const MutableBufferSequence& buffers) { return next_layer_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. - template - std::size_t read_some(const Mutable_Buffers& buffers, + template + std::size_t read_some(const MutableBufferSequence& buffers, asio::error_code& ec) { return next_layer_.read_some(buffers, ec); @@ -282,24 +282,25 @@ public: /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. - template - void async_read_some(const Mutable_Buffers& buffers, Handler handler) + template + void async_read_some(const MutableBufferSequence& buffers, + ReadHandler handler) { next_layer_.async_read_some(buffers, handler); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. - template - std::size_t peek(const Mutable_Buffers& buffers) + template + std::size_t peek(const MutableBufferSequence& buffers) { return next_layer_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. - template - std::size_t peek(const Mutable_Buffers& buffers, + template + std::size_t peek(const MutableBufferSequence& buffers, asio::error_code& ec) { return next_layer_.peek(buffers, ec); @@ -320,8 +321,8 @@ public: private: /// Copy data into the internal buffer from the specified source buffer. /// Returns the number of bytes copied. - template - std::size_t copy(const Const_Buffers& buffers) + template + std::size_t copy(const ConstBufferSequence& buffers) { using namespace std; // For memcpy. @@ -329,8 +330,8 @@ private: std::size_t space_avail = storage_.capacity() - orig_size; std::size_t bytes_copied = 0; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); for (; iter != end && space_avail > 0; ++iter) { std::size_t bytes_avail = buffer_size(*iter); diff --git a/asio/include/asio/datagram_socket_service.hpp b/asio/include/asio/datagram_socket_service.hpp index 53786d4f..bbe14938 100644 --- a/asio/include/asio/datagram_socket_service.hpp +++ b/asio/include/asio/datagram_socket_service.hpp @@ -152,33 +152,33 @@ public: } /// Start an asynchronous connect. - template + template void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, Handler handler) + const endpoint_type& peer_endpoint, ConnectHandler handler) { service_impl_.async_connect(impl, peer_endpoint, handler); } /// Set a socket option. - template + template asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) + const SettableSocketOption& option, asio::error_code& ec) { return service_impl_.set_option(impl, option, ec); } /// Get a socket option. - template + template asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const + GettableSocketOption& option, asio::error_code& ec) const { return service_impl_.get_option(impl, option, ec); } /// Perform an IO control command on the socket. - template + template asio::error_code io_control(implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) + IoControlCommand& command, asio::error_code& ec) { return service_impl_.io_control(impl, command, ec); } @@ -205,59 +205,62 @@ public: } /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, const Const_Buffers& buffers, + template + std::size_t send(implementation_type& impl, + const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.send(impl, buffers, flags, ec); } /// Start an asynchronous send. - template - void async_send(implementation_type& impl, const Const_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_send(implementation_type& impl, const ConstBufferSequence& buffers, + socket_base::message_flags flags, WriteHandler handler) { service_impl_.async_send(impl, buffers, flags, handler); } /// Send a datagram to the specified endpoint. - template - std::size_t send_to(implementation_type& impl, const Const_Buffers& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - asio::error_code& ec) + template + std::size_t send_to(implementation_type& impl, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.send_to(impl, buffers, destination, flags, ec); } /// Start an asynchronous send. - template - void async_send_to(implementation_type& impl, const Const_Buffers& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - Handler handler) + template + void async_send_to(implementation_type& impl, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags, WriteHandler handler) { service_impl_.async_send_to(impl, buffers, destination, flags, handler); } /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + std::size_t receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.receive(impl, buffers, flags, ec); } /// Start an asynchronous receive. - template - void async_receive(implementation_type& impl, const Mutable_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_receive(implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, ReadHandler handler) { service_impl_.async_receive(impl, buffers, flags, handler); } /// Receive a datagram with the endpoint of the sender. - template + template std::size_t receive_from(implementation_type& impl, - const Mutable_Buffers& buffers, endpoint_type& sender_endpoint, + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.receive_from(impl, buffers, sender_endpoint, flags, @@ -265,10 +268,10 @@ public: } /// Start an asynchronous receive that will get the endpoint of the sender. - template + template void async_receive_from(implementation_type& impl, - const Mutable_Buffers& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler handler) + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, + socket_base::message_flags flags, ReadHandler handler) { service_impl_.async_receive_from(impl, buffers, sender_endpoint, flags, handler); diff --git a/asio/include/asio/deadline_timer_service.hpp b/asio/include/asio/deadline_timer_service.hpp index 2415d9be..b9dcd6ab 100644 --- a/asio/include/asio/deadline_timer_service.hpp +++ b/asio/include/asio/deadline_timer_service.hpp @@ -134,8 +134,8 @@ public: } // Start an asynchronous wait on the timer. - template - void async_wait(implementation_type& impl, Handler handler) + template + void async_wait(implementation_type& impl, WaitHandler handler) { service_impl_.async_wait(impl, handler); } diff --git a/asio/include/asio/detail/const_buffers_iterator.hpp b/asio/include/asio/detail/const_buffers_iterator.hpp index f48d2df8..84711601 100644 --- a/asio/include/asio/detail/const_buffers_iterator.hpp +++ b/asio/include/asio/detail/const_buffers_iterator.hpp @@ -29,9 +29,9 @@ namespace asio { namespace detail { // A proxy iterator for a sub-range in a list of buffers. -template +template class const_buffers_iterator - : public boost::iterator_facade, + : public boost::iterator_facade, const char, boost::bidirectional_traversal_tag> { public: @@ -41,7 +41,8 @@ public: } // Create an iterator for the specified position. - const_buffers_iterator(const Const_Buffers& buffers, std::size_t position) + const_buffers_iterator(const ConstBufferSequence& buffers, + std::size_t position) : begin_(buffers.begin()), current_(buffers.begin()), end_(buffers.end()), @@ -107,7 +108,7 @@ private: return; } - typename Const_Buffers::const_iterator iter = current_; + typename ConstBufferSequence::const_iterator iter = current_; while (iter != begin_) { --iter; @@ -136,9 +137,9 @@ private: asio::const_buffer current_buffer_; std::size_t current_buffer_position_; - typename Const_Buffers::const_iterator begin_; - typename Const_Buffers::const_iterator current_; - typename Const_Buffers::const_iterator end_; + typename ConstBufferSequence::const_iterator begin_; + typename ConstBufferSequence::const_iterator current_; + typename ConstBufferSequence::const_iterator end_; std::size_t position_; }; diff --git a/asio/include/asio/detail/reactive_socket_service.hpp b/asio/include/asio/detail/reactive_socket_service.hpp index a6b83ea9..3dcacc31 100644 --- a/asio/include/asio/detail/reactive_socket_service.hpp +++ b/asio/include/asio/detail/reactive_socket_service.hpp @@ -372,14 +372,14 @@ public: } // Send the given data to the peer. - template - size_t send(implementation_type& impl, const Const_Buffers& buffers, + template + size_t send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); size_t i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -420,12 +420,12 @@ public: } } - template + template class send_handler { public: send_handler(socket_type socket, asio::io_service& io_service, - const Const_Buffers& buffers, socket_base::message_flags flags, + const ConstBufferSequence& buffers, socket_base::message_flags flags, Handler handler) : socket_(socket), io_service_(io_service), @@ -447,8 +447,8 @@ public: // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers_.begin(); - typename Const_Buffers::const_iterator end = buffers_.end(); + typename ConstBufferSequence::const_iterator iter = buffers_.begin(); + typename ConstBufferSequence::const_iterator end = buffers_.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -475,15 +475,15 @@ public: socket_type socket_; asio::io_service& io_service_; asio::io_service::work work_; - Const_Buffers buffers_; + ConstBufferSequence buffers_; socket_base::message_flags flags_; Handler handler_; }; // Start an asynchronous send. The data being sent must be valid for the // lifetime of the asynchronous operation. - template - void async_send(implementation_type& impl, const Const_Buffers& buffers, + template + void async_send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { if (impl.socket_ == invalid_socket) @@ -496,8 +496,8 @@ public: if (impl.protocol_.type() == SOCK_STREAM) { // Determine total size of buffers. - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); size_t i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -529,22 +529,22 @@ public: } reactor_.start_write_op(impl.socket_, - send_handler( + send_handler( impl.socket_, io_service(), buffers, flags, handler)); } } // Send a datagram to the specified endpoint. Returns the number of bytes // sent. - template - size_t send_to(implementation_type& impl, const Const_Buffers& buffers, + template + size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -577,12 +577,12 @@ public: } } - template + template class send_to_handler { public: send_to_handler(socket_type socket, asio::io_service& io_service, - const Const_Buffers& buffers, const endpoint_type& endpoint, + const ConstBufferSequence& buffers, const endpoint_type& endpoint, socket_base::message_flags flags, Handler handler) : socket_(socket), io_service_(io_service), @@ -605,8 +605,8 @@ public: // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers_.begin(); - typename Const_Buffers::const_iterator end = buffers_.end(); + typename ConstBufferSequence::const_iterator iter = buffers_.begin(); + typename ConstBufferSequence::const_iterator end = buffers_.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -634,7 +634,7 @@ public: socket_type socket_; asio::io_service& io_service_; asio::io_service::work work_; - Const_Buffers buffers_; + ConstBufferSequence buffers_; endpoint_type destination_; socket_base::message_flags flags_; Handler handler_; @@ -642,8 +642,9 @@ public: // Start an asynchronous send. The data being sent must be valid for the // lifetime of the asynchronous operation. - template - void async_send_to(implementation_type& impl, const Const_Buffers& buffers, + template + void async_send_to(implementation_type& impl, + const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, Handler handler) { @@ -668,20 +669,21 @@ public: } reactor_.start_write_op(impl.socket_, - send_to_handler( + send_to_handler( impl.socket_, io_service(), buffers, destination, flags, handler)); } } // Receive some data from the peer. Returns the number of bytes received. - template - size_t receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + size_t receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); size_t i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -729,12 +731,12 @@ public: } } - template + template class receive_handler { public: receive_handler(socket_type socket, asio::io_service& io_service, - const Mutable_Buffers& buffers, socket_base::message_flags flags, + const MutableBufferSequence& buffers, socket_base::message_flags flags, Handler handler) : socket_(socket), io_service_(io_service), @@ -756,8 +758,8 @@ public: // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers_.begin(); - typename Mutable_Buffers::const_iterator end = buffers_.end(); + typename MutableBufferSequence::const_iterator iter = buffers_.begin(); + typename MutableBufferSequence::const_iterator end = buffers_.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -786,15 +788,16 @@ public: socket_type socket_; asio::io_service& io_service_; asio::io_service::work work_; - Mutable_Buffers buffers_; + MutableBufferSequence buffers_; socket_base::message_flags flags_; Handler handler_; }; // Start an asynchronous receive. The buffer for the data being received // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + void async_receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { if (impl.socket_ == invalid_socket) @@ -807,8 +810,8 @@ public: if (impl.protocol_.type() == SOCK_STREAM) { // Determine total size of buffers. - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); size_t i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -842,13 +845,13 @@ public: if (flags & socket_base::message_out_of_band) { reactor_.start_except_op(impl.socket_, - receive_handler( + receive_handler( impl.socket_, io_service(), buffers, flags, handler)); } else { reactor_.start_read_op(impl.socket_, - receive_handler( + receive_handler( impl.socket_, io_service(), buffers, flags, handler)); } } @@ -856,15 +859,16 @@ public: // Receive a datagram with the endpoint of the sender. Returns the number of // bytes received. - template - size_t receive_from(implementation_type& impl, const Mutable_Buffers& buffers, + template + size_t receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -908,14 +912,14 @@ public: } } - template + template class receive_from_handler { public: receive_from_handler(socket_type socket, - asio::io_service& io_service, const Mutable_Buffers& buffers, - endpoint_type& endpoint, socket_base::message_flags flags, - Handler handler) + asio::io_service& io_service, + const MutableBufferSequence& buffers, endpoint_type& endpoint, + socket_base::message_flags flags, Handler handler) : socket_(socket), io_service_(io_service), work_(io_service), @@ -937,8 +941,8 @@ public: // Copy buffers into array. socket_ops::buf bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers_.begin(); - typename Mutable_Buffers::const_iterator end = buffers_.end(); + typename MutableBufferSequence::const_iterator iter = buffers_.begin(); + typename MutableBufferSequence::const_iterator end = buffers_.end(); size_t i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -970,7 +974,7 @@ public: socket_type socket_; asio::io_service& io_service_; asio::io_service::work work_; - Mutable_Buffers buffers_; + MutableBufferSequence buffers_; endpoint_type& sender_endpoint_; socket_base::message_flags flags_; Handler handler_; @@ -979,9 +983,9 @@ public: // Start an asynchronous receive. The buffer for the data being received and // the sender_endpoint object must both be valid for the lifetime of the // asynchronous operation. - template + template void async_receive_from(implementation_type& impl, - const Mutable_Buffers& buffers, endpoint_type& sender_endpoint, + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, Handler handler) { if (impl.socket_ == invalid_socket) @@ -1005,7 +1009,7 @@ public: } reactor_.start_read_op(impl.socket_, - receive_from_handler( + receive_from_handler( impl.socket_, io_service(), buffers, sender_endpoint, flags, handler)); } diff --git a/asio/include/asio/detail/win_iocp_socket_service.hpp b/asio/include/asio/detail/win_iocp_socket_service.hpp index dac08c66..16876e31 100644 --- a/asio/include/asio/detail/win_iocp_socket_service.hpp +++ b/asio/include/asio/detail/win_iocp_socket_service.hpp @@ -516,14 +516,14 @@ public: } // Send the given data to the peer. Returns the number of bytes sent. - template - size_t send(implementation_type& impl, const Const_Buffers& buffers, + template + size_t send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -561,17 +561,17 @@ public: return bytes_transferred; } - template + template class send_operation : public operation { public: send_operation(asio::io_service& io_service, weak_cancel_token_type cancel_token, - const Const_Buffers& buffers, Handler handler) + const ConstBufferSequence& buffers, Handler handler) : operation( - &send_operation::do_completion_impl, - &send_operation::destroy_impl), + &send_operation::do_completion_impl, + &send_operation::destroy_impl), work_(io_service), cancel_token_(cancel_token), buffers_(buffers), @@ -584,16 +584,16 @@ public: DWORD last_error, size_t bytes_transferred) { // Take ownership of the operation object. - typedef send_operation op_type; + typedef send_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. - typename Const_Buffers::const_iterator iter + typename ConstBufferSequence::const_iterator iter = handler_op->buffers_.begin(); - typename Const_Buffers::const_iterator end + typename ConstBufferSequence::const_iterator end = handler_op->buffers_.end(); while (iter != end) { @@ -632,7 +632,7 @@ public: static void destroy_impl(operation* op) { // Take ownership of the operation object. - typedef send_operation op_type; + typedef send_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); @@ -640,14 +640,14 @@ public: asio::io_service::work work_; weak_cancel_token_type cancel_token_; - Const_Buffers buffers_; + ConstBufferSequence buffers_; Handler handler_; }; // Start an asynchronous send. The data being sent must be valid for the // lifetime of the asynchronous operation. - template - void async_send(implementation_type& impl, const Const_Buffers& buffers, + template + void async_send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { // Update the ID of the thread from which cancellation is safe. @@ -657,7 +657,7 @@ public: impl.safe_cancellation_thread_id_ = ~DWORD(0); // Allocate and construct an operation to wrap the handler. - typedef send_operation value_type; + typedef send_operation value_type; typedef handler_alloc_traits alloc_traits; raw_handler_ptr raw_ptr(handler); handler_ptr ptr(raw_ptr, @@ -665,8 +665,8 @@ public: // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -708,15 +708,15 @@ public: // Send a datagram to the specified endpoint. Returns the number of bytes // sent. - template - size_t send_to(implementation_type& impl, const Const_Buffers& buffers, + template + size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -743,16 +743,16 @@ public: return bytes_transferred; } - template + template class send_to_operation : public operation { public: send_to_operation(asio::io_service& io_service, - const Const_Buffers& buffers, Handler handler) + const ConstBufferSequence& buffers, Handler handler) : operation( - &send_to_operation::do_completion_impl, - &send_to_operation::destroy_impl), + &send_to_operation::do_completion_impl, + &send_to_operation::destroy_impl), work_(io_service), buffers_(buffers), handler_(handler) @@ -764,16 +764,16 @@ public: DWORD last_error, size_t bytes_transferred) { // Take ownership of the operation object. - typedef send_to_operation op_type; + typedef send_to_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. - typename Const_Buffers::const_iterator iter + typename ConstBufferSequence::const_iterator iter = handler_op->buffers_.begin(); - typename Const_Buffers::const_iterator end + typename ConstBufferSequence::const_iterator end = handler_op->buffers_.end(); while (iter != end) { @@ -805,23 +805,23 @@ public: static void destroy_impl(operation* op) { // Take ownership of the operation object. - typedef send_to_operation op_type; + typedef send_to_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); } asio::io_service::work work_; - Const_Buffers buffers_; + ConstBufferSequence buffers_; Handler handler_; }; // Start an asynchronous send. The data being sent must be valid for the // lifetime of the asynchronous operation. - template - void async_send_to(implementation_type& impl, const Const_Buffers& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - Handler handler) + template + void async_send_to(implementation_type& impl, + const ConstBufferSequence& buffers, const endpoint_type& destination, + socket_base::message_flags flags, Handler handler) { // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -830,15 +830,15 @@ public: impl.safe_cancellation_thread_id_ = ~DWORD(0); // Allocate and construct an operation to wrap the handler. - typedef send_to_operation value_type; + typedef send_to_operation value_type; typedef handler_alloc_traits alloc_traits; raw_handler_ptr raw_ptr(handler); handler_ptr ptr(raw_ptr, io_service(), buffers, handler); // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Const_Buffers::const_iterator iter = buffers.begin(); - typename Const_Buffers::const_iterator end = buffers.end(); + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -868,14 +868,15 @@ public: } // Receive some data from the peer. Returns the number of bytes received. - template - size_t receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + size_t receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -918,17 +919,19 @@ public: return bytes_transferred; } - template + template class receive_operation : public operation { public: receive_operation(asio::io_service& io_service, weak_cancel_token_type cancel_token, - const Mutable_Buffers& buffers, Handler handler) + const MutableBufferSequence& buffers, Handler handler) : operation( - &receive_operation::do_completion_impl, - &receive_operation::destroy_impl), + &receive_operation< + MutableBufferSequence, Handler>::do_completion_impl, + &receive_operation< + MutableBufferSequence, Handler>::destroy_impl), work_(io_service), cancel_token_(cancel_token), buffers_(buffers), @@ -941,16 +944,16 @@ public: DWORD last_error, size_t bytes_transferred) { // Take ownership of the operation object. - typedef receive_operation op_type; + typedef receive_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. - typename Mutable_Buffers::const_iterator iter + typename MutableBufferSequence::const_iterator iter = handler_op->buffers_.begin(); - typename Mutable_Buffers::const_iterator end + typename MutableBufferSequence::const_iterator end = handler_op->buffers_.end(); while (iter != end) { @@ -995,7 +998,7 @@ public: static void destroy_impl(operation* op) { // Take ownership of the operation object. - typedef receive_operation op_type; + typedef receive_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); @@ -1003,14 +1006,15 @@ public: asio::io_service::work work_; weak_cancel_token_type cancel_token_; - Mutable_Buffers buffers_; + MutableBufferSequence buffers_; Handler handler_; }; // Start an asynchronous receive. The buffer for the data being received // must be valid for the lifetime of the asynchronous operation. - template - void async_receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + void async_receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { // Update the ID of the thread from which cancellation is safe. @@ -1020,7 +1024,7 @@ public: impl.safe_cancellation_thread_id_ = ~DWORD(0); // Allocate and construct an operation to wrap the handler. - typedef receive_operation value_type; + typedef receive_operation value_type; typedef handler_alloc_traits alloc_traits; raw_handler_ptr raw_ptr(handler); handler_ptr ptr(raw_ptr, @@ -1028,8 +1032,8 @@ public: // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; size_t total_buffer_size = 0; for (; iter != end && i < max_buffers; ++iter, ++i) @@ -1069,15 +1073,16 @@ public: // Receive a datagram with the endpoint of the sender. Returns the number of // bytes received. - template - size_t receive_from(implementation_type& impl, const Mutable_Buffers& buffers, + template + size_t receive_from(implementation_type& impl, + const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, asio::error_code& ec) { // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { @@ -1112,17 +1117,19 @@ public: return bytes_transferred; } - template + template class receive_from_operation : public operation { public: receive_from_operation(asio::io_service& io_service, - endpoint_type& endpoint, const Mutable_Buffers& buffers, + endpoint_type& endpoint, const MutableBufferSequence& buffers, Handler handler) : operation( - &receive_from_operation::do_completion_impl, - &receive_from_operation::destroy_impl), + &receive_from_operation< + MutableBufferSequence, Handler>::do_completion_impl, + &receive_from_operation< + MutableBufferSequence, Handler>::destroy_impl), endpoint_(endpoint), endpoint_size_(endpoint.capacity()), work_(io_service), @@ -1141,16 +1148,16 @@ public: DWORD last_error, size_t bytes_transferred) { // Take ownership of the operation object. - typedef receive_from_operation op_type; + typedef receive_from_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. - typename Mutable_Buffers::const_iterator iter + typename MutableBufferSequence::const_iterator iter = handler_op->buffers_.begin(); - typename Mutable_Buffers::const_iterator end + typename MutableBufferSequence::const_iterator end = handler_op->buffers_.end(); while (iter != end) { @@ -1191,7 +1198,7 @@ public: static void destroy_impl(operation* op) { // Take ownership of the operation object. - typedef receive_from_operation op_type; + typedef receive_from_operation op_type; op_type* handler_op(static_cast(op)); typedef handler_alloc_traits alloc_traits; handler_ptr ptr(handler_op->handler_, handler_op); @@ -1200,16 +1207,16 @@ public: endpoint_type& endpoint_; int endpoint_size_; asio::io_service::work work_; - Mutable_Buffers buffers_; + MutableBufferSequence buffers_; Handler handler_; }; // Start an asynchronous receive. The buffer for the data being received and // the sender_endpoint object must both be valid for the lifetime of the // asynchronous operation. - template + template void async_receive_from(implementation_type& impl, - const Mutable_Buffers& buffers, endpoint_type& sender_endp, + const MutableBufferSequence& buffers, endpoint_type& sender_endp, socket_base::message_flags flags, Handler handler) { // Update the ID of the thread from which cancellation is safe. @@ -1219,7 +1226,7 @@ public: impl.safe_cancellation_thread_id_ = ~DWORD(0); // Allocate and construct an operation to wrap the handler. - typedef receive_from_operation value_type; + typedef receive_from_operation value_type; typedef handler_alloc_traits alloc_traits; raw_handler_ptr raw_ptr(handler); handler_ptr ptr(raw_ptr, @@ -1227,8 +1234,8 @@ public: // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; - typename Mutable_Buffers::const_iterator iter = buffers.begin(); - typename Mutable_Buffers::const_iterator end = buffers.end(); + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); DWORD i = 0; for (; iter != end && i < max_buffers; ++iter, ++i) { diff --git a/asio/include/asio/impl/read.ipp b/asio/include/asio/impl/read.ipp index 7f567480..14285e79 100644 --- a/asio/include/asio/impl/read.ipp +++ b/asio/include/asio/impl/read.ipp @@ -28,13 +28,13 @@ namespace asio { -template -std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition, asio::error_code& ec) +template +std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition, asio::error_code& ec) { asio::detail::consuming_buffers< - mutable_buffer, Mutable_Buffers> tmp(buffers); + mutable_buffer, MutableBufferSequence> tmp(buffers); std::size_t total_transferred = 0; while (tmp.begin() != tmp.end()) { @@ -48,8 +48,8 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, return total_transferred; } -template -inline std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers) +template +inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec); @@ -57,10 +57,10 @@ inline std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers) return bytes_transferred; } -template -inline std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition) +template +inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition) { asio::error_code ec; std::size_t bytes_transferred = read(s, buffers, completion_condition, ec); @@ -68,11 +68,11 @@ inline std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, return bytes_transferred; } -template -std::size_t read(Sync_Read_Stream& s, +template +std::size_t read(SyncReadStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition, asio::error_code& ec) + CompletionCondition completion_condition, asio::error_code& ec) { std::size_t total_transferred = 0; for (;;) @@ -85,8 +85,8 @@ std::size_t read(Sync_Read_Stream& s, } } -template -inline std::size_t read(Sync_Read_Stream& s, +template +inline std::size_t read(SyncReadStream& s, asio::basic_streambuf& b) { asio::error_code ec; @@ -95,11 +95,11 @@ inline std::size_t read(Sync_Read_Stream& s, return bytes_transferred; } -template -inline std::size_t read(Sync_Read_Stream& s, +template +inline std::size_t read(SyncReadStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition) + CompletionCondition completion_condition) { asio::error_code ec; std::size_t bytes_transferred = read(s, b, completion_condition, ec); @@ -109,13 +109,13 @@ inline std::size_t read(Sync_Read_Stream& s, namespace detail { - template + template class read_handler { public: - read_handler(Async_Read_Stream& stream, const Mutable_Buffers& buffers, - Completion_Condition completion_condition, Handler handler) + read_handler(AsyncReadStream& stream, const MutableBufferSequence& buffers, + CompletionCondition completion_condition, ReadHandler handler) : stream_(stream), buffers_(buffers), total_transferred_(0), @@ -141,74 +141,75 @@ namespace detail } //private: - Async_Read_Stream& stream_; + AsyncReadStream& stream_; asio::detail::consuming_buffers< - mutable_buffer, Mutable_Buffers> buffers_; + mutable_buffer, MutableBufferSequence> buffers_; std::size_t total_transferred_; - Completion_Condition completion_condition_; - Handler handler_; + CompletionCondition completion_condition_; + ReadHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - read_handler* this_handler) + read_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_handler* this_handler) + read_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - read_handler* this_handler) + read_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -inline void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition, Handler handler) +template +inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition, ReadHandler handler) { s.async_read_some(buffers, - detail::read_handler( + detail::read_handler( s, buffers, completion_condition, handler)); } -template -inline void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, - Handler handler) +template +inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, + ReadHandler handler) { async_read(s, buffers, transfer_all(), handler); } namespace detail { - template + template class read_streambuf_handler { public: - read_streambuf_handler(Async_Read_Stream& stream, + read_streambuf_handler(AsyncReadStream& stream, basic_streambuf& streambuf, - Completion_Condition completion_condition, Handler handler) + CompletionCondition completion_condition, ReadHandler handler) : stream_(stream), streambuf_(streambuf), total_transferred_(0), @@ -233,59 +234,59 @@ namespace detail } //private: - Async_Read_Stream& stream_; + AsyncReadStream& stream_; asio::basic_streambuf& streambuf_; std::size_t total_transferred_; - Completion_Condition completion_condition_; - Handler handler_; + CompletionCondition completion_condition_; + ReadHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - read_streambuf_handler* this_handler) + read_streambuf_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_streambuf_handler* this_handler) + read_streambuf_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - read_streambuf_handler* this_handler) + read_streambuf_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -inline void async_read(Async_Read_Stream& s, +template +inline void async_read(AsyncReadStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition, Handler handler) + CompletionCondition completion_condition, ReadHandler handler) { s.async_read_some(b.prepare(512), - detail::read_streambuf_handler( + detail::read_streambuf_handler( s, b, completion_condition, handler)); } -template -inline void async_read(Async_Read_Stream& s, - asio::basic_streambuf& b, Handler handler) +template +inline void async_read(AsyncReadStream& s, + asio::basic_streambuf& b, ReadHandler handler) { async_read(s, b, transfer_all(), handler); } diff --git a/asio/include/asio/impl/read_until.ipp b/asio/include/asio/impl/read_until.ipp index d3e6e999..6fe201b7 100644 --- a/asio/include/asio/impl/read_until.ipp +++ b/asio/include/asio/impl/read_until.ipp @@ -33,8 +33,8 @@ namespace asio { -template -inline std::size_t read_until(Sync_Read_Stream& s, +template +inline std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, char delim) { asio::error_code ec; @@ -43,8 +43,8 @@ inline std::size_t read_until(Sync_Read_Stream& s, return bytes_transferred; } -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, char delim, asio::error_code& ec) { @@ -81,8 +81,8 @@ std::size_t read_until(Sync_Read_Stream& s, } } -template -inline std::size_t read_until(Sync_Read_Stream& s, +template +inline std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const std::string& delim) { asio::error_code ec; @@ -126,8 +126,8 @@ namespace detail } } // namespace detail -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const std::string& delim, asio::error_code& ec) { @@ -173,8 +173,8 @@ std::size_t read_until(Sync_Read_Stream& s, } } -template -inline std::size_t read_until(Sync_Read_Stream& s, +template +inline std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const boost::regex& expr) { asio::error_code ec; @@ -183,8 +183,8 @@ inline std::size_t read_until(Sync_Read_Stream& s, return bytes_transferred; } -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const boost::regex& expr, asio::error_code& ec) { @@ -232,13 +232,13 @@ std::size_t read_until(Sync_Read_Stream& s, namespace detail { - template + template class read_until_delim_handler { public: - read_until_delim_handler(Async_Read_Stream& stream, + read_until_delim_handler(AsyncReadStream& stream, asio::basic_streambuf& streambuf, char delim, - std::size_t next_search_start, Handler handler) + std::size_t next_search_start, ReadHandler handler) : stream_(stream), streambuf_(streambuf), delim_(delim), @@ -286,45 +286,45 @@ namespace detail } //private: - Async_Read_Stream& stream_; + AsyncReadStream& stream_; asio::basic_streambuf& streambuf_; char delim_; std::size_t next_search_start_; - Handler handler_; + ReadHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - read_until_delim_handler* this_handler) + read_until_delim_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_delim_handler* this_handler) + read_until_delim_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - read_until_delim_handler* this_handler) + read_until_delim_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -void async_read_until(Async_Read_Stream& s, - asio::basic_streambuf& b, char delim, Handler handler) +template +void async_read_until(AsyncReadStream& s, + asio::basic_streambuf& b, char delim, ReadHandler handler) { // Determine the range of the data to be searched. typedef typename asio::basic_streambuf< @@ -348,20 +348,20 @@ void async_read_until(Async_Read_Stream& s, // No match. Start a new asynchronous read operation to obtain more data. s.async_read_some(b.prepare(512), - detail::read_until_delim_handler( + detail::read_until_delim_handler( s, b, delim, end.position(), handler)); } namespace detail { - template + template class read_until_delim_string_handler { public: - read_until_delim_string_handler(Async_Read_Stream& stream, + read_until_delim_string_handler(AsyncReadStream& stream, asio::basic_streambuf& streambuf, const std::string& delim, std::size_t next_search_start, - Handler handler) + ReadHandler handler) : stream_(stream), streambuf_(streambuf), delim_(delim), @@ -422,46 +422,46 @@ namespace detail } //private: - Async_Read_Stream& stream_; + AsyncReadStream& stream_; asio::basic_streambuf& streambuf_; std::string delim_; std::size_t next_search_start_; - Handler handler_; + ReadHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - read_until_delim_string_handler* this_handler) + read_until_delim_string_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_delim_string_handler* this_handler) + read_until_delim_string_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - read_until_delim_string_handler* this_handler) + read_until_delim_string_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -void async_read_until(Async_Read_Stream& s, +template +void async_read_until(AsyncReadStream& s, asio::basic_streambuf& b, const std::string& delim, - Handler handler) + ReadHandler handler) { // Determine the range of the data to be searched. typedef typename asio::basic_streambuf< @@ -501,20 +501,20 @@ void async_read_until(Async_Read_Stream& s, // No match. Start a new asynchronous read operation to obtain more data. s.async_read_some(b.prepare(512), detail::read_until_delim_string_handler< - Async_Read_Stream, Allocator, Handler>( + AsyncReadStream, Allocator, ReadHandler>( s, b, delim, next_search_start, handler)); } namespace detail { - template + template class read_until_expr_handler { public: - read_until_expr_handler(Async_Read_Stream& stream, + read_until_expr_handler(AsyncReadStream& stream, asio::basic_streambuf& streambuf, const boost::regex& expr, std::size_t next_search_start, - Handler handler) + ReadHandler handler) : stream_(stream), streambuf_(streambuf), expr_(expr), @@ -575,46 +575,46 @@ namespace detail } //private: - Async_Read_Stream& stream_; + AsyncReadStream& stream_; asio::basic_streambuf& streambuf_; boost::regex expr_; std::size_t next_search_start_; - Handler handler_; + ReadHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - read_until_expr_handler* this_handler) + read_until_expr_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - read_until_expr_handler* this_handler) + read_until_expr_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - read_until_expr_handler* this_handler) + read_until_expr_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -void async_read_until(Async_Read_Stream& s, +template +void async_read_until(AsyncReadStream& s, asio::basic_streambuf& b, const boost::regex& expr, - Handler handler) + ReadHandler handler) { // Determine the range of the data to be searched. typedef typename asio::basic_streambuf< @@ -653,7 +653,7 @@ void async_read_until(Async_Read_Stream& s, // No match. Start a new asynchronous read operation to obtain more data. s.async_read_some(b.prepare(512), - detail::read_until_expr_handler( + detail::read_until_expr_handler( s, b, expr, next_search_start, handler)); } diff --git a/asio/include/asio/impl/write.ipp b/asio/include/asio/impl/write.ipp index 6614f1b2..103cd231 100644 --- a/asio/include/asio/impl/write.ipp +++ b/asio/include/asio/impl/write.ipp @@ -27,13 +27,13 @@ namespace asio { -template -std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition, asio::error_code& ec) +template +std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition, asio::error_code& ec) { asio::detail::consuming_buffers< - const_buffer, Const_Buffers> tmp(buffers); + const_buffer, ConstBufferSequence> tmp(buffers); std::size_t total_transferred = 0; while (tmp.begin() != tmp.end()) { @@ -47,8 +47,8 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, return total_transferred; } -template -inline std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers) +template +inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers) { asio::error_code ec; std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec); @@ -56,10 +56,10 @@ inline std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers) return bytes_transferred; } -template -inline std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition) +template +inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition) { asio::error_code ec; std::size_t bytes_transferred = write(s, buffers, completion_condition, ec); @@ -67,19 +67,19 @@ inline std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, return bytes_transferred; } -template -std::size_t write(Sync_Write_Stream& s, +template +std::size_t write(SyncWriteStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition, asio::error_code& ec) + CompletionCondition completion_condition, asio::error_code& ec) { std::size_t bytes_transferred = write(s, b.data(), completion_condition, ec); b.consume(bytes_transferred); return bytes_transferred; } -template -inline std::size_t write(Sync_Write_Stream& s, +template +inline std::size_t write(SyncWriteStream& s, asio::basic_streambuf& b) { asio::error_code ec; @@ -88,11 +88,11 @@ inline std::size_t write(Sync_Write_Stream& s, return bytes_transferred; } -template -inline std::size_t write(Sync_Write_Stream& s, +template +inline std::size_t write(SyncWriteStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition) + CompletionCondition completion_condition) { asio::error_code ec; std::size_t bytes_transferred = write(s, b, completion_condition, ec); @@ -102,13 +102,13 @@ inline std::size_t write(Sync_Write_Stream& s, namespace detail { - template + template class write_handler { public: - write_handler(Async_Write_Stream& stream, const Const_Buffers& buffers, - Completion_Condition completion_condition, Handler handler) + write_handler(AsyncWriteStream& stream, const ConstBufferSequence& buffers, + CompletionCondition completion_condition, WriteHandler handler) : stream_(stream), buffers_(buffers), total_transferred_(0), @@ -134,71 +134,74 @@ namespace detail } //private: - Async_Write_Stream& stream_; + AsyncWriteStream& stream_; asio::detail::consuming_buffers< - const_buffer, Const_Buffers> buffers_; + const_buffer, ConstBufferSequence> buffers_; std::size_t total_transferred_; - Completion_Condition completion_condition_; - Handler handler_; + CompletionCondition completion_condition_; + WriteHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - write_handler* this_handler) + write_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_handler* this_handler) + write_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - write_handler* this_handler) + write_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -inline void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition, Handler handler) +template +inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition, WriteHandler handler) { s.async_write_some(buffers, - detail::write_handler( + detail::write_handler( s, buffers, completion_condition, handler)); } -template -inline void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, - Handler handler) +template +inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, + WriteHandler handler) { async_write(s, buffers, transfer_all(), handler); } namespace detail { - template + template class write_streambuf_handler { public: write_streambuf_handler(asio::basic_streambuf& streambuf, - Handler handler) + WriteHandler handler) : streambuf_(streambuf), handler_(handler) { @@ -213,52 +216,54 @@ namespace detail //private: asio::basic_streambuf& streambuf_; - Handler handler_; + WriteHandler handler_; }; - template + template inline void* asio_handler_allocate(std::size_t size, - write_streambuf_handler* this_handler) + write_streambuf_handler* this_handler) { return asio_handler_alloc_helpers::allocate( size, &this_handler->handler_); } - template + template inline void asio_handler_deallocate(void* pointer, std::size_t size, - write_streambuf_handler* this_handler) + write_streambuf_handler* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, &this_handler->handler_); } - template + template inline void asio_handler_invoke(const Function& function, - write_streambuf_handler* this_handler) + write_streambuf_handler* this_handler) { asio_handler_invoke_helpers::invoke( function, &this_handler->handler_); } } // namespace detail -template -inline void async_write(Async_Write_Stream& s, +template +inline void async_write(AsyncWriteStream& s, asio::basic_streambuf& b, - Completion_Condition completion_condition, Handler handler) + CompletionCondition completion_condition, WriteHandler handler) { async_write(s, b.data(), completion_condition, - detail::write_streambuf_handler( - b, handler)); + detail::write_streambuf_handler< + AsyncWriteStream, Allocator, WriteHandler>(b, handler)); } -template -inline void async_write(Async_Write_Stream& s, - asio::basic_streambuf& b, Handler handler) +template +inline void async_write(AsyncWriteStream& s, + asio::basic_streambuf& b, WriteHandler handler) { async_write(s, b, transfer_all(), handler); } diff --git a/asio/include/asio/io_service.hpp b/asio/include/asio/io_service.hpp index 55015d72..5eaa5c6a 100644 --- a/asio/include/asio/io_service.hpp +++ b/asio/include/asio/io_service.hpp @@ -173,8 +173,8 @@ public: * a copy of the handler object as required. The function signature of the * handler must be: @code void handler(); @endcode */ - template - void dispatch(Handler handler); + template + void dispatch(CompletionHandler handler); /// Request the io_service to invoke the given handler and return immediately. /** @@ -190,8 +190,8 @@ public: * a copy of the handler object as required. The function signature of the * handler must be: @code void handler(); @endcode */ - template - void post(Handler handler); + template + void post(CompletionHandler handler); /// Create a new handler that automatically dispatches the wrapped handler /// on the io_service. diff --git a/asio/include/asio/ip/basic_endpoint.hpp b/asio/include/asio/ip/basic_endpoint.hpp index 942e4dc9..c6cc307b 100644 --- a/asio/include/asio/ip/basic_endpoint.hpp +++ b/asio/include/asio/ip/basic_endpoint.hpp @@ -46,12 +46,12 @@ namespace ip { * @par Concepts: * Endpoint. */ -template +template class basic_endpoint { public: /// The protocol type associated with the endpoint. - typedef Protocol protocol_type; + typedef InternetProtocol protocol_type; /// The type of the endpoint structure. This type is dependent on the /// underlying implementation of the socket layer. @@ -96,7 +96,7 @@ public: * asio::ip::udp::endpoint ep(asio::ip::udp::v6(), 9876); * @endcode */ - basic_endpoint(const Protocol& protocol, unsigned short port_num) + basic_endpoint(const InternetProtocol& protocol, unsigned short port_num) : data_() { using namespace std; // For memcpy. @@ -173,8 +173,8 @@ public: protocol_type protocol() const { if (data_.ss_family == AF_INET) - return Protocol::v4(); - return Protocol::v6(); + return InternetProtocol::v4(); + return InternetProtocol::v6(); } /// Get the underlying endpoint in the native type. @@ -275,27 +275,27 @@ public: /// Set the IP address associated with the endpoint. void address(const asio::ip::address& addr) { - basic_endpoint tmp_endpoint(addr, port()); + basic_endpoint tmp_endpoint(addr, port()); data_ = tmp_endpoint.data_; } /// Compare two endpoints for equality. - friend bool operator==(const basic_endpoint& e1, - const basic_endpoint& e2) + friend bool operator==(const basic_endpoint& e1, + const basic_endpoint& e2) { return e1.address() == e2.address() && e1.port() == e2.port(); } /// Compare two endpoints for inequality. - friend bool operator!=(const basic_endpoint& e1, - const basic_endpoint& e2) + friend bool operator!=(const basic_endpoint& e1, + const basic_endpoint& e2) { return e1.address() != e2.address() || e1.port() != e2.port(); } /// Compare endpoints for ordering. - friend bool operator<(const basic_endpoint& e1, - const basic_endpoint& e2) + friend bool operator<(const basic_endpoint& e1, + const basic_endpoint& e2) { if (e1.address() < e2.address()) return true; @@ -322,9 +322,9 @@ private: * @relates asio::ip::basic_endpoint */ #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -template +template std::ostream& operator<<(std::ostream& os, - const basic_endpoint& endpoint) + const basic_endpoint& endpoint) { const address& addr = endpoint.address(); if (addr.is_v4()) @@ -335,10 +335,10 @@ std::ostream& operator<<(std::ostream& os, return os; } #else // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -template +template std::basic_ostream& operator<<( std::basic_ostream& os, - const basic_endpoint& endpoint) + const basic_endpoint& endpoint) { const address& addr = endpoint.address(); if (addr.is_v4()) diff --git a/asio/include/asio/ip/basic_resolver.hpp b/asio/include/asio/ip/basic_resolver.hpp index bbaac114..e77e7b78 100644 --- a/asio/include/asio/ip/basic_resolver.hpp +++ b/asio/include/asio/ip/basic_resolver.hpp @@ -34,22 +34,23 @@ namespace ip { * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. */ -template > +template > class basic_resolver - : public basic_io_object + : public basic_io_object { public: /// The protocol type. - typedef Protocol protocol_type; + typedef InternetProtocol protocol_type; /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; + typedef typename InternetProtocol::endpoint endpoint_type; /// The query type. - typedef typename Protocol::resolver_query query; + typedef typename InternetProtocol::resolver_query query; /// The iterator type. - typedef typename Protocol::resolver_iterator iterator; + typedef typename InternetProtocol::resolver_iterator iterator; /// Constructor. /** @@ -59,7 +60,7 @@ public: * dispatch handlers for any asynchronous operations performed on the timer. */ explicit basic_resolver(asio::io_service& io_service) - : basic_io_object(io_service) + : basic_io_object(io_service) { } @@ -146,8 +147,8 @@ public: * A successful resolve operation is guaranteed to pass at least one entry to * the handler. */ - template - void async_resolve(const query& q, Handler handler) + template + void async_resolve(const query& q, ResolveHandler handler) { return this->service.async_resolve(this->implementation, q, handler); } @@ -229,8 +230,8 @@ public: * A successful resolve operation is guaranteed to pass at least one entry to * the handler. */ - template - void async_resolve(const endpoint_type& e, Handler handler) + template + void async_resolve(const endpoint_type& e, ResolveHandler handler) { return this->service.async_resolve(this->implementation, e, handler); } diff --git a/asio/include/asio/ip/basic_resolver_entry.hpp b/asio/include/asio/ip/basic_resolver_entry.hpp index d85c8e5d..02457fd2 100644 --- a/asio/include/asio/ip/basic_resolver_entry.hpp +++ b/asio/include/asio/ip/basic_resolver_entry.hpp @@ -32,19 +32,16 @@ namespace ip { * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Endpoint. */ -template +template class basic_resolver_entry { public: /// The protocol type associated with the endpoint entry. - typedef Protocol protocol_type; + typedef InternetProtocol protocol_type; /// The endpoint type associated with the endpoint entry. - typedef typename Protocol::endpoint endpoint_type; + typedef typename InternetProtocol::endpoint endpoint_type; /// Default constructor. basic_resolver_entry() diff --git a/asio/include/asio/ip/basic_resolver_iterator.hpp b/asio/include/asio/ip/basic_resolver_iterator.hpp index 5bc6dfb8..8a9d9074 100644 --- a/asio/include/asio/ip/basic_resolver_iterator.hpp +++ b/asio/include/asio/ip/basic_resolver_iterator.hpp @@ -38,17 +38,17 @@ namespace ip { * iterators over the results returned by a resolver. * * The iterator's value_type, obtained when the iterator is dereferenced, is: - * @code const basic_resolver_entry @endcode + * @code const basic_resolver_entry @endcode * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. */ -template +template class basic_resolver_iterator : public boost::iterator_facade< - basic_resolver_iterator, - const basic_resolver_entry, + basic_resolver_iterator, + const basic_resolver_entry, boost::forward_traversal_tag> { public: @@ -78,14 +78,14 @@ public: || address_info->ai_family == PF_INET6) { using namespace std; // For memcpy. - typename Protocol::endpoint endpoint; + typename InternetProtocol::endpoint endpoint; endpoint.resize( static_cast( address_info->ai_addrlen)); memcpy(endpoint.data(), address_info->ai_addr, address_info->ai_addrlen); iter.values_->push_back( - basic_resolver_entry(endpoint, + basic_resolver_entry(endpoint, actual_host_name, service_name)); } address_info = address_info->ai_next; @@ -101,13 +101,14 @@ public: /// Create an iterator from an endpoint, host name and service name. static basic_resolver_iterator create( - const typename Protocol::endpoint& endpoint, + const typename InternetProtocol::endpoint& endpoint, const std::string& host_name, const std::string& service_name) { basic_resolver_iterator iter; iter.values_.reset(new values_type); iter.values_->push_back( - basic_resolver_entry(endpoint, host_name, service_name)); + basic_resolver_entry( + endpoint, host_name, service_name)); iter.iter_ = iter.values_->begin(); return iter; } @@ -135,12 +136,12 @@ private: return iter_ == other.iter_; } - const basic_resolver_entry& dereference() const + const basic_resolver_entry& dereference() const { return *iter_; } - typedef std::vector > values_type; + typedef std::vector > values_type; boost::shared_ptr values_; typename values_type::const_iterator iter_; }; diff --git a/asio/include/asio/ip/basic_resolver_query.hpp b/asio/include/asio/ip/basic_resolver_query.hpp index f5b27457..09b3ca99 100644 --- a/asio/include/asio/ip/basic_resolver_query.hpp +++ b/asio/include/asio/ip/basic_resolver_query.hpp @@ -36,17 +36,14 @@ namespace ip { * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. - * - * @par Concepts: - * Endpoint. */ -template +template class basic_resolver_query : public resolver_query_base { public: /// The protocol type associated with the endpoint query. - typedef Protocol protocol_type; + typedef InternetProtocol protocol_type; /// Construct with specified service name for any protocol. basic_resolver_query(const std::string& service_name, @@ -55,7 +52,7 @@ public: host_name_(), service_name_(service_name) { - typename Protocol::endpoint endpoint; + typename InternetProtocol::endpoint endpoint; hints_.ai_flags = flags; hints_.ai_family = PF_UNSPEC; hints_.ai_socktype = endpoint.protocol().type(); @@ -91,7 +88,7 @@ public: host_name_(host_name), service_name_(service_name) { - typename Protocol::endpoint endpoint; + typename InternetProtocol::endpoint endpoint; hints_.ai_flags = flags; hints_.ai_family = PF_UNSPEC; hints_.ai_socktype = endpoint.protocol().type(); diff --git a/asio/include/asio/ip/multicast.hpp b/asio/include/asio/ip/multicast.hpp index 4f9e0b76..28b87374 100644 --- a/asio/include/asio/ip/multicast.hpp +++ b/asio/include/asio/ip/multicast.hpp @@ -44,7 +44,7 @@ namespace multicast { * @endcode * * @par Concepts: - * Socket_Option, IP_MReq_Socket_Option. + * SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined join_group; @@ -69,7 +69,7 @@ typedef asio::ip::detail::socket_option::multicast_request< * @endcode * * @par Concepts: - * Socket_Option, IP_MReq_Socket_Option. + * SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined leave_group; @@ -94,7 +94,7 @@ typedef asio::ip::detail::socket_option::multicast_request< * @endcode * * @par Concepts: - * Socket_Option, IP_Network_Interface_Socket_Option. + * SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined outbound_interface; @@ -128,7 +128,7 @@ typedef asio::ip::detail::socket_option::network_interface< * @endcode * * @par Concepts: - * Socket_Option, Integer_Socket_Option. + * GettableSocketOption, SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined hops; @@ -162,7 +162,7 @@ typedef asio::ip::detail::socket_option::integer< * @endcode * * @par Concepts: - * Socket_Option, Boolean_Socket_Option. + * GettableSocketOption, SettableSocketOption. */ #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined enable_loopback; diff --git a/asio/include/asio/ip/resolver_service.hpp b/asio/include/asio/ip/resolver_service.hpp index cf493a2c..53e1a340 100644 --- a/asio/include/asio/ip/resolver_service.hpp +++ b/asio/include/asio/ip/resolver_service.hpp @@ -25,26 +25,27 @@ namespace asio { namespace ip { /// Default service implementation for a resolver. -template +template class resolver_service : public asio::io_service::service { public: /// The protocol type. - typedef Protocol protocol_type; + typedef InternetProtocol protocol_type; /// The endpoint type. - typedef typename Protocol::endpoint endpoint_type; + typedef typename InternetProtocol::endpoint endpoint_type; /// The query type. - typedef typename Protocol::resolver_query query_type; + typedef typename InternetProtocol::resolver_query query_type; /// The iterator type. - typedef typename Protocol::resolver_iterator iterator_type; + typedef typename InternetProtocol::resolver_iterator iterator_type; private: // The type of the platform-specific implementation. - typedef asio::detail::resolver_service service_impl_type; + typedef asio::detail::resolver_service + service_impl_type; public: /// The type of a resolver implementation. @@ -107,9 +108,9 @@ public: } /// Asynchronously resolve an endpoint to a list of entries. - template + template void async_resolve(implementation_type& impl, const endpoint_type& endpoint, - Handler handler) + ResolveHandler handler) { return service_impl_.async_resolve(impl, endpoint, handler); } diff --git a/asio/include/asio/ip/tcp.hpp b/asio/include/asio/ip/tcp.hpp index 46dd38c8..cd11d67a 100644 --- a/asio/include/asio/ip/tcp.hpp +++ b/asio/include/asio/ip/tcp.hpp @@ -39,7 +39,7 @@ namespace ip { * @e Shared @e objects: Safe. * * @par Concepts: - * Protocol. + * Protocol, InternetProtocol. */ class tcp { diff --git a/asio/include/asio/ip/udp.hpp b/asio/include/asio/ip/udp.hpp index dbd67d90..4a7c04d7 100644 --- a/asio/include/asio/ip/udp.hpp +++ b/asio/include/asio/ip/udp.hpp @@ -36,7 +36,7 @@ namespace ip { * @e Shared @e objects: Safe. * * @par Concepts: - * Protocol. + * Protocol, InternetProtocol. */ class udp { diff --git a/asio/include/asio/read.hpp b/asio/include/asio/read.hpp index 808bbf09..975a8ae6 100644 --- a/asio/include/asio/read.hpp +++ b/asio/include/asio/read.hpp @@ -46,7 +46,7 @@ namespace asio { * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param buffers One or more buffers into which the data will be read. The sum * of the buffer sizes indicates the maximum number of bytes to read from the @@ -68,8 +68,8 @@ namespace asio { * s, buffers, * asio::transfer_all()); @endcode */ -template -std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers); +template +std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers); /// Attempt to read a certain amount of data from a stream before returning. /** @@ -85,7 +85,7 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers); * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param buffers One or more buffers into which the data will be read. The sum * of the buffer sizes indicates the maximum number of bytes to read from the @@ -116,10 +116,10 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers); * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ -template -std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition); +template +std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition); /// Attempt to read a certain amount of data from a stream before returning. /** @@ -135,7 +135,7 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param buffers One or more buffers into which the data will be read. The sum * of the buffer sizes indicates the maximum number of bytes to read from the @@ -159,10 +159,10 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, * @returns The number of bytes read. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ -template -std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition, asio::error_code& ec); +template +std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition, asio::error_code& ec); /// Attempt to read a certain amount of data from a stream before returning. /** @@ -175,7 +175,7 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b The basic_streambuf object into which the data will be read. * @@ -188,8 +188,8 @@ std::size_t read(Sync_Read_Stream& s, const Mutable_Buffers& buffers, * s, b, * asio::transfer_all()); @endcode */ -template -std::size_t read(Sync_Read_Stream& s, basic_streambuf& b); +template +std::size_t read(SyncReadStream& s, basic_streambuf& b); /// Attempt to read a certain amount of data from a stream before returning. /** @@ -202,7 +202,7 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b); * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b The basic_streambuf object into which the data will be read. * @@ -223,10 +223,10 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b); * * @throws asio::system_error Thrown on failure. */ -template -std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition); +template +std::size_t read(SyncReadStream& s, basic_streambuf& b, + CompletionCondition completion_condition); /// Attempt to read a certain amount of data from a stream before returning. /** @@ -239,7 +239,7 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, * read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b The basic_streambuf object into which the data will be read. * @@ -261,10 +261,10 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, * @returns The number of bytes read. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ -template -std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition, asio::error_code& ec); +template +std::size_t read(SyncReadStream& s, basic_streambuf& b, + CompletionCondition completion_condition, asio::error_code& ec); /*@}*/ /** @@ -289,7 +289,7 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, * async_read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param buffers One or more buffers into which the data will be read. The sum * of the buffer sizes indicates the maximum number of bytes to read from the @@ -329,10 +329,10 @@ std::size_t read(Sync_Read_Stream& s, basic_streambuf& b, * asio::transfer_all(), * handler); @endcode */ -template -void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, - Handler handler); +template +void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, + ReadHandler handler); /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -348,7 +348,7 @@ void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, * @li The completion_condition function object returns true. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param buffers One or more buffers into which the data will be read. The sum * of the buffer sizes indicates the maximum number of bytes to read from the @@ -397,10 +397,10 @@ void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ -template -void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, - Completion_Condition completion_condition, Handler handler); +template +void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, + CompletionCondition completion_condition, ReadHandler handler); /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -416,7 +416,7 @@ void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, * async_read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param b A basic_streambuf object into which the data will be read. Ownership * of the streambuf is retained by the caller, which must guarantee that it @@ -445,9 +445,9 @@ void async_read(Async_Read_Stream& s, const Mutable_Buffers& buffers, * asio::transfer_all(), * handler); @endcode */ -template -void async_read(Async_Read_Stream& s, basic_streambuf& b, - Handler handler); +template +void async_read(AsyncReadStream& s, basic_streambuf& b, + ReadHandler handler); /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -463,7 +463,7 @@ void async_read(Async_Read_Stream& s, basic_streambuf& b, * async_read_some function. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param b A basic_streambuf object into which the data will be read. Ownership * of the streambuf is retained by the caller, which must guarantee that it @@ -500,10 +500,10 @@ void async_read(Async_Read_Stream& s, basic_streambuf& b, * the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ -template -void async_read(Async_Read_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition, Handler handler); +template +void async_read(AsyncReadStream& s, basic_streambuf& b, + CompletionCondition completion_condition, ReadHandler handler); /*@}*/ diff --git a/asio/include/asio/read_until.hpp b/asio/include/asio/read_until.hpp index 688ee95f..83b27073 100644 --- a/asio/include/asio/read_until.hpp +++ b/asio/include/asio/read_until.hpp @@ -49,7 +49,7 @@ namespace asio { * delimiter, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -68,8 +68,8 @@ namespace asio { * std::string line; * std::getline(is, line); @endcode */ -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, char delim); /// Read data into a streambuf until a delimiter is encountered. @@ -87,7 +87,7 @@ std::size_t read_until(Sync_Read_Stream& s, * delimiter, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -98,8 +98,8 @@ std::size_t read_until(Sync_Read_Stream& s, * @returns The number of bytes in the streambuf's get area up to and including * the delimiter. Returns 0 if an error occurred. */ -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, char delim, asio::error_code& ec); @@ -118,7 +118,7 @@ std::size_t read_until(Sync_Read_Stream& s, * delimiter, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -137,8 +137,8 @@ std::size_t read_until(Sync_Read_Stream& s, * std::string line; * std::getline(is, line); @endcode */ -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const std::string& delim); /// Read data into a streambuf until a delimiter is encountered. @@ -156,7 +156,7 @@ std::size_t read_until(Sync_Read_Stream& s, * delimiter, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -167,8 +167,8 @@ std::size_t read_until(Sync_Read_Stream& s, * @returns The number of bytes in the streambuf's get area up to and including * the delimiter. Returns 0 if an error occurred. */ -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const std::string& delim, asio::error_code& ec); @@ -187,7 +187,7 @@ std::size_t read_until(Sync_Read_Stream& s, * matches the regular expression, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -206,8 +206,8 @@ std::size_t read_until(Sync_Read_Stream& s, * std::string line; * std::getline(is, line); @endcode */ -template -std::size_t read_until(Sync_Read_Stream& s, +template +std::size_t read_until(SyncReadStream& s, asio::basic_streambuf& b, const boost::regex& expr); /// Read data into a streambuf until a regular expression is located. @@ -225,7 +225,7 @@ std::size_t read_until(Sync_Read_Stream& s, * matches the regular expression, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Sync_Read_Stream concept. + * the SyncReadStream concept. * * @param b A streambuf object into which the data will be read. * @@ -237,10 +237,10 @@ std::size_t read_until(Sync_Read_Stream& s, * the substring that matches the regular expression. Returns 0 if an error * occurred. */ -template -std::size_t read_until(Sync_Read_Stream& s, - asio::basic_streambuf& b, const boost::regex& expr, - asio::error_code& ec); +template +std::size_t read_until(SyncReadStream& s, + asio::basic_streambuf& b, const boost::regex& expr, + asio::error_code& ec); /*@}*/ /** @@ -265,7 +265,7 @@ std::size_t read_until(Sync_Read_Stream& s, * delimiter, the asynchronous operation completes immediately. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param b A streambuf object into which the data will be read. Ownership of * the streambuf is retained by the caller, which must guarantee that it remains @@ -306,9 +306,10 @@ std::size_t read_until(Sync_Read_Stream& s, * ... * asio::async_read_until(s, b, '\n', handler); @endcode */ -template -void async_read_until(Async_Read_Stream& s, - asio::basic_streambuf& b, char delim, Handler handler); +template +void async_read_until(AsyncReadStream& s, + asio::basic_streambuf& b, + char delim, ReadHandler handler); /// Start an asynchronous operation to read data into a streambuf until a /// delimiter is encountered. @@ -327,7 +328,7 @@ void async_read_until(Async_Read_Stream& s, * delimiter, the asynchronous operation completes immediately. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param b A streambuf object into which the data will be read. Ownership of * the streambuf is retained by the caller, which must guarantee that it remains @@ -368,10 +369,10 @@ void async_read_until(Async_Read_Stream& s, * ... * asio::async_read_until(s, b, "\r\n", handler); @endcode */ -template -void async_read_until(Async_Read_Stream& s, - asio::basic_streambuf& b, const std::string& delim, - Handler handler); +template +void async_read_until(AsyncReadStream& s, + asio::basic_streambuf& b, const std::string& delim, + ReadHandler handler); /// Start an asynchronous operation to read data into a streambuf until a /// regular expression is located. @@ -391,7 +392,7 @@ void async_read_until(Async_Read_Stream& s, * that matches the regular expression, the function returns immediately. * * @param s The stream from which the data is to be read. The type must support - * the Async_Read_Stream concept. + * the AsyncReadStream concept. * * @param b A streambuf object into which the data will be read. Ownership of * the streambuf is retained by the caller, which must guarantee that it remains @@ -435,10 +436,10 @@ void async_read_until(Async_Read_Stream& s, * ... * asio::async_read_until(s, b, boost::regex("\r\n"), handler); @endcode */ -template -void async_read_until(Async_Read_Stream& s, +template +void async_read_until(AsyncReadStream& s, asio::basic_streambuf& b, const boost::regex& expr, - Handler handler); + ReadHandler handler); /*@}*/ diff --git a/asio/include/asio/socket_acceptor_service.hpp b/asio/include/asio/socket_acceptor_service.hpp index 27b4c81e..f3c10a62 100644 --- a/asio/include/asio/socket_acceptor_service.hpp +++ b/asio/include/asio/socket_acceptor_service.hpp @@ -145,25 +145,25 @@ public: } /// Set a socket option. - template + template asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) + const SettableSocketOption& option, asio::error_code& ec) { return service_impl_.set_option(impl, option, ec); } /// Get a socket option. - template + template asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const + GettableSocketOption& option, asio::error_code& ec) const { return service_impl_.get_option(impl, option, ec); } /// Perform an IO control command on the socket. - template + template asio::error_code io_control(implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) + IoControlCommand& command, asio::error_code& ec) { return service_impl_.io_control(impl, command, ec); } @@ -176,36 +176,36 @@ public: } /// Accept a new connection. - template + template asio::error_code accept(implementation_type& impl, - basic_socket& peer, + basic_socket& peer, asio::error_code& ec) { return service_impl_.accept(impl, peer, ec); } /// Accept a new connection. - template + template asio::error_code accept_endpoint(implementation_type& impl, - basic_socket& peer, + basic_socket& peer, endpoint_type& peer_endpoint, asio::error_code& ec) { return service_impl_.accept_endpoint(impl, peer, peer_endpoint, ec); } /// Start an asynchronous accept. - template + template void async_accept(implementation_type& impl, - basic_socket& peer, Handler handler) + basic_socket& peer, AcceptHandler handler) { service_impl_.async_accept(impl, peer, handler); } /// Start an asynchronous accept. - template + template void async_accept_endpoint(implementation_type& impl, - basic_socket& peer, - endpoint_type& peer_endpoint, Handler handler) + basic_socket& peer, + endpoint_type& peer_endpoint, AcceptHandler handler) { service_impl_.async_accept_endpoint(impl, peer, peer_endpoint, handler); } diff --git a/asio/include/asio/ssl/basic_context.hpp b/asio/include/asio/ssl/basic_context.hpp index 3a41bce7..b85a01c1 100755 --- a/asio/include/asio/ssl/basic_context.hpp +++ b/asio/include/asio/ssl/basic_context.hpp @@ -388,8 +388,8 @@ public: * * @throws asio::system_error Thrown on failure. */ - template - void set_password_callback(Password_Callback callback) + template + void set_password_callback(PasswordCallback callback) { asio::error_code ec; service_.set_password_callback(impl_, callback, ec); @@ -411,8 +411,8 @@ public: * * @param ec Set to indicate what error occurred, if any. */ - template - asio::error_code set_password_callback(Password_Callback callback, + template + asio::error_code set_password_callback(PasswordCallback callback, asio::error_code& ec) { return service_.set_password_callback(impl_, callback, ec); diff --git a/asio/include/asio/ssl/context_service.hpp b/asio/include/asio/ssl/context_service.hpp index 975e906a..31fcff40 100755 --- a/asio/include/asio/ssl/context_service.hpp +++ b/asio/include/asio/ssl/context_service.hpp @@ -145,9 +145,9 @@ public: } /// Set the password callback. - template + template asio::error_code set_password_callback(impl_type& impl, - Password_Callback callback, asio::error_code& ec) + PasswordCallback callback, asio::error_code& ec) { return service_impl_.set_password_callback(impl, callback, ec); } diff --git a/asio/include/asio/ssl/stream.hpp b/asio/include/asio/ssl/stream.hpp index 0ad74899..a6af1610 100644 --- a/asio/include/asio/ssl/stream.hpp +++ b/asio/include/asio/ssl/stream.hpp @@ -195,8 +195,8 @@ public: * const asio::error_code& error // Result of operation. * ); @endcode */ - template - void async_handshake(handshake_type type, Handler handler) + template + void async_handshake(handshake_type type, HandshakeHandler handler) { service_.async_handshake(impl_, next_layer_, type, handler); } @@ -239,8 +239,8 @@ public: * const asio::error_code& error // Result of operation. * ); @endcode */ - template - void async_shutdown(Handler handler) + template + void async_shutdown(ShutdownHandler handler) { service_.async_shutdown(impl_, next_layer_, handler); } @@ -261,8 +261,8 @@ public: * peer. Consider using the @ref write function if you need to ensure that all * data is written before the blocking operation completes. */ - template - std::size_t write_some(const Const_Buffers& buffers) + template + std::size_t write_some(const ConstBufferSequence& buffers) { asio::error_code ec; std::size_t s = service_.write_some(impl_, next_layer_, buffers, ec); @@ -286,8 +286,8 @@ public: * peer. Consider using the @ref write function if you need to ensure that all * data is written before the blocking operation completes. */ - template - std::size_t write_some(const Const_Buffers& buffers, + template + std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec) { return service_.write_some(impl_, next_layer_, buffers, ec); @@ -315,8 +315,9 @@ public: * the peer. Consider using the @ref async_write function if you need to * ensure that all data is written before the blocking operation completes. */ - template - void async_write_some(const Const_Buffers& buffers, Handler handler) + template + void async_write_some(const ConstBufferSequence& buffers, + WriteHandler handler) { service_.async_write_some(impl_, next_layer_, buffers, handler); } @@ -337,8 +338,8 @@ public: * bytes. Consider using the @ref read function if you need to ensure that the * requested amount of data is read before the blocking operation completes. */ - template - std::size_t read_some(const Mutable_Buffers& buffers) + template + std::size_t read_some(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = service_.read_some(impl_, next_layer_, buffers, ec); @@ -362,8 +363,8 @@ public: * bytes. Consider using the @ref read function if you need to ensure that the * requested amount of data is read before the blocking operation completes. */ - template - std::size_t read_some(const Mutable_Buffers& buffers, + template + std::size_t read_some(const MutableBufferSequence& buffers, asio::error_code& ec) { return service_.read_some(impl_, next_layer_, buffers, ec); @@ -392,8 +393,9 @@ public: * ensure that the requested amount of data is read before the asynchronous * operation completes. */ - template - void async_read_some(const Mutable_Buffers& buffers, Handler handler) + template + void async_read_some(const MutableBufferSequence& buffers, + ReadHandler handler) { service_.async_read_some(impl_, next_layer_, buffers, handler); } @@ -410,8 +412,8 @@ public: * * @throws asio::system_error Thrown on failure. */ - template - std::size_t peek(const Mutable_Buffers& buffers) + template + std::size_t peek(const MutableBufferSequence& buffers) { asio::error_code ec; std::size_t s = service_.peek(impl_, next_layer_, buffers, ec); @@ -431,8 +433,8 @@ public: * * @returns The number of bytes read. Returns 0 if an error occurred. */ - template - std::size_t peek(const Mutable_Buffers& buffers, + template + std::size_t peek(const MutableBufferSequence& buffers, asio::error_code& ec) { return service_.peek(impl_, next_layer_, buffers, ec); diff --git a/asio/include/asio/ssl/stream_service.hpp b/asio/include/asio/ssl/stream_service.hpp index c0a3a69e..fe707982 100644 --- a/asio/include/asio/ssl/stream_service.hpp +++ b/asio/include/asio/ssl/stream_service.hpp @@ -90,9 +90,9 @@ public: } /// Start an asynchronous SSL handshake. - template + template void async_handshake(impl_type& impl, Stream& next_layer, - stream_base::handshake_type type, Handler handler) + stream_base::handshake_type type, HandshakeHandler handler) { service_impl_.async_handshake(impl, next_layer, type, handler); } @@ -106,48 +106,51 @@ public: } /// Asynchronously shut down SSL on the stream. - template - void async_shutdown(impl_type& impl, Stream& next_layer, Handler handler) + template + void async_shutdown(impl_type& impl, Stream& next_layer, + ShutdownHandler handler) { service_impl_.async_shutdown(impl, next_layer, handler); } /// Write some data to the stream. - template + template std::size_t write_some(impl_type& impl, Stream& next_layer, - const Const_Buffers& buffers, asio::error_code& ec) + const ConstBufferSequence& buffers, asio::error_code& ec) { return service_impl_.write_some(impl, next_layer, buffers, ec); } /// Start an asynchronous write. - template + template void async_write_some(impl_type& impl, Stream& next_layer, - const Const_Buffers& buffers, Handler handler) + const ConstBufferSequence& buffers, WriteHandler handler) { service_impl_.async_write_some(impl, next_layer, buffers, handler); } /// Read some data from the stream. - template + template std::size_t read_some(impl_type& impl, Stream& next_layer, - const Mutable_Buffers& buffers, asio::error_code& ec) + const MutableBufferSequence& buffers, asio::error_code& ec) { return service_impl_.read_some(impl, next_layer, buffers, ec); } /// Start an asynchronous read. - template + template void async_read_some(impl_type& impl, Stream& next_layer, - const Mutable_Buffers& buffers, Handler handler) + const MutableBufferSequence& buffers, ReadHandler handler) { service_impl_.async_read_some(impl, next_layer, buffers, handler); } /// Peek at the incoming data on the stream. - template + template std::size_t peek(impl_type& impl, Stream& next_layer, - const Mutable_Buffers& buffers, asio::error_code& ec) + const MutableBufferSequence& buffers, asio::error_code& ec) { return service_impl_.peek(impl, next_layer, buffers, ec); } diff --git a/asio/include/asio/stream_socket_service.hpp b/asio/include/asio/stream_socket_service.hpp index 0303b73b..89f7e4c9 100644 --- a/asio/include/asio/stream_socket_service.hpp +++ b/asio/include/asio/stream_socket_service.hpp @@ -152,33 +152,33 @@ public: } /// Start an asynchronous connect. - template + template void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, Handler handler) + const endpoint_type& peer_endpoint, ConnectHandler handler) { service_impl_.async_connect(impl, peer_endpoint, handler); } /// Set a socket option. - template + template asio::error_code set_option(implementation_type& impl, - const Option& option, asio::error_code& ec) + const SettableSocketOption& option, asio::error_code& ec) { return service_impl_.set_option(impl, option, ec); } /// Get a socket option. - template + template asio::error_code get_option(const implementation_type& impl, - Option& option, asio::error_code& ec) const + GettableSocketOption& option, asio::error_code& ec) const { return service_impl_.get_option(impl, option, ec); } /// Perform an IO control command on the socket. - template + template asio::error_code io_control(implementation_type& impl, - IO_Control_Command& command, asio::error_code& ec) + IoControlCommand& command, asio::error_code& ec) { return service_impl_.io_control(impl, command, ec); } @@ -205,33 +205,37 @@ public: } /// Send the given data to the peer. - template - std::size_t send(implementation_type& impl, const Const_Buffers& buffers, + template + std::size_t send(implementation_type& impl, + const ConstBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.send(impl, buffers, flags, ec); } /// Start an asynchronous send. - template - void async_send(implementation_type& impl, const Const_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_send(implementation_type& impl, + const ConstBufferSequence& buffers, + socket_base::message_flags flags, WriteHandler handler) { service_impl_.async_send(impl, buffers, flags, handler); } /// Receive some data from the peer. - template - std::size_t receive(implementation_type& impl, const Mutable_Buffers& buffers, + template + std::size_t receive(implementation_type& impl, + const MutableBufferSequence& buffers, socket_base::message_flags flags, asio::error_code& ec) { return service_impl_.receive(impl, buffers, flags, ec); } /// Start an asynchronous receive. - template - void async_receive(implementation_type& impl, const Mutable_Buffers& buffers, - socket_base::message_flags flags, Handler handler) + template + void async_receive(implementation_type& impl, + const MutableBufferSequence& buffers, + socket_base::message_flags flags, ReadHandler handler) { service_impl_.async_receive(impl, buffers, flags, handler); } diff --git a/asio/include/asio/write.hpp b/asio/include/asio/write.hpp index 395ea398..74f0587a 100644 --- a/asio/include/asio/write.hpp +++ b/asio/include/asio/write.hpp @@ -46,7 +46,7 @@ namespace asio { * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param buffers One or more buffers containing the data to be written. The sum * of the buffer sizes indicates the maximum number of bytes to write to the @@ -68,8 +68,8 @@ namespace asio { * s, buffers, * asio::transfer_all()); @endcode */ -template -std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers); +template +std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers); /// Write a certain amount of data to a stream before returning. /** @@ -85,7 +85,7 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers); * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param buffers One or more buffers containing the data to be written. The sum * of the buffer sizes indicates the maximum number of bytes to write to the @@ -117,10 +117,10 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers); * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ -template -std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition); +template +std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition); /// Write a certain amount of data to a stream before returning. /** @@ -136,7 +136,7 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param buffers One or more buffers containing the data to be written. The sum * of the buffer sizes indicates the maximum number of bytes to write to the @@ -161,10 +161,10 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, * @returns The number of bytes written. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ -template -std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition, asio::error_code& ec); +template +std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition, asio::error_code& ec); /// Write a certain amount of data to a stream before returning. /** @@ -179,7 +179,7 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param b The basic_streambuf object from which data will be written. * @@ -192,8 +192,8 @@ std::size_t write(Sync_Write_Stream& s, const Const_Buffers& buffers, * s, b, * asio::transfer_all()); @endcode */ -template -std::size_t write(Sync_Write_Stream& s, basic_streambuf& b); +template +std::size_t write(SyncWriteStream& s, basic_streambuf& b); /// Write a certain amount of data to a stream before returning. /** @@ -208,7 +208,7 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b); * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param b The basic_streambuf object from which data will be written. * @@ -230,10 +230,10 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b); * * @throws asio::system_error Thrown on failure. */ -template -std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition); +template +std::size_t write(SyncWriteStream& s, basic_streambuf& b, + CompletionCondition completion_condition); /// Write a certain amount of data to a stream before returning. /** @@ -248,7 +248,7 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, * write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Sync_Write_Stream concept. + * the SyncWriteStream concept. * * @param b The basic_streambuf object from which data will be written. * @@ -271,10 +271,10 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, * @returns The number of bytes written. If an error occurs, returns the total * number of bytes successfully transferred prior to the error. */ -template -std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition, asio::error_code& ec); +template +std::size_t write(SyncWriteStream& s, basic_streambuf& b, + CompletionCondition completion_condition, asio::error_code& ec); /*@}*/ /** @@ -299,7 +299,7 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, * async_write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Async_Write_Stream concept. + * the AsyncWriteStream concept. * * @param buffers One or more buffers containing the data to be written. * Although the buffers object may be copied as necessary, ownership of the @@ -331,9 +331,10 @@ std::size_t write(Sync_Write_Stream& s, basic_streambuf& b, * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ -template -void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, - Handler handler); +template +void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, + WriteHandler handler); /// Start an asynchronous operation to write a certain amount of data to a /// stream. @@ -352,7 +353,7 @@ void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, * async_write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Async_Write_Stream concept. + * the AsyncWriteStream concept. * * @param buffers One or more buffers containing the data to be written. * Although the buffers object may be copied as necessary, ownership of the @@ -399,10 +400,10 @@ void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ -template -void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, - Completion_Condition completion_condition, Handler handler); +template +void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, + CompletionCondition completion_condition, WriteHandler handler); /// Start an asynchronous operation to write a certain amount of data to a /// stream. @@ -420,7 +421,7 @@ void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, * async_write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Async_Write_Stream concept. + * the AsyncWriteStream concept. * * @param b A basic_streambuf object from which data will be written. Ownership * of the streambuf is retained by the caller, which must guarantee that it @@ -442,9 +443,9 @@ void async_write(Async_Write_Stream& s, const Const_Buffers& buffers, * the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ -template -void async_write(Async_Write_Stream& s, basic_streambuf& b, - Handler handler); +template +void async_write(AsyncWriteStream& s, basic_streambuf& b, + WriteHandler handler); /// Start an asynchronous operation to write a certain amount of data to a /// stream. @@ -462,7 +463,7 @@ void async_write(Async_Write_Stream& s, basic_streambuf& b, * async_write_some function. * * @param s The stream to which the data is to be written. The type must support - * the Async_Write_Stream concept. + * the AsyncWriteStream concept. * * @param b A basic_streambuf object from which data will be written. Ownership * of the streambuf is retained by the caller, which must guarantee that it @@ -498,10 +499,10 @@ void async_write(Async_Write_Stream& s, basic_streambuf& b, * the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ -template -void async_write(Async_Write_Stream& s, basic_streambuf& b, - Completion_Condition completion_condition, Handler handler); +template +void async_write(AsyncWriteStream& s, basic_streambuf& b, + CompletionCondition completion_condition, WriteHandler handler); /*@}*/