GCC Code Coverage Report


Directory: libs/http_proto/
File: include/boost/http_proto/static_request.hpp
Date: 2025-06-14 21:08:33
Exec Total Coverage
Lines: 19 19 100.0%
Functions: 9 9 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 //
2 // Copyright (c) 2025 Mohammad Nejati
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/cppalliance/http_proto
8 //
9
10 #ifndef BOOST_HTTP_PROTO_STATIC_REQUEST_HPP
11 #define BOOST_HTTP_PROTO_STATIC_REQUEST_HPP
12
13 #include <boost/http_proto/request_base.hpp>
14
15 namespace boost {
16 namespace http_proto {
17
18 /** A modfiable static container for HTTP requests
19 */
20 template<std::size_t Capacity>
21 class static_request
22 : public request_base
23 {
24 alignas(entry)
25 char buf_[Capacity];
26
27 public:
28 /** Constructor
29 */
30 40 static_request() noexcept
31 40 : fields_view_base(&this->fields_base::h_)
32 40 , request_base(buf_, Capacity)
33 {
34 40 }
35
36 /** Constructor
37 */
38 explicit
39 44 static_request(
40 core::string_view s)
41 44 : fields_view_base(&this->fields_base::h_)
42 44 , request_base(s, buf_, Capacity)
43 {
44 44 }
45
46 /** Constructor
47 */
48 4 static_request(
49 static_request const& other) noexcept
50 4 : fields_view_base(&this->fields_base::h_)
51 4 , request_base(*other.ph_, buf_, Capacity)
52 {
53 4 }
54
55 /** Constructor
56 */
57 2 static_request(
58 request_view const& other)
59 2 : fields_view_base(&this->fields_base::h_)
60 2 , request_base(*other.ph_, buf_, Capacity)
61 {
62 2 }
63
64 /** Assignment
65 */
66 static_request&
67 9 operator=(
68 static_request const& other) noexcept
69 {
70 9 copy_impl(*other.ph_);
71 9 return *this;
72 }
73
74 /** Assignment
75 */
76 static_request&
77 operator=(
78 request_view const& other)
79 {
80 copy_impl(*other.ph_);
81 return *this;
82 }
83 };
84
85 } // http_proto
86 } // boost
87
88 #endif
89