X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=testing%2Flib%2FCluster.hpp;h=1bbc9d22325568a7c64369b068b1e64175377c26;hb=d1c9b695e9b3fbfcc94230a242b0290b43f27006;hp=416da13849067386af93ad13b34c1b67aba5c3a0;hpb=f33fd6e7d1df8e5878ce5c5605f64bab7b02ceb6;p=awesomized%2Flibmemcached diff --git a/testing/lib/Cluster.hpp b/testing/lib/Cluster.hpp index 416da138..1bbc9d22 100644 --- a/testing/lib/Cluster.hpp +++ b/testing/lib/Cluster.hpp @@ -6,15 +6,25 @@ class Cluster { public: explicit - Cluster(Server &&serv, uint16_t cnt = 0); + Cluster(Server serv, uint16_t cnt = 0); ~Cluster(); Cluster(const Cluster &c) = delete; Cluster &operator = (const Cluster &c) = delete; - Cluster(Cluster &&c) = default; - Cluster &operator = (Cluster &&c) = default; + Cluster(Cluster &&c) + : proto{} + { + *this = move(c); + }; + Cluster &operator = (Cluster &&c) { + count = exchange(c.count, 0); + proto = exchange(c.proto, Server{}); + cluster = exchange(c.cluster, {}); + pids = exchange(c.pids, {}); + return *this; + } const vector &getServers() const; @@ -30,4 +40,6 @@ private: Server proto; vector cluster; map pids; + + bool startServer(Server &server); };