Flat map all the things
In an earlier commit, entity-manager gained required dependency
on std::flat_map. This means that EM can only compile with gcc-15,
which the project only recently moved to. Rather than move backwards,
port forward all uses of boost flat_map and flat_set to their std
equivalents.
Tested: entity-manager launches and enumerates devices on
gb200-obmc.
Change-Id: Id24803057711c60d5b00f436db80b27edbb756a3
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/src/entity_manager/perform_scan.cpp b/src/entity_manager/perform_scan.cpp
index 6ba362b..85eb723 100644
--- a/src/entity_manager/perform_scan.cpp
+++ b/src/entity_manager/perform_scan.cpp
@@ -7,11 +7,11 @@
#include "utils.hpp"
#include <boost/asio/steady_timer.hpp>
-#include <boost/container/flat_map.hpp>
-#include <boost/container/flat_set.hpp>
#include <phosphor-logging/lg2.hpp>
#include <charconv>
+#include <flat_map>
+#include <flat_set>
using GetSubTreeType = std::vector<
std::pair<std::string,
@@ -42,7 +42,8 @@
scan->_em.systemBus->async_method_call(
[instance, scan, probeVector, retries,
- &io](boost::system::error_code& errc, const DBusInterface& resp) {
+ &io](boost::system::error_code& errc,
+ const DBusInterface& resp) mutable {
if (errc)
{
lg2::error("error calling getall on {BUSNAME} {PATH} {INTF}",
@@ -59,7 +60,8 @@
return;
}
- scan->dbusProbeObjects[instance.path][instance.interface] = resp;
+ scan->dbusProbeObjects[std::string(instance.path)]
+ [std::string(instance.interface)] = resp;
},
instance.busName, instance.path, "org.freedesktop.DBus.Properties",
"GetAll", instance.interface);
@@ -97,7 +99,7 @@
// for the paths that own the interfaces passed in.
void findDbusObjects(
std::vector<std::shared_ptr<probe::PerformProbe>>&& probeVector,
- boost::container::flat_set<std::string>&& interfaces,
+ std::flat_set<std::string, std::less<>>&& interfaces,
const std::shared_ptr<scan::PerformScan>& scan, boost::asio::io_context& io,
size_t retries = 5)
{
@@ -540,7 +542,7 @@
void scan::PerformScan::run()
{
- boost::container::flat_set<std::string> dbusProbeInterfaces;
+ std::flat_set<std::string, std::less<>> dbusProbeInterfaces;
std::vector<std::shared_ptr<probe::PerformProbe>> dbusProbePointers;
for (auto it = _configurations.begin(); it != _configurations.end();)