| #include "app_singleton.hpp" |
| #include "async_resp.hpp" |
| #include "http_request.hpp" |
| #include "privileges.hpp" |
| #include "utility.hpp" |
| |
| #include <boost/beast/http/verb.hpp> |
| |
| #include <array> |
| #include <string_view> |
| |
| // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) |
| #define REDFISH_HANDLER_ADD(url, verb, privileges, func) \ |
| plugins::addRedfishHandler<crow::black_magic::getParameterTag(url)>( \ |
| url, verb, privileges, func); |
| |
| namespace plugins |
| { |
| template <uint64_t tag, typename RedfishHandler, size_t N> |
| void addRedfishHandler(std::string_view url, boost::beast::http::verb verb, |
| const std::array<redfish::Privileges, N>& p, |
| RedfishHandler&& func) |
| { |
| crow::globalBmcWebApp->addHandler<tag>(url, verb, p, func); |
| } |
| } // namespace plugins |