| | |
| | | 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; |