From afcaa7bb07bf02bd4ebd2c0fd7287b408cbdf40b Mon Sep 17 00:00:00 2001 From: jvallve <jvallve@iri.upc.edu> Date: Thu, 12 May 2022 18:04:42 +0200 Subject: [PATCH] keeping debugging functions in factory --- include/core/common/factory.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/core/common/factory.h b/include/core/common/factory.h index 381edd63f..790ec3066 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; } -- GitLab