aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/module/ModuleManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/module/ModuleManager.cpp')
-rw-r--r--src/core/module/ModuleManager.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/module/ModuleManager.cpp b/src/core/module/ModuleManager.cpp
index 0bf9e972..20f9ab28 100644
--- a/src/core/module/ModuleManager.cpp
+++ b/src/core/module/ModuleManager.cpp
@@ -28,11 +28,12 @@
#include "ModuleManager.h"
-#include <memory>
+#include <boost/format.hpp>
#include "core/module/GlobalModuleContext.h"
#include "core/module/GlobalRegisterTable.h"
#include "core/module/Module.h"
+#include "core/thread/Task.h"
#include "core/thread/TaskRunner.h"
namespace GpgFrontend::Module {
@@ -88,6 +89,10 @@ class ModuleManager::Impl {
return grt_->LookupKV(n, k);
}
+ bool ListenPublish(QObject* o, Namespace n, Key k, LPCallback c) {
+ return grt_->ListenPublish(o, n, k, c);
+ }
+
private:
static ModuleMangerPtr global_module_manager_;
TaskRunnerPtr task_runner_;
@@ -95,6 +100,12 @@ class ModuleManager::Impl {
GRTPtr grt_;
};
+bool UpsertRTValueTyped(const std::string& namespace_, const std::string& key,
+ const std::any& value) {
+ return ModuleManager::GetInstance()->UpsertRTValue(namespace_, key,
+ std::any(value));
+}
+
ModuleManager::ModuleManager() : p_(std::make_unique<Impl>()) {}
ModuleManager::~ModuleManager() = default;
@@ -129,4 +140,15 @@ std::optional<std::any> ModuleManager::RetrieveRTValue(Namespace n, Key k) {
return p_->RetrieveRTValue(n, k);
}
+bool ModuleManager::ListenPublish(QObject* o, Namespace n, Key k,
+ LPCallback c) {
+ return p_->ListenPublish(o, n, k, c);
+}
+
+ModuleIdentifier GetRealModuleIdentifier(const ModuleIdentifier& id) {
+ // WARNING: when YOU need to CHANGE this line, YOU SHOULD change the same code
+ // in Module.cpp as well.
+ return (boost::format("__module_%1%") % id).str();
+}
+
} // namespace GpgFrontend::Module \ No newline at end of file