Dhruvaraj Subhashchandran | 3f47524 | 2017-07-12 00:44:27 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <string> |
| 4 | #include <vector> |
| 5 | #include <experimental/filesystem> |
| 6 | #include "host_state_manager.hpp" |
| 7 | #include "config.h" |
| 8 | |
| 9 | namespace phosphor |
| 10 | { |
| 11 | namespace state |
| 12 | { |
| 13 | namespace manager |
| 14 | { |
| 15 | |
| 16 | namespace fs = std::experimental::filesystem; |
| 17 | |
| 18 | /** @brief Serialize and persist requested host state |
| 19 | * @param[in] host - const reference to host state. |
| 20 | * @param[in] dir - pathname of file where the serialized host state will |
| 21 | * be placed. |
| 22 | * @return fs::path - pathname of persisted requested host state. |
| 23 | */ |
| 24 | fs::path serialize(const Host& host, |
| 25 | const fs::path& dir = fs::path(HOST_STATE_PERSIST_PATH)); |
| 26 | |
| 27 | /** @brief Deserialze a persisted requested host state. |
| 28 | * @param[in] path - pathname of persisted host state file |
| 29 | * @param[in] host - reference to host state object which is the target of |
| 30 | * deserialization. |
| 31 | * @return bool - true if the deserialization was successful, false otherwise. |
| 32 | */ |
| 33 | bool deserialize(const fs::path& path, Host& host); |
| 34 | |
| 35 | } // namespace manager |
| 36 | } // namespace state |
| 37 | } // namespace phosphor |