xref: /openbmc/bmcweb/include/async_resp.hpp (revision 72374eb7fe42257e866dd088bc13520b0b28cffa)
1e3cb5a31SEd Tanous #pragma once
2e3cb5a31SEd Tanous 
38d1b46d7Szhanghch05 #include "http_response.hpp"
48d1b46d7Szhanghch05 
5c0a1c8a0SIwona Klimaszewska #include <functional>
6c0a1c8a0SIwona Klimaszewska 
7e3cb5a31SEd Tanous namespace bmcweb
8e3cb5a31SEd Tanous {
9e3cb5a31SEd Tanous 
10e3cb5a31SEd Tanous /**
11e3cb5a31SEd Tanous  * AsyncResp
12e3cb5a31SEd Tanous  * Gathers data needed for response processing after async calls are done
13e3cb5a31SEd Tanous  */
14c0a1c8a0SIwona Klimaszewska 
15e3cb5a31SEd Tanous class AsyncResp
16e3cb5a31SEd Tanous {
17e3cb5a31SEd Tanous   public:
18*72374eb7SNan Zhou     AsyncResp() = default;
19c0a1c8a0SIwona Klimaszewska 
20dab0604aSKrzysztof Grobelny     AsyncResp(const AsyncResp&) = delete;
21dab0604aSKrzysztof Grobelny     AsyncResp(AsyncResp&&) = delete;
22ecd6a3a2SEd Tanous     AsyncResp& operator=(const AsyncResp&) = delete;
23ecd6a3a2SEd Tanous     AsyncResp& operator=(AsyncResp&&) = delete;
24dab0604aSKrzysztof Grobelny 
25e3cb5a31SEd Tanous     ~AsyncResp()
26e3cb5a31SEd Tanous     {
27e3cb5a31SEd Tanous         res.end();
28e3cb5a31SEd Tanous     }
29e3cb5a31SEd Tanous 
30*72374eb7SNan Zhou     crow::Response res;
31e3cb5a31SEd Tanous };
32e3cb5a31SEd Tanous 
33e3cb5a31SEd Tanous } // namespace bmcweb
34