LAPTOP-SNT8I5JK\Boounion
2025-09-19 81df82be1f5f401b80780f65e5811685d9a8e4c4
SourceCode/Bond/Servo/ProcessJob.cpp
@@ -186,9 +186,11 @@
        return true;
    }
    bool CProcessJob::abort() {
    bool CProcessJob::abort(std::string reason) {
        if (m_state == PJState::Completed || m_state == PJState::Aborted || m_state == PJState::Failed)
            return false;
        m_failReason = trimCopy(reason);
        clampString(m_failReason, 128);
        m_state = PJState::Aborted;
        markEnd();
        return true;
@@ -275,6 +277,31 @@
        }
    }
    bool CProcessJob::setCarrierSlotsAndContexts(std::string carrierId, std::vector<uint8_t> slots, std::vector<void*> contexts)
    {
        for (auto& c : m_carriers) {
            if (c.carrierId.compare(carrierId) == 0) {
                c.slots = std::move(slots);
                c.contexts = std::move(contexts);
                return true;
            }
        }
        return false;
    }
    bool CProcessJob::setCarrierContexts(std::string carrierId, std::vector<void*> contexts)
    {
        for (auto& c : m_carriers) {
            if (c.carrierId.compare(carrierId) == 0) {
                c.contexts = std::move(contexts);
                return true;
            }
        }
        return false;
    }
    // --------- 核心:serialize/deserialize ---------
    void CProcessJob::serialize(std::ostream& os) const {
        // ͷ