Adding a few integration points to the C++ TSocketPool.

- Adding ability to use a vector of TSocketPoolServers to construct a TSocketPool
- Ability to get back the list of TSocketPoolServers

This is especially useful in multithreaded client code that
will just keep around the list of servers, and create the pool
on every request. Since TSocketPool updates the failure stuff,
we need a way to get back the updated TSocketPoolServers

Reviewed By: aditya

Test Plan: just compiling the code


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665537 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TSocketPool.cpp b/lib/cpp/src/transport/TSocketPool.cpp
index 6398052..d1d5bcd 100644
--- a/lib/cpp/src/transport/TSocketPool.cpp
+++ b/lib/cpp/src/transport/TSocketPool.cpp
@@ -57,7 +57,7 @@
   }
 }
 
-TSocketPool::TSocketPool(const vector<pair<string, int> > servers) : TSocket(),
+TSocketPool::TSocketPool(const std::vector<pair<string, int> >& servers) : TSocket(),
   numRetries_(1),
   retryInterval_(60),
   maxConsecutiveFailures_(1),
@@ -69,6 +69,16 @@
   }
 }
 
+TSocketPool::TSocketPool(const std::vector<TSocketPoolServer>& servers) : TSocket(),
+  servers_(servers),
+  numRetries_(1),
+  retryInterval_(60),
+  maxConsecutiveFailures_(1),
+  randomize_(true),
+  alwaysTryLast_(true)
+{
+}
+
 TSocketPool::TSocketPool(const string& host, int port) : TSocket(),
   numRetries_(1),
   retryInterval_(60),
@@ -87,6 +97,10 @@
   servers_.push_back(TSocketPoolServer(host, port));
 }
 
+std::vector<TSocketPoolServer> TSocketPool::getServers() {
+  return servers_;
+}
+
 void TSocketPool::setNumRetries(int numRetries) {
   numRetries_ = numRetries;
 }
diff --git a/lib/cpp/src/transport/TSocketPool.h b/lib/cpp/src/transport/TSocketPool.h
index bed4cca..2d0496b 100644
--- a/lib/cpp/src/transport/TSocketPool.h
+++ b/lib/cpp/src/transport/TSocketPool.h
@@ -65,7 +65,14 @@
     *
     * @param servers list of pairs of host name and port
     */
-   TSocketPool(const std::vector<std::pair<std::string, int> > servers);
+   TSocketPool(const std::vector<std::pair<std::string, int> >& servers);
+
+   /**
+    * Socket pool constructor
+    *
+    * @param servers list of TSocketPoolServers
+    */
+   TSocketPool(const std::vector<TSocketPoolServer>& servers);
 
    /**
     * Socket pool constructor
@@ -85,6 +92,12 @@
     */
    void addServer(const std::string& host, int port);
 
+
+   /**
+    * Get list of servers in this pool
+    */
+   std::vector<TSocketPoolServer> getServers();
+
    /**
     * Sets how many times to keep retrying a host in the connect function.
     */