summaryrefslogtreecommitdiffstats
path: root/src/event_serialize.hpp
blob: f05284577447597c721332e54db2046485c057ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <experimental/filesystem>
#include "event_entry.hpp"
#include "config.h"

namespace phosphor
{
namespace events
{

namespace fs = std::experimental::filesystem;

/** @brief Serialize and persist event d-bus object
 *  @param[in] event - const reference to event entry.
 *  @param[in] eventName - Name of the event.
 *  @return fs::path - pathname of persisted events file
 */
fs::path serialize(const Entry& event, const std::string& eventName);

/** @brief Deserialze a persisted event into a d-bus object
 *  @param[in] path - pathname of persisted event file
 *  @param[in] event - reference to event object which is the target of
 *             deserialization.
 *  @return bool - true if the deserialization was successful, false otherwise.
 */
bool deserialize(const fs::path& path, Entry& event);

} // namespace events
} // namespace phosphor
OpenPOWER on IntegriCloud