projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
missing inttypes.h
[awesomized/libmemcached]
/
test
/
lib
/
Cluster.hpp
diff --git
a/test/lib/Cluster.hpp
b/test/lib/Cluster.hpp
index c6c0cb926aa776b6d1672d4f4d51d4d128eba83a..ab20108c17d447a50532209c53a4b22fa2e75043 100644
(file)
--- a/
test/lib/Cluster.hpp
+++ b/
test/lib/Cluster.hpp
@@
-20,18
+20,17
@@
class Cluster {
public:
class Cluster {
public:
- explicit Cluster(Server serv, uint16_t cnt = 0);
-
+ explicit Cluster(Server serv, size_t cnt = 3);
~Cluster();
Cluster(const Cluster &c) = delete;
Cluster &operator=(const Cluster &c) = delete;
~Cluster();
Cluster(const Cluster &c) = delete;
Cluster &operator=(const Cluster &c) = delete;
- Cluster(Cluster &&c)
+ Cluster(Cluster &&c)
noexcept
: proto{} {
*this = move(c);
};
: 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, {});
count = exchange(c.count, 0);
proto = exchange(c.proto, Server{});
cluster = exchange(c.cluster, {});
@@
-42,17
+41,16
@@
public:
const vector<Server> &getServers() const;
bool start();
const vector<Server> &getServers() const;
bool start();
- void stop();
- void reset();
+ void stop(bool graceful = false);
bool isStopped();
bool isStopped();
- bool isListening();
+ bool isListening() const;
+ bool ensureListening();
void wait();
void wait();
+ bool restart();
private:
private:
-
uint16
_t count;
+
size
_t count;
Server proto;
vector<Server> cluster;
map<pid_t, Server *> pids;
Server proto;
vector<Server> cluster;
map<pid_t, Server *> pids;
-
- bool startServer(Server &server);
};
};