THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr)
Client: C++
This closes #1328
diff --git a/lib/cpp/test/GenericHelpers.h b/lib/cpp/test/GenericHelpers.h
index c175561..e131c42 100644
--- a/lib/cpp/test/GenericHelpers.h
+++ b/lib/cpp/test/GenericHelpers.h
@@ -20,13 +20,10 @@
#ifndef _THRIFT_TEST_GENERICHELPERS_H_
#define _THRIFT_TEST_GENERICHELPERS_H_ 1
-#include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/transport/TBufferTransports.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/stdcxx.h>
#include <thrift/Thrift.h>
-using boost::shared_ptr;
-using namespace apache::thrift::protocol;
-
/* ClassName Helper for cleaner exceptions */
class ClassNames {
public:
@@ -66,43 +63,43 @@
public:
/* Write functions */
- static uint32_t write(shared_ptr<TProtocol> proto, const int8_t& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const int8_t& val) {
return proto->writeByte(val);
}
- static uint32_t write(shared_ptr<TProtocol> proto, const int16_t& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const int16_t& val) {
return proto->writeI16(val);
}
- static uint32_t write(shared_ptr<TProtocol> proto, const int32_t& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const int32_t& val) {
return proto->writeI32(val);
}
- static uint32_t write(shared_ptr<TProtocol> proto, const double& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const double& val) {
return proto->writeDouble(val);
}
- static uint32_t write(shared_ptr<TProtocol> proto, const int64_t& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const int64_t& val) {
return proto->writeI64(val);
}
- static uint32_t write(shared_ptr<TProtocol> proto, const std::string& val) {
+ static uint32_t write(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, const std::string& val) {
return proto->writeString(val);
}
/* Read functions */
- static uint32_t read(shared_ptr<TProtocol> proto, int8_t& val) { return proto->readByte(val); }
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, int8_t& val) { return proto->readByte(val); }
- static uint32_t read(shared_ptr<TProtocol> proto, int16_t& val) { return proto->readI16(val); }
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, int16_t& val) { return proto->readI16(val); }
- static uint32_t read(shared_ptr<TProtocol> proto, int32_t& val) { return proto->readI32(val); }
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, int32_t& val) { return proto->readI32(val); }
- static uint32_t read(shared_ptr<TProtocol> proto, int64_t& val) { return proto->readI64(val); }
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, int64_t& val) { return proto->readI64(val); }
- static uint32_t read(shared_ptr<TProtocol> proto, double& val) { return proto->readDouble(val); }
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, double& val) { return proto->readDouble(val); }
- static uint32_t read(shared_ptr<TProtocol> proto, std::string& val) {
+ static uint32_t read(apache::thrift::stdcxx::shared_ptr<apache::thrift::protocol::TProtocol> proto, std::string& val) {
return proto->readString(val);
}
};