From d68541dce155a682f65b7c3fbfbfbeef17ea5b8f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 12 五月 2025 12:00:41 +0800
Subject: [PATCH] 1.StoredJob, Fetched out Job实现; 2.CStep增加定制的Attribute, 以便通过的Step不使用getAttributeVector也能添加不一样的Attribute;
---
SourceCode/Bond/Servo/CGlass.cpp | 66 ++++++++++++++++++++++++++++++++-
1 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index b7d05fe..a21bd7b 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -5,12 +5,18 @@
namespace SERVO {
CGlass::CGlass()
{
-
+ m_pPath = nullptr;
}
CGlass::~CGlass()
{
-
+ CPath* pPath = m_pPath;
+ while (pPath != nullptr) {
+ CPath* pTemp = pPath->getNext();
+ delete pPath;
+ pPath = pTemp;
+ }
+ m_pPath = nullptr;
}
std::string& CGlass::getClassName()
@@ -38,4 +44,60 @@
{
return m_strID;
}
+
+ CPath* CGlass::getPathWithSiteID(unsigned int nSiteId)
+ {
+ CPath* pPath = m_pPath;
+ while (pPath != nullptr) {
+ if (nSiteId == pPath->getSiteID()) {
+ return pPath;
+ }
+ pPath = pPath->getNext();
+ }
+
+ return nullptr;
+ }
+
+ CPath* CGlass::getPath()
+ {
+ return m_pPath;
+ }
+
+ void CGlass::addPath(unsigned int nSiteId)
+ {
+ CPath* pPath = new CPath(nSiteId);
+ if (m_pPath == nullptr) {
+ m_pPath = pPath;
+ }
+ else {
+ m_pPath->addPath(pPath);
+ }
+ }
+
+ void CGlass::serialize(CArchive& ar)
+ {
+ if (ar.IsStoring())
+ {
+ Lock();
+ WriteString(ar, m_strID);
+ ar << (ULONGLONG)m_pPath;
+ if (m_pPath != nullptr) {
+ m_pPath->serialize(ar);
+ }
+ Unlock();
+ }
+ else
+ {
+ Lock();
+ ReadString(ar, m_strID);
+ ULONGLONG ullPath;
+ ar >> ullPath;
+ if (ullPath != 0) {
+ m_pPath = new CPath();
+ m_pPath->serialize(ar);
+ }
+
+ Unlock();
+ }
+ }
}
--
Gitblit v1.9.3