identt
ServerResponse.hpp
Go to the documentation of this file.
1 
33 #ifndef _IDENTT_HTTP_SERVER_RESPONSE_HPP_
34 #define _IDENTT_HTTP_SERVER_RESPONSE_HPP_
35 
36 #include <boost/asio.hpp>
37 #include <iostream>
38 #include <sstream>
39 
40 namespace identt {
41 namespace http {
42 
43 template <class socket_type>
44 struct ServerResponse : public std::ostream {
45  ServerResponse(const std::shared_ptr<socket_type> &socket): std::ostream(&streambuf), socket(socket) {}
46  size_t size()
47  {
48  return streambuf.size();
49  }
50  boost::asio::streambuf streambuf;
51  std::shared_ptr<socket_type> socket;
52 };
53 
54 } // namespace http
55 } // namespace identt
56 #endif /* _IDENTT_HTTP_SERVER_RESPONSE_HPP_ */
Definition: ServerResponse.hpp:44
Definition: CryptoBase.hpp:49