#pragma once #include #include #include "tupleref.hpp" namespace any_ns = std::experimental; namespace phosphor { namespace dbus { namespace monitoring { constexpr auto MAPPER_BUSNAME = "xyz.openbmc_project.ObjectMapper"; constexpr auto MAPPER_PATH = "/xyz/openbmc_project/object_mapper"; constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper"; /** @brief A map with references as keys. */ template using RefKeyMap = std::map, Value, std::less>; /** @brief A map with a tuple of references as keys. */ template using TupleRefMap = std::map, Value, TupleOfRefsLess>; /** @brief A vector of references. */ template using RefVector = std::vector>; /** @brief * * The mapper has a defect such that it provides strings * rather than object paths. Use an alias for easy refactoring * when the mapper is fixed. */ using MapperPath = std::string; /** @brief ObjectManager.InterfacesAdded signal signature alias. */ template using InterfacesAdded = std::map < std::string, std::map < std::string, sdbusplus::message::variant>>; /** @brief ObjectMapper.GetObject response signature alias. */ using GetObject = std::map>; /** @brief Properties.GetAll response signature alias. */ template using PropertiesChanged = std::map < std::string, sdbusplus::message::variant>; /** @brief Lookup index for properties . */ // *INDENT-OFF* using PropertyIndex = TupleRefMap < TupleOfRefs< const std::string, const std::string, any_ns::any>, const std::string, const std::string, const std::string >; // *INDENT-ON* /** @brief Convert some C++ types to others. * * Remove type decorators to reduce template specializations. * * 1. Remove references. * 2. Remove 'const' and 'volatile'. */ template struct Downcast { using Type = std::remove_cv_t>; }; template using DowncastType = typename Downcast::Type; } // namespace monitoring } // namespace dbus } // namespace phosphor