Process current branches, removing those that are finished returns true if the branch list has branches remaining
| 915 | // returns true if the branch list has branches remaining |
| 916 | // |
| 917 | size_t NetworkSequenceCollection::processBranchesTrim() |
| 918 | { |
| 919 | size_t numBranchesRemoved = 0; |
| 920 | vector<BranchGroupMap::iterator> removeBranches; |
| 921 | // Check if any of the current branches have gone inactive |
| 922 | for (BranchGroupMap::iterator iter = m_activeBranchGroups.begin(); |
| 923 | iter != m_activeBranchGroups.end(); iter++) { |
| 924 | if(!iter->second.isActive()) |
| 925 | { |
| 926 | assert(iter->second.size() == 1); |
| 927 | if (AssemblyAlgorithms::processTerminatedBranchTrim( |
| 928 | this, iter->second[0])) |
| 929 | numBranchesRemoved++; |
| 930 | |
| 931 | // Mark the group for removal |
| 932 | removeBranches.push_back(iter); |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | // Remove all the finished branches |
| 937 | for (vector<BranchGroupMap::iterator>::iterator rmIter |
| 938 | = removeBranches.begin(); |
| 939 | rmIter != removeBranches.end(); rmIter++) |
| 940 | m_activeBranchGroups.erase(*rmIter); |
| 941 | return numBranchesRemoved; |
| 942 | } |
| 943 | |
| 944 | /** Discover bubbles to pop. */ |
| 945 | size_t NetworkSequenceCollection:: |