blob: aa0120cd99d3186a5c435ce7a9a88cc9df3cde12 [file] [log] [blame]
#pragma once
#include <systemd/sd-event.h>
#include <memory>
namespace open_power
{
namespace occ
{
/* Need a custom deleter for freeing up sd_event */
struct EventDeleter
{
void operator()(sd_event* event) const
{
sd_event_unref(event);
}
};
using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
/* Need a custom deleter for freeing up 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>;
} // namespace occ
} // namespace open_power