Skip to content

Commit 80a073a

Browse files
committed
Initial implementation of default destructors for client connections.
1 parent 31a8807 commit 80a073a

File tree

6 files changed

+113
-16
lines changed

6 files changed

+113
-16
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_HPP_20111103
2+
#define BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_HPP_20111103
3+
4+
// Copyright 2011 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2011 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include <boost/function.hpp>
11+
#include <boost/range/iterator_range.hpp>
12+
#include <boost/system/error_code.hpp>
13+
#include <boost/network/protocol/http/request/request_base.hpp>
14+
#include <boost/network/protocol/http/response.hpp>
15+
16+
namespace boost { namespace network { namespace http {
17+
18+
struct client_connection {
19+
typedef function<void(iterator_range<char const *> const &,
20+
system::error_code const &)>
21+
callback_type;
22+
virtual response send_request(std::string const & method,
23+
request_base const & request,
24+
bool get_body,
25+
callback_type callback) = 0;
26+
virtual void reset() = 0;
27+
virtual ~client_connection() = 0;
28+
};
29+
30+
} /* http */
31+
32+
} /* network */
33+
34+
} /* boost */
35+
36+
#ifdef BOOST_NETWORK_NO_LIB
37+
#include <boost/network/protocol/http/client/client_connection.ipp>
38+
#endif
39+
40+
#endif /* BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_HPP_20111103 */
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_IPP_20111103
2+
#define BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_IPP_20111103
3+
4+
// Copyright 2011 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2011 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include <boost/network/protocol/http/client/client_connection.hpp>
11+
12+
namespace boost { namespace network { namespace http {
13+
14+
client_connection::~client_connection() {
15+
// default implementation, for linkage only.
16+
}
17+
18+
19+
} /* http */
20+
21+
} /* network */
22+
23+
} /* boost */
24+
25+
#endif /* BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CLIENT_CONNECTION_IPP_20111103 */

boost/network/protocol/http/client/connection_manager.hpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,12 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10-
namespace boost { namespace network { namespace http {
11-
12-
struct request_base;
13-
14-
struct response;
10+
#include <boost/network/protocol/http/client/client_connection.hpp>
11+
#include <boost/network/protocol/http/request/request_base.hpp>
12+
#include <boost/network/protocol/http/response/response_base.hpp>
13+
#include <boost/asio/io_service.hpp>
1514

16-
struct client_connection {
17-
typedef function<void(iterator_range<char const *> const &,
18-
system::error_code const &)>
19-
callback_type;
20-
virtual response send_request(std::string const & method,
21-
request_base const & request,
22-
bool get_body,
23-
callback_type callback) = 0;
24-
virtual void reset() = 0;
25-
virtual ~client_connection() = 0;
26-
};
15+
namespace boost { namespace network { namespace http {
2716

2817
struct connection_manager {
2918
virtual shared_ptr<client_connection> get_connection(
@@ -34,7 +23,13 @@ struct connection_manager {
3423
};
3524

3625
} /* http */
26+
3727
} /* network */
28+
3829
} /* boost */
3930

31+
#ifdef BOOST_NETWORK_NO_LIB
32+
#include <boost/network/protocol/http/client/connection_manager.ipp>
33+
#endif
34+
4035
#endif /* BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_MANAGER_HPP_20110930 */
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_MANAGER_IPP_20111103
2+
#define BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_MANAGER_IPP_20111103
3+
4+
// Copyright 2011 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2011 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include <boost/network/protocol/http/client/connection_manager.hpp>
11+
12+
namespace boost { namespace network { namespace http {
13+
14+
connection_manager::~connection_manager() {
15+
// default implementation, for linkage only.
16+
}
17+
18+
} /* http */
19+
} /* network */
20+
} /* boost */
21+
22+
#endif /* BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_MANAGER_IPP_20111103 */

libs/network/src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ add_library(cppnetlib-message-wrappers ${CPP-NETLIB_MESSAGE_WRAPPERS_SRCS})
2828
set(CPP-NETLIB_HTTP_MESSAGE_SRCS http/request.cpp http/response.cpp)
2929
add_library(cppnetlib-http-message ${CPP-NETLIB_HTTP_MESSAGE_SRCS})
3030

31+
set(CPP-NETLIB_HTTP_CLIENT_CONNECTIONS_SRCS http/client_connections.cpp)
32+
add_library(cppnetlib-http-client-connections ${CPP-NETLIB_HTTP_CLIENT_CONNECTIONS_SRCS})
33+
3134
set(CPP-NETLIB_UTILS_THREAD_POOL_SRCS utils/thread_pool.cpp)
3235
add_library(cppnetlib-utils-thread_pool ${CPP-NETLIB_UTILS_THREAD_POOL_SRCS})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2011 Dean Michael Berris <dberris@google.com>.
2+
// Copyright 2011 Google, Inc.
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#ifdef BOOST_NETWORK_NO_LIB
8+
#undef BOOST_NETWORK_NO_LIB
9+
#endif
10+
11+
#include <boost/network/protocol/http/client/connection_manager.ipp>
12+
#include <boost/network/protocol/http/client/client_connection.ipp>

0 commit comments

Comments
 (0)