//-------------------------------------------- //Parameters: nKey[In] 工况的唯一标记Key // return: // Memo: 查找this工况的子孙工况的唯一标记Key=nKey的工况 // //--------------------------------------------- Scenario* Scenario::LookUp(int nKey) { if(m_nKey == nKey) { return this; } else { POSITION pos = m_childList.GetHeadPosition(); Scenario *pChild = NULL; Scenario *pFind = NULL; while(pos) { pChild = m_childList.GetNext(pos); pFind = pChild->LookUp(nKey); if(pFind != NULL) break; } return pFind; } }