Ed Tanous | e3cb5a3 | 2018-08-08 14:16:49 -0700 | [diff] [blame] | 1 | #pragma once |
2 | |||||
zhanghch05 | 8d1b46d | 2021-04-01 11:18:24 +0800 | [diff] [blame] | 3 | #include "http_response.hpp" |
4 | |||||
Iwona Klimaszewska | c0a1c8a | 2019-07-12 18:26:38 +0200 | [diff] [blame] | 5 | #include <functional> |
6 | |||||
Ed Tanous | e3cb5a3 | 2018-08-08 14:16:49 -0700 | [diff] [blame] | 7 | namespace bmcweb |
8 | { | ||||
9 | |||||
10 | /** | ||||
11 | * AsyncResp | ||||
12 | * Gathers data needed for response processing after async calls are done | ||||
13 | */ | ||||
Iwona Klimaszewska | c0a1c8a | 2019-07-12 18:26:38 +0200 | [diff] [blame] | 14 | |
Ed Tanous | e3cb5a3 | 2018-08-08 14:16:49 -0700 | [diff] [blame] | 15 | class AsyncResp |
16 | { | ||||
17 | public: | ||||
Nan Zhou | 72374eb | 2022-01-27 17:06:51 -0800 | [diff] [blame] | 18 | AsyncResp() = default; |
Ed Tanous | 13548d8 | 2022-07-22 09:50:44 -0700 | [diff] [blame] | 19 | explicit AsyncResp(crow::Response&& resIn) : res(std::move(resIn)) |
20 | {} | ||||
Iwona Klimaszewska | c0a1c8a | 2019-07-12 18:26:38 +0200 | [diff] [blame] | 21 | |
Krzysztof Grobelny | dab0604 | 2021-04-02 13:28:14 +0000 | [diff] [blame] | 22 | AsyncResp(const AsyncResp&) = delete; |
23 | AsyncResp(AsyncResp&&) = delete; | ||||
Ed Tanous | ecd6a3a | 2022-01-07 09:18:40 -0800 | [diff] [blame] | 24 | AsyncResp& operator=(const AsyncResp&) = delete; |
25 | AsyncResp& operator=(AsyncResp&&) = delete; | ||||
Krzysztof Grobelny | dab0604 | 2021-04-02 13:28:14 +0000 | [diff] [blame] | 26 | |
Ed Tanous | e3cb5a3 | 2018-08-08 14:16:49 -0700 | [diff] [blame] | 27 | ~AsyncResp() |
28 | { | ||||
29 | res.end(); | ||||
30 | } | ||||
31 | |||||
Nan Zhou | 72374eb | 2022-01-27 17:06:51 -0800 | [diff] [blame] | 32 | crow::Response res; |
Ed Tanous | e3cb5a3 | 2018-08-08 14:16:49 -0700 | [diff] [blame] | 33 | }; |
34 | |||||
Iwona Klimaszewska | c0a1c8a | 2019-07-12 18:26:38 +0200 | [diff] [blame] | 35 | } // namespace bmcweb |