remove stdcxx namespace and use std directly
diff --git a/lib/cpp/test/processor/Handlers.h b/lib/cpp/test/processor/Handlers.h
index ad47229..29784d8 100644
--- a/lib/cpp/test/processor/Handlers.h
+++ b/lib/cpp/test/processor/Handlers.h
@@ -29,7 +29,7 @@
class ParentHandler : virtual public ParentServiceIf {
public:
- ParentHandler(const stdcxx::shared_ptr<EventLog>& log)
+ ParentHandler(const std::shared_ptr<EventLog>& log)
: triggerMonitor(&mutex_), generation_(0), wait_(false), log_(log) {}
int32_t incrementGeneration() {
@@ -136,7 +136,7 @@
int32_t generation_;
bool wait_;
std::vector<std::string> strings_;
- stdcxx::shared_ptr<EventLog> log_;
+ std::shared_ptr<EventLog> log_;
};
#ifdef _WIN32
@@ -146,7 +146,7 @@
class ChildHandler : public ParentHandler, virtual public ChildServiceIf {
public:
- ChildHandler(const stdcxx::shared_ptr<EventLog>& log) : ParentHandler(log), value_(0) {}
+ ChildHandler(const std::shared_ptr<EventLog>& log) : ParentHandler(log), value_(0) {}
int32_t setValue(const int32_t value) {
concurrency::Guard g(mutex_);
@@ -174,13 +174,13 @@
struct ConnContext {
public:
- ConnContext(stdcxx::shared_ptr<protocol::TProtocol> in,
- stdcxx::shared_ptr<protocol::TProtocol> out,
+ ConnContext(std::shared_ptr<protocol::TProtocol> in,
+ std::shared_ptr<protocol::TProtocol> out,
uint32_t id)
: input(in), output(out), id(id) {}
- stdcxx::shared_ptr<protocol::TProtocol> input;
- stdcxx::shared_ptr<protocol::TProtocol> output;
+ std::shared_ptr<protocol::TProtocol> input;
+ std::shared_ptr<protocol::TProtocol> output;
uint32_t id;
};
@@ -196,12 +196,12 @@
class ServerEventHandler : public server::TServerEventHandler {
public:
- ServerEventHandler(const stdcxx::shared_ptr<EventLog>& log) : nextId_(1), log_(log) {}
+ ServerEventHandler(const std::shared_ptr<EventLog>& log) : nextId_(1), log_(log) {}
virtual void preServe() {}
- virtual void* createContext(stdcxx::shared_ptr<protocol::TProtocol> input,
- stdcxx::shared_ptr<protocol::TProtocol> output) {
+ virtual void* createContext(std::shared_ptr<protocol::TProtocol> input,
+ std::shared_ptr<protocol::TProtocol> output) {
ConnContext* context = new ConnContext(input, output, nextId_);
++nextId_;
log_->append(EventLog::ET_CONN_CREATED, context->id, 0);
@@ -209,8 +209,8 @@
}
virtual void deleteContext(void* serverContext,
- stdcxx::shared_ptr<protocol::TProtocol> input,
- stdcxx::shared_ptr<protocol::TProtocol> output) {
+ std::shared_ptr<protocol::TProtocol> input,
+ std::shared_ptr<protocol::TProtocol> output) {
ConnContext* context = reinterpret_cast<ConnContext*>(serverContext);
if (input != context->input) {
@@ -226,7 +226,7 @@
}
virtual void processContext(void* serverContext,
- stdcxx::shared_ptr<transport::TTransport> transport) {
+ std::shared_ptr<transport::TTransport> transport) {
// TODO: We currently don't test the behavior of the processContext()
// calls. The various server implementations call processContext() at
// slightly different times, and it is too annoying to try and account for
@@ -251,12 +251,12 @@
protected:
uint32_t nextId_;
- stdcxx::shared_ptr<EventLog> log_;
+ std::shared_ptr<EventLog> log_;
};
class ProcessorEventHandler : public TProcessorEventHandler {
public:
- ProcessorEventHandler(const stdcxx::shared_ptr<EventLog>& log) : nextId_(1), log_(log) {}
+ ProcessorEventHandler(const std::shared_ptr<EventLog>& log) : nextId_(1), log_(log) {}
void* getContext(const char* fnName, void* serverContext) {
ConnContext* connContext = reinterpret_cast<ConnContext*>(serverContext);
@@ -329,7 +329,7 @@
}
uint32_t nextId_;
- stdcxx::shared_ptr<EventLog> log_;
+ std::shared_ptr<EventLog> log_;
};
}
}
diff --git a/lib/cpp/test/processor/ProcessorTest.cpp b/lib/cpp/test/processor/ProcessorTest.cpp
index c9e186f..36ce013 100644
--- a/lib/cpp/test/processor/ProcessorTest.cpp
+++ b/lib/cpp/test/processor/ProcessorTest.cpp
@@ -57,13 +57,13 @@
public:
typedef TSimpleServer ServerType;
- stdcxx::shared_ptr<TSimpleServer> createServer(
- const stdcxx::shared_ptr<TProcessor>& processor,
+ std::shared_ptr<TSimpleServer> createServer(
+ const std::shared_ptr<TProcessor>& processor,
uint16_t port,
- const stdcxx::shared_ptr<TTransportFactory>& transportFactory,
- const stdcxx::shared_ptr<TProtocolFactory>& protocolFactory) {
- stdcxx::shared_ptr<TServerSocket> socket(new TServerSocket(port));
- return stdcxx::shared_ptr<TSimpleServer>(
+ const std::shared_ptr<TTransportFactory>& transportFactory,
+ const std::shared_ptr<TProtocolFactory>& protocolFactory) {
+ std::shared_ptr<TServerSocket> socket(new TServerSocket(port));
+ return std::shared_ptr<TSimpleServer>(
new TSimpleServer(processor, socket, transportFactory, protocolFactory));
}
};
@@ -72,13 +72,13 @@
public:
typedef TThreadedServer ServerType;
- stdcxx::shared_ptr<TThreadedServer> createServer(
- const stdcxx::shared_ptr<TProcessor>& processor,
+ std::shared_ptr<TThreadedServer> createServer(
+ const std::shared_ptr<TProcessor>& processor,
uint16_t port,
- const stdcxx::shared_ptr<TTransportFactory>& transportFactory,
- const stdcxx::shared_ptr<TProtocolFactory>& protocolFactory) {
- stdcxx::shared_ptr<TServerSocket> socket(new TServerSocket(port));
- return stdcxx::shared_ptr<TThreadedServer>(
+ const std::shared_ptr<TTransportFactory>& transportFactory,
+ const std::shared_ptr<TProtocolFactory>& protocolFactory) {
+ std::shared_ptr<TServerSocket> socket(new TServerSocket(port));
+ return std::shared_ptr<TThreadedServer>(
new TThreadedServer(processor, socket, transportFactory, protocolFactory));
}
};
@@ -87,19 +87,19 @@
public:
typedef TThreadPoolServer ServerType;
- stdcxx::shared_ptr<TThreadPoolServer> createServer(
- const stdcxx::shared_ptr<TProcessor>& processor,
+ std::shared_ptr<TThreadPoolServer> createServer(
+ const std::shared_ptr<TProcessor>& processor,
uint16_t port,
- const stdcxx::shared_ptr<TTransportFactory>& transportFactory,
- const stdcxx::shared_ptr<TProtocolFactory>& protocolFactory) {
- stdcxx::shared_ptr<TServerSocket> socket(new TServerSocket(port));
+ const std::shared_ptr<TTransportFactory>& transportFactory,
+ const std::shared_ptr<TProtocolFactory>& protocolFactory) {
+ std::shared_ptr<TServerSocket> socket(new TServerSocket(port));
- stdcxx::shared_ptr<PlatformThreadFactory> threadFactory(new PlatformThreadFactory);
- stdcxx::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(8);
+ std::shared_ptr<PlatformThreadFactory> threadFactory(new PlatformThreadFactory);
+ std::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(8);
threadManager->threadFactory(threadFactory);
threadManager->start();
- return stdcxx::shared_ptr<TThreadPoolServer>(
+ return std::shared_ptr<TThreadPoolServer>(
new TThreadPoolServer(processor, socket, transportFactory, protocolFactory, threadManager));
}
};
@@ -108,11 +108,11 @@
public:
typedef TNonblockingServer ServerType;
- stdcxx::shared_ptr<TNonblockingServer> createServer(
- const stdcxx::shared_ptr<TProcessor>& processor,
+ std::shared_ptr<TNonblockingServer> createServer(
+ const std::shared_ptr<TProcessor>& processor,
uint16_t port,
- const stdcxx::shared_ptr<TTransportFactory>& transportFactory,
- const stdcxx::shared_ptr<TProtocolFactory>& protocolFactory) {
+ const std::shared_ptr<TTransportFactory>& transportFactory,
+ const std::shared_ptr<TProtocolFactory>& protocolFactory) {
// TNonblockingServer automatically uses TFramedTransport.
// Raise an exception if the supplied transport factory is not a
// TFramedTransportFactory
@@ -122,13 +122,13 @@
throw TException("TNonblockingServer must use TFramedTransport");
}
- stdcxx::shared_ptr<TNonblockingServerSocket> socket(new TNonblockingServerSocket(port));
- stdcxx::shared_ptr<PlatformThreadFactory> threadFactory(new PlatformThreadFactory);
- stdcxx::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(8);
+ std::shared_ptr<TNonblockingServerSocket> socket(new TNonblockingServerSocket(port));
+ std::shared_ptr<PlatformThreadFactory> threadFactory(new PlatformThreadFactory);
+ std::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(8);
threadManager->threadFactory(threadFactory);
threadManager->start();
- return stdcxx::shared_ptr<TNonblockingServer>(
+ return std::shared_ptr<TNonblockingServer>(
new TNonblockingServer(processor, protocolFactory, socket, threadManager));
}
};
@@ -137,11 +137,11 @@
public:
typedef TNonblockingServer ServerType;
- stdcxx::shared_ptr<TNonblockingServer> createServer(
- const stdcxx::shared_ptr<TProcessor>& processor,
+ std::shared_ptr<TNonblockingServer> createServer(
+ const std::shared_ptr<TProcessor>& processor,
uint16_t port,
- const stdcxx::shared_ptr<TTransportFactory>& transportFactory,
- const stdcxx::shared_ptr<TProtocolFactory>& protocolFactory) {
+ const std::shared_ptr<TTransportFactory>& transportFactory,
+ const std::shared_ptr<TProtocolFactory>& protocolFactory) {
// TNonblockingServer automatically uses TFramedTransport.
// Raise an exception if the supplied transport factory is not a
// TFramedTransportFactory
@@ -151,10 +151,10 @@
throw TException("TNonblockingServer must use TFramedTransport");
}
- stdcxx::shared_ptr<TNonblockingServerSocket> socket(new TNonblockingServerSocket(port));
+ std::shared_ptr<TNonblockingServerSocket> socket(new TNonblockingServerSocket(port));
// Use a NULL ThreadManager
- stdcxx::shared_ptr<ThreadManager> threadManager;
- return stdcxx::shared_ptr<TNonblockingServer>(
+ std::shared_ptr<ThreadManager> threadManager;
+ return std::shared_ptr<TNonblockingServer>(
new TNonblockingServer(processor, protocolFactory, socket, threadManager));
}
};
@@ -244,48 +244,48 @@
processor_->setEventHandler(processorEventHandler_);
}
- stdcxx::shared_ptr<TServer> createServer(uint16_t port) {
+ std::shared_ptr<TServer> createServer(uint16_t port) {
ServerTraits_ serverTraits;
return serverTraits.createServer(processor_, port, transportFactory_, protocolFactory_);
}
- stdcxx::shared_ptr<TServerEventHandler> getServerEventHandler() { return serverEventHandler_; }
+ std::shared_ptr<TServerEventHandler> getServerEventHandler() { return serverEventHandler_; }
void bindSuccessful(uint16_t port) { port_ = port; }
uint16_t getPort() const { return port_; }
- const stdcxx::shared_ptr<EventLog>& getLog() const { return log_; }
+ const std::shared_ptr<EventLog>& getLog() const { return log_; }
- const stdcxx::shared_ptr<Handler>& getHandler() const { return handler_; }
+ const std::shared_ptr<Handler>& getHandler() const { return handler_; }
- stdcxx::shared_ptr<Client> createClient() {
+ std::shared_ptr<Client> createClient() {
typedef typename ServiceTraits_::Protocol Protocol;
- stdcxx::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", port_));
- stdcxx::shared_ptr<Transport_> transport(new Transport_(socket));
- stdcxx::shared_ptr<Protocol> protocol(new Protocol(transport));
+ std::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", port_));
+ std::shared_ptr<Transport_> transport(new Transport_(socket));
+ std::shared_ptr<Protocol> protocol(new Protocol(transport));
transport->open();
- stdcxx::shared_ptr<Client> client(new Client(protocol));
+ std::shared_ptr<Client> client(new Client(protocol));
return client;
}
private:
uint16_t port_;
- stdcxx::shared_ptr<EventLog> log_;
- stdcxx::shared_ptr<Handler> handler_;
- stdcxx::shared_ptr<Processor> processor_;
- stdcxx::shared_ptr<TTransportFactory> transportFactory_;
- stdcxx::shared_ptr<TProtocolFactory> protocolFactory_;
- stdcxx::shared_ptr<TServerEventHandler> serverEventHandler_;
- stdcxx::shared_ptr<TProcessorEventHandler> processorEventHandler_;
+ std::shared_ptr<EventLog> log_;
+ std::shared_ptr<Handler> handler_;
+ std::shared_ptr<Processor> processor_;
+ std::shared_ptr<TTransportFactory> transportFactory_;
+ std::shared_ptr<TProtocolFactory> protocolFactory_;
+ std::shared_ptr<TServerEventHandler> serverEventHandler_;
+ std::shared_ptr<TProcessorEventHandler> processorEventHandler_;
};
/**
* Check that there are no more events in the log
*/
-void checkNoEvents(const stdcxx::shared_ptr<EventLog>& log) {
+void checkNoEvents(const std::shared_ptr<EventLog>& log) {
// Wait for an event with a very short timeout period. We don't expect
// anything to be present, so we will normally wait for the full timeout.
// On the other hand, a non-zero timeout is nice since it does give a short
@@ -299,7 +299,7 @@
*
* Returns the connection ID allocated by the server.
*/
-uint32_t checkNewConnEvents(const stdcxx::shared_ptr<EventLog>& log) {
+uint32_t checkNewConnEvents(const std::shared_ptr<EventLog>& log) {
// Check for an ET_CONN_CREATED event
Event event = log->waitForEvent(2500);
BOOST_CHECK_EQUAL(EventLog::ET_CONN_CREATED, event.type);
@@ -314,7 +314,7 @@
/**
* Check for the events that should be logged when a connection is closed.
*/
-void checkCloseEvents(const stdcxx::shared_ptr<EventLog>& log, uint32_t connId) {
+void checkCloseEvents(const std::shared_ptr<EventLog>& log, uint32_t connId) {
// Check for an ET_CONN_DESTROYED event
Event event = log->waitForEvent();
BOOST_CHECK_EQUAL(EventLog::ET_CONN_DESTROYED, event.type);
@@ -332,7 +332,7 @@
*
* Returns the call ID allocated by the server.
*/
-uint32_t checkCallHandlerEvents(const stdcxx::shared_ptr<EventLog>& log,
+uint32_t checkCallHandlerEvents(const std::shared_ptr<EventLog>& log,
uint32_t connId,
EventType callType,
const string& callName) {
@@ -369,7 +369,7 @@
/**
* Check for the events that should be after a handler returns.
*/
-void checkCallPostHandlerEvents(const stdcxx::shared_ptr<EventLog>& log,
+void checkCallPostHandlerEvents(const std::shared_ptr<EventLog>& log,
uint32_t connId,
uint32_t callId,
const string& callName) {
@@ -409,7 +409,7 @@
*
* Returns the call ID allocated by the server.
*/
-uint32_t checkCallEvents(const stdcxx::shared_ptr<EventLog>& log,
+uint32_t checkCallEvents(const std::shared_ptr<EventLog>& log,
uint32_t connId,
EventType callType,
const string& callName) {
@@ -424,8 +424,8 @@
*/
template <typename State_>
-void testParentService(const stdcxx::shared_ptr<State_>& state) {
- stdcxx::shared_ptr<typename State_::Client> client = state->createClient();
+void testParentService(const std::shared_ptr<State_>& state) {
+ std::shared_ptr<typename State_::Client> client = state->createClient();
int32_t gen = client->getGeneration();
int32_t newGen = client->incrementGeneration();
@@ -446,8 +446,8 @@
}
template <typename State_>
-void testChildService(const stdcxx::shared_ptr<State_>& state) {
- stdcxx::shared_ptr<typename State_::Client> client = state->createClient();
+void testChildService(const std::shared_ptr<State_>& state) {
+ std::shared_ptr<typename State_::Client> client = state->createClient();
// Test calling some of the parent methids via the a child client
int32_t gen = client->getGeneration();
@@ -468,7 +468,7 @@
typedef ServiceState<ServerTraits, ParentServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
testParentService(state);
@@ -479,7 +479,7 @@
typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
testParentService(state);
@@ -502,10 +502,10 @@
TBufferedTransport> State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
- const stdcxx::shared_ptr<EventLog>& log = state->getLog();
+ const std::shared_ptr<EventLog>& log = state->getLog();
// Make sure we're at the end of the log
checkNoEvents(log);
@@ -514,7 +514,7 @@
// Make sure createContext() is called after a connection has been
// established. We open a plain socket instead of creating a client.
- stdcxx::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", state->getPort()));
+ std::shared_ptr<TSocket> socket(new TSocket("127.0.0.1", state->getPort()));
socket->open();
// Make sure the proper events occurred after a new connection
@@ -635,19 +635,19 @@
typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
- const stdcxx::shared_ptr<EventLog>& log = state->getLog();
+ const std::shared_ptr<EventLog>& log = state->getLog();
// Create a client
- stdcxx::shared_ptr<typename State::Client> client1 = state->createClient();
+ std::shared_ptr<typename State::Client> client1 = state->createClient();
// Make sure the expected events were logged
uint32_t client1Id = checkNewConnEvents(log);
// Create a second client
- stdcxx::shared_ptr<typename State::Client> client2 = state->createClient();
+ std::shared_ptr<typename State::Client> client2 = state->createClient();
// Make sure the expected events were logged
uint32_t client2Id = checkNewConnEvents(log);
@@ -683,13 +683,13 @@
typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
- const stdcxx::shared_ptr<EventLog>& log = state->getLog();
+ const std::shared_ptr<EventLog>& log = state->getLog();
// Create a client
- stdcxx::shared_ptr<typename State::Client> client = state->createClient();
+ std::shared_ptr<typename State::Client> client = state->createClient();
uint32_t connId = checkNewConnEvents(log);
// Make a oneway call
@@ -735,13 +735,13 @@
typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
- const stdcxx::shared_ptr<EventLog>& log = state->getLog();
+ const std::shared_ptr<EventLog>& log = state->getLog();
// Create a client
- stdcxx::shared_ptr<typename State::Client> client = state->createClient();
+ std::shared_ptr<typename State::Client> client = state->createClient();
uint32_t connId = checkNewConnEvents(log);
// Send the exceptionWait() call
@@ -790,13 +790,13 @@
typedef ServiceState<ServerTraits, ChildServiceTraits<TemplateTraits> > State;
// Start the server
- stdcxx::shared_ptr<State> state(new State);
+ std::shared_ptr<State> state(new State);
ServerThread serverThread(state, true);
- const stdcxx::shared_ptr<EventLog>& log = state->getLog();
+ const std::shared_ptr<EventLog>& log = state->getLog();
// Create a client
- stdcxx::shared_ptr<typename State::Client> client = state->createClient();
+ std::shared_ptr<typename State::Client> client = state->createClient();
uint32_t connId = checkNewConnEvents(log);
// Send the unexpectedExceptionWait() call
diff --git a/lib/cpp/test/processor/ServerThread.cpp b/lib/cpp/test/processor/ServerThread.cpp
index e752d5e..4d1ec4c 100644
--- a/lib/cpp/test/processor/ServerThread.cpp
+++ b/lib/cpp/test/processor/ServerThread.cpp
@@ -130,7 +130,7 @@
serverState_->bindSuccessful(port_);
// Set the real server event handler (replacing ourself)
- stdcxx::shared_ptr<server::TServerEventHandler> serverEventHandler
+ std::shared_ptr<server::TServerEventHandler> serverEventHandler
= serverState_->getServerEventHandler();
server_->setServerEventHandler(serverEventHandler);
diff --git a/lib/cpp/test/processor/ServerThread.h b/lib/cpp/test/processor/ServerThread.h
index 21c3b60..61e31a3 100644
--- a/lib/cpp/test/processor/ServerThread.h
+++ b/lib/cpp/test/processor/ServerThread.h
@@ -43,7 +43,7 @@
* If the server returned fails to bind to the specified port when serve() is
* called on it, createServer() may be called again on a different port.
*/
- virtual stdcxx::shared_ptr<server::TServer> createServer(uint16_t port) = 0;
+ virtual std::shared_ptr<server::TServer> createServer(uint16_t port) = 0;
/**
* Get the TServerEventHandler to set on the server.
@@ -52,8 +52,8 @@
* start serving traffic. It is invoked from the server thread, rather than
* the main thread.
*/
- virtual stdcxx::shared_ptr<server::TServerEventHandler> getServerEventHandler() {
- return stdcxx::shared_ptr<server::TServerEventHandler>();
+ virtual std::shared_ptr<server::TServerEventHandler> getServerEventHandler() {
+ return std::shared_ptr<server::TServerEventHandler>();
}
/**
@@ -70,7 +70,7 @@
*/
class ServerThread {
public:
- ServerThread(const stdcxx::shared_ptr<ServerState>& state, bool autoStart)
+ ServerThread(const std::shared_ptr<ServerState>& state, bool autoStart)
: port_(0),
running_(false),
serving_(false),
@@ -116,7 +116,7 @@
void run();
void preServe();
- stdcxx::shared_ptr<Helper> helper_;
+ std::shared_ptr<Helper> helper_;
uint16_t port_;
bool running_;
@@ -124,9 +124,9 @@
bool error_;
concurrency::Monitor serverMonitor_;
- stdcxx::shared_ptr<ServerState> serverState_;
- stdcxx::shared_ptr<server::TServer> server_;
- stdcxx::shared_ptr<concurrency::Thread> thread_;
+ std::shared_ptr<ServerState> serverState_;
+ std::shared_ptr<server::TServer> server_;
+ std::shared_ptr<concurrency::Thread> thread_;
};
}
}