blob: 219d9df796ff244ce34e09b05ebecf333b0a3779 [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:
Nan Zhou72374eb2022-01-27 17:06:51 -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;
Ed Tanousecd6a3a2022-01-07 09:18:40 -080022 AsyncResp& operator=(const AsyncResp&) = delete;
23 AsyncResp& operator=(AsyncResp&&) = delete;
Krzysztof Grobelnydab06042021-04-02 13:28:14 +000024
Ed Tanouse3cb5a32018-08-08 14:16:49 -070025 ~AsyncResp()
26 {
27 res.end();
28 }
29
Nan Zhou72374eb2022-01-27 17:06:51 -080030 crow::Response res;
Ed Tanouse3cb5a32018-08-08 14:16:49 -070031};
32
Iwona Klimaszewskac0a1c8a2019-07-12 18:26:38 +020033} // namespace bmcweb