| 52 | } |
| 53 | |
| 54 | std::vector<std::vector<std::string>> GetAffiliations(std::vector<FeatureBuilder> const & fbs, |
| 55 | AffiliationInterface const & affiliation, size_t threadsCount) |
| 56 | { |
| 57 | base::ComputationalThreadPool pool(threadsCount); |
| 58 | std::vector<std::future<std::vector<std::string>>> futuresAffiliations; |
| 59 | for (auto const & fb : fbs) |
| 60 | { |
| 61 | auto result = pool.Submit([&]() { return affiliation.GetAffiliations(fb); }); |
| 62 | futuresAffiliations.emplace_back(std::move(result)); |
| 63 | } |
| 64 | |
| 65 | std::vector<std::vector<std::string>> resultAffiliations; |
| 66 | resultAffiliations.reserve(futuresAffiliations.size()); |
| 67 | for (auto & f : futuresAffiliations) |
| 68 | resultAffiliations.emplace_back(f.get()); |
| 69 | |
| 70 | return resultAffiliations; |
| 71 | } |
| 72 | } // namespace generator |
nothing calls this directly
no test coverage detected