void BadUserDialog::GetIds(IdList &theList) { ListArea *aList = mIsSimple?mSimpleUserList.get():mUserList.get(); theList.clear(); aList->RewindSelections(); while(aList->HasMoreSelections()) { BadUserItem *anItem = (BadUserItem *)aList->GetNextSelection(); theList.push_back(anItem->mColInt[1]); } }
IdList Repository::idsOfAllChildrenOf(Id id) const { IdList result; result.clear(); result.append(id); IdList list = mObjects[id]->children(); for (const Id &childId : list) { result.append(idsOfAllChildrenOf(childId)); } return result; }
void FunctionDefinitionRecursion::determineCycles(const Model& m) { IdIter it; IdRange range; IdList variables; IdMap logged; std::string id; variables.clear(); /* create a list of variables that are cycles ie (x, x) */ for (it = mIdMap.begin(); it != mIdMap.end(); it++) { if ((*it).first == (*it).second) { id = (*it).first; if (!variables.contains(id)) { variables.append(id); } } } /* loop thru other dependencies for each; if the dependent is also * in the list then this is the cycle * keep a record of logged dependencies to avoid logging twice */ for (unsigned int n = 0; n < variables.size(); n++) { id = variables.at((int)n); range = mIdMap.equal_range(id); for (it = range.first; it != range.second; it++) { if (((*it).second != id) && (variables.contains((*it).second)) && !alreadyExistsInMap(logged, pair<const std::string, std::string>(id, (*it).second)) && !alreadyExistsInMap(logged, pair<const std::string, std::string>((*it).second, id))) { logCycle(m.getFunctionDefinition(id), m.getFunctionDefinition((*it).second)); logged.insert(pair<const std::string, std::string>(id, (*it).second)); } } } }
void Debugger::GetSessionList(IdList& output) const { output.clear(); for (auto& itr : m_sessions) output.push_back(itr.first); }