#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"; // PropertyIndex::key_type fields constexpr auto pathIndex = 0; constexpr auto interfaceIndex = 1; constexpr auto propertyIndex = 2; // PropertyIndex::mapped_type fields constexpr auto pathMetaIndex = 0; constexpr auto propertyMetaIndex = 1; constexpr auto storageIndex = 2; // ConfigPropertyStorage fields constexpr auto valueIndex = 0; constexpr auto resultIndex = 1; enum class Context { START, SIGNAL, }; /** @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>>; using Value = sdbusplus::message::variant; /** @brief ObjectManager.InterfacesAdded signal signature alias. */ using Interface = std::string; using Property = std::string; using PathInterfacesAdded = std::map>; /** @brief ObjectMapper.GetObject response signature alias. */ using GetObject = std::map>; /** @brief Properties.GetAll response signature alias. */ template using PropertiesChanged = std::map>; /** @brief Lookup index for properties . */ // *INDENT-OFF* using PropertyIndex = TupleRefMap>, 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