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