Add legislator factory

This commit is contained in:
juju committed 2020-05-05 14:47:12 +02:00
1 parent d7b740b86e
commit 1f2cf940ce
8 files changed
+69 -14

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#include <memory>
#include "legislator-factory.hh"
namespace paxos
{
shared_legislator LegislatorFactory::Create(LegislatorConfig& config)
{
auto shared = std::make_shared<Legislator>(config);
return shared;
}
}
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include "legislator.hh"
#include "config/config.hh"
namespace paxos
{
class LegislatorFactory
{
public:
static shared_legislator Create(LegislatorConfig& config);
};
}
+9
View File
@@ -0,0 +1,9 @@
#include "legislator.hh"
namespace paxos
{
Legislator::Legislator(const LegislatorConfig& config)
: config_(config)
{
}
}
+5 -3
View File
@@ -1,12 +1,14 @@
#pragma once
#include "legislator-config.hh"
#include "config/config.hh"
namespace paxos
{
class Legislator
{
public:
LegislatorConfig config;
Legislator(const LegislatorConfig& config);
LegislatorConfig config_;
}
};
using shared_legislator = std::shared_ptr<Legislator>;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.