diff --git a/src/GraphCtrl/GraphPipeline/_GStroage/GStorage.h b/src/GraphCtrl/GraphPipeline/_GStroage/GStorage.h index ae386e89..1ade3082 100644 --- a/src/GraphCtrl/GraphPipeline/_GStroage/GStorage.h +++ b/src/GraphCtrl/GraphPipeline/_GStroage/GStorage.h @@ -21,6 +21,7 @@ class GPipeline; class GStorage : public GraphObject { protected: explicit GStorage() = default; + ~GStorage() override = default; /** * 保存 @@ -65,12 +66,53 @@ class GStorage : public GraphObject { * @return */ static CStatus loadBuffer(GPipeline* pipeline, char* buffer, CSize size); + + /** + * 加载 element 信息 + * @param pipeline + * @param storage + * @return + */ static CStatus loadElement(GPipeline* pipeline, const _GPipelineStorage& storage); + + /** + * 加载 event 信息 + * @param pipeline + * @param storage + * @return + */ static CStatus loadEvent(GPipeline* pipeline, const _GPipelineStorage& storage); + + /** + * 加载 GParam 信息 + * @param pipeline + * @param storage + * @return + */ static CStatus loadParam(GPipeline* pipeline, const _GPipelineStorage& storage); + + /** + * + * @param pipeline + * @param storage + * @return + */ static CStatus loadDaemon(GPipeline* pipeline, const _GPipelineStorage& storage); + + /** + * 加载 stage 信息 + * @param pipeline + * @param storage + * @return + */ static CStatus loadStage(GPipeline* pipeline, const _GPipelineStorage& storage); + /** + * 加载 aspect 信息 + * @param element + * @param aspStorages + * @return + */ static CStatus loadAspect(GElementPtr element, const std::vector<_GAspectStorage>& aspStorages); friend class GPipeline; diff --git a/src/GraphCtrl/GraphPipeline/_GStroage/GStorageFactory.h b/src/GraphCtrl/GraphPipeline/_GStroage/GStorageFactory.h index 4c2bb9ad..b68912cf 100644 --- a/src/GraphCtrl/GraphPipeline/_GStroage/GStorageFactory.h +++ b/src/GraphCtrl/GraphPipeline/_GStroage/GStorageFactory.h @@ -58,7 +58,8 @@ class GStorageFactory : public GraphObject { friend class GStorage; }; -#define CGRAPH_REGISTER_META_TYPE(_CLZ) GStorageFactory::registerMetaType<_CLZ>(); \ +#define CGRAPH_REGISTER_META_TYPE(...) \ + do { GStorageFactory::registerMetaType<__VA_ARGS__>(); } while (0) \ CGRAPH_NAMESPACE_END diff --git a/tutorial/T16-MessageSendRecv.cpp b/tutorial/T16-MessageSendRecv.cpp index 59c34d90..a3f5959e 100644 --- a/tutorial/T16-MessageSendRecv.cpp +++ b/tutorial/T16-MessageSendRecv.cpp @@ -40,7 +40,7 @@ void recv_message() { void tutorial_message_send_recv() { - CGRAPH_CREATE_MESSAGE_TOPIC(MyMessageParam, "send-recv", 48) // 创建一个topic,也在算子中实现创建流程 + CGRAPH_CREATE_MESSAGE_TOPIC(MyMessageParam, "send-recv", 48) // 创建一个topic,也可以在算子中进行创建 std::thread sendThd = std::thread(send_message); std::thread recvThd = std::thread(recv_message);