Как должен выглядеть интерфейс IChartCreatorsFactory на класс ChartCreatorsFactory…
- User
Как должен выглядеть интерфейс IChartCreatorsFactory на класс ChartCreatorsFactory
#include
#include "ChartCreators/ichartcreator.h" #include "ChartCreators/barchartcreator.h" #include "ChartCreators/piechartcreator.h" #include "ChartData/charttype.h"
using std::shared_ptr; using std::make_shared;
class ChartCreatorsFactory: public IChartCreatorsFactory{ private: using CreatorFunc = std::function<std::shared_ptr()>; std::unordered_map<ChartType, CreatorFunc> creators;
public: template void registerReader(const ChartType& type) { creators[type] = { return std::make_shared(); }; }
codeChartCreatorsFactory(); std::shared_ptr<IChartCreator> getCreator(const ChartType& type) const;};
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.