From 0569c29b19e4d23f055845a167c706f11590fa2a Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 19 八月 2025 15:55:00 +0800
Subject: [PATCH] 1.CControlJob和CProcessJob的序列化和反序列化;

---
 SourceCode/Bond/Servo/CControlJob.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CControlJob.h b/SourceCode/Bond/Servo/CControlJob.h
index a9611a4..c5fdf60 100644
--- a/SourceCode/Bond/Servo/CControlJob.h
+++ b/SourceCode/Bond/Servo/CControlJob.h
@@ -36,6 +36,7 @@
     /// CControlJob:Control Job 管理类
     class CControlJob {
     public:
+        CControlJob();
         explicit CControlJob(std::string cjId);
         explicit CControlJob(CControlJob& src);
 
@@ -111,12 +112,18 @@
         static void clampString(std::string& s, size_t maxLen);
         static bool asciiPrintable(const std::string& s);
 
+        static constexpr uint32_t CJ_MAGIC = 0x434A5031; // "CJP1"
+        static constexpr uint16_t CJ_VERSION = 0x0001;
+
+        void serialize(std::ostream& os) const;
+        static bool deserialize(std::istream& is, CControlJob& out, std::string* err = nullptr);
+
     private:
         void markQueued();
         void markStart();
         void markEnd();
 
-    private:
+    protected:
         // —— 标识 & 配置 —— //
         std::string m_cjId;
         uint8_t     m_priority{ 5 }; // 缺省优先级(自定)

--
Gitblit v1.9.3