testing: freebsd [travis skip]
[awesomized/libmemcached] / test / lib / Cluster.hpp
index c6c0cb926aa776b6d1672d4f4d51d4d128eba83a..4e151020c65cdc2a7c6dc747a973dc451de8f80d 100644 (file)
 class Cluster {
 public:
   explicit Cluster(Server serv, uint16_t cnt = 0);
-
+  explicit Cluster(vector<Server> servers);
   ~Cluster();
 
   Cluster(const Cluster &c) = delete;
   Cluster &operator=(const Cluster &c) = delete;
 
-  Cluster(Cluster &&c)
+  Cluster(Cluster &&c) noexcept
   : proto{} {
     *this = move(c);
   };
-  Cluster &operator=(Cluster &&c) {
+  Cluster &operator=(Cluster &&c) noexcept {
     count = exchange(c.count, 0);
     proto = exchange(c.proto, Server{});
     cluster = exchange(c.cluster, {});
@@ -42,14 +42,14 @@ public:
   const vector<Server> &getServers() const;
 
   bool start();
-  void stop();
-  void reset();
+  void stop(bool graceful = false);
   bool isStopped();
   bool isListening();
   void wait();
+  bool restart();
 
 private:
-  uint16_t count;
+  size_t count;
   Server proto;
   vector<Server> cluster;
   map<pid_t, Server *> pids;