diff options
author | saturneric <[email protected]> | 2023-10-23 06:29:25 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-10-23 06:29:25 +0000 |
commit | 31fc827672a131da020c4b4a0c3c8a145d477835 (patch) | |
tree | a825cdbf87d69d7449d00f7360c797e755e8f783 /src/core/module/ModuleManager.h | |
parent | fix: improve the stability of thread system (diff) | |
download | GpgFrontend-31fc827672a131da020c4b4a0c3c8a145d477835.tar.gz GpgFrontend-31fc827672a131da020c4b4a0c3c8a145d477835.zip |
feat: improve project structure and add GRT for modules
Diffstat (limited to 'src/core/module/ModuleManager.h')
-rw-r--r-- | src/core/module/ModuleManager.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/module/ModuleManager.h b/src/core/module/ModuleManager.h index c2889f87..66fa9db6 100644 --- a/src/core/module/ModuleManager.h +++ b/src/core/module/ModuleManager.h @@ -26,11 +26,7 @@ * */ -#ifndef GPGFRONTEND_MODULEMANAGER_H -#define GPGFRONTEND_MODULEMANAGER_H - -#include <memory> -#include <string> +#pragma once #include "core/module/Event.h" @@ -51,7 +47,9 @@ using EventRefrernce = std::shared_ptr<Event>; using ModuleIdentifier = std::string; using ModulePtr = std::shared_ptr<Module>; using ModuleMangerPtr = std::shared_ptr<ModuleManager>; -using GlobalModuleContextPtr = std::shared_ptr<GlobalModuleContext>; +using GMCPtr = std::shared_ptr<GlobalModuleContext>; +using Namespace = std::string; +using Key = std::string; class GPGFRONTEND_CORE_EXPORT ModuleManager : public QObject { Q_OBJECT @@ -70,6 +68,10 @@ class GPGFRONTEND_CORE_EXPORT ModuleManager : public QObject { std::optional<TaskRunnerPtr> GetTaskRunner(ModuleIdentifier); + bool UpsertRTValue(Namespace, Key, std::any); + + std::optional<std::any> RetrieveRTValue(Namespace, Key); + private: class Impl; std::unique_ptr<Impl> p_; @@ -98,6 +100,4 @@ void TriggerEvent(const EventIdentifier& event_id, Args&&... args) { std::move(MakeEvent(event_id, std::forward<Args>(args)...))); } -} // namespace GpgFrontend::Module - -#endif // GPGFRONTEND_MODULEMANAGER_H
\ No newline at end of file +} // namespace GpgFrontend::Module
\ No newline at end of file |