#pragma once #include #include #include "IGenerator.h" namespace mdd { template class Generator : public IGenerator { virtual std::shared_ptr Generate() { return std::make_shared(); } }; std::map>& GetGenerators( const std::string& name = "", const std::shared_ptr& generator = nullptr); template class GeneratorRegistration { public: GeneratorRegistration(const std::string& name) { GetGenerators(name, std::make_shared>()); } }; } #define ADD_GENERATOR(CLASS) namespace{mdd::GeneratorRegistration reg_sdewfdsf(#CLASS);}