| #ifndef THIRD_PARTY_GBMCWEB_DEVPATH_PLUGIN_REDFISH_TO_UHM_TRIE_H_ | |
| #define THIRD_PARTY_GBMCWEB_DEVPATH_PLUGIN_REDFISH_TO_UHM_TRIE_H_ | |
| #include <memory> | |
| #include "redfish_to_uhm_mapping.pb.h" | |
| #include "redfish_to_uhm_mapping_value.hpp" | |
| #include "redfish_to_uhm_trie_node.hpp" | |
| namespace devpath_plugin { | |
| class RedfishToUhmTrie { | |
| public: | |
| RedfishToUhmTrie() = default; | |
| // Split path by '/' and insert based on key's URL pattern | |
| void Insert(const ::devpath_plugin::Key& key, | |
| const std::shared_ptr<const RedfishToUhmMappingValue>& value); | |
| // Split path by '/' and lookup using the key's URL pattern | |
| std::shared_ptr<const RedfishToUhmMappingValue> GetMappingFromUrl( | |
| const ::devpath_plugin::Key& key) const; | |
| const RedfishToUhmTrieNode& GetRoot() const { return root_; } | |
| private: | |
| RedfishToUhmTrieNode root_; | |
| }; | |
| } // namespace devpath_plugin | |
| #endif // THIRD_PARTY_GBMCWEB_DEVPATH_PLUGIN_REDFISH_TO_UHM_TRIE_H_ |