24 TCS_EXCEPTION(
"AlgFactory: algorithm " <<
algName <<
" already exists. Serious configuration error.")
28 const auto&
it = m_callMap.find(algType);
31 if (
it == m_callMap.end()) {
32 std::cout <<
"Registered algorithms are:" << std::endl;
33 for(
const auto &
x: m_callMap)
34 std::cout <<
" " <<
x.first << std::endl;
35 TCS_EXCEPTION(
"AlgFactory: trying to instantiate algorithm of type " << algType <<
" with name " <<
algName <<
", but it has not been registered.");
39 auto [itr,inserted] = m_algs.emplace(
algName, std::move(createdAlg));
41 return itr->second.get();
47 const auto& [itr, inserted] = m_callMap.emplace(algType, creator);
50 TCS_EXCEPTION (
"TCS::AlgFactory: registration of algorithm " << algType <<
" failed since it already exists");
55 std::vector<std::string>
57 std::vector<std::string> classNames;
58 classNames.reserve(m_callMap.size());
59 for (
const auto& [
key,
_] : m_callMap) {
60 classNames.push_back(
key);
67 auto findRes = m_algs.find(
algName);
69 if(findRes == m_algs.end())
72 return findRes->second.get();
78 for(
const auto& [
name,
alg] : m_algs) {
79 std::cout <<
name <<
" --> " <<
alg->fullname() << std::endl;