39859b7d90aee4e9bd162ba305a84210a10abf42
[m6w6/libmemcached] / testing / lib / MemcachedCluster.hpp
1 #pragma once
2
3 #include "common.hpp"
4 #include "Cluster.hpp"
5 #include "ReturnMatcher.hpp"
6
7
8 class MemcachedCluster {
9 public:
10 Cluster cluster;
11 memcached_st memc{empty_memc};
12 ReturnMatcher returns{&memc};
13
14 MemcachedCluster();
15 explicit
16 MemcachedCluster(Cluster &&cluster);
17 ~MemcachedCluster();
18
19 MemcachedCluster(const MemcachedCluster &) = delete;
20 MemcachedCluster &operator=(const MemcachedCluster &) = delete;
21
22 MemcachedCluster(MemcachedCluster &&mc);;
23 MemcachedCluster &operator=(MemcachedCluster &&mc);
24
25 void enableBinaryProto(bool enable = true);
26 void enableBuffering(bool enable = true);
27 void enableReplication();
28 void flush();
29
30 static MemcachedCluster mixed();
31 static MemcachedCluster network();
32 static MemcachedCluster socket();
33
34 #if LIBMEMCACHED_WITH_SASL_SUPPORT
35 static MemcachedCluster sasl();
36 #endif
37
38 private:
39 static const memcached_st empty_memc;
40
41 void init();
42 };