Skip to content

Commit 2d268e7

Browse files
committed
chore: remove static containers
1 parent 58a73fa commit 2d268e7

23 files changed

+598
-1502
lines changed

include/boost/http_proto.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,12 @@
2424
#include <boost/http_proto/method.hpp>
2525
#include <boost/http_proto/parser.hpp>
2626
#include <boost/http_proto/request.hpp>
27-
#include <boost/http_proto/request_base.hpp>
2827
#include <boost/http_proto/request_parser.hpp>
2928
#include <boost/http_proto/response.hpp>
30-
#include <boost/http_proto/response_base.hpp>
3129
#include <boost/http_proto/response_parser.hpp>
3230
#include <boost/http_proto/serializer.hpp>
3331
#include <boost/http_proto/sink.hpp>
3432
#include <boost/http_proto/source.hpp>
35-
#include <boost/http_proto/static_request.hpp>
36-
#include <boost/http_proto/static_response.hpp>
3733
#include <boost/http_proto/status.hpp>
3834
#include <boost/http_proto/string_body.hpp>
3935
#include <boost/http_proto/version.hpp>

include/boost/http_proto/fields_base.hpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class fields_base
3737
detail::header h_;
3838
std::size_t max_cap_ =
3939
std::numeric_limits<std::size_t>::max();
40-
bool external_storage_ = false;
40+
bool view_ = false;
4141

4242
using entry =
4343
detail::header::entry;
@@ -46,6 +46,9 @@ class fields_base
4646
using table =
4747
detail::header::table;
4848

49+
struct view_tag_t {};
50+
static constexpr view_tag_t view_tag{};
51+
4952
class op_t;
5053
class prefix_op_t
5154
{
@@ -65,26 +68,18 @@ class fields_base
6568

6669
friend class fields;
6770
friend class message_base;
68-
friend class request_base;
6971
friend class request;
70-
friend class static_request;
71-
friend class response_base;
7272
friend class response;
73-
friend class static_response;
7473
friend class parser;
74+
friend class request_parser;
75+
friend class response_parser;
7576
friend class serializer;
7677

7778
BOOST_HTTP_PROTO_DECL
7879
explicit
7980
fields_base(
8081
detail::kind k) noexcept;
8182

82-
BOOST_HTTP_PROTO_DECL
83-
fields_base(
84-
detail::kind k,
85-
void* storage,
86-
std::size_t cap) noexcept;
87-
8883
BOOST_HTTP_PROTO_DECL
8984
fields_base(
9085
detail::kind k,
@@ -101,9 +96,8 @@ class fields_base
10196

10297
BOOST_HTTP_PROTO_DECL
10398
fields_base(
104-
detail::header const& h,
105-
void* storage,
106-
std::size_t cap);
99+
view_tag_t,
100+
detail::header const& h);
107101

108102
public:
109103
//--------------------------------------------
@@ -1349,6 +1343,9 @@ class fields_base
13491343
copy_impl(
13501344
detail::header const&);
13511345

1346+
void
1347+
clone_if_needed();
1348+
13521349
BOOST_HTTP_PROTO_DECL
13531350
void
13541351
insert_impl(

include/boost/http_proto/message_base.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
namespace boost {
1919
namespace http_proto {
2020

21-
/** Mixin for modifing common metadata
22-
in HTTP request and response messages.
21+
/** Mixin for common metadata in HTTP request and response messages.
2322
2423
This type is useful for modifying common
2524
properties shared by both requests
@@ -28,15 +27,13 @@ namespace http_proto {
2827
@see
2928
@ref response,
3029
@ref request,
31-
@ref static_response,
32-
@ref static_request,
3330
@ref metadata.
3431
*/
3532
class message_base
3633
: public fields_base
3734
{
38-
friend class request_base;
39-
friend class response_base;
35+
friend class request;
36+
friend class response;
4037

4138
using fields_base::fields_base;
4239

include/boost/http_proto/parser.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ namespace http_proto {
3232
// Forward declaration
3333
class request_parser;
3434
class response_parser;
35-
class static_request;
36-
class static_response;
3735

3836
/** A parser for HTTP/1 messages.
3937
@@ -624,11 +622,8 @@ class parser
624622
void
625623
start_impl(bool);
626624

627-
static_request const&
628-
safe_get_request() const;
629-
630-
static_response const&
631-
safe_get_response() const;
625+
detail::header const&
626+
safe_get_header() const;
632627

633628
BOOST_HTTP_PROTO_DECL
634629
detail::workspace&

0 commit comments

Comments
 (0)