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 | |
Gunnar Mills | f3fac22 | 2018-08-14 11:59:10 -0500 | [diff] [blame] | 13 | constexpr auto SEPARATOR = "_"; |
Ratan Gupta | 212f53e | 2018-04-30 17:28:05 +0530 | [diff] [blame] | 14 | |
| 15 | namespace fs = std::experimental::filesystem; |
| 16 | |
Ratan Gupta | a7ff385 | 2018-11-16 14:05:57 +0530 | [diff] [blame] | 17 | /** @brief Serialize and persist SNMP manager/client D-Bus object. |
| 18 | * @param[in] id - filename of the persisted SNMP manager object. |
Ratan Gupta | 212f53e | 2018-04-30 17:28:05 +0530 | [diff] [blame] | 19 | * @param[in] manager - const reference to snmp client/manager object. |
| 20 | * @param[in] path - path of persistent location where D-Bus object would be |
| 21 | * saved. |
| 22 | * @return fs::path - pathname of persisted snmp manager/client file. |
| 23 | */ |
Ratan Gupta | a7ff385 | 2018-11-16 14:05:57 +0530 | [diff] [blame] | 24 | fs::path serialize(Id id, const Client& manager, const fs::path& path); |
Ratan Gupta | 212f53e | 2018-04-30 17:28:05 +0530 | [diff] [blame] | 25 | |
| 26 | /** @brief Deserialze SNMP manager/client info into a D-Bus object |
| 27 | * @param[in] path - pathname of persisted manager/client file. |
| 28 | * @param[in] manager - reference to snmp client/manager object |
| 29 | * which is the target of deserialization. |
| 30 | * @return bool - true if the deserialization was successful, false otherwise. |
| 31 | */ |
| 32 | bool deserialize(const fs::path& path, Client& manager); |
| 33 | |
| 34 | } // namespace snmp |
| 35 | } // namespace network |
| 36 | } // namespace phosphor |