MCPcopy Create free account
hub / github.com/comaps/comaps / GetAffiliations

Function GetAffiliations

generator/final_processor_utils.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54std::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

Callers

nothing calls this directly

Calls 6

SubmitMethod · 0.80
getMethod · 0.65
GetAffiliationsMethod · 0.45
emplace_backMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected