#include "pool_factory.hpp" const char* PoolFactory::MINING_POOL_NAME_OCEAN = "ocean"; const char* PoolFactory::MINING_POOL_NAME_NODERUNNERS = "noderunners"; const char* PoolFactory::MINING_POOL_NAME_BRAIINS = "braiins"; std::unique_ptr PoolFactory::createPool(const std::string& poolName) { static const std::unordered_map()>> poolFactories = { {MINING_POOL_NAME_OCEAN, []() { return std::make_unique(); }}, {MINING_POOL_NAME_NODERUNNERS, []() { return std::make_unique(); }}, {MINING_POOL_NAME_BRAIINS, []() { return std::make_unique(); }} }; auto it = poolFactories.find(poolName); if (it == poolFactories.end()) { return nullptr; } return it->second(); }