diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-10-28 20:00:57 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-11-08 15:01:04 -0500 |
commit | adc4566c0cf67413ed4987309f4194c8636633dd (patch) | |
tree | 33079fb4c197cc6a43ae57e2b0b78910b1f806b2 /xyz/openbmc_project/Inventory/Manager | |
parent | afbd28efcc2a070c0d6b9ec1a8bb392bdd54d0d6 (diff) | |
download | phosphor-inventory-manager-adc4566c0cf67413ed4987309f4194c8636633dd.tar.gz phosphor-inventory-manager-adc4566c0cf67413ed4987309f4194c8636633dd.zip |
Add manager interface server binding
Eventually any DBus interfaces in phosphor-dbus-interfaces will
have bindings generated and available in a shared library.
Add the generated Manager interface directly to the repository until
that happens.
Change-Id: I9e1ac3266ca6467bbddbbd12ed2d2de6c079765b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'xyz/openbmc_project/Inventory/Manager')
-rw-r--r-- | xyz/openbmc_project/Inventory/Manager/server.hpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/xyz/openbmc_project/Inventory/Manager/server.hpp b/xyz/openbmc_project/Inventory/Manager/server.hpp new file mode 100644 index 0000000..9c3118b --- /dev/null +++ b/xyz/openbmc_project/Inventory/Manager/server.hpp @@ -0,0 +1,74 @@ +#pragma once +#include <tuple> +#include <systemd/sd-bus.h> +#include <sdbusplus/server.hpp> + +namespace sdbusplus +{ +namespace server +{ +namespace xyz +{ +namespace openbmc_project +{ +namespace Inventory +{ + +class Manager +{ + public: + /* Define all of the basic class operations: + * Not allowed: + * - Default constructor to avoid nullptrs. + * - Copy operations due to internal unique_ptr. + * Allowed: + * - Move operations. + * - Destructor. + */ + Manager() = delete; + Manager(const Manager&) = delete; + Manager& operator=(const Manager&) = delete; + Manager(Manager&&) = default; + Manager& operator=(Manager&&) = default; + virtual ~Manager() = default; + + /** @brief Constructor to put object onto bus at a dbus path. + * @param[in] bus - Bus to attach to. + * @param[in] path - Path to attach at. + */ + Manager(bus::bus& bus, const char* path); + + + /** @brief Implementation for Notify + * Signal the implementing service that an item is ready to have its state managed. + * + * @param[in] path - The path of the item to be managed, relative to the inventory namespace root. + * @param[in] object - The fully enumerated item to be managed. + */ + virtual void notify( + std::string path, + std::map<std::string, std::map<std::string, sdbusplus::message::variant<std::string>>> object) = 0; + + + + private: + + /** @brief sd-bus callback for Notify + */ + static int _callback_Notify( + sd_bus_message*, void*, sd_bus_error*); + + + static constexpr auto _interface = "xyz.openbmc_project.Inventory.Manager"; + static const vtable::vtable_t _vtable[]; + interface::interface _xyz_openbmc_project_Inventory_Manager_interface; + + +}; + +} // namespace Inventory +} // namespace openbmc_project +} // namespace xyz +} // namespace server +} // namespace sdbusplus + |