Ratan Gupta | 212f53e | 2018-04-30 17:28:05 +0530 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <experimental/filesystem> |
| 4 | #include "snmp_client.hpp" |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace network |
| 9 | { |
| 10 | namespace snmp |
| 11 | { |
| 12 | |
| 13 | constexpr auto SEPRATOR = "_"; |
| 14 | |
| 15 | namespace fs = std::experimental::filesystem; |
| 16 | |
| 17 | /** @brief Serialize and persist SNMP manager/client D-Bus object |
| 18 | * @param[in] manager - const reference to snmp client/manager object. |
| 19 | * @param[in] path - path of persistent location where D-Bus object would be |
| 20 | * saved. |
| 21 | * @return fs::path - pathname of persisted snmp manager/client file. |
| 22 | */ |
| 23 | fs::path serialize(const Client& manager, const fs::path& path); |
| 24 | |
| 25 | /** @brief Deserialze SNMP manager/client info into a D-Bus object |
| 26 | * @param[in] path - pathname of persisted manager/client file. |
| 27 | * @param[in] manager - reference to snmp client/manager object |
| 28 | * which is the target of deserialization. |
| 29 | * @return bool - true if the deserialization was successful, false otherwise. |
| 30 | */ |
| 31 | bool deserialize(const fs::path& path, Client& manager); |
| 32 | |
| 33 | } // namespace snmp |
| 34 | } // namespace network |
| 35 | } // namespace phosphor |