Modernize mapper core types

There's a number of best practices that have evolved in our use of
flat_maps and flat_sets since this code was originally written.

First, add std::less<> to the Compare template argument.  The default
for this is std::less<Key> which limits find() calls (and any lookup for
that matter) to only supporting std::string.  Using std::less<> allows
lookup by std::string_view, which can prevent some copies in some cases.

Next, add std::vector<...> to the types under the AllocatorOrContainer
template arg.  Per our coding standard, this overrides the default of
using boost::vector, and replaces it with std::vector, which, although
it has a very similar interface, tends to optimize better, and be better
supported overall.

The rest of this patch updates a couple places where the various types
were specifically hardcoded, so it moves to using the various using
declarations.

Tested: Unit tests;  Next patch tests this more fully.

Change-Id: I11e8ecb669f31193c55dda344b25d3fa5d191502
Signed-off-by: Ed Tanous <edtanous@google.com>
5 files changed
tree: d79372ff167b9f2ac95e151211ade15fccdf0dc2
  1. fail-monitor/
  2. libmapper/
  3. src/
  4. subprojects/
  5. .clang-format
  6. .gitignore
  7. LICENSE
  8. MAINTAINERS
  9. meson.build
  10. meson_options.txt
  11. OWNERS
  12. README.md
README.md

Prerequisites

Non-OpenBMC build dependencies are:

  • meson/ninja
  • boost
  • libsystemd
  • systemd
  • tinyxml2

Build

meson build && ninja -C build

Run Unit Tests

meson build && ninja -C build test

Clean the repository

rm -rf build