Revision cfdc7053f2bba3965c665328fc1d014f44cab16b authored by Lonca Emmanuel on 17 March 2021, 12:16:06 UTC, committed by Lonca Emmanuel on 17 March 2021, 12:16:06 UTC
1 parent 76983f8
StatMapFactory.h
#ifndef __STAT_MAP_FACTORY_H__
#define __STAT_MAP_FACTORY_H__
#include <memory>
#include "DefaultStatMap.h"
#include "FakeStatMap.h"
#include "LogStatMap.h"
namespace CoQuiAAS {
class StatMapFactory {
public:
static void createInstance(bool isFake) {
if(isFake)
StatMapFactory::instance = std::shared_ptr<StatMap>(std::make_shared<FakeStatMap>());
else
StatMapFactory::instance = std::shared_ptr<StatMap>(std::make_shared<LogStatMap>(stdout));
}
static std::shared_ptr<StatMap> getInstance() {
return StatMapFactory::instance;
}
public:
static std::shared_ptr<StatMap> instance;
};
std::shared_ptr<StatMap> StatMapFactory::instance = nullptr;
}
#endif /* #ifndef __STAT_MAP_FACTORY_H__ */
Computing file changes ...