Matt Spinler | e824f98 | 2017-05-11 10:07:55 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <memory> |
| 4 | #include <systemd/sd-event.h> |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace fan |
| 9 | { |
| 10 | namespace event |
| 11 | { |
| 12 | |
| 13 | /** |
| 14 | * Custom deleter for sd_event_source |
| 15 | */ |
| 16 | struct EventSourceDeleter |
| 17 | { |
| 18 | void operator()(sd_event_source* eventSource) const |
| 19 | { |
| 20 | sd_event_source_unref(eventSource); |
| 21 | } |
| 22 | }; |
| 23 | |
| 24 | using EventSourcePtr = std::unique_ptr<sd_event_source, EventSourceDeleter>; |
| 25 | |
Matt Spinler | e824f98 | 2017-05-11 10:07:55 -0500 | [diff] [blame] | 26 | } |
| 27 | } |
| 28 | } |