blob: cc6f616fe304e36fa1a60c238d9a0f3b30734510 [file] [log] [blame]
Vishwanatha Subbannaee4d83d2017-06-29 18:35:00 +05301#pragma once
2
3#include <systemd/sd-event.h>
4namespace open_power
5{
6namespace occ
7{
8
9/* Need a custom deleter for freeing up sd_event */
10struct EventDeleter
11{
12 void operator()(sd_event* event) const
13 {
14 event = sd_event_unref(event);
15 }
16};
17using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
18
19/* Need a custom deleter for freeing up sd_event_source */
20struct EventSourceDeleter
21{
22 void operator()(sd_event_source* eventSource) const
23 {
24 eventSource = sd_event_source_unref(eventSource);
25 }
26};
27using EventSourcePtr = std::unique_ptr<sd_event_source, EventSourceDeleter>;
28
29} // namespace occ
30} // namespace open_power