From 306cfc06ed38a2f86616c1f2fe64de45321f21a6 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 13 Sep 2025 14:38:44 +1000 Subject: plugin: refactor into modules --- plugin/src/Caelestia/Services/service.hpp | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 plugin/src/Caelestia/Services/service.hpp (limited to 'plugin/src/Caelestia/Services/service.hpp') diff --git a/plugin/src/Caelestia/Services/service.hpp b/plugin/src/Caelestia/Services/service.hpp new file mode 100644 index 0000000..787818b --- /dev/null +++ b/plugin/src/Caelestia/Services/service.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include +#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; + mutable QMutex m_mutex; + + virtual void start() = 0; + virtual void stop() = 0; +}; + +} // namespace caelestia -- cgit v1.2.3-freya