| #ifndef THIRD_PARTY_MILOTIC_INTERNAL_CC_BMCWEB_APP_INTERFACE_H_ | |
| #define THIRD_PARTY_MILOTIC_INTERNAL_CC_BMCWEB_APP_INTERFACE_H_ | |
| #include <cstddef> | |
| #include <memory> | |
| #include <string> | |
| #include <string_view> | |
| #include "absl/container/flat_hash_map.h" | |
| #include "absl/container/flat_hash_set.h" | |
| #include "boost/beast/http/verb.hpp" // NOLINT | |
| #include "http_request.hpp" | |
| #include "async_resp.hpp" | |
| namespace crow { | |
| // Abstract Redfish App Away. | |
| // We have this interface to hide tlBMC headers. | |
| class AppInterface { | |
| public: | |
| AppInterface() = default; | |
| virtual ~AppInterface() = default; | |
| AppInterface(const AppInterface&) = default; | |
| AppInterface& operator=(const AppInterface&) = default; | |
| AppInterface(AppInterface&&) = default; | |
| AppInterface& operator=(AppInterface&&) = default; | |
| virtual absl::flat_hash_map<std::string, size_t> GetOwnedUrls() const = 0; | |
| // Avoid header pollution and forward declaration. | |
| virtual void SetSmartRouter(void* smart_router) = 0; | |
| virtual void HandleFromCrowRequest( | |
| const crow::Request& req, | |
| const std::shared_ptr<bmcweb::AsyncResp>& async_resp) const = 0; | |
| virtual void DebugPrint() const = 0; | |
| virtual absl::flat_hash_set<std::string> GetOwnedSubtrees() const = 0; | |
| virtual bool HasRule(std::string_view url, | |
| boost::beast::http::verb verb) const = 0; | |
| }; | |
| } // namespace crow | |
| #endif // THIRD_PARTY_MILOTIC_INTERNAL_CC_BMCWEB_APP_INTERFACE_H_ |