summaryrefslogtreecommitdiffstats
path: root/event.hpp
blob: a937d6dcb1c9c8591f0b743422bf270106d8cb5d (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
#pragma once

#include <memory>
#include <systemd/sd-event.h>

namespace phosphor
{
namespace fan
{
namespace event
{

/**
 * Custom deleter for sd_event_source
 */
struct EventSourceDeleter
{
    void operator()(sd_event_source* eventSource) const
    {
        sd_event_source_unref(eventSource);
    }
};

using EventSourcePtr = std::unique_ptr<sd_event_source, EventSourceDeleter>;

}
}
}
OpenPOWER on IntegriCloud