From 26702d01c5a9290e8dcd20736223b002ec3ebadd Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 3 Nov 2021 15:02:33 -0700 Subject: /s/boost::beast::span/std::span std::span is now available in c++ 20 builds, and should be a drop in replacement for boost::span we were using previously. This commit sed replaces it, and changes reference to cbegin and cend to begin and end respectively. Tested: Ran redfish-service-validator. No new failures, and all nodes within /redfish/v1/Registries that would be effected by this change respond with 200 and the same content as previously. Signed-off-by: Ed Tanous Change-Id: Iace89473b7c20f32106eae9d872c16cfae5f17f6 --- redfish-core/include/event_service_manager.hpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'redfish-core/include/event_service_manager.hpp') diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp index a20f36ac0e..eb076c97e5 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp @@ -36,6 +36,7 @@ #include #include #include +#include #include namespace redfish @@ -52,22 +53,22 @@ static constexpr const char* eventServiceFile = namespace message_registries { -inline boost::beast::span +inline std::span getRegistryFromPrefix(const std::string& registryName) { if (task_event::header.registryPrefix == registryName) { - return boost::beast::span(task_event::registry); + return {task_event::registry}; } if (openbmc::header.registryPrefix == registryName) { - return boost::beast::span(openbmc::registry); + return {openbmc::registry}; } if (base::header.registryPrefix == registryName) { - return boost::beast::span(base::registry); + return {base::registry}; } - return boost::beast::span(openbmc::registry); + return {openbmc::registry}; } } // namespace message_registries @@ -89,14 +90,14 @@ namespace message_registries { static const Message* getMsgFromRegistry(const std::string& messageKey, - const boost::beast::span& registry) + const std::span& registry) { - boost::beast::span::const_iterator messageIt = - std::find_if(registry.cbegin(), registry.cend(), + std::span::iterator messageIt = + std::find_if(registry.begin(), registry.end(), [&messageKey](const MessageEntry& messageEntry) { return !messageKey.compare(messageEntry.first); }); - if (messageIt != registry.cend()) + if (messageIt != registry.end()) { return &messageIt->second; } -- cgit v1.2.3