24 assert(pHistMap.empty() != pHistVector.empty());
25 for (ProcessHistoryVector::const_iterator
i = pHistVector.begin(),
e = pHistVector.end();
i !=
e; ++
i) {
26 pHistMap.insert(std::make_pair(
i->id(), *
i));
29 for (ProcessHistoryMap::const_iterator
i = pHistMap.begin(),
e = pHistMap.end();
i !=
e; ++
i) {
34 newHist.
emplace_back(it->processName(), newPsetID, it->releaseVersion(), it->passID());
38 pHistVector.push_back(
std::move(newHist));
39 if (newphID != oldphID) {
43 assert(pHistVector.size() == pHistMap.size());
48 typedef std::set<OneHistory> Histories;
49 typedef std::pair<std::string, BranchID> Product;
50 typedef std::vector<Product> OrderedProducts;
52 explicit Sorter(Histories
const& histories) : histories_(histories) {}
53 bool operator()(Product
const&
a, Product
const&
b)
const;
54 Histories
const histories_;
56 bool Sorter::operator()(Product
const&
a, Product
const&
b)
const {
58 if (
a.first ==
b.first)
60 bool mayBeTrue =
false;
61 for (Histories::const_iterator it = histories_.begin(), itEnd = histories_.end(); it != itEnd; ++it) {
62 OneHistory::const_iterator itA =
find_in_all(*it,
a.first);
65 OneHistory::const_iterator itB =
find_in_all(*it,
b.first);
80 procConfigVector.clear();
81 std::set<ProcessConfiguration> pcset;
82 for (
auto const& history : pHistVec) {
83 for (
auto const&
process : history) {
84 if (pcset.insert(
process).second) {
85 procConfigVector.push_back(
process);
91 void fillListsAndIndexes(ProductRegistry& productRegistry,
93 std::shared_ptr<BranchIDLists const>& branchIDLists,
94 std::vector<BranchListIndex>& branchListIndexes) {
95 OrderedProducts orderedProducts;
96 std::set<std::string> processNamesThatProduced;
98 for (
auto&
item : prodList) {
99 BranchDescription&
prod =
item.second;
102 processNamesThatProduced.insert(
prod.processName());
103 orderedProducts.emplace_back(
prod.processName(),
prod.branchID());
106 assert(!orderedProducts.empty());
107 Histories processHistories;
109 for (ProcessHistoryMap::const_iterator it = pHistMap.begin(), itEnd = pHistMap.end(); it != itEnd; ++it) {
111 OneHistory processHistory;
113 if (processNamesThatProduced.find(
i->processName()) != processNamesThatProduced.end()) {
114 processHistory.push_back(
i->processName());
117 max = (processHistory.size() >
max ? processHistory.size() :
max);
118 assert(
max <= processNamesThatProduced.size());
119 if (processHistory.size() > 1) {
120 processHistories.insert(processHistory);
125 auto pv = std::make_unique<BranchIDLists>();
126 auto p = std::make_unique<BranchIDList>();
129 for (OrderedProducts::const_iterator it = orderedProducts.begin(), itEnd = orderedProducts.end(); it != itEnd;
133 branchListIndexes.push_back(blix);
140 p->push_back(it->second.id());
142 branchListIndexes.push_back(blix);
144 branchIDLists.reset(
pv.release());
154 : parameterSetIdConverter_(parameterSetIdConverter),
155 processHistoryIdConverter_(),
157 branchListIndexes_() {
159 fillProcessConfiguration(pHistVector, procConfigVector);
160 if (fullConversion) {