message: clang-formatted LandmarkMapper
diff: #include "toml.hpp"
  +#include <optional>
  +#include <stdexcept>
  #include <string>
  #include <unordered_map>
  -#include <stdexcept>
  -#include <optional>
  namespace eos {
  namespace core {
  @@ -48,7 +48,8 @@ namespace eos {
  * - Converting one set of 2D landmarks into another set of 2D
  * landmarks with different identifiers.
  */
  -class LandmarkMapper {
  +class LandmarkMapper
  +{
  public:
  /**
  * @brief Constructs a new landmark mapper that performs an identity
  @@ -73,15 +74,22 @@ public:
  const auto data = toml::parse(filename);
  const auto mappings_table = toml::get<toml::Table>(data.at("landmark_mappings"));
  - // The key in the config is always a string. The value however may be a string or an integer, so we check for that and convert to a string.
  + // The key in the config is always a string. The value however may be a string or an integer, so we
  + // check for that and convert to a string.
  for (const auto& mapping : mappings_table)
  {
  std::string f = mapping.first;
  std::string value;
  - switch (mapping.second.type()) {
  - case toml::value_t::Integer: value = std::to_string(toml::get<int>(mapping.second)); break;
  - case toml::value_t::String: value = toml::get<std::string>(mapping.second); break;
  - default: throw std::runtime_error("unexpected type : " + toml::stringize(mapping.second.type()));
  + switch (mapping.second.type())
  + {
  + case toml::value_t::Integer:
  + value = std::to_string(toml::get<int>(mapping.second));
  + break;
  + case toml::value_t::String:
  + value = toml::get<std::string>(mapping.second);
  + break;
  + default:
  + throw std::runtime_error("unexpected type : " + toml::stringize(mapping.second.type()));
  }
  landmark_mappings.emplace(mapping.first, value);
  @@ -96,17 +104,19 @@ public:
  */
  std::optional<std::string> convert(std::string landmark_name) const
  {
  - if (landmark_mappings.empty()) {
  + if (landmark_mappings.empty())
  + {
  // perform identity mapping, i.e. return the input
  return landmark_name;
  }
  const auto& converted_landmark = landmark_mappings.find(landmark_name);
  - if (converted_landmark != std::end(landmark_mappings)) {
  + if (converted_landmark != std::end(landmark_mappings))
  + {
  // landmark mapping found, return it
  return converted_landmark->second;
  - }
  - else { // landmark_name does not match the key of any element in the map
  + } else
  + { // landmark_name does not match the key of any element in the map
  return std::nullopt;
  }
  };
  @@ -116,13 +126,11 @@ public:
  *
  * @return The number of landmark mappings.
  */
  - auto num_mappings() const
  - {
  - return landmark_mappings.size();
  - };
  + auto num_mappings() const { return landmark_mappings.size(); };
  private:
  - std::unordered_map<std::string, std::string> landmark_mappings; ///< Mapping from one landmark name to a name in a different format.
  + std::unordered_map<std::string, std::string>
  + landmark_mappings; ///< Mapping from one landmark name to a name in a different format.
  };
  } /* namespace core */
  