Adding a copy of memcached to the tree.
[m6w6/libmemcached] / libtest / server_container.h
index 9c9922ed0ed6b30c1a58b51e052826d7b6affaa9..29ecb97d689ecbaf34beae6bbd71b56c1375e865 100644 (file)
@@ -35,9 +35,11 @@ namespace libtest {
 class server_startup_st
 {
 private:
+  uint64_t _magic;
   std::string server_list;
   bool _socket;
   bool _sasl;
+  uint32_t _count;
   std::string _username;
   std::string _password;
 
@@ -46,21 +48,27 @@ public:
   uint8_t udp;
   std::vector<Server *> servers;
 
-  server_startup_st() :
-    _socket(false),
-    _sasl(false),
-    udp(0)
-  { }
+  server_startup_st();
+  ~server_startup_st();
+
+  bool validate();
 
   bool start_socket_server(const std::string& server_type, const in_port_t try_port, int argc, const char *argv[]);
 
-  std::string option_string() const;
+  uint32_t count() const
+  {
+    return _count;
+  }
 
-  size_t count() const
+  void set_count(uint32_t arg)
   {
-    return servers.size();
+    _count= arg;
   }
 
+  void restart();
+
+  std::string option_string() const;
+
   const std::string& password() const
   {
     return _password;
@@ -99,11 +107,12 @@ public:
   }
 
 
-  void shutdown(bool remove= false);
+  void shutdown_and_remove();
+  void shutdown();
+  bool shutdown(uint32_t number_of_host);
+
   void push_server(Server *);
   Server *pop_server();
-
-  ~server_startup_st();
 };
 
 bool server_startup(server_startup_st&, const std::string&, in_port_t try_port, int argc, const char *argv[]);