Archana Kakani | c366447 | 2025-02-04 05:36:37 -0600 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include <sdbusplus/server.hpp> |
| 5 | #include <sdbusplus/server/object.hpp> |
| 6 | #include <xyz/openbmc_project/Inventory/Item/server.hpp> |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace pldm |
| 11 | { |
| 12 | namespace dbus |
| 13 | { |
| 14 | using ItemIntf = sdbusplus::server::object_t< |
| 15 | sdbusplus::xyz::openbmc_project::Inventory::server::Item>; |
| 16 | |
| 17 | class InventoryItem : public ItemIntf |
| 18 | { |
| 19 | public: |
| 20 | InventoryItem() = delete; |
| 21 | ~InventoryItem() = default; |
| 22 | InventoryItem(const InventoryItem&) = delete; |
| 23 | InventoryItem& operator=(const InventoryItem&) = delete; |
| 24 | InventoryItem(InventoryItem&&) = delete; |
| 25 | InventoryItem& operator=(InventoryItem&&) = delete; |
| 26 | |
| 27 | InventoryItem(sdbusplus::bus_t& bus, const std::string& objPath) : |
| 28 | ItemIntf(bus, objPath.c_str()), path(objPath) |
| 29 | {} |
| 30 | |
| 31 | /** Get value of PrettyName */ |
| 32 | std::string prettyName() const override; |
| 33 | |
| 34 | /** Set value of PrettyName */ |
| 35 | std::string prettyName(std::string value) override; |
| 36 | |
| 37 | /** Get value of Present */ |
| 38 | bool present() const override; |
| 39 | |
| 40 | /** Set value of Present */ |
| 41 | bool present(bool value) override; |
| 42 | |
| 43 | private: |
| 44 | std::string path; |
| 45 | }; |
| 46 | |
| 47 | } // namespace dbus |
| 48 | } // namespace pldm |