diff --git a/include/core/common/factory.h b/include/core/common/factory.h index 381edd63f1bb802b9b0b37e14d8c6b782d598089..790ec306644c12e607a4657859bedc8e360284aa 100644 --- a/include/core/common/factory.h +++ b/include/core/common/factory.h @@ -322,30 +322,30 @@ class Factory Factory(const Factory&) = delete; void operator=(Factory const&) = delete; private: - Factory() { } + Factory(); ~Factory(); }; template<class TypeBase, typename... TypeInput> -inline Factory<TypeBase, TypeInput...>::~Factory<TypeBase, TypeInput...>() +inline Factory<TypeBase, TypeInput...>::Factory() { - std::cout << " Factory destructor " << this->getClass() << std::endl; + //std::cout << " Factory constructor " << this->getClass() << std::endl; } template<class TypeBase, typename... TypeInput> -inline bool Factory<TypeBase, TypeInput...>::registerCreator(const std::string& _type, CreatorCallback createFn) +inline Factory<TypeBase, TypeInput...>::~Factory() { - printCallbacks(); - printAddress(); + //std::cout << " Factory destructor " << this->getClass() << std::endl; +} +template<class TypeBase, typename... TypeInput> +inline bool Factory<TypeBase, TypeInput...>::registerCreator(const std::string& _type, CreatorCallback createFn) +{ bool reg = get().callbacks_.insert(typename CallbackMap::value_type(_type, createFn)).second; if (reg) std::cout << std::setw(26) << std::left << get().getClass() << " <-- registered " << _type << std::endl; else std::cout << std::setw(26) << std::left << get().getClass() << " X-- skipping " << _type << ": already registered." << std::endl; - - printCallbacks(); - printAddress(); return reg; }