blob: 7306017f08e2bd3fc971d77760f658c2e88c5661 [file] [log] [blame]
Ed Tanouse3cb5a32018-08-08 14:16:49 -07001#pragma once
2
zhanghch058d1b46d2021-04-01 11:18:24 +08003#include "http_response.hpp"
4
Iwona Klimaszewskac0a1c8a2019-07-12 18:26:38 +02005#include <functional>
6
Ed Tanouse3cb5a32018-08-08 14:16:49 -07007namespace bmcweb
8{
9
10/**
11 * AsyncResp
12 * Gathers data needed for response processing after async calls are done
13 */
Iwona Klimaszewskac0a1c8a2019-07-12 18:26:38 +020014
Ed Tanouse3cb5a32018-08-08 14:16:49 -070015class AsyncResp
16{
17 public:
zhanghch0591995f32021-10-20 18:43:55 +080018 AsyncResp() = default;
Iwona Klimaszewskac0a1c8a2019-07-12 18:26:38 +020019
Krzysztof Grobelnydab06042021-04-02 13:28:14 +000020 AsyncResp(const AsyncResp&) = delete;
21 AsyncResp(AsyncResp&&) = delete;
22
Ed Tanouse3cb5a32018-08-08 14:16:49 -070023 ~AsyncResp()
24 {
25 res.end();
26 }
27
zhanghch0591995f32021-10-20 18:43:55 +080028 crow::Response res;
Ed Tanouse3cb5a32018-08-08 14:16:49 -070029};
30
Iwona Klimaszewskac0a1c8a2019-07-12 18:26:38 +020031} // namespace bmcweb