remove stdcxx namespace and use std directly
diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp
index f10c725..5208411 100644
--- a/tutorial/cpp/CppClient.cpp
+++ b/tutorial/cpp/CppClient.cpp
@@ -22,7 +22,6 @@
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TTransportUtils.h>
-#include <thrift/stdcxx.h>
#include "../gen-cpp/Calculator.h"
@@ -35,9 +34,9 @@
using namespace shared;
int main() {
- 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));
+ std::shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
+ std::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
+ std::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
CalculatorClient client(protocol);
try {
diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp
index 80b100e..f7379d5 100644
--- a/tutorial/cpp/CppServer.cpp
+++ b/tutorial/cpp/CppServer.cpp
@@ -27,7 +27,6 @@
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TTransportUtils.h>
#include <thrift/TToString.h>
-#include <thrift/stdcxx.h>
#include <iostream>
#include <stdexcept>
@@ -117,7 +116,7 @@
virtual ~CalculatorCloneFactory() {}
virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo)
{
- stdcxx::shared_ptr<TSocket> sock = stdcxx::dynamic_pointer_cast<TSocket>(connInfo.transport);
+ std::shared_ptr<TSocket> sock = std::dynamic_pointer_cast<TSocket>(connInfo.transport);
cout << "Incoming connection\n";
cout << "\tSocketInfo: " << sock->getSocketInfo() << "\n";
cout << "\tPeerHost: " << sock->getPeerHost() << "\n";
@@ -132,18 +131,18 @@
int main() {
TThreadedServer server(
- stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
- stdcxx::make_shared<TServerSocket>(9090), //port
- stdcxx::make_shared<TBufferedTransportFactory>(),
- stdcxx::make_shared<TBinaryProtocolFactory>());
+ std::make_shared<CalculatorProcessorFactory>(std::make_shared<CalculatorCloneFactory>()),
+ std::make_shared<TServerSocket>(9090), //port
+ std::make_shared<TBufferedTransportFactory>(),
+ std::make_shared<TBinaryProtocolFactory>());
/*
// if you don't need per-connection state, do the following instead
TThreadedServer server(
- stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
- stdcxx::make_shared<TServerSocket>(9090), //port
- stdcxx::make_shared<TBufferedTransportFactory>(),
- stdcxx::make_shared<TBinaryProtocolFactory>());
+ std::make_shared<CalculatorProcessor>(std::make_shared<CalculatorHandler>()),
+ std::make_shared<TServerSocket>(9090), //port
+ std::make_shared<TBufferedTransportFactory>(),
+ std::make_shared<TBinaryProtocolFactory>());
*/
/**
@@ -151,25 +150,25 @@
// This server only allows one connection at a time, but spawns no threads
TSimpleServer server(
- stdcxx::make_shared<CalculatorProcessor>(stdcxx::make_shared<CalculatorHandler>()),
- stdcxx::make_shared<TServerSocket>(9090),
- stdcxx::make_shared<TBufferedTransportFactory>(),
- stdcxx::make_shared<TBinaryProtocolFactory>());
+ std::make_shared<CalculatorProcessor>(std::make_shared<CalculatorHandler>()),
+ std::make_shared<TServerSocket>(9090),
+ std::make_shared<TBufferedTransportFactory>(),
+ std::make_shared<TBinaryProtocolFactory>());
const int workerCount = 4;
- stdcxx::shared_ptr<ThreadManager> threadManager =
+ std::shared_ptr<ThreadManager> threadManager =
ThreadManager::newSimpleThreadManager(workerCount);
threadManager->threadFactory(
- stdcxx::make_shared<PlatformThreadFactory>());
+ std::make_shared<PlatformThreadFactory>());
threadManager->start();
// This server allows "workerCount" connection at a time, and reuses threads
TThreadPoolServer server(
- stdcxx::make_shared<CalculatorProcessorFactory>(stdcxx::make_shared<CalculatorCloneFactory>()),
- stdcxx::make_shared<TServerSocket>(9090),
- stdcxx::make_shared<TBufferedTransportFactory>(),
- stdcxx::make_shared<TBinaryProtocolFactory>(),
+ std::make_shared<CalculatorProcessorFactory>(std::make_shared<CalculatorCloneFactory>()),
+ std::make_shared<TServerSocket>(9090),
+ std::make_shared<TBufferedTransportFactory>(),
+ std::make_shared<TBinaryProtocolFactory>(),
threadManager);
*/