summaryrefslogtreecommitdiff
path: root/lib/cpp/src/thrift/TProcessor.h
diff options
context:
space:
mode:
authorJames E. King, III <jim.king@simplivity.com>2017-08-05 12:23:54 -0400
committerJames E. King, III <jking@apache.org>2017-08-10 13:27:21 -0400
commit82ae9575cdc112088771fc7b876f75e1e4d85ebb (patch)
treed8e6827311ee6e69c560604fe660788b7dfd4908 /lib/cpp/src/thrift/TProcessor.h
parent0a8c34ceedf0f9272fb6d3519596ddf90cffcac2 (diff)
downloadthrift-82ae9575cdc112088771fc7b876f75e1e4d85ebb.tar.gz
THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr)
Client: C++ This closes #1328
Diffstat (limited to 'lib/cpp/src/thrift/TProcessor.h')
-rw-r--r--lib/cpp/src/thrift/TProcessor.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/cpp/src/thrift/TProcessor.h b/lib/cpp/src/thrift/TProcessor.h
index 4a0604eac..27294d3ec 100644
--- a/lib/cpp/src/thrift/TProcessor.h
+++ b/lib/cpp/src/thrift/TProcessor.h
@@ -22,7 +22,7 @@
#include <string>
#include <thrift/protocol/TProtocol.h>
-#include <boost/shared_ptr.hpp>
+#include <thrift/stdcxx.h>
namespace apache {
namespace thrift {
@@ -142,28 +142,28 @@ class TProcessor {
public:
virtual ~TProcessor() {}
- virtual bool process(boost::shared_ptr<protocol::TProtocol> in,
- boost::shared_ptr<protocol::TProtocol> out,
+ virtual bool process(stdcxx::shared_ptr<protocol::TProtocol> in,
+ stdcxx::shared_ptr<protocol::TProtocol> out,
void* connectionContext) = 0;
- bool process(boost::shared_ptr<apache::thrift::protocol::TProtocol> io, void* connectionContext) {
+ bool process(stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> io, void* connectionContext) {
return process(io, io, connectionContext);
}
- boost::shared_ptr<TProcessorEventHandler> getEventHandler() const { return eventHandler_; }
+ stdcxx::shared_ptr<TProcessorEventHandler> getEventHandler() const { return eventHandler_; }
- void setEventHandler(boost::shared_ptr<TProcessorEventHandler> eventHandler) {
+ void setEventHandler(stdcxx::shared_ptr<TProcessorEventHandler> eventHandler) {
eventHandler_ = eventHandler;
}
protected:
TProcessor() {}
- boost::shared_ptr<TProcessorEventHandler> eventHandler_;
+ stdcxx::shared_ptr<TProcessorEventHandler> eventHandler_;
};
/**
- * This is a helper class to allow boost::shared_ptr to be used with handler
+ * This is a helper class to allow stdcxx::shared_ptr to be used with handler
* pointers returned by the generated handler factories.
*
* The handler factory classes generated by the thrift compiler return raw
@@ -177,7 +177,7 @@ protected:
template <typename HandlerFactory_>
class ReleaseHandler {
public:
- ReleaseHandler(const boost::shared_ptr<HandlerFactory_>& handlerFactory)
+ ReleaseHandler(const stdcxx::shared_ptr<HandlerFactory_>& handlerFactory)
: handlerFactory_(handlerFactory) {}
void operator()(typename HandlerFactory_::Handler* handler) {
@@ -187,18 +187,18 @@ public:
}
private:
- boost::shared_ptr<HandlerFactory_> handlerFactory_;
+ stdcxx::shared_ptr<HandlerFactory_> handlerFactory_;
};
struct TConnectionInfo {
// The input and output protocols
- boost::shared_ptr<protocol::TProtocol> input;
- boost::shared_ptr<protocol::TProtocol> output;
+ stdcxx::shared_ptr<protocol::TProtocol> input;
+ stdcxx::shared_ptr<protocol::TProtocol> output;
// The underlying transport used for the connection
// This is the transport that was returned by TServerTransport::accept(),
// and it may be different than the transport pointed to by the input and
// output protocols.
- boost::shared_ptr<transport::TTransport> transport;
+ stdcxx::shared_ptr<transport::TTransport> transport;
};
class TProcessorFactory {
@@ -212,17 +212,17 @@ public:
* accepted on. This generally means that this call does not need to be
* thread safe, as it will always be invoked from a single thread.
*/
- virtual boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo& connInfo) = 0;
+ virtual stdcxx::shared_ptr<TProcessor> getProcessor(const TConnectionInfo& connInfo) = 0;
};
class TSingletonProcessorFactory : public TProcessorFactory {
public:
- TSingletonProcessorFactory(boost::shared_ptr<TProcessor> processor) : processor_(processor) {}
+ TSingletonProcessorFactory(stdcxx::shared_ptr<TProcessor> processor) : processor_(processor) {}
- boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo&) { return processor_; }
+ stdcxx::shared_ptr<TProcessor> getProcessor(const TConnectionInfo&) { return processor_; }
private:
- boost::shared_ptr<TProcessor> processor_;
+ stdcxx::shared_ptr<TProcessor> processor_;
};
}
} // apache::thrift