swh:1:snp:5c81b35c32cd128e955f4da753d99c09557a4451
Tip revision: 7e149916f56918f135b5259c3fb0b3f7119f8d07 authored by Lonca Emmanuel on 24 March 2021, 14:04:19 UTC
bumped version number to 3.0.3-dev
bumped version number to 3.0.3-dev
Tip revision: 7e14991
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__ */