From 100931d6912d8f215215805eb1e823c9c0b96ca7 Mon Sep 17 00:00:00 2001 From: ChunelFeng Date: Sat, 2 Mar 2024 22:55:12 +0800 Subject: [PATCH] [bugfix] fix GMutable isSerializable --- src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.cpp | 8 +++++++- src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.cpp b/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.cpp index c6b815e8..aa103819 100644 --- a/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.cpp +++ b/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.cpp @@ -32,6 +32,7 @@ CStatus GMutable::addElement(GElementPtr element) { CStatus GMutable::init() { CGRAPH_FUNCTION_BEGIN + CGRAPH_ASSERT_NOT_NULL(manager_) manager_->setThreadPool(thread_pool_); status = manager_->initEngine(); CGRAPH_FUNCTION_CHECK_STATUS @@ -43,7 +44,6 @@ CStatus GMutable::init() { CStatus GMutable::run() { CGRAPH_FUNCTION_BEGIN - CGRAPH_ASSERT_NOT_NULL(manager_) /** * 1. 初始化内容 @@ -71,6 +71,12 @@ CStatus GMutable::destroy() { } +CBool GMutable::isSerializable() const { + // 情况随时可能发生变化,直接设定不可以 serialize 即可 + return false; +} + + CVoid GMutable::setup() { for (auto* element : group_elements_arr_) { element->run_before_.clear(); diff --git a/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.h b/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.h index b4b4942d..2c94fd42 100644 --- a/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.h +++ b/src/GraphCtrl/GraphElement/GGroup/GMutable/GMutable.h @@ -36,6 +36,8 @@ class GMutable : public GGroup { CStatus destroy() final; + CBool isSerializable() const override; + /** * 将数据进行恢复 * @return