Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcd5554

Browse files
committed
Renamed connection_delegate.
1 parent40a2309 commitbcd5554

File tree

5 files changed

+61
-32
lines changed

5 files changed

+61
-32
lines changed

‎http/src/network/http/v2/client/connection/async_resolver.hpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ namespace network {
6767

6868
/**
6969
* \brief Resolves a host asynchronously.
70+
* \param host The hostname to resolve.
71+
* \param port The port number.
72+
* \param callback A callback handler.
7073
*/
7174

7275
voidasync_resolve(const std::string &host, std::uint16_t port, callback_fn callback) {

‎http/src/network/http/v2/client/connection/connection_delegate.hpp‎renamed to ‎http/src/network/http/v2/client/connection/connection.hpp‎

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_DELEGATE_INC__
7-
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_DELEGATE_INC__
6+
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC__
7+
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC__
88

99
#include<functional>
1010
#include<string>
@@ -16,13 +16,13 @@ namespace network {
1616
namespacehttp {
1717
namespacev2 {
1818
/**
19-
* \classconnection_delegate network/http/v2/client/connection/connection_delegate.hpp
19+
* \classconnection network/http/v2/client/connection/connection.hpp
2020
* \brief Manages a connection through a socket.
2121
*/
22-
classconnection_delegate {
22+
classconnection {
2323

24-
connection_delegate(constconnection_delegate &) =delete;
25-
connection_delegate &operator = (constconnection_delegate &) =delete;
24+
connection(constconnection &) =delete;
25+
connection &operator = (constconnection &) =delete;
2626

2727
public:
2828

@@ -41,24 +41,50 @@ namespace network {
4141
*/
4242
typedef std::function<void (const boost::system::error_code &, std::size_t)> read_callback;
4343

44-
connection_delegate() =default;
44+
/**
45+
* \brief Constructor.
46+
*/
47+
connection() =default;
4548

46-
virtual~connection_delegate()noexcept { }
49+
/**
50+
* \brief Destructor.
51+
*/
52+
virtual~connection()noexcept { }
4753

54+
/**
55+
* \brief Asynchronously creates a connection to an endpoint.
56+
* \param endpoint The endpoint to which to connect.
57+
* \param host The host name.
58+
* \param callback A callback handler.
59+
*/
60+
*/
4861
virtualvoidasync_connect(boost::asio::ip::tcp::endpoint &endpoint,
4962
const std::string &host, connect_callback callback) = 0;
5063

64+
/**
65+
* \brief Asynchronously writes data across the connection.
66+
* \param command_streambuf
67+
* \param callback A callback handler.
68+
*/
5169
virtualvoidasync_write(boost::asio::streambuf &command_streambuf,
5270
write_callback callback) = 0;
5371

72+
/**
73+
* \brief Asynchronously reads some data from the connection.
74+
* \param read_buffer The buffer in which to read the network data.
75+
* \param callback A callback handler.
76+
*/
5477
virtualvoidasync_read_some(const boost::asio::mutable_buffers_1 &read_buffer,
5578
read_callback callback) = 0;
5679

80+
/**
81+
* \brief Cancels an operation on a connection.
82+
*/
5783
virtualvoidcancel() = 0;
5884

5985
};
6086
}// namespace v2
6187
}// namespace http
6288
}// namespace network
6389

64-
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_DELEGATE_INC__
90+
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC__

‎http/src/network/http/v2/client/connection/normal_connection_delegate.hpp‎renamed to ‎http/src/network/http/v2/client/connection/normal_connection.hpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_DELEGATE_INC__
7-
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_DELEGATE_INC__
6+
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_INC__
7+
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_INC__
88

99
#include<boost/asio/ip/tcp.hpp>
1010
#include<boost/asio/io_service.hpp>
11-
#include<network/http/v2/client/connection/connection_delegate.hpp>
11+
#include<network/http/v2/client/connection/connection.hpp>
1212

1313
namespacenetwork {
1414
namespacehttp {
1515
namespacev2 {
16-
classnormal_connection_delegate :publicconnection_delegate {
16+
classnormal_connection :publicconnection {
1717

18-
normal_connection_delegate(constnormal_connection_delegate &) =delete;
19-
normal_connection_delegate &operator = (constnormal_connection_delegate &) =delete;
18+
normal_connection(constnormal_connection &) =delete;
19+
normal_connection &operator = (constnormal_connection &) =delete;
2020

2121
public:
2222

23-
explicitnormal_connection_delegate(boost::asio::io_service &io_service)
23+
explicitnormal_connection(boost::asio::io_service &io_service)
2424
: io_service_(io_service) {
2525

2626
}
2727

28-
virtual~normal_connection_delegate()noexcept {
28+
virtual~normal_connection()noexcept {
2929

3030
}
3131

@@ -60,4 +60,4 @@ namespace network {
6060
}// namespace http
6161
}// namespace network
6262

63-
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_DELEGATE_INC__
63+
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_NORMAL_CONNECTION_INC__

‎http/src/network/http/v2/client/connection/ssl_connection_delegate.hpp‎renamed to ‎http/src/network/http/v2/client/connection/ssl_connection.hpp‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_DELEGATE_INC__
7-
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_DELEGATE_INC__
6+
#ifndef__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_INC__
7+
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_INC__
88

9-
#include"network/http/v2/client/connection/connection_delegate.hpp"
10-
#include"network/http/v2/client/client.hpp"
9+
#include<network/http/v2/client/connection/connection.hpp>
10+
#include<network/http/v2/client/client.hpp>
1111
#include<memory>
1212
#include<vector>
1313
#include<boost/asio/ip/tcp.hpp>
@@ -18,21 +18,21 @@
1818
namespacenetwork {
1919
namespacehttp {
2020
namespacev2 {
21-
classssl_connection_delegate
22-
: publicconnection_delegate, std::enable_shared_from_this<ssl_connection_delegate> {
21+
classssl_connection
22+
: publicconnection, std::enable_shared_from_this<ssl_connection> {
2323

24-
ssl_connection_delegate(constssl_connection_delegate &) =delete;
25-
ssl_connection_delegate &operator = (constssl_connection_delegate &) =delete;
24+
ssl_connection(constssl_connection &) =delete;
25+
ssl_connection &operator = (constssl_connection &) =delete;
2626

2727
public:
2828

29-
ssl_connection_delegate(boost::asio::io_service &io_service,const client_options &options)
29+
ssl_connection(boost::asio::io_service &io_service,const client_options &options)
3030
: io_service_(io_service)
3131
, options_(options) {
3232

3333
}
3434

35-
virtual~ssl_connection_delegate()noexcept {
35+
virtual~ssl_connection()noexcept {
3636

3737
}
3838

@@ -94,4 +94,4 @@ namespace network {
9494
}// namespace http
9595
}// namespace network
9696

97-
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_DELEGATE_INC__
97+
#endif//__NETWORK_HTTP_V2_CLIENT_CONNECTION_SSL_CONNECTION_INC__

‎http/test/v2/features/client/normal_connection_test.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include<thread>
88
#include<igloo/igloo_alt.h>
99
#include<boost/asio.hpp>
10-
#include"network/http/v2/client/connection/normal_connection_delegate.hpp"
10+
#include"network/http/v2/client/connection/normal_connection.hpp"
1111
#include"network/http/v2/client/request.hpp"
1212

1313
usingnamespaceigloo;
@@ -19,7 +19,7 @@ Describe(normal_http_connection) {
1919
voidSetUp() {
2020
io_service_.reset(new boost::asio::io_service);
2121
resolver_.reset(newtcp::resolver(*io_service_));
22-
connection_.reset(newhttp::normal_connection_delegate(*io_service_));
22+
connection_.reset(newhttp::normal_connection(*io_service_));
2323
socket_.reset(newtcp::socket(*io_service_));
2424
}
2525

@@ -131,7 +131,7 @@ Describe(normal_http_connection) {
131131

132132
std::unique_ptr<boost::asio::io_service> io_service_;
133133
std::unique_ptr<tcp::resolver> resolver_;
134-
std::unique_ptr<http::connection_delegate> connection_;
134+
std::unique_ptr<http::connection> connection_;
135135
std::unique_ptr<tcp::socket> socket_;
136136

137137
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp