diff options
author | Ed Tanous <edtanous@google.com> | 2021-11-04 01:02:33 +0300 |
---|---|---|
committer | Ed Tanous <edtanous@google.com> | 2021-12-07 00:23:23 +0300 |
commit | 26702d01c5a9290e8dcd20736223b002ec3ebadd (patch) | |
tree | 4c4b2845c782cc73e126dc0620e3048675d7a2ac /redfish-core/include/event_service_manager.hpp | |
parent | 889ff6943d62762eeaf58824b651d2edaf940d1d (diff) | |
download | bmcweb-26702d01c5a9290e8dcd20736223b002ec3ebadd.tar.xz |
/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 <edtanous@google.com>
Change-Id: Iace89473b7c20f32106eae9d872c16cfae5f17f6
Diffstat (limited to 'redfish-core/include/event_service_manager.hpp')
-rw-r--r-- | redfish-core/include/event_service_manager.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
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 <ctime> #include <fstream> #include <memory> +#include <span> #include <variant> namespace redfish @@ -52,22 +53,22 @@ static constexpr const char* eventServiceFile = namespace message_registries { -inline boost::beast::span<const MessageEntry> +inline std::span<const MessageEntry> getRegistryFromPrefix(const std::string& registryName) { if (task_event::header.registryPrefix == registryName) { - return boost::beast::span<const MessageEntry>(task_event::registry); + return {task_event::registry}; } if (openbmc::header.registryPrefix == registryName) { - return boost::beast::span<const MessageEntry>(openbmc::registry); + return {openbmc::registry}; } if (base::header.registryPrefix == registryName) { - return boost::beast::span<const MessageEntry>(base::registry); + return {base::registry}; } - return boost::beast::span<const MessageEntry>(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<const MessageEntry>& registry) + const std::span<const MessageEntry>& registry) { - boost::beast::span<const MessageEntry>::const_iterator messageIt = - std::find_if(registry.cbegin(), registry.cend(), + std::span<const MessageEntry>::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; } |