blob: 6427a9313e3cfd465a839066d52f343f2928a979 [file] [log] [blame]
George Liu682ee182020-12-25 15:24:33 +08001#include "custom_dbus.hpp"
2
3namespace pldm
4{
5namespace dbus
6{
7void CustomDBus::setLocationCode(const std::string& path, std::string value)
8{
9 if (!location.contains(path))
10 {
11 location.emplace(path,
12 std::make_unique<LocationIntf>(
13 pldm::utils::DBusHandler::getBus(), path.c_str()));
14 }
15
16 location.at(path)->locationCode(value);
17}
18
19std::optional<std::string>
20 CustomDBus::getLocationCode(const std::string& path) const
21{
22 if (location.contains(path))
23 {
24 return location.at(path)->locationCode();
25 }
26
27 return std::nullopt;
28}
29
30} // namespace dbus
31} // namespace pldm