Repository: thrift
Updated Branches:
  refs/heads/master 0a8c34cee -> 82ae9575c


http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/test/cpp/src/StressTestNonBlocking.cpp
----------------------------------------------------------------------
diff --git a/test/cpp/src/StressTestNonBlocking.cpp 
b/test/cpp/src/StressTestNonBlocking.cpp
index 1ebb9e0..e68988f 100644
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -33,11 +33,10 @@
 #include <thrift/transport/TTransportUtils.h>
 #include <thrift/transport/TFileTransport.h>
 #include <thrift/TLogging.h>
+#include <thrift/stdcxx.h>
 
 #include "Service.h"
 
-#include <boost/shared_ptr.hpp>
-
 #include <iostream>
 #include <set>
 #include <stdexcept>
@@ -110,8 +109,8 @@ private:
 
 class ClientThread : public Runnable {
 public:
-  ClientThread(boost::shared_ptr<TTransport> transport,
-               boost::shared_ptr<ServiceClient> client,
+  ClientThread(stdcxx::shared_ptr<TTransport> transport,
+               stdcxx::shared_ptr<ServiceClient> client,
                Monitor& monitor,
                size_t& workerCount,
                size_t loopCount,
@@ -222,8 +221,8 @@ public:
     }
   }
 
-  boost::shared_ptr<TTransport> _transport;
-  boost::shared_ptr<ServiceClient> _client;
+  stdcxx::shared_ptr<TTransport> _transport;
+  stdcxx::shared_ptr<ServiceClient> _client;
   Monitor& _monitor;
   size_t& _workerCount;
   size_t _loopCount;
@@ -345,24 +344,24 @@ int main(int argc, char** argv) {
     cerr << usage.str();
   }
 
-  boost::shared_ptr<PlatformThreadFactory> threadFactory
-      = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
+  stdcxx::shared_ptr<PlatformThreadFactory> threadFactory
+      = stdcxx::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
 
   // Dispatcher
-  boost::shared_ptr<Server> serviceHandler(new Server());
+  stdcxx::shared_ptr<Server> serviceHandler(new Server());
 
   if (replayRequests) {
-    boost::shared_ptr<Server> serviceHandler(new Server());
-    boost::shared_ptr<ServiceProcessor> serviceProcessor(new 
ServiceProcessor(serviceHandler));
+    stdcxx::shared_ptr<Server> serviceHandler(new Server());
+    stdcxx::shared_ptr<ServiceProcessor> serviceProcessor(new 
ServiceProcessor(serviceHandler));
 
     // Transports
-    boost::shared_ptr<TFileTransport> fileTransport(new 
TFileTransport(requestLogPath));
+    stdcxx::shared_ptr<TFileTransport> fileTransport(new 
TFileTransport(requestLogPath));
     fileTransport->setChunkSize(2 * 1024 * 1024);
     fileTransport->setMaxEventSize(1024 * 16);
     fileTransport->seekToEnd();
 
     // Protocol Factory
-    boost::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
+    stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
 
     TFileProcessor fileProcessor(serviceProcessor, protocolFactory, 
fileTransport);
 
@@ -372,48 +371,50 @@ int main(int argc, char** argv) {
 
   if (runServer) {
 
-    boost::shared_ptr<ServiceProcessor> serviceProcessor(new 
ServiceProcessor(serviceHandler));
+    stdcxx::shared_ptr<ServiceProcessor> serviceProcessor(new 
ServiceProcessor(serviceHandler));
 
     // Protocol Factory
-    boost::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
+    stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
 
     // Transport Factory
-    boost::shared_ptr<TTransportFactory> transportFactory;
+    stdcxx::shared_ptr<TTransportFactory> transportFactory;
 
     if (logRequests) {
       // initialize the log file
-      boost::shared_ptr<TFileTransport> fileTransport(new 
TFileTransport(requestLogPath));
+      stdcxx::shared_ptr<TFileTransport> fileTransport(new 
TFileTransport(requestLogPath));
       fileTransport->setChunkSize(2 * 1024 * 1024);
       fileTransport->setMaxEventSize(1024 * 16);
 
       transportFactory
-          = boost::shared_ptr<TTransportFactory>(new 
TPipedTransportFactory(fileTransport));
+          = stdcxx::shared_ptr<TTransportFactory>(new 
TPipedTransportFactory(fileTransport));
     }
 
-    boost::shared_ptr<Thread> serverThread;
-    boost::shared_ptr<Thread> serverThread2;
-    boost::shared_ptr<transport::TNonblockingServerSocket> nbSocket1, 
nbSocket2;
+    stdcxx::shared_ptr<Thread> serverThread;
+    stdcxx::shared_ptr<Thread> serverThread2;
+    stdcxx::shared_ptr<transport::TNonblockingServerSocket> nbSocket1;
+    stdcxx::shared_ptr<transport::TNonblockingServerSocket> nbSocket2;
 
     if (serverType == "simple") {
+
       nbSocket1.reset(new transport::TNonblockingServerSocket(port));
-      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(
+      serverThread = threadFactory->newThread(stdcxx::shared_ptr<TServer>(
           new TNonblockingServer(serviceProcessor, protocolFactory, 
nbSocket1)));
       nbSocket2.reset(new transport::TNonblockingServerSocket(port + 1));
-      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(
+      serverThread2 = threadFactory->newThread(stdcxx::shared_ptr<TServer>(
           new TNonblockingServer(serviceProcessor, protocolFactory, 
nbSocket2)));
 
     } else if (serverType == "thread-pool") {
 
-      boost::shared_ptr<ThreadManager> threadManager
+      stdcxx::shared_ptr<ThreadManager> threadManager
           = ThreadManager::newSimpleThreadManager(workerCount);
 
       threadManager->threadFactory(threadFactory);
       threadManager->start();
       nbSocket1.reset(new transport::TNonblockingServerSocket(port));
-      serverThread = threadFactory->newThread(boost::shared_ptr<TServer>(
+      serverThread = threadFactory->newThread(stdcxx::shared_ptr<TServer>(
           new TNonblockingServer(serviceProcessor, protocolFactory, nbSocket1, 
threadManager)));
       nbSocket2.reset(new transport::TNonblockingServerSocket(port + 1));
-      serverThread2 = threadFactory->newThread(boost::shared_ptr<TServer>(
+      serverThread2 = threadFactory->newThread(stdcxx::shared_ptr<TServer>(
           new TNonblockingServer(serviceProcessor, protocolFactory, nbSocket2, 
threadManager)));
     }
 
@@ -436,7 +437,7 @@ int main(int argc, char** argv) {
 
     size_t threadCount = 0;
 
-    set<boost::shared_ptr<Thread> > clientThreads;
+    set<stdcxx::shared_ptr<Thread> > clientThreads;
 
     if (callName == "echoVoid") {
       loopType = T_VOID;
@@ -454,16 +455,16 @@ int main(int argc, char** argv) {
 
     for (uint32_t ix = 0; ix < clientCount; ix++) {
 
-      boost::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", port + (ix % 
2)));
-      boost::shared_ptr<TFramedTransport> framedSocket(new 
TFramedTransport(socket));
-      boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(framedSocket));
-      boost::shared_ptr<ServiceClient> serviceClient(new 
ServiceClient(protocol));
+      stdcxx::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", port + (ix % 
2)));
+      stdcxx::shared_ptr<TFramedTransport> framedSocket(new 
TFramedTransport(socket));
+      stdcxx::shared_ptr<TProtocol> protocol(new 
TBinaryProtocol(framedSocket));
+      stdcxx::shared_ptr<ServiceClient> serviceClient(new 
ServiceClient(protocol));
 
-      
clientThreads.insert(threadFactory->newThread(boost::shared_ptr<ClientThread>(
+      
clientThreads.insert(threadFactory->newThread(stdcxx::shared_ptr<ClientThread>(
           new ClientThread(socket, serviceClient, monitor, threadCount, 
loopCount, loopType))));
     }
 
-    for (std::set<boost::shared_ptr<Thread> >::const_iterator thread = 
clientThreads.begin();
+    for (std::set<stdcxx::shared_ptr<Thread> >::const_iterator thread = 
clientThreads.begin();
          thread != clientThreads.end();
          thread++) {
       (*thread)->start();
@@ -496,12 +497,12 @@ int main(int argc, char** argv) {
     int64_t minTime = 9223372036854775807LL;
     int64_t maxTime = 0;
 
-    for (set<boost::shared_ptr<Thread> >::iterator ix = clientThreads.begin();
+    for (set<stdcxx::shared_ptr<Thread> >::iterator ix = clientThreads.begin();
          ix != clientThreads.end();
          ix++) {
 
-      boost::shared_ptr<ClientThread> client
-          = boost::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
+      stdcxx::shared_ptr<ClientThread> client
+          = stdcxx::dynamic_pointer_cast<ClientThread>((*ix)->runnable());
 
       int64_t delta = client->_endTime - client->_startTime;
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/test/cpp/src/TestClient.cpp
----------------------------------------------------------------------
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 6ecf540..6b2e731 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -40,10 +40,9 @@
 #include <inttypes.h>
 #endif
 
-#include <boost/shared_ptr.hpp>
 #include <boost/program_options.hpp>
 #include <boost/filesystem.hpp>
-#include <thrift/cxxfunctional.h>
+#include <thrift/stdcxx.h>
 #if _WIN32
 #include <thrift/windows/TWinsockSingleton.h>
 #endif
@@ -52,10 +51,10 @@
 
 using namespace std;
 using namespace apache::thrift;
+using namespace apache::thrift::async;
 using namespace apache::thrift::protocol;
 using namespace apache::thrift::transport;
 using namespace thrift::test;
-using namespace apache::thrift::async;
 
 // Current time, microseconds since the epoch
 uint64_t now() {
@@ -94,10 +93,10 @@ static void testVoid_clientReturn(event_base* base, 
ThriftTestCobClient* client)
     for (int testNr = 0; testNr < 10; ++testNr) {
       std::ostringstream os;
       os << "test" << testNr;
-      client->testString(tcxx::bind(testString_clientReturn,
+      client->testString(stdcxx::bind(testString_clientReturn,
                                     base,
                                     testNr,
-                                    tcxx::placeholders::_1),
+                                    stdcxx::placeholders::_1),
                        os.str());
     }
   } catch (TException& exn) {
@@ -229,17 +228,17 @@ int main(int argc, char** argv) {
   }
 
   // THRIFT-4164: The factory MUST outlive any sockets it creates for correct 
behavior!
-  boost::shared_ptr<TSSLSocketFactory> factory;
-  boost::shared_ptr<TSocket> socket;
-  boost::shared_ptr<TTransport> transport;
-  boost::shared_ptr<TProtocol> protocol;
+  stdcxx::shared_ptr<TSSLSocketFactory> factory;
+  stdcxx::shared_ptr<TSocket> socket;
+  stdcxx::shared_ptr<TTransport> transport;
+  stdcxx::shared_ptr<TProtocol> protocol;
 
   if (ssl) {
     cout << "Client Certificate File: " << certPath << endl;
     cout << "Client Key         File: " << keyPath << endl;
     cout << "CA                 File: " << caPath << endl;
 
-    factory = boost::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
+    factory = stdcxx::shared_ptr<TSSLSocketFactory>(new TSSLSocketFactory());
     factory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
     factory->loadTrustedCertificates(caPath.c_str());
     factory->loadCertificate(certPath.c_str());
@@ -251,38 +250,38 @@ int main(int argc, char** argv) {
       if (abstract_namespace) {
         std::string abstract_socket("\0", 1);
         abstract_socket += domain_socket;
-        socket = boost::shared_ptr<TSocket>(new TSocket(abstract_socket));
+        socket = stdcxx::shared_ptr<TSocket>(new TSocket(abstract_socket));
       } else {
-        socket = boost::shared_ptr<TSocket>(new TSocket(domain_socket));
+        socket = stdcxx::shared_ptr<TSocket>(new TSocket(domain_socket));
       }
       port = 0;
     } else {
-      socket = boost::shared_ptr<TSocket>(new TSocket(host, port));
+      socket = stdcxx::shared_ptr<TSocket>(new TSocket(host, port));
     }
   }
 
   if (transport_type.compare("http") == 0) {
-    boost::shared_ptr<TTransport> httpSocket(new THttpClient(socket, host, 
"/service"));
+    stdcxx::shared_ptr<TTransport> httpSocket(new THttpClient(socket, host, 
"/service"));
     transport = httpSocket;
   } else if (transport_type.compare("framed") == 0) {
-    boost::shared_ptr<TFramedTransport> framedSocket(new 
TFramedTransport(socket));
+    stdcxx::shared_ptr<TFramedTransport> framedSocket(new 
TFramedTransport(socket));
     transport = framedSocket;
   } else {
-    boost::shared_ptr<TBufferedTransport> bufferedSocket(new 
TBufferedTransport(socket));
+    stdcxx::shared_ptr<TBufferedTransport> bufferedSocket(new 
TBufferedTransport(socket));
     transport = bufferedSocket;
   }
 
   if (protocol_type.compare("json") == 0) {
-    boost::shared_ptr<TProtocol> jsonProtocol(new TJSONProtocol(transport));
+    stdcxx::shared_ptr<TProtocol> jsonProtocol(new TJSONProtocol(transport));
     protocol = jsonProtocol;
   } else if (protocol_type.compare("compact") == 0) {
-    boost::shared_ptr<TProtocol> compactProtocol(new 
TCompactProtocol(transport));
+    stdcxx::shared_ptr<TProtocol> compactProtocol(new 
TCompactProtocol(transport));
     protocol = compactProtocol;
   } else if (protocol_type == "header") {
-    boost::shared_ptr<TProtocol> headerProtocol(new 
THeaderProtocol(transport));
+    stdcxx::shared_ptr<TProtocol> headerProtocol(new 
THeaderProtocol(transport));
     protocol = headerProtocol;
   } else {
-    boost::shared_ptr<TBinaryProtocol> binaryProtocol(new 
TBinaryProtocol(transport));
+    stdcxx::shared_ptr<TBinaryProtocol> binaryProtocol(new 
TBinaryProtocol(transport));
     protocol = binaryProtocol;
   }
 
@@ -305,14 +304,14 @@ int main(int argc, char** argv) {
     cout << "Libevent Features: 0x" << hex << event_base_get_features(base) << 
endl;
 #endif
 
-    boost::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
+    stdcxx::shared_ptr<TProtocolFactory> protocolFactory(new 
TBinaryProtocolFactory());
 
-    boost::shared_ptr<TAsyncChannel> channel(
+    stdcxx::shared_ptr<TAsyncChannel> channel(
         new TEvhttpClientChannel(host.c_str(), "/", host.c_str(), port, base));
     ThriftTestCobClient* client = new ThriftTestCobClient(channel, 
protocolFactory.get());
-    client->testVoid(tcxx::bind(testVoid_clientReturn,
+    client->testVoid(stdcxx::bind(testVoid_clientReturn,
                                 base,
-                                tcxx::placeholders::_1));
+                                stdcxx::placeholders::_1));
 
     event_base_loop(base, 0);
     return 0;

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/test/cpp/src/TestServer.cpp
----------------------------------------------------------------------
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 2b58f8a..37d0eb6 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -52,7 +52,7 @@
 
 #include <boost/program_options.hpp>
 #include <boost/filesystem.hpp>
-#include <thrift/cxxfunctional.h>
+#include <thrift/stdcxx.h>
 
 #include <signal.h>
 #if _WIN32
@@ -62,11 +62,11 @@
 using namespace std;
 
 using namespace apache::thrift;
+using namespace apache::thrift::async;
 using namespace apache::thrift::concurrency;
 using namespace apache::thrift::protocol;
 using namespace apache::thrift::transport;
 using namespace apache::thrift::server;
-using namespace apache::thrift::async;
 
 using namespace thrift::test;
 
@@ -371,66 +371,66 @@ class TestProcessorEventHandler : public 
TProcessorEventHandler {
 
 class TestHandlerAsync : public ThriftTestCobSvIf {
 public:
-  TestHandlerAsync(boost::shared_ptr<TestHandler>& handler) : 
_delegate(handler) {}
+  TestHandlerAsync(stdcxx::shared_ptr<TestHandler>& handler) : 
_delegate(handler) {}
   virtual ~TestHandlerAsync() {}
 
-  virtual void testVoid(tcxx::function<void()> cob) {
+  virtual void testVoid(stdcxx::function<void()> cob) {
     _delegate->testVoid();
     cob();
   }
 
-  virtual void testString(tcxx::function<void(std::string const& _return)> cob,
+  virtual void testString(stdcxx::function<void(std::string const& _return)> 
cob,
                           const std::string& thing) {
     std::string res;
     _delegate->testString(res, thing);
     cob(res);
   }
 
-  virtual void testBool(tcxx::function<void(bool const& _return)> cob, const 
bool thing) {
+  virtual void testBool(stdcxx::function<void(bool const& _return)> cob, const 
bool thing) {
     bool res = _delegate->testBool(thing);
     cob(res);
   }
 
-  virtual void testByte(tcxx::function<void(int8_t const& _return)> cob, const 
int8_t thing) {
+  virtual void testByte(stdcxx::function<void(int8_t const& _return)> cob, 
const int8_t thing) {
     int8_t res = _delegate->testByte(thing);
     cob(res);
   }
 
-  virtual void testI32(tcxx::function<void(int32_t const& _return)> cob, const 
int32_t thing) {
+  virtual void testI32(stdcxx::function<void(int32_t const& _return)> cob, 
const int32_t thing) {
     int32_t res = _delegate->testI32(thing);
     cob(res);
   }
 
-  virtual void testI64(tcxx::function<void(int64_t const& _return)> cob, const 
int64_t thing) {
+  virtual void testI64(stdcxx::function<void(int64_t const& _return)> cob, 
const int64_t thing) {
     int64_t res = _delegate->testI64(thing);
     cob(res);
   }
 
-  virtual void testDouble(tcxx::function<void(double const& _return)> cob, 
const double thing) {
+  virtual void testDouble(stdcxx::function<void(double const& _return)> cob, 
const double thing) {
     double res = _delegate->testDouble(thing);
     cob(res);
   }
 
-  virtual void testBinary(tcxx::function<void(std::string const& _return)> cob,
+  virtual void testBinary(stdcxx::function<void(std::string const& _return)> 
cob,
                           const std::string& thing) {
     std::string res;
     _delegate->testBinary(res, thing);
     cob(res);
   }
 
-  virtual void testStruct(tcxx::function<void(Xtruct const& _return)> cob, 
const Xtruct& thing) {
+  virtual void testStruct(stdcxx::function<void(Xtruct const& _return)> cob, 
const Xtruct& thing) {
     Xtruct res;
     _delegate->testStruct(res, thing);
     cob(res);
   }
 
-  virtual void testNest(tcxx::function<void(Xtruct2 const& _return)> cob, 
const Xtruct2& thing) {
+  virtual void testNest(stdcxx::function<void(Xtruct2 const& _return)> cob, 
const Xtruct2& thing) {
     Xtruct2 res;
     _delegate->testNest(res, thing);
     cob(res);
   }
 
-  virtual void testMap(tcxx::function<void(std::map<int32_t, int32_t> const& 
_return)> cob,
+  virtual void testMap(stdcxx::function<void(std::map<int32_t, int32_t> const& 
_return)> cob,
                        const std::map<int32_t, int32_t>& thing) {
     std::map<int32_t, int32_t> res;
     _delegate->testMap(res, thing);
@@ -438,40 +438,40 @@ public:
   }
 
   virtual void testStringMap(
-      tcxx::function<void(std::map<std::string, std::string> const& _return)> 
cob,
+      stdcxx::function<void(std::map<std::string, std::string> const& 
_return)> cob,
       const std::map<std::string, std::string>& thing) {
     std::map<std::string, std::string> res;
     _delegate->testStringMap(res, thing);
     cob(res);
   }
 
-  virtual void testSet(tcxx::function<void(std::set<int32_t> const& _return)> 
cob,
+  virtual void testSet(stdcxx::function<void(std::set<int32_t> const& 
_return)> cob,
                        const std::set<int32_t>& thing) {
     std::set<int32_t> res;
     _delegate->testSet(res, thing);
     cob(res);
   }
 
-  virtual void testList(tcxx::function<void(std::vector<int32_t> const& 
_return)> cob,
+  virtual void testList(stdcxx::function<void(std::vector<int32_t> const& 
_return)> cob,
                         const std::vector<int32_t>& thing) {
     std::vector<int32_t> res;
     _delegate->testList(res, thing);
     cob(res);
   }
 
-  virtual void testEnum(tcxx::function<void(Numberz::type const& _return)> cob,
+  virtual void testEnum(stdcxx::function<void(Numberz::type const& _return)> 
cob,
                         const Numberz::type thing) {
     Numberz::type res = _delegate->testEnum(thing);
     cob(res);
   }
 
-  virtual void testTypedef(tcxx::function<void(UserId const& _return)> cob, 
const UserId thing) {
+  virtual void testTypedef(stdcxx::function<void(UserId const& _return)> cob, 
const UserId thing) {
     UserId res = _delegate->testTypedef(thing);
     cob(res);
   }
 
   virtual void testMapMap(
-      tcxx::function<void(std::map<int32_t, std::map<int32_t, int32_t> > 
const& _return)> cob,
+      stdcxx::function<void(std::map<int32_t, std::map<int32_t, int32_t> > 
const& _return)> cob,
       const int32_t hello) {
     std::map<int32_t, std::map<int32_t, int32_t> > res;
     _delegate->testMapMap(res, hello);
@@ -479,14 +479,14 @@ public:
   }
 
   virtual void testInsanity(
-      tcxx::function<void(std::map<UserId, std::map<Numberz::type, Insanity> > 
const& _return)> cob,
+      stdcxx::function<void(std::map<UserId, std::map<Numberz::type, Insanity> 
> const& _return)> cob,
       const Insanity& argument) {
     std::map<UserId, std::map<Numberz::type, Insanity> > res;
     _delegate->testInsanity(res, argument);
     cob(res);
   }
 
-  virtual void testMulti(tcxx::function<void(Xtruct const& _return)> cob,
+  virtual void testMulti(stdcxx::function<void(Xtruct const& _return)> cob,
                          const int8_t arg0,
                          const int32_t arg1,
                          const int64_t arg2,
@@ -499,8 +499,8 @@ public:
   }
 
   virtual void testException(
-      tcxx::function<void()> cob,
-      tcxx::function<void(::apache::thrift::TDelayedException* _throw)> 
exn_cob,
+      stdcxx::function<void()> cob,
+      stdcxx::function<void(::apache::thrift::TDelayedException* _throw)> 
exn_cob,
       const std::string& arg) {
     try {
       _delegate->testException(arg);
@@ -512,8 +512,8 @@ public:
   }
 
   virtual void testMultiException(
-      tcxx::function<void(Xtruct const& _return)> cob,
-      tcxx::function<void(::apache::thrift::TDelayedException* _throw)> 
exn_cob,
+      stdcxx::function<void(Xtruct const& _return)> cob,
+      stdcxx::function<void(::apache::thrift::TDelayedException* _throw)> 
exn_cob,
       const std::string& arg0,
       const std::string& arg1) {
     Xtruct res;
@@ -526,13 +526,13 @@ public:
     cob(res);
   }
 
-  virtual void testOneway(tcxx::function<void()> cob, const int32_t 
secondsToSleep) {
+  virtual void testOneway(stdcxx::function<void()> cob, const int32_t 
secondsToSleep) {
     _delegate->testOneway(secondsToSleep);
     cob();
   }
 
 protected:
-  boost::shared_ptr<TestHandler> _delegate;
+  stdcxx::shared_ptr<TestHandler> _delegate;
 };
 
 namespace po = boost::program_options;
@@ -626,9 +626,9 @@ int main(int argc, char** argv) {
   }
 
   // Dispatcher
-  boost::shared_ptr<TProtocolFactory> protocolFactory;
+  stdcxx::shared_ptr<TProtocolFactory> protocolFactory;
   if (protocol_type == "json") {
-    boost::shared_ptr<TProtocolFactory> jsonProtocolFactory(new 
TJSONProtocolFactory());
+    stdcxx::shared_ptr<TProtocolFactory> jsonProtocolFactory(new 
TJSONProtocolFactory());
     protocolFactory = jsonProtocolFactory;
   } else if (protocol_type == "compact") {
     TCompactProtocolFactoryT<TBufferBase> *compactProtocolFactory = new 
TCompactProtocolFactoryT<TBufferBase>();
@@ -636,7 +636,7 @@ int main(int argc, char** argv) {
     compactProtocolFactory->setStringSizeLimit(string_limit);
     protocolFactory.reset(compactProtocolFactory);
   } else if (protocol_type == "header") {
-    boost::shared_ptr<TProtocolFactory> headerProtocolFactory(new 
THeaderProtocolFactory());
+    stdcxx::shared_ptr<TProtocolFactory> headerProtocolFactory(new 
THeaderProtocolFactory());
     protocolFactory = headerProtocolFactory;
   } else {
     TBinaryProtocolFactoryT<TBufferBase>* binaryProtocolFactory = new 
TBinaryProtocolFactoryT<TBufferBase>();
@@ -646,51 +646,51 @@ int main(int argc, char** argv) {
   }
 
   // Processor
-  boost::shared_ptr<TestHandler> testHandler(new TestHandler());
-  boost::shared_ptr<ThriftTestProcessor> testProcessor(new 
ThriftTestProcessor(testHandler));
+  stdcxx::shared_ptr<TestHandler> testHandler(new TestHandler());
+  stdcxx::shared_ptr<ThriftTestProcessor> testProcessor(new 
ThriftTestProcessor(testHandler));
 
   if (vm.count("processor-events")) {
     testProcessor->setEventHandler(
-        boost::shared_ptr<TProcessorEventHandler>(new 
TestProcessorEventHandler()));
+        stdcxx::shared_ptr<TProcessorEventHandler>(new 
TestProcessorEventHandler()));
   }
 
   // Transport
-  boost::shared_ptr<TSSLSocketFactory> sslSocketFactory;
-  boost::shared_ptr<TServerSocket> serverSocket;
+  stdcxx::shared_ptr<TSSLSocketFactory> sslSocketFactory;
+  stdcxx::shared_ptr<TServerSocket> serverSocket;
 
   if (ssl) {
-    sslSocketFactory = boost::shared_ptr<TSSLSocketFactory>(new 
TSSLSocketFactory());
+    sslSocketFactory = stdcxx::shared_ptr<TSSLSocketFactory>(new 
TSSLSocketFactory());
     sslSocketFactory->loadCertificate(certPath.c_str());
     sslSocketFactory->loadPrivateKey(keyPath.c_str());
     sslSocketFactory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
-    serverSocket = boost::shared_ptr<TServerSocket>(new TSSLServerSocket(port, 
sslSocketFactory));
+    serverSocket = stdcxx::shared_ptr<TServerSocket>(new 
TSSLServerSocket(port, sslSocketFactory));
   } else {
     if (domain_socket != "") {
       if (abstract_namespace) {
         std::string abstract_socket("\0", 1);
         abstract_socket += domain_socket;
-        serverSocket = boost::shared_ptr<TServerSocket>(new 
TServerSocket(abstract_socket));
+        serverSocket = stdcxx::shared_ptr<TServerSocket>(new 
TServerSocket(abstract_socket));
       } else {
         unlink(domain_socket.c_str());
-        serverSocket = boost::shared_ptr<TServerSocket>(new 
TServerSocket(domain_socket));
+        serverSocket = stdcxx::shared_ptr<TServerSocket>(new 
TServerSocket(domain_socket));
       }
       port = 0;
     } else {
-      serverSocket = boost::shared_ptr<TServerSocket>(new TServerSocket(port));
+      serverSocket = stdcxx::shared_ptr<TServerSocket>(new 
TServerSocket(port));
     }
   }
 
   // Factory
-  boost::shared_ptr<TTransportFactory> transportFactory;
+  stdcxx::shared_ptr<TTransportFactory> transportFactory;
 
   if (transport_type == "http" && server_type != "nonblocking") {
-    boost::shared_ptr<TTransportFactory> httpTransportFactory(new 
THttpServerTransportFactory());
+    stdcxx::shared_ptr<TTransportFactory> httpTransportFactory(new 
THttpServerTransportFactory());
     transportFactory = httpTransportFactory;
   } else if (transport_type == "framed") {
-    boost::shared_ptr<TTransportFactory> framedTransportFactory(new 
TFramedTransportFactory());
+    stdcxx::shared_ptr<TTransportFactory> framedTransportFactory(new 
TFramedTransportFactory());
     transportFactory = framedTransportFactory;
   } else {
-    boost::shared_ptr<TTransportFactory> bufferedTransportFactory(new 
TBufferedTransportFactory());
+    stdcxx::shared_ptr<TTransportFactory> bufferedTransportFactory(new 
TBufferedTransportFactory());
     transportFactory = bufferedTransportFactory;
   }
 
@@ -707,16 +707,16 @@ int main(int argc, char** argv) {
   cout << endl;
 
   // Server
-  boost::shared_ptr<apache::thrift::server::TServer> server;
+  stdcxx::shared_ptr<apache::thrift::server::TServer> server;
 
   if (server_type == "simple") {
     server.reset(new TSimpleServer(testProcessor, serverSocket, 
transportFactory, protocolFactory));
   } else if (server_type == "thread-pool") {
 
-    boost::shared_ptr<ThreadManager> threadManager = 
ThreadManager::newSimpleThreadManager(workers);
+    stdcxx::shared_ptr<ThreadManager> threadManager = 
ThreadManager::newSimpleThreadManager(workers);
 
-    boost::shared_ptr<PlatformThreadFactory> threadFactory
-        = boost::shared_ptr<PlatformThreadFactory>(new 
PlatformThreadFactory());
+    stdcxx::shared_ptr<PlatformThreadFactory> threadFactory
+        = stdcxx::shared_ptr<PlatformThreadFactory>(new 
PlatformThreadFactory());
 
     threadManager->threadFactory(threadFactory);
 
@@ -733,10 +733,10 @@ int main(int argc, char** argv) {
         new TThreadedServer(testProcessor, serverSocket, transportFactory, 
protocolFactory));
   } else if (server_type == "nonblocking") {
     if (transport_type == "http") {
-      boost::shared_ptr<TestHandlerAsync> testHandlerAsync(new 
TestHandlerAsync(testHandler));
-      boost::shared_ptr<TAsyncProcessor> testProcessorAsync(
+      stdcxx::shared_ptr<TestHandlerAsync> testHandlerAsync(new 
TestHandlerAsync(testHandler));
+      stdcxx::shared_ptr<TAsyncProcessor> testProcessorAsync(
           new ThriftTestAsyncProcessor(testHandlerAsync));
-      boost::shared_ptr<TAsyncBufferProcessor> testBufferProcessor(
+      stdcxx::shared_ptr<TAsyncBufferProcessor> testBufferProcessor(
           new TAsyncProtocolProcessor(testProcessorAsync, protocolFactory));
 
       // not loading nonblockingServer into "server" because
@@ -745,7 +745,7 @@ int main(int argc, char** argv) {
       TEvhttpServer nonblockingServer(testBufferProcessor, port);
       nonblockingServer.serve();
     } else {
-      boost::shared_ptr<transport::TNonblockingServerSocket> nbSocket;
+      stdcxx::shared_ptr<transport::TNonblockingServerSocket> nbSocket;
       nbSocket.reset(new transport::TNonblockingServerSocket(port));
       server.reset(new TNonblockingServer(testProcessor, protocolFactory, 
nbSocket));
     }
@@ -755,12 +755,12 @@ int main(int argc, char** argv) {
     if (protocol_type == "header") {
       // Tell the server to use the same protocol for input / output
       // if using header
-      server->setOutputProtocolFactory(boost::shared_ptr<TProtocolFactory>());
+      server->setOutputProtocolFactory(stdcxx::shared_ptr<TProtocolFactory>());
     }
     apache::thrift::concurrency::PlatformThreadFactory factory;
     factory.setDetached(false);
-    boost::shared_ptr<apache::thrift::concurrency::Runnable> 
serverThreadRunner(server);
-    boost::shared_ptr<apache::thrift::concurrency::Thread> thread
+    stdcxx::shared_ptr<apache::thrift::concurrency::Runnable> 
serverThreadRunner(server);
+    stdcxx::shared_ptr<apache::thrift::concurrency::Thread> thread
         = factory.newThread(serverThreadRunner);
     thread->start();
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/tutorial/cpp/CppClient.cpp
----------------------------------------------------------------------
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index 2763fee..f10c725 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -22,6 +22,7 @@
 #include <thrift/protocol/TBinaryProtocol.h>
 #include <thrift/transport/TSocket.h>
 #include <thrift/transport/TTransportUtils.h>
+#include <thrift/stdcxx.h>
 
 #include "../gen-cpp/Calculator.h"
 
@@ -34,9 +35,9 @@ using namespace tutorial;
 using namespace shared;
 
 int main() {
-  boost::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
-  boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
-  boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
+  stdcxx::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
+  stdcxx::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
+  stdcxx::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
   CalculatorClient client(protocol);
 
   try {

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/tutorial/cpp/CppServer.cpp
----------------------------------------------------------------------
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index eafffa9..80b100e 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -27,8 +27,7 @@
 #include <thrift/transport/TSocket.h>
 #include <thrift/transport/TTransportUtils.h>
 #include <thrift/TToString.h>
-
-#include <boost/make_shared.hpp>
+#include <thrift/stdcxx.h>
 
 #include <iostream>
 #include <stdexcept>
@@ -118,7 +117,7 @@ class CalculatorCloneFactory : virtual public 
CalculatorIfFactory {
   virtual ~CalculatorCloneFactory() {}
   virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& 
connInfo)
   {
-    boost::shared_ptr<TSocket> sock = 
boost::dynamic_pointer_cast<TSocket>(connInfo.transport);
+    stdcxx::shared_ptr<TSocket> sock = 
stdcxx::dynamic_pointer_cast<TSocket>(connInfo.transport);
     cout << "Incoming connection\n";
     cout << "\tSocketInfo: "  << sock->getSocketInfo() << "\n";
     cout << "\tPeerHost: "    << sock->getPeerHost() << "\n";
@@ -133,18 +132,18 @@ class CalculatorCloneFactory : virtual public 
CalculatorIfFactory {
 
 int main() {
   TThreadedServer server(
-    
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
-    boost::make_shared<TServerSocket>(9090), //port
-    boost::make_shared<TBufferedTransportFactory>(),
-    boost::make_shared<TBinaryProtocolFactory>());
+    
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
+    stdcxx::make_shared<TServerSocket>(9090), //port
+    stdcxx::make_shared<TBufferedTransportFactory>(),
+    stdcxx::make_shared<TBinaryProtocolFactory>());
 
   /*
   // if you don't need per-connection state, do the following instead
   TThreadedServer server(
-    
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
-    boost::make_shared<TServerSocket>(9090), //port
-    boost::make_shared<TBufferedTransportFactory>(),
-    boost::make_shared<TBinaryProtocolFactory>());
+    
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
+    stdcxx::make_shared<TServerSocket>(9090), //port
+    stdcxx::make_shared<TBufferedTransportFactory>(),
+    stdcxx::make_shared<TBinaryProtocolFactory>());
   */
 
   /**
@@ -152,25 +151,25 @@ int main() {
 
   // This server only allows one connection at a time, but spawns no threads
   TSimpleServer server(
-    
boost::make_shared<CalculatorProcessor>(boost::make_shared<CalculatorHandler>()),
-    boost::make_shared<TServerSocket>(9090),
-    boost::make_shared<TBufferedTransportFactory>(),
-    boost::make_shared<TBinaryProtocolFactory>());
+    
stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
+    stdcxx::make_shared<TServerSocket>(9090),
+    stdcxx::make_shared<TBufferedTransportFactory>(),
+    stdcxx::make_shared<TBinaryProtocolFactory>());
 
   const int workerCount = 4;
 
-  boost::shared_ptr<ThreadManager> threadManager =
+  stdcxx::shared_ptr<ThreadManager> threadManager =
     ThreadManager::newSimpleThreadManager(workerCount);
   threadManager->threadFactory(
-    boost::make_shared<PlatformThreadFactory>());
+    stdcxx::make_shared<PlatformThreadFactory>());
   threadManager->start();
 
   // This server allows "workerCount" connection at a time, and reuses threads
   TThreadPoolServer server(
-    
boost::make_shared<CalculatorProcessorFactory>(boost::make_shared<CalculatorCloneFactory>()),
-    boost::make_shared<TServerSocket>(9090),
-    boost::make_shared<TBufferedTransportFactory>(),
-    boost::make_shared<TBinaryProtocolFactory>(),
+    
stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
+    stdcxx::make_shared<TServerSocket>(9090),
+    stdcxx::make_shared<TBufferedTransportFactory>(),
+    stdcxx::make_shared<TBinaryProtocolFactory>(),
     threadManager);
   */
 

Reply via email to