blob: 2608866612b6af03a9e0a82a8b79ce56a113cf40 [file] [log] [blame]
Ratan Gupta212f53e2018-04-30 17:28:05 +05301#pragma once
2
3#include <experimental/filesystem>
4#include "snmp_client.hpp"
5
6namespace phosphor
7{
8namespace network
9{
10namespace snmp
11{
12
Gunnar Millsf3fac222018-08-14 11:59:10 -050013constexpr auto SEPARATOR = "_";
Ratan Gupta212f53e2018-04-30 17:28:05 +053014
15namespace fs = std::experimental::filesystem;
16
Ratan Guptaa7ff3852018-11-16 14:05:57 +053017/** @brief Serialize and persist SNMP manager/client D-Bus object.
18 * @param[in] id - filename of the persisted SNMP manager object.
Ratan Gupta212f53e2018-04-30 17:28:05 +053019 * @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 Guptaa7ff3852018-11-16 14:05:57 +053024fs::path serialize(Id id, const Client& manager, const fs::path& path);
Ratan Gupta212f53e2018-04-30 17:28:05 +053025
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 */
32bool deserialize(const fs::path& path, Client& manager);
33
34} // namespace snmp
35} // namespace network
36} // namespace phosphor