From f9a49043c35e73fc2d4ffb3ed9b39c33849c43b3 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 15 Dec 2023 21:14:17 +0800 Subject: fix: slove threading and memory issues --- src/core/module/Module.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/core/module/Module.h') diff --git a/src/core/module/Module.h b/src/core/module/Module.h index da87f88e..6cc1cc3f 100644 --- a/src/core/module/Module.h +++ b/src/core/module/Module.h @@ -41,7 +41,6 @@ using ModuleIdentifier = std::string; using ModuleVersion = std::string; using ModuleMetaData = std::map; using ModulePtr = std::shared_ptr; -using GMCPtr = std::shared_ptr; using TaskRunnerPtr = std::shared_ptr; @@ -52,26 +51,26 @@ class GPGFRONTEND_CORE_EXPORT Module : public QObject { ~Module(); - virtual bool Register() = 0; + virtual auto Register() -> bool = 0; - virtual bool Active() = 0; + virtual auto Active() -> bool = 0; - virtual int Exec(EventRefrernce) = 0; + virtual auto Exec(EventRefrernce) -> int = 0; - virtual bool Deactive() = 0; + virtual auto Deactive() -> bool = 0; - ModuleIdentifier GetModuleIdentifier() const; + [[nodiscard]] auto GetModuleIdentifier() const -> ModuleIdentifier; - void SetGPC(GMCPtr); + void SetGPC(GlobalModuleContext*); protected: - int getChannel(); + auto getChannel() -> int; - int getDefaultChannel(); + auto getDefaultChannel() -> int; - TaskRunnerPtr getTaskRunner(); + auto getTaskRunner() -> TaskRunnerPtr; - bool listenEvent(EventIdentifier); + auto listenEvent(EventIdentifier) -> bool; private: class Impl; -- cgit v1.2.3