| | |
| | | m_tEnd = src.m_tEnd; |
| | | } |
| | | |
| | | void CControlJob::setId(std::string& id) |
| | | { |
| | | m_cjId = trimCopy(id); |
| | | clampString(m_cjId, MAX_ID_LEN); |
| | | } |
| | | |
| | | bool CControlJob::addPJ(const std::string& pjId) { |
| | | if (pjId.empty()) return false; |
| | | auto id = pjId; |
| | |
| | | return true; |
| | | } |
| | | |
| | | bool CControlJob::addPjPointer(CProcessJob* pj) |
| | | { |
| | | for (auto item : m_pjs) { |
| | | if (item->id().compare(pj->id()) == 0) return false; |
| | | } |
| | | |
| | | m_pjs.push_back(pj); |
| | | return true; |
| | | } |
| | | |
| | | bool CControlJob::removePjPointer(const std::string& id) |
| | | { |
| | | for(auto iter = m_pjs.begin(); iter != m_pjs.end(); ++iter) { |
| | | if ((*iter)->id().compare(id) == 0) { |
| | | m_pjs.erase(iter); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | bool CControlJob::removePJ(const std::string& pjId) { |
| | | auto it = std::find(m_pjIds.begin(), m_pjIds.end(), pjId); |
| | | if (it == m_pjIds.end()) return false; |
| | |
| | | const std::vector<CControlJob::ValidationIssue>& CControlJob::issues() |
| | | { |
| | | return m_issues; |
| | | } |
| | | |
| | | void CControlJob::clearIssues() |
| | | { |
| | | m_issues.clear(); |
| | | } |
| | | |
| | | bool CControlJob::validateForCreate( |
| | |
| | | return true; |
| | | } |
| | | |
| | | bool CControlJob::abort() { |
| | | bool CControlJob::abort(std::string reason) { |
| | | if (m_state == CJState::Completed || m_state == CJState::Aborted || m_state == CJState::Failed) |
| | | return false; |
| | | m_failReason = trimCopy(reason); |
| | | clampString(m_failReason, 128); |
| | | m_state = CJState::Aborted; |
| | | markEnd(); |
| | | return true; |