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/ProcessJob.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/ProcessJob.h b/SourceCode/Bond/Servo/ProcessJob.h
index da5db9b..062bd8b 100644
--- a/SourceCode/Bond/Servo/ProcessJob.h
+++ b/SourceCode/Bond/Servo/ProcessJob.h
@@ -85,6 +85,7 @@
class CProcessJob {
public:
// —— 构造 / 基本设置 ——
+ CProcessJob();
explicit CProcessJob(std::string pjId);
const std::string& id() const noexcept { return m_pjId; }
@@ -157,6 +158,15 @@
bool usesCarrierSlots() const noexcept { return !m_carriers.empty(); }
+ public:
+ // ====== 版本头常量(建议保留,便于兼容)======
+ static constexpr uint32_t PJ_FILE_MAGIC = 0x504A4A31; // "PJJ1"
+ static constexpr uint16_t PJ_FILE_VERSION = 0x0001;
+
+ // ====== 流式序列化接口 ======
+ void serialize(std::ostream& os) const;
+ static bool deserialize(std::istream& is, CProcessJob& out, std::string* err = nullptr);
+
private:
// 内部状态转移帮助
void markQueued();
--
Gitblit v1.9.3