blob: fcbccafd2c48f10fe004b74c1d2a8d450a5600e9 [file] [log] [blame]
#pragma once
#include "http_response.hpp"
#include <functional>
namespace bmcweb
{
constexpr const char* BMCWEB_HINT_MAX_AGE_SEC = "BMCWEB_HINT_MAX_AGE_SEC";
// TODO: need to find a better spot for these ^ ?
/**
* AsyncResp
* Gathers data needed for response processing after async calls are done
*/
class AsyncResp
{
public:
AsyncResp() = default;
explicit AsyncResp(crow::Response&& resIn) :
res(std::move(resIn)), hintMaxAgeSec(static_cast<int64_t>(0))
{}
AsyncResp(const AsyncResp&) = delete;
AsyncResp(AsyncResp&&) = delete;
AsyncResp& operator=(const AsyncResp&) = delete;
AsyncResp& operator=(AsyncResp&&) = delete;
~AsyncResp()
{
res.end();
}
crow::Response res;
int64_t hintMaxAgeSec;
};
} // namespace bmcweb