File indexing completed on 2025-09-18 08:36:06
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_BEAST_HTTP_MESSAGE_GENERATOR_HPP
0010 #define BOOST_BEAST_HTTP_MESSAGE_GENERATOR_HPP
0011
0012 #include <boost/beast/http/message_generator_fwd.hpp>
0013
0014 #include <boost/beast/core/span.hpp>
0015 #include <boost/beast/http/message.hpp>
0016 #include <boost/beast/http/serializer.hpp>
0017 #include <memory>
0018
0019 namespace boost {
0020 namespace beast {
0021 namespace http {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 class message_generator
0046 {
0047 public:
0048 using const_buffers_type = span<net::const_buffer>;
0049
0050 template <bool isRequest, class Body, class Fields>
0051 message_generator(http::message<isRequest, Body, Fields>&&);
0052
0053
0054 bool is_done() const {
0055 return impl_->is_done();
0056 }
0057
0058
0059 const_buffers_type
0060 prepare(error_code& ec)
0061 {
0062 return impl_->prepare(ec);
0063 }
0064
0065
0066 void
0067 consume(std::size_t n)
0068 {
0069 impl_->consume(n);
0070 }
0071
0072
0073 bool
0074 keep_alive() const noexcept
0075 {
0076 return impl_->keep_alive();
0077 }
0078
0079 private:
0080 struct impl_base
0081 {
0082 virtual ~impl_base() = default;
0083 virtual bool is_done() = 0;
0084 virtual const_buffers_type prepare(error_code& ec) = 0;
0085 virtual void consume(std::size_t n) = 0;
0086 virtual bool keep_alive() const noexcept = 0;
0087 };
0088
0089 std::unique_ptr<impl_base> impl_;
0090
0091 template <bool isRequest, class Body, class Fields>
0092 struct generator_impl;
0093 };
0094
0095 }
0096 }
0097 }
0098
0099 #include <boost/beast/http/impl/message_generator.hpp>
0100
0101 #endif