From c99e05026f918a44dd43ba58ceaa15ecdd9bb7ad Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 6 Sep 2025 15:41:19 +1000 Subject: plugin: abstract service + ref --- plugin/src/Caelestia/service.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 plugin/src/Caelestia/service.hpp (limited to 'plugin/src/Caelestia/service.hpp') diff --git a/plugin/src/Caelestia/service.hpp b/plugin/src/Caelestia/service.hpp new file mode 100644 index 0000000..861d715 --- /dev/null +++ b/plugin/src/Caelestia/service.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include + +namespace caelestia { + +class Service : public QObject { + Q_OBJECT + + Q_PROPERTY(int refCount READ refCount NOTIFY refCountChanged) + +public: + explicit Service(QObject* parent = nullptr); + + [[nodiscard]] int refCount() const; + + void ref(); + void unref(); + +signals: + void refCountChanged(); + +private: + int m_refCount; + + virtual void start() = 0; + virtual void stop() = 0; +}; + +} // namespace caelestia -- cgit v1.2.3-freya