Add legislator factory
This commit is contained in:
1 parent
d7b740b86e
commit
1f2cf940ce
8 files changed
+69
-14
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "legislator.hh"
|
||||
#include "config/config.hh"
|
||||
|
||||
namespace paxos
|
||||
{
|
||||
class LegislatorFactory
|
||||
{
|
||||
public:
|
||||
static shared_legislator Create(LegislatorConfig& config);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "legislator.hh"
|
||||
|
||||
namespace paxos
|
||||
{
|
||||
Legislator::Legislator(const LegislatorConfig& config)
|
||||
: config_(config)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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>;
|
||||
}
|
||||