blob: 71ca6a6d3fc02e44a8531a173b659c2e2cf9d016 [file] [log] [blame]
Matt Spinlere824f982017-05-11 10:07:55 -05001#pragma once
2
3#include <memory>
4#include <systemd/sd-event.h>
5
6namespace phosphor
7{
8namespace fan
9{
10namespace event
11{
12
13/**
14 * Custom deleter for sd_event_source
15 */
16struct EventSourceDeleter
17{
18 void operator()(sd_event_source* eventSource) const
19 {
20 sd_event_source_unref(eventSource);
21 }
22};
23
24using EventSourcePtr = std::unique_ptr<sd_event_source, EventSourceDeleter>;
25
26/**
27 * Customer deleter for sd_event
28 */
29struct EventDeleter
30{
31 void operator()(sd_event* event) const
32 {
33 sd_event_unref(event);
34 }
35};
36
37using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
38
39}
40}
41}