flush [ci skip]
[awesomized/libmemcached] / testing / lib / Cluster.hpp
1 #pragma once
2
3 #include "common.hpp"
4 #include "Server.hpp"
5
6 class Cluster {
7 public:
8 explicit
9 Cluster(Server &&serv, uint16_t cnt = 0);
10
11 ~Cluster();
12
13 Cluster(const Cluster &c) = delete;
14 Cluster &operator = (const Cluster &c) = delete;
15
16 Cluster(Cluster &&c) = default;
17 Cluster &operator = (Cluster &&c) = default;
18
19 const vector<Server> &getServers() const;
20
21 bool start();
22 void stop();
23 void reset();
24 bool isStopped();
25 bool isListening();
26 void wait();
27
28 private:
29 uint16_t count;
30 Server proto;
31 vector<Server> cluster;
32 map<pid_t, Server *> pids;
33 };