xref: /openbmc/pldm/host-bmc/dbus/asset.hpp (revision 1634a6e93f1e9b2efb508216f2d90fd1d5af3e4c)
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/Decorator/Asset/server.hpp>
7 
8 #include <string>
9 
10 namespace pldm
11 {
12 namespace dbus
13 {
14 
15 using ItemAsset = sdbusplus::server::object_t<
16     sdbusplus::xyz::openbmc_project::Inventory::Decorator::server::Asset>;
17 
18 class Asset : public ItemAsset
19 {
20   public:
21     Asset() = delete;
22     ~Asset() = default;
23     Asset(const Asset&) = delete;
24     Asset& operator=(const Asset&) = delete;
25     Asset(Asset&&) = delete;
26     Asset& operator=(Asset&&) = delete;
27 
Asset(sdbusplus::bus_t & bus,const std::string & objPath)28     Asset(sdbusplus::bus_t& bus, const std::string& objPath) :
29         ItemAsset(bus, objPath.c_str()), path(objPath)
30     {
31         // no need to save this in pldm memory
32     }
33 
34     std::string partNumber(std::string value) override;
35 
36   private:
37     std::string path;
38 };
39 
40 } // namespace dbus
41 } // namespace pldm
42