10a816c5dSWilliam A. Kennington III #pragma once
20a816c5dSWilliam A. Kennington III 
3*65db863eSWilliam A. Kennington III #include <cstdint>
40a816c5dSWilliam A. Kennington III #include <sdeventplus/internal/sdevent.hpp>
50a816c5dSWilliam A. Kennington III #include <sdeventplus/internal/sdref.hpp>
60a816c5dSWilliam A. Kennington III #include <systemd/sd-bus.h>
70a816c5dSWilliam A. Kennington III #include <type_traits>
80a816c5dSWilliam A. Kennington III 
90a816c5dSWilliam A. Kennington III namespace sdeventplus
100a816c5dSWilliam A. Kennington III {
110a816c5dSWilliam A. Kennington III namespace source
120a816c5dSWilliam A. Kennington III {
130a816c5dSWilliam A. Kennington III 
140a816c5dSWilliam A. Kennington III class Base
150a816c5dSWilliam A. Kennington III {
160a816c5dSWilliam A. Kennington III   public:
17*65db863eSWilliam A. Kennington III     virtual ~Base();
18*65db863eSWilliam A. Kennington III 
190a816c5dSWilliam A. Kennington III     // We don't want to allow any kind of slicing.
200a816c5dSWilliam A. Kennington III     Base(const Base& source) = delete;
210a816c5dSWilliam A. Kennington III     Base& operator=(const Base& source) = delete;
220a816c5dSWilliam A. Kennington III     Base(Base&& source) = delete;
230a816c5dSWilliam A. Kennington III     Base& operator=(Base&& source) = delete;
240a816c5dSWilliam A. Kennington III 
25*65db863eSWilliam A. Kennington III     const char* get_description();
26*65db863eSWilliam A. Kennington III     void set_description(const char* description);
27*65db863eSWilliam A. Kennington III     int get_pending();
28*65db863eSWilliam A. Kennington III     int64_t get_priority();
29*65db863eSWilliam A. Kennington III     void set_priority(int64_t priority);
30*65db863eSWilliam A. Kennington III     int get_enabled();
31*65db863eSWilliam A. Kennington III     void set_enabled(int enabled);
32*65db863eSWilliam A. Kennington III 
330a816c5dSWilliam A. Kennington III   protected:
34*65db863eSWilliam A. Kennington III     const internal::SdEvent* const sdevent;
35*65db863eSWilliam A. Kennington III     const internal::SdRef<sd_event_source> source;
360a816c5dSWilliam A. Kennington III 
370a816c5dSWilliam A. Kennington III     // Base sources cannot be directly constructed.
380a816c5dSWilliam A. Kennington III     Base(sd_event_source* source,
390a816c5dSWilliam A. Kennington III          internal::SdEvent* sdevent = &internal::sdevent_impl);
400a816c5dSWilliam A. Kennington III     Base(sd_event_source* source, std::false_type,
410a816c5dSWilliam A. Kennington III          internal::SdEvent* sdevent = &internal::sdevent_impl);
420a816c5dSWilliam A. Kennington III };
430a816c5dSWilliam A. Kennington III 
440a816c5dSWilliam A. Kennington III } // namespace source
450a816c5dSWilliam A. Kennington III } // namespace sdeventplus
46