if (!count) {
count = 1;
}
- reset();
+ for (int i = 0; i < count; ++i) {
+ cluster.push_back(proto);
+ }
+}
+
+Cluster::Cluster(vector<Server> servers)
+: count{servers.size()}
+, cluster{move(servers)}
+{
+
}
Cluster::~Cluster() {
return cluster;
}
-void Cluster::reset() {
- pids.clear();
- cluster.clear();
- for (int i = 0; i < count; ++i) {
- cluster.push_back(proto);
- }
-}
-
bool Cluster::start() {
bool started = true;