[thrift] branch master updated: automatize the double rendering test
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git The following commit(s) were added to refs/heads/master by this push: new caf7da9 automatize the double rendering test caf7da9 is described below commit caf7da976755694ee2a905cc8b85e36852f87558 Author: Ozan Can Altiok AuthorDate: Mon Jan 7 14:14:11 2019 +0300 automatize the double rendering test --- lib/js/Gruntfile.js| 3 ++- lib/js/test/test-double-rendering.html | 6 +++--- lib/js/test/test-double-rendering.js | 22 ++ 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/lib/js/Gruntfile.js b/lib/js/Gruntfile.js index bb7691a..b32a016 100644 --- a/lib/js/Gruntfile.js +++ b/lib/js/Gruntfile.js @@ -270,7 +270,7 @@ module.exports = function(grunt) { grunt.registerTask('installAndGenerate', [ 'shell:InstallThriftJS', 'shell:InstallThriftNodeJSDep', 'shell:ThriftGen', -'shell:ThriftGenDeepConstructor', +'shell:ThriftGenDeepConstructor', 'shell:ThriftGenDoubleConstants', 'shell:InstallTestLibs', ]); @@ -282,6 +282,7 @@ module.exports = function(grunt) { 'wait', 'qunit:ThriftDeepConstructor', 'qunit:ThriftJS', 'qunit:ThriftJS_TLS', +'qunit:ThriftJS_DoubleRendering', 'qunit:ThriftWS', 'qunit:ThriftJSJQ', 'qunit:ThriftJSJQ_TLS', 'qunit:ThriftWSES6', diff --git a/lib/js/test/test-double-rendering.html b/lib/js/test/test-double-rendering.html index 240cb39..7a430a5 100644 --- a/lib/js/test/test-double-rendering.html +++ b/lib/js/test/test-double-rendering.html @@ -29,11 +29,11 @@ - + - - + + diff --git a/lib/js/test/test-double-rendering.js b/lib/js/test/test-double-rendering.js index b4b79b8..1790c1b 100644 --- a/lib/js/test/test-double-rendering.js +++ b/lib/js/test/test-double-rendering.js @@ -20,29 +20,11 @@ /* * JavaScript test suite for double constants inside - * DebugProtoTest.thrift. These tests will run against Normal (-gen js) + * DoubleConstantsTest.thrift. These tests will run against Normal (-gen js) * Apache Thrift interfaces. * - * Synchronous blocking calls should be identical in both - * Normal and jQuery interfaces. All synchronous tests belong - * here. - * - * Asynchronous success callbacks passed as the last parameter - * of an RPC call should be identical in both Normal and jQuery - * interfaces. Async success tests belong here. - * - * Asynchronous exception processing is different in Normal - * and jQuery interfaces. Such tests belong in the test-nojq.js - * or test-jq.js files respectively. jQuery specific XHR object - * tests also belong in test-jq.js. Do not create any jQuery - * dependencies in this file or in test-nojq.js - * * To compile client code for this test use: - * $ thrift -gen js ThriftTest.thrift - * $ thrift -gen js DebugProtoTest.thrift - * - * See also: - * ++ test-nojq.js for "-gen js" only tests + * $ thrift -gen js DoubleConstantsTest.thrift */ // double assertion threshold
[thrift] 06/22: remove boost::thread and boost::mutex code
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit c109e019790a87ef1f874dfac3482ac45a57d3ab Author: cyy AuthorDate: Sat Jan 5 13:45:07 2019 +0800 remove boost::thread and boost::mutex code --- .travis.yml| 2 +- build/cmake/DefineOptions.cmake| 7 +- build/cmake/DefinePlatformSpecifc.cmake| 4 +- build/cmake/README-MSYS2.md| 2 +- build/cmake/README.md | 2 +- build/cmake/config.h.in| 3 - build/wincpp/build-thrift.bat | 1 - configure.ac | 18 -- contrib/transport-sample/ThriftCommon.h| 2 - lib/cpp/CMakeLists.txt | 9 +- lib/cpp/Makefile.am| 7 - lib/cpp/src/thrift/concurrency/BoostMonitor.cpp| 214 - lib/cpp/src/thrift/concurrency/BoostMutex.cpp | 73 --- .../src/thrift/concurrency/BoostThreadFactory.cpp | 162 .../src/thrift/concurrency/BoostThreadFactory.h| 63 -- .../src/thrift/concurrency/PlatformThreadFactory.h | 8 +- lib/cpp/src/thrift/concurrency/Thread.h| 11 +- lib/cpp/src/thrift/server/TNonblockingServer.cpp | 2 +- lib/cpp/src/thrift/windows/TWinsockSingleton.cpp | 10 - lib/cpp/src/thrift/windows/TWinsockSingleton.h | 12 -- lib/cpp/src/thrift/windows/config.h| 3 - lib/cpp/test/CMakeLists.txt| 2 +- lib/cpp/test/Makefile.am | 2 - lib/cpp/test/TNonblockingSSLServerTest.cpp | 2 +- lib/cpp/test/TNonblockingServerTest.cpp| 2 +- lib/cpp/test/concurrency/ThreadManagerTests.h | 8 +- 26 files changed, 19 insertions(+), 612 deletions(-) diff --git a/.travis.yml b/.travis.yml index e09b8a4..96e0b51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -142,7 +142,7 @@ jobs: - JOB="C++98 (Boost Thread)" - SCRIPT="cmake.sh" - BUILD_LIBS="CPP TESTING TUTORIALS" -- BUILD_ARG="-DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF --DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" +- BUILD_ARG="-DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" - BUILD_ENV="-e CC=clang -e CXX=clang++" - script: build/docker/run.sh diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index f419229..43b73e4 100644 --- a/build/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake @@ -88,9 +88,7 @@ if(WITH_CPP) find_package(OpenSSL QUIET) CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON "OPENSSL_FOUND" OFF) -option(WITH_STDTHREADS "Build with C++ std::thread support" OFF) -CMAKE_DEPENDENT_OPTION(WITH_BOOSTTHREADS "Build with Boost threads support" OFF -"NOT WITH_STDTHREADS;Boost_FOUND" OFF) +option(WITH_STDTHREADS "Build with C++ std::thread support" ON) endif() CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON "BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF) @@ -107,7 +105,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON if(BUILD_CPP) set(boost_components) -if(WITH_BOOSTTHREADS OR BUILD_TESTING) +if(BUILD_TESTING) list(APPEND boost_components system thread) endif() if(BUILD_TESTING) @@ -206,7 +204,6 @@ message(STATUS " Library features:") message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}") message(STATUS " Build static libraries: ${WITH_STATIC_LIB}") message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}") -message(STATUS " Build with Boost thread support: ${WITH_BOOSTTHREADS}") message(STATUS " Build with boost/tr1/functional (forced) ${WITH_BOOST_FUNCTIONAL}") message(STATUS " Build with boost/smart_ptr (forced) ${WITH_BOOST_SMART_PTR}") message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}") diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index 626f5e5..cbd5ca8 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -90,9 +90,7 @@ add_definitions("-D__STDC_FORMAT_MACROS") add_definitions("-D__STDC_LIMIT_MACROS") # WITH_*THREADS selects which threading library to use -if(WITH_BOOSTTHREADS) - add_definitions("-DUSE_BOOST_THREAD=1") -elseif(WITH_STDTHREADS) +if(WITH_STDTHREADS) add_definitions("-DUSE_STD_THREAD=1") endif() diff --git
[thrift] 12/22: remove stdcxx namespace and use std directly
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit d65e91c47613e54eb0c2bf521ae2cd4242d58ed9 Author: cyy AuthorDate: Sat Jan 5 16:43:55 2019 +0800 remove stdcxx namespace and use std directly --- contrib/zeromq/TZmqServer.h | 5 +++-- lib/cpp/Makefile.am | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/zeromq/TZmqServer.h b/contrib/zeromq/TZmqServer.h index 43f86c0..ecd13b4 100644 --- a/contrib/zeromq/TZmqServer.h +++ b/contrib/zeromq/TZmqServer.h @@ -20,6 +20,7 @@ #ifndef _THRIFT_SERVER_TZMQSERVER_H_ #define _THRIFT_SERVER_TZMQSERVER_H_ 1 +#include #include #include @@ -28,7 +29,7 @@ namespace apache { namespace thrift { namespace server { class TZmqServer : public TServer { public: TZmqServer( - apache::thrift::stdcxx::shared_ptr processor, + std::shared_ptr processor, zmq::context_t& ctx, const std::string& endpoint, int type) : TServer(processor) , processor_(processor) @@ -56,7 +57,7 @@ class TZmqServer : public TServer { } private: - apache::thrift::stdcxx::shared_ptr processor_; + std::shared_ptr processor_; int zmq_type_; zmq::socket_t sock_; }; diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index 11d6b05..85bb9ab 100755 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -159,7 +159,6 @@ include_thrift_HEADERS = \ src/thrift/TApplicationException.h \ src/thrift/TLogging.h \ src/thrift/TToString.h \ - src/thrift/stdcxx.h \ src/thrift/TBase.h include_concurrencydir = $(include_thriftdir)/concurrency
[thrift] 17/22: replace boost static_assert with static_assert
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 7007506960437a51fad46a2426ebadee50b7817f Author: cyy AuthorDate: Sun Jan 6 10:12:45 2019 +0800 replace boost static_assert with static_assert --- lib/cpp/src/thrift/protocol/TBase64Utils.cpp | 2 -- lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc | 8 lib/cpp/src/thrift/protocol/TCompactProtocol.tcc | 8 lib/cpp/src/thrift/protocol/TDebugProtocol.cpp | 1 - lib/cpp/src/thrift/protocol/THeaderProtocol.cpp | 1 - lib/cpp/src/thrift/protocol/TProtocol.h | 3 +-- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/cpp/src/thrift/protocol/TBase64Utils.cpp b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp index beb76eb..7474f5a 100644 --- a/lib/cpp/src/thrift/protocol/TBase64Utils.cpp +++ b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp @@ -19,8 +19,6 @@ #include -#include - using std::string; namespace apache { diff --git a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc index d6f6dbb..902ef98 100644 --- a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc @@ -165,8 +165,8 @@ uint32_t TBinaryProtocolT::writeI64(const int64_t i64) { template uint32_t TBinaryProtocolT::writeDouble(const double dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits::is_iec559); uint64_t bits = bitwise_cast(dub); bits = ByteOrder_::toWire64(bits); @@ -388,8 +388,8 @@ uint32_t TBinaryProtocolT::readI64(int64_t& i64) { template uint32_t TBinaryProtocolT::readDouble(double& dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits::is_iec559); union bytes { uint8_t b[8]; diff --git a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc index d40c331..2b8207a 100644 --- a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc @@ -253,8 +253,8 @@ uint32_t TCompactProtocolT::writeI64(const int64_t i64) { */ template uint32_t TCompactProtocolT::writeDouble(const double dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits::is_iec559); uint64_t bits = bitwise_cast(dub); bits = THRIFT_htolell(bits); @@ -653,8 +653,8 @@ uint32_t TCompactProtocolT::readI64(int64_t& i64) { */ template uint32_t TCompactProtocolT::readDouble(double& dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits::is_iec559); union { uint64_t bits; diff --git a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp index d3c6beb..0e6d4a2 100644 --- a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp +++ b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp @@ -24,7 +24,6 @@ #include #include #include -#include using std::string; diff --git a/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp b/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp index a19d545..6242e30 100644 --- a/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp +++ b/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp @@ -26,7 +26,6 @@ #include -#include #include namespace apache { diff --git a/lib/cpp/src/thrift/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h index 28e1bb7..746973d 100644 --- a/lib/cpp/src/thrift/protocol/TProtocol.h +++ b/lib/cpp/src/thrift/protocol/TProtocol.h @@ -29,7 +29,6 @@ #include #include -#include #ifdef HAVE_NETINET_IN_H #include @@ -48,7 +47,7 @@ // http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html template static inline To bitwise_cast(From from) { - BOOST_STATIC_ASSERT(sizeof(From) == sizeof(To)); + static_assert(sizeof(From) == sizeof(To)); // BAD!!! These are all broken with -O2. //return *reinterpret_cast(); // BAD!!!
[thrift] 04/22: force c++11 in GNU autotools
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 0705d9956750b9d61d763c8d8e38bb98e86870eb Author: cyy AuthorDate: Sat Jan 5 10:52:48 2019 +0800 force c++11 in GNU autotools --- configure.ac | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e04891f..9885e1b 100755 --- a/configure.ac +++ b/configure.ac @@ -102,10 +102,7 @@ AC_PROG_AWK AC_PROG_RANLIB AC_LANG([C++]) -AX_CXX_COMPILE_STDCXX_11([noext], [optional]) -if test "$ac_success" = "no"; then - CXXFLAGS="$CXXFLAGS -Wno-variadic-macros -Wno-long-long -Wno-c++11-long-long" -fi +AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) AM_EXTRA_RECURSIVE_TARGETS([style]) AC_SUBST(CPPSTYLE_CMD, 'find . -type f \( -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" -or -iname "*.tcc" \) -printf "Reformatting: %h/%f\n" -exec clang-format -i {} \;')
[thrift] 09/22: remove boost smart ptr
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 9f837bbfb4c61ad8afe80950b6ce677a5cd39aeb Author: cyy AuthorDate: Sat Jan 5 14:49:24 2019 +0800 remove boost smart ptr --- build/cmake/DefineOptions.cmake | 6 - build/cmake/DefinePlatformSpecifc.cmake | 2 -- lib/cpp/src/thrift/stdcxx.h | 39 +++-- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index 43b73e4..7465c80 100644 --- a/build/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake @@ -45,11 +45,6 @@ if (WITH_BOOST_FUNCTIONAL) add_definitions(-DFORCE_BOOST_FUNCTIONAL) endif() -option(WITH_BOOST_SMART_PTR "Use boost/smart_ptr.hpp even under C++11 or later" OFF) -if (WITH_BOOST_SMART_PTR) -add_definitions(-DFORCE_BOOST_SMART_PTR) -endif() - option(WITH_BOOST_STATIC "Build with Boost static link library" OFF) set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC}) if (NOT WITH_BOOST_STATIC) @@ -205,7 +200,6 @@ message(STATUS " Build shared libraries: ${WITH_SHARED_LIB} message(STATUS " Build static libraries: ${WITH_STATIC_LIB}") message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}") message(STATUS " Build with boost/tr1/functional (forced) ${WITH_BOOST_FUNCTIONAL}") -message(STATUS " Build with boost/smart_ptr (forced) ${WITH_BOOST_SMART_PTR}") message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}") message(STATUS " Build with libevent support: ${WITH_LIBEVENT}") message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}") diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index cbd5ca8..98fb589 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -125,7 +125,5 @@ if (WITH_PLUGIN) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8") message(SEND_ERROR "Thrift compiler plug-in support is not possible with older gcc ( < 4.8 ) compiler") endif() - message(STATUS "Forcing use of boost::smart_ptr to build WITH_PLUGIN") - add_definitions("-DFORCE_BOOST_SMART_PTR=1") endif() diff --git a/lib/cpp/src/thrift/stdcxx.h b/lib/cpp/src/thrift/stdcxx.h index c8cabf5..1a65f87 100644 --- a/lib/cpp/src/thrift/stdcxx.h +++ b/lib/cpp/src/thrift/stdcxx.h @@ -87,42 +87,19 @@ // /// -// We can use std for memory functions only if the compiler supports template aliasing -// The macro BOOST_NO_CXX11_SMART_PTR is defined as 1 under Visual Studio 2010 and 2012 -// which do not support the feature, so we must continue to use C++98 and boost on them. -// We cannot use __cplusplus to detect this either, since Microsoft advertises an older one. - -#if defined(BOOST_NO_CXX11_SMART_PTR) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_SMART_PTR) -#include -#else #include -#endif namespace apache { namespace thrift { namespace stdcxx { -#if defined(BOOST_NO_CXX11_SMART_PTR) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_SMART_PTR) - - using ::boost::const_pointer_cast; - using ::boost::dynamic_pointer_cast; - using ::boost::enable_shared_from_this; - using ::boost::make_shared; - using ::boost::scoped_ptr; - using ::boost::shared_ptr; - using ::boost::static_pointer_cast; - using ::boost::weak_ptr; +using ::std::const_pointer_cast; +using ::std::dynamic_pointer_cast; +using ::std::enable_shared_from_this; +using ::std::make_shared; +template using scoped_ptr = std::unique_ptr; // compiler must support template aliasing +using ::std::shared_ptr; +using ::std::static_pointer_cast; +using ::std::weak_ptr; -#else - - using ::std::const_pointer_cast; - using ::std::dynamic_pointer_cast; - using ::std::enable_shared_from_this; - using ::std::make_shared; - template using scoped_ptr = std::unique_ptr; // compiler must support template aliasing - using ::std::shared_ptr; - using ::std::static_pointer_cast; - using ::std::weak_ptr; - -#endif }}} // apache::thrift::stdcxx
[thrift] 02/22: use noexcept instead of throw() in library
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 7b935597bac2336c7f4d282069ab4d78ca473543 Author: cyy AuthorDate: Sat Jan 5 10:04:25 2019 +0800 use noexcept instead of throw() in library --- lib/cpp/src/thrift/TApplicationException.h | 4 ++-- lib/cpp/src/thrift/Thrift.h | 4 ++-- lib/cpp/src/thrift/protocol/TProtocolException.h | 4 ++-- lib/cpp/src/thrift/transport/TSSLSocket.cpp | 6 +++--- lib/cpp/src/thrift/transport/TSSLSocket.h| 14 +++--- lib/cpp/src/thrift/transport/TTransportException.cpp | 2 +- lib/cpp/src/thrift/transport/TTransportException.h | 6 +++--- lib/cpp/src/thrift/transport/TZlibTransport.h| 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/cpp/src/thrift/TApplicationException.h b/lib/cpp/src/thrift/TApplicationException.h index 81d9424..60618fb 100644 --- a/lib/cpp/src/thrift/TApplicationException.h +++ b/lib/cpp/src/thrift/TApplicationException.h @@ -57,7 +57,7 @@ public: TApplicationException(TApplicationExceptionType type, const std::string& message) : TException(message), type_(type) {} - virtual ~TApplicationException() throw() {} + virtual ~TApplicationException() noexcept {} /** * Returns an error code that provides information about the type of error @@ -67,7 +67,7 @@ public: */ TApplicationExceptionType getType() const { return type_; } - virtual const char* what() const throw() { + virtual const char* what() const noexcept { if (message_.empty()) { switch (type_) { case UNKNOWN: diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h index e8e70eb..b41d5d2 100644 --- a/lib/cpp/src/thrift/Thrift.h +++ b/lib/cpp/src/thrift/Thrift.h @@ -82,9 +82,9 @@ public: TException(const std::string& message) : message_(message) {} - virtual ~TException() throw() {} + virtual ~TException() noexcept {} - virtual const char* what() const throw() { + virtual const char* what() const noexcept { if (message_.empty()) { return "Default TException."; } else { diff --git a/lib/cpp/src/thrift/protocol/TProtocolException.h b/lib/cpp/src/thrift/protocol/TProtocolException.h index 6e536b4..10178e1 100644 --- a/lib/cpp/src/thrift/protocol/TProtocolException.h +++ b/lib/cpp/src/thrift/protocol/TProtocolException.h @@ -59,7 +59,7 @@ public: TProtocolException(TProtocolExceptionType type, const std::string& message) : apache::thrift::TException(message), type_(type) {} - virtual ~TProtocolException() throw() {} + virtual ~TProtocolException() noexcept {} /** * Returns an error code that provides information about the type of error @@ -69,7 +69,7 @@ public: */ TProtocolExceptionType getType() const { return type_; } - virtual const char* what() const throw() { + virtual const char* what() const noexcept { if (message_.empty()) { switch (type_) { case UNKNOWN: diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp index 251ef2f..5f8a2c0 100644 --- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp +++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp @@ -1046,14 +1046,14 @@ void buildErrors(string& errors, int errno_copy, int sslerrno) { /** * Default implementation of AccessManager */ -Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa) throw() { +Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa) noexcept { (void)sa; return SKIP; } Decision DefaultClientAccessManager::verify(const string& host, const char* name, -int size) throw() { +int size) noexcept { if (host.empty() || name == NULL || size <= 0) { return SKIP; } @@ -1062,7 +1062,7 @@ Decision DefaultClientAccessManager::verify(const string& host, Decision DefaultClientAccessManager::verify(const sockaddr_storage& sa, const char* data, -int size) throw() { +int size) noexcept { bool match = false; if (sa.ss_family == AF_INET && size == sizeof(in_addr)) { match = (memcmp(&((sockaddr_in*))->sin_addr, data, size) == 0); diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.h b/lib/cpp/src/thrift/transport/TSSLSocket.h index ec30cc1..d8fd77e 100644 --- a/lib/cpp/src/thrift/transport/TSSLSocket.h +++ b/lib/cpp/src/thrift/transport/TSSLSocket.h @@ -335,7 +335,7 @@ public: TSSLException(const std::string& message) : TTransportException(TTransportException::INTERNAL_ERROR, message) {} - virtual const char* what() const throw() { + virtual const char* what() const noexcept {
[thrift] 18/22: replace boost unique_ptr with std::unique_ptr
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 77d26e2e5c2f9624f6d4b5f20819448164a7ae1b Author: cyy AuthorDate: Sun Jan 6 10:17:35 2019 +0800 replace boost unique_ptr with std::unique_ptr --- lib/cpp/src/thrift/transport/TFileTransport.cpp | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/cpp/src/thrift/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp index c9f65b8..afb4411 100644 --- a/lib/cpp/src/thrift/transport/TFileTransport.cpp +++ b/lib/cpp/src/thrift/transport/TFileTransport.cpp @@ -25,13 +25,6 @@ #include #include -#if (BOOST_VERSION >= 105700) -#include -using boost::movelib::unique_ptr; -#else -#include -using boost::interprocess::unique_ptr; -#endif #ifdef HAVE_SYS_TIME_H #include @@ -49,6 +42,7 @@ using boost::interprocess::unique_ptr; #include #include #include +#include #ifdef HAVE_SYS_STAT_H #include #endif @@ -203,8 +197,6 @@ void TFileTransport::write(const uint8_t* buf, uint32_t len) { enqueueEvent(buf, len); } -// this is needed until boost 1.57 as the older unique_ptr implementation -// has no default deleter in interprocess template struct uniqueDeleter { @@ -228,7 +220,7 @@ void TFileTransport::enqueueEvent(const uint8_t* buf, uint32_t eventLen) { return; } - unique_ptr > toEnqueue(new eventInfo()); + std::unique_ptr > toEnqueue(new eventInfo()); toEnqueue->eventBuff_ = new uint8_t[(sizeof(uint8_t) * eventLen) + 4]; // first 4 bytes is the event length
[thrift] 20/22: set c++11 in proper place
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 5e16f8b9086ce9bf4fa74993ecc51a7b9354f51e Author: cyy AuthorDate: Sun Jan 6 10:49:20 2019 +0800 set c++11 in proper place --- build/cmake/DefineCMakeDefaults.cmake | 17 +++-- build/cmake/DefinePlatformSpecifc.cmake | 11 --- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/build/cmake/DefineCMakeDefaults.cmake b/build/cmake/DefineCMakeDefaults.cmake index 65ccc69..93255e0 100644 --- a/build/cmake/DefineCMakeDefaults.cmake +++ b/build/cmake/DefineCMakeDefaults.cmake @@ -73,19 +73,16 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # C++ Language Level Defaults - this depends on the compiler capabilities # if (NOT DEFINED CMAKE_CXX_STANDARD) - if (MSVC AND MSVC_VERSION LESS 1800) -# MSVC 2012 and earlier don't support template aliases so you have to use C++98 -set(CMAKE_CXX_STANDARD 98) -message(STATUS "Setting C++98 as the default language level (for an older MSVC compiler).") - else() -set(CMAKE_CXX_STANDARD 11) # C++11 -message(STATUS "Setting C++11 as the default language level.") - endif() + set(CMAKE_CXX_STANDARD 11) # C++11 + message(STATUS "Setting C++11 as the default language level.") message(STATUS "To specify a different C++ language level, set CMAKE_CXX_STANDARD") endif() -if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) - set(CMAKE_CXX_STANDARD_REQUIRED OFF) # can degrade to C++98 if compiler does not support C++11 +if (CMAKE_CXX_STANDARD EQUAL 98) + message(FATAL_ERROR "only C++11 or above C++ standard is supported") +elseif (CMAKE_CXX_STANDARD EQUAL 11) + # should not fallback to C++98 + set(CMAKE_CXX_STANDARD_REQUIRED ON) endif() if (NOT DEFINED CMAKE_CXX_EXTENSIONS) diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index 98fb589..3f112b6 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -95,17 +95,6 @@ if(WITH_STDTHREADS) endif() # C++ Language Level -if (NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 11) -elseif (CMAKE_CXX_STANDARD EQUAL 98) - message(FATAL_ERROR "only C++11 or above C++ standard is supported") -endif() - -if (CMAKE_CXX_STANDARD EQUAL 11) - # should not fallback to C++98 - set(CMAKE_CXX_STANDARD_REQUIRED ON) -endif() - set(CXX_LANGUAGE_LEVEL "C++${CMAKE_CXX_STANDARD}") if (CMAKE_CXX_STANDARD_REQUIRED) string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [compiler must support it]")
[thrift] branch master updated (93e8ec2 -> 0140cbf)
This is an automated email from the ASF dual-hosted git repository. jking pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git. from 93e8ec2 THRIFT-4726: Remove SLF4J Logging Guards new 3cf0667 force c++11 in cmake new 7b93559 use noexcept instead of throw() in library new e42cf50 use noexcept instead of throw() in compiler generated code new 0705d99 force c++11 in GNU autotools new 83b65f0 allow specifing CMAKE_CXX_STANDARD above c++11 new c109e01 remove boost::thread and boost::mutex code new 2150a34 remove boost::thread in CI new f23e6a5 remove boost::thread in CI new 9f837bb remove boost smart ptr new 52637b3 remove std tr1 new 316723a remove stdcxx namespace and use std directly new d65e91c remove stdcxx namespace and use std directly new 8cb3b68 remove stdcxx namespace and use std directly new 0f43f95 revert noexcept changings new e9421b8 remove std tr1 new 7f8aef7 replace boost::atomic with std::atomic new 7007506 replace boost static_assert with static_assert new 77d26e2 replace boost unique_ptr with std::unique_ptr new 863262d add static_assert message new 5e16f8b set c++11 in proper place new 1f34504 remove unused boost headers new 0140cbf remove unused variables The 22 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml| 8 - build/appveyor/cl_setenv.bat | 11 +- build/cmake/DefineCMakeDefaults.cmake | 17 +- build/cmake/DefineOptions.cmake| 19 +- build/cmake/DefinePlatformSpecifc.cmake| 13 +- build/cmake/README-MSYS2.md| 2 +- build/cmake/README.md | 2 +- build/cmake/config.h.in| 3 - build/wincpp/build-thrift.bat | 1 - .../cpp/src/thrift/generate/t_cpp_generator.cc | 118 ++-- .../cpp/src/thrift/generate/t_erl_generator.cc | 2 - compiler/cpp/src/thrift/generate/t_go_generator.cc | 3 - compiler/cpp/src/thrift/generate/t_hs_generator.cc | 4 - compiler/cpp/src/thrift/generate/t_py_generator.cc | 2 - compiler/cpp/src/thrift/plugin/plugin.cc | 29 +-- compiler/cpp/src/thrift/plugin/plugin_output.cc| 7 +- configure.ac | 23 +-- contrib/transport-sample/ThriftCommon.h| 2 - contrib/zeromq/TZmqServer.cpp | 2 +- contrib/zeromq/TZmqServer.h| 5 +- contrib/zeromq/test-client.cpp | 2 +- contrib/zeromq/test-receiver.cpp | 2 +- contrib/zeromq/test-sender.cpp | 2 +- contrib/zeromq/test-server.cpp | 2 +- lib/c_glib/test/testbufferedtransport.c| 3 - lib/c_glib/test/testframedtransport.c | 3 - lib/c_glib/test/testthrifttestclient.cpp | 12 +- lib/c_glib/test/testtransportsocket.c | 3 - lib/cpp/CMakeLists.txt | 9 +- lib/cpp/Makefile.am| 8 - lib/cpp/src/thrift/TApplicationException.h | 4 +- lib/cpp/src/thrift/TDispatchProcessor.h| 8 +- lib/cpp/src/thrift/TProcessor.h| 33 ++-- lib/cpp/src/thrift/Thrift.h| 7 +- lib/cpp/src/thrift/async/TAsyncBufferProcessor.h | 8 +- lib/cpp/src/thrift/async/TAsyncChannel.cpp | 5 +- lib/cpp/src/thrift/async/TAsyncChannel.h | 5 +- lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h | 20 +- lib/cpp/src/thrift/async/TAsyncProcessor.h | 20 +- .../src/thrift/async/TAsyncProtocolProcessor.cpp | 18 +- lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h | 18 +- .../src/thrift/async/TConcurrentClientSyncInfo.h | 4 +- lib/cpp/src/thrift/async/TEvhttpClientChannel.h| 2 +- lib/cpp/src/thrift/async/TEvhttpServer.cpp | 19 +- lib/cpp/src/thrift/async/TEvhttpServer.h | 8 +- lib/cpp/src/thrift/concurrency/BoostMonitor.cpp| 214 - lib/cpp/src/thrift/concurrency/BoostMutex.cpp | 73 --- .../src/thrift/concurrency/BoostThreadFactory.cpp | 162 .../src/thrift/concurrency/BoostThreadFactory.h| 63 -- lib/cpp/src/thrift/concurrency/FunctionRunner.h| 18 +- lib/cpp/src/thrift/concurrency/Monitor.cpp | 8 +- lib/cpp/src/thrift/concurrency/Mutex.h | 6 +- .../src/thrift/concurrency/PlatformThreadFactory.h | 8 +- .../src/thrift/concurrency/PosixThreadFactory.cpp | 26 +--
[thrift] 03/22: use noexcept instead of throw() in compiler generated code
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit e42cf5023e3fc7fddf7e6f897aa1fb7d4a090afc Author: cyy AuthorDate: Sat Jan 5 10:05:48 2019 +0800 use noexcept instead of throw() in compiler generated code --- compiler/cpp/src/thrift/generate/t_cpp_generator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc index 3e8f728..0839302 100644 --- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc @@ -1097,7 +1097,7 @@ void t_cpp_generator::generate_struct_declaration(ostream& out, } if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) { -out << endl << indent() << "virtual ~" << tstruct->get_name() << "() throw();" << endl; +out << endl << indent() << "virtual ~" << tstruct->get_name() << "() noexcept;" << endl; } // Declare all fields @@ -1226,7 +1226,7 @@ void t_cpp_generator::generate_struct_definition(ostream& out, // Destructor if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) { force_cpp_out << endl << indent() << tstruct->get_name() << "::~" << tstruct->get_name() - << "() throw() {" << endl; + << "() noexcept {" << endl; indent_up(); indent_down(); @@ -1598,7 +1598,7 @@ void t_cpp_generator::generate_exception_what_method_decl(std::ostream& out, if (external) { out << tstruct->get_name() << "::"; } - out << "what() const throw()"; + out << "what() const noexcept"; } namespace struct_ostream_operator_generator {
[thrift] 10/22: remove std tr1
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 52637b33aba090851436b2031476529423ea3281 Author: cyy AuthorDate: Sat Jan 5 15:11:17 2019 +0800 remove std tr1 --- lib/cpp/src/thrift/stdcxx.h | 66 - 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/lib/cpp/src/thrift/stdcxx.h b/lib/cpp/src/thrift/stdcxx.h index 1a65f87..20910de 100644 --- a/lib/cpp/src/thrift/stdcxx.h +++ b/lib/cpp/src/thrift/stdcxx.h @@ -29,57 +29,25 @@ // /// -#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) || (defined(_MSC_VER) && _MSC_VER < 1800) || defined(FORCE_BOOST_FUNCTIONAL) -#if (BOOST_VERSION <= 106500) -#include -#else -#include -#endif -#define _THRIFT_FUNCTIONAL_TR1_ 1 -#endif +#include -#if _THRIFT_FUNCTIONAL_TR1_ - - namespace apache { namespace thrift { namespace stdcxx { - -using ::std::tr1::bind; -using ::std::tr1::function; - -namespace placeholders { - using ::std::tr1::placeholders::_1; - using ::std::tr1::placeholders::_2; - using ::std::tr1::placeholders::_3; - using ::std::tr1::placeholders::_4; - using ::std::tr1::placeholders::_5; - using ::std::tr1::placeholders::_6; - using ::std::tr1::placeholders::_7; - using ::std::tr1::placeholders::_8; - using ::std::tr1::placeholders::_9; -} // apache::thrift::stdcxx::placeholders - }}} // apache::thrift::stdcxx - -#else - - #include - - namespace apache { namespace thrift { namespace stdcxx { -using ::std::bind; -using ::std::function; - -namespace placeholders { - using ::std::placeholders::_1; - using ::std::placeholders::_2; - using ::std::placeholders::_3; - using ::std::placeholders::_4; - using ::std::placeholders::_5; - using ::std::placeholders::_6; - using ::std::placeholders::_7; - using ::std::placeholders::_8; - using ::std::placeholders::_9; -} // apache::thrift::stdcxx::placeholders - }}} // apache::thrift::stdcxx +namespace apache { namespace thrift { namespace stdcxx { + using ::std::bind; + using ::std::function; + + namespace placeholders { +using ::std::placeholders::_1; +using ::std::placeholders::_2; +using ::std::placeholders::_3; +using ::std::placeholders::_4; +using ::std::placeholders::_5; +using ::std::placeholders::_6; +using ::std::placeholders::_7; +using ::std::placeholders::_8; +using ::std::placeholders::_9; + } // apache::thrift::stdcxx::placeholders +}}} // apache::thrift::stdcxx -#endif /// //
[thrift] 13/22: remove stdcxx namespace and use std directly
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 8cb3b6854818bf63d3208afaf4dc9e70c6137500 Author: cyy AuthorDate: Sat Jan 5 17:09:34 2019 +0800 remove stdcxx namespace and use std directly --- lib/cpp/src/thrift/concurrency/Monitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cpp/src/thrift/concurrency/Monitor.cpp b/lib/cpp/src/thrift/concurrency/Monitor.cpp index 8e4ac79..9570cc6 100644 --- a/lib/cpp/src/thrift/concurrency/Monitor.cpp +++ b/lib/cpp/src/thrift/concurrency/Monitor.cpp @@ -34,7 +34,7 @@ namespace apache { namespace thrift { -using std::scoped_ptr; +using std::unique_ptr; using std::shared_ptr; namespace concurrency { @@ -163,7 +163,7 @@ private: } } - scoped_ptr ownedMutex_; + unique_ptr ownedMutex_; Mutex* mutex_; mutable pthread_cond_t pthread_cond_;
[thrift] 22/22: remove unused variables
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 0140cbf5674c5573d142c95c182f4ba98de99769 Author: cyy AuthorDate: Sun Jan 6 11:21:10 2019 +0800 remove unused variables --- compiler/cpp/src/thrift/generate/t_erl_generator.cc | 2 -- compiler/cpp/src/thrift/generate/t_go_generator.cc | 3 --- compiler/cpp/src/thrift/generate/t_hs_generator.cc | 4 compiler/cpp/src/thrift/generate/t_py_generator.cc | 2 -- lib/c_glib/test/testbufferedtransport.c | 3 --- lib/c_glib/test/testframedtransport.c | 3 --- lib/c_glib/test/testtransportsocket.c | 3 --- lib/cpp/src/thrift/protocol/TJSONProtocol.cpp | 1 - 8 files changed, 21 deletions(-) diff --git a/compiler/cpp/src/thrift/generate/t_erl_generator.cc b/compiler/cpp/src/thrift/generate/t_erl_generator.cc index 587133f..12d91a7 100644 --- a/compiler/cpp/src/thrift/generate/t_erl_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_erl_generator.cc @@ -415,7 +415,6 @@ const std::string emit_double_as_string(const double value) { } void t_erl_generator::generate_type_metadata(std::string function_name, vector names) { - vector::iterator s_iter; size_t num_structs = names.size(); indent(f_types_file_) << function_name << "() ->\n"; @@ -947,7 +946,6 @@ void t_erl_generator::generate_service(t_service* tservice) { void t_erl_generator::generate_service_metadata(t_service* tservice) { export_string("function_names", 0); vector functions = tservice->get_functions(); - vector::iterator f_iter; size_t num_functions = functions.size(); indent(f_service_) << "function_names() -> " << endl; diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.cc b/compiler/cpp/src/thrift/generate/t_go_generator.cc index 5ada4fa..ec16b87 100644 --- a/compiler/cpp/src/thrift/generate/t_go_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_go_generator.cc @@ -2153,7 +2153,6 @@ void t_go_generator::generate_service_remote(t_service* tservice) { << (*f_iter)->get_name() << "("; t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector& args = arg_struct->get_members(); -vector::const_iterator a_iter; std::vector::size_type num_args = args.size(); bool first = true; @@ -2308,7 +2307,6 @@ void t_go_generator::generate_service_remote(t_service* tservice) { for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) { t_struct* arg_struct = (*f_iter)->get_arglist(); const std::vector& args = arg_struct->get_members(); -vector::const_iterator a_iter; std::vector::size_type num_args = args.size(); string funcName((*f_iter)->get_name()); string pubName(publicize(funcName)); @@ -2693,7 +2691,6 @@ void t_go_generator::generate_process_function(t_service* tservice, t_function* // t_struct* xs = tfunction->get_xceptions(); // const std::vector& xceptions = xs->get_members(); - vector::const_iterator x_iter; f_types_ << indent() << "type " << processorName << " struct {" << endl; f_types_ << indent() << " handler " << publicize(tservice->get_name()) << endl; f_types_ << indent() << "}" << endl << endl; diff --git a/compiler/cpp/src/thrift/generate/t_hs_generator.cc b/compiler/cpp/src/thrift/generate/t_hs_generator.cc index ce7cd0c..8f6d4b0 100644 --- a/compiler/cpp/src/thrift/generate/t_hs_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_hs_generator.cc @@ -590,7 +590,6 @@ void t_hs_generator::generate_hs_struct_arbitrary(ostream& out, t_struct* tstruc string tname = type_name(tstruct); string name = tstruct->get_name(); const vector& members = tstruct->get_members(); - vector::const_iterator m_iter; indent(out) << "instance QC.Arbitrary " << tname << " where " << endl; indent_up(); @@ -654,7 +653,6 @@ void t_hs_generator::generate_hs_struct_arbitrary(ostream& out, t_struct* tstruc */ void t_hs_generator::generate_hs_struct_reader(ostream& out, t_struct* tstruct) { const vector& fields = tstruct->get_members(); - vector::const_iterator f_iter; string sname = type_name(tstruct); string id = tmp("_id"); @@ -725,7 +723,6 @@ void t_hs_generator::generate_hs_struct_reader(ostream& out, t_struct* tstruct) void t_hs_generator::generate_hs_struct_writer(ostream& out, t_struct* tstruct) { string name = type_name(tstruct); const vector& fields = tstruct->get_sorted_members(); - vector::const_iterator f_iter; string str = tmp("_str"); string f = tmp("_f"); string v = tmp("_v"); @@ -909,7 +906,6 @@ void t_hs_generator::generate_hs_function_helpers(t_function* tfunction) { void t_hs_generator::generate_hs_typemap(ostream& out, t_struct* tstruct) { string name = type_name(tstruct); const vector& fields = tstruct->get_sorted_members(); - vector::const_iterator f_iter; indent(out) << "typemap_" << name << " ::
[thrift] 01/22: force c++11 in cmake
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 3cf066708e29e8cef76102c82cb51e74dfdd0426 Author: root AuthorDate: Sat Jan 5 10:03:19 2019 +0800 force c++11 in cmake --- build/cmake/DefinePlatformSpecifc.cmake | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index a809c07..e324f59 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -97,21 +97,14 @@ elseif(WITH_STDTHREADS) endif() # C++ Language Level -set(CXX_LANGUAGE_LEVEL "C++${CMAKE_CXX_STANDARD}") -if (CMAKE_CXX_STANDARD_REQUIRED) - string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [compiler must support it]") -else() - string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [fallback to earlier if compiler does not support it]") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -Wno-long-long") endif() -if (CMAKE_CXX_EXTENSIONS) - string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [with compiler-specific extensions]") -else() - if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -Wno-long-long") - endif() - if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-long-long") - endif() +if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-long-long") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
[thrift] 05/22: allow specifing CMAKE_CXX_STANDARD above c++11
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 83b65f06fa380ed94669bdb461344f4f6b591191 Author: cyy AuthorDate: Sat Jan 5 11:06:50 2019 +0800 allow specifing CMAKE_CXX_STANDARD above c++11 --- build/cmake/DefinePlatformSpecifc.cmake | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index e324f59..626f5e5 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -97,14 +97,25 @@ elseif(WITH_STDTHREADS) endif() # C++ Language Level -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -Wno-long-long") +if (NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) +elseif (CMAKE_CXX_STANDARD EQUAL 98) + message(FATAL_ERROR "only C++11 or above C++ standard is supported") endif() -if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT MINGW) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-long-long") + +if (CMAKE_CXX_STANDARD EQUAL 11) + # should not fallback to C++98 + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + +set(CXX_LANGUAGE_LEVEL "C++${CMAKE_CXX_STANDARD}") +if (CMAKE_CXX_STANDARD_REQUIRED) + string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [compiler must support it]") +else() + string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [fallback to earlier if compiler does not support it]") +endif() +if (CMAKE_CXX_EXTENSIONS) + string(CONCAT CXX_LANGUAGE_LEVEL "${CXX_LANGUAGE_LEVEL} [with compiler-specific extensions]") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
[thrift] 16/22: replace boost::atomic with std::atomic
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 7f8aef709937fb0a033ba89eade671a989d16f96 Author: cyy AuthorDate: Sun Jan 6 10:05:50 2019 +0800 replace boost::atomic with std::atomic --- lib/cpp/src/thrift/server/TThreadPoolServer.h | 6 +++--- lib/cpp/src/thrift/transport/TFileTransport.h | 7 +++ lib/cpp/test/TServerIntegrationTest.cpp | 12 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/cpp/src/thrift/server/TThreadPoolServer.h b/lib/cpp/src/thrift/server/TThreadPoolServer.h index a957b47..121998c 100644 --- a/lib/cpp/src/thrift/server/TThreadPoolServer.h +++ b/lib/cpp/src/thrift/server/TThreadPoolServer.h @@ -20,7 +20,7 @@ #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_ #define _THRIFT_SERVER_TTHREADPOOLSERVER_H_ 1 -#include +#include #include #include @@ -90,8 +90,8 @@ protected: virtual void onClientDisconnected(TConnectedClient* pClient) /* override */; std::shared_ptr threadManager_; - boost::atomic timeout_; - boost::atomic taskExpiration_; + std::atomic timeout_; + std::atomic taskExpiration_; }; } diff --git a/lib/cpp/src/thrift/transport/TFileTransport.h b/lib/cpp/src/thrift/transport/TFileTransport.h index 4fbdd9e..6cc7bd2 100644 --- a/lib/cpp/src/thrift/transport/TFileTransport.h +++ b/lib/cpp/src/thrift/transport/TFileTransport.h @@ -24,11 +24,10 @@ #include #include +#include #include #include -#include - #include #include #include @@ -347,11 +346,11 @@ private: // conditions used to block when the buffer is full or empty Monitor notFull_, notEmpty_; - boost::atomic closing_; + std::atomic closing_; // To keep track of whether the buffer has been flushed Monitor flushed_; - boost::atomic forceFlush_; + std::atomic forceFlush_; // Mutex that is grabbed when enqueueing and swapping the read/write buffers Mutex mutex_; diff --git a/lib/cpp/test/TServerIntegrationTest.cpp b/lib/cpp/test/TServerIntegrationTest.cpp index 3723679..7976c8b 100644 --- a/lib/cpp/test/TServerIntegrationTest.cpp +++ b/lib/cpp/test/TServerIntegrationTest.cpp @@ -18,8 +18,8 @@ */ #define BOOST_TEST_MODULE TServerIntegrationTest +#include #include -#include #include #include #include @@ -310,10 +310,10 @@ public: shared_ptr pProtocol(new TBinaryProtocol(pSocket)); ParentServiceClient client(pProtocol); pSocket->open(); - bStressConnectionCount.fetch_add(1, boost::memory_order_relaxed); + bStressConnectionCount.fetch_add(1, std::memory_order_relaxed); for (int i = 0; i < rand() % 1000; ++i) { client.incrementGeneration(); -bStressRequestCount.fetch_add(1, boost::memory_order_relaxed); +bStressRequestCount.fetch_add(1, std::memory_order_relaxed); } } } @@ -321,9 +321,9 @@ public: shared_ptr pServer; shared_ptr pEventHandler; shared_ptr pServerThread; - boost::atomic bStressDone; - boost::atomic_int64_t bStressConnectionCount; - boost::atomic_int64_t bStressRequestCount; + std::atomic bStressDone; + std::atomic bStressConnectionCount; + std::atomic bStressRequestCount; }; template
[thrift] 21/22: remove unused boost headers
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 1f34504f43a7a409364d4114f180762bf2679e57 Author: cyy AuthorDate: Sun Jan 6 11:19:38 2019 +0800 remove unused boost headers --- lib/cpp/src/thrift/Thrift.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h index b41d5d2..6322742 100644 --- a/lib/cpp/src/thrift/Thrift.h +++ b/lib/cpp/src/thrift/Thrift.h @@ -42,9 +42,6 @@ #include #include -#include -#include - #include #include
[thrift] 15/22: remove std tr1
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit e9421b826f3db5491b583db5202394e8e3861226 Author: cyy AuthorDate: Sat Jan 5 19:28:55 2019 +0800 remove std tr1 --- build/cmake/DefineOptions.cmake | 6 -- 1 file changed, 6 deletions(-) diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index 7465c80..9aff53c 100644 --- a/build/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake @@ -40,11 +40,6 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON) # and enables the library if all are found. This means the default is to build as # much as possible but leaving out libraries if their dependencies are not met. -option(WITH_BOOST_FUNCTIONAL "Use boost/tr1/functional.hpp even under C++11 or later" OFF) -if (WITH_BOOST_FUNCTIONAL) -add_definitions(-DFORCE_BOOST_FUNCTIONAL) -endif() - option(WITH_BOOST_STATIC "Build with Boost static link library" OFF) set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC}) if (NOT WITH_BOOST_STATIC) @@ -199,7 +194,6 @@ message(STATUS " Library features:") message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}") message(STATUS " Build static libraries: ${WITH_STATIC_LIB}") message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}") -message(STATUS " Build with boost/tr1/functional (forced) ${WITH_BOOST_FUNCTIONAL}") message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}") message(STATUS " Build with libevent support: ${WITH_LIBEVENT}") message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")
[thrift] 19/22: add static_assert message
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit 863262dad7ee2719a6699d564a249dfea7480032 Author: cyy AuthorDate: Sun Jan 6 10:40:58 2019 +0800 add static_assert message --- lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc | 8 lib/cpp/src/thrift/protocol/TCompactProtocol.tcc | 8 lib/cpp/src/thrift/protocol/TProtocol.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc index 902ef98..fe73992 100644 --- a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc @@ -165,8 +165,8 @@ uint32_t TBinaryProtocolT::writeI64(const int64_t i64) { template uint32_t TBinaryProtocolT::writeDouble(const double dub) { - static_assert(sizeof(double) == sizeof(uint64_t)); - static_assert(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t), "sizeof(double) == sizeof(uint64_t)"); + static_assert(std::numeric_limits::is_iec559, "std::numeric_limits::is_iec559"); uint64_t bits = bitwise_cast(dub); bits = ByteOrder_::toWire64(bits); @@ -388,8 +388,8 @@ uint32_t TBinaryProtocolT::readI64(int64_t& i64) { template uint32_t TBinaryProtocolT::readDouble(double& dub) { - static_assert(sizeof(double) == sizeof(uint64_t)); - static_assert(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t), "sizeof(double) == sizeof(uint64_t)"); + static_assert(std::numeric_limits::is_iec559, "std::numeric_limits::is_iec559"); union bytes { uint8_t b[8]; diff --git a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc index 2b8207a..8efec6e 100644 --- a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc @@ -253,8 +253,8 @@ uint32_t TCompactProtocolT::writeI64(const int64_t i64) { */ template uint32_t TCompactProtocolT::writeDouble(const double dub) { - static_assert(sizeof(double) == sizeof(uint64_t)); - static_assert(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t), "sizeof(double) == sizeof(uint64_t)"); + static_assert(std::numeric_limits::is_iec559, "std::numeric_limits::is_iec559"); uint64_t bits = bitwise_cast(dub); bits = THRIFT_htolell(bits); @@ -653,8 +653,8 @@ uint32_t TCompactProtocolT::readI64(int64_t& i64) { */ template uint32_t TCompactProtocolT::readDouble(double& dub) { - static_assert(sizeof(double) == sizeof(uint64_t)); - static_assert(std::numeric_limits::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t), "sizeof(double) == sizeof(uint64_t)"); + static_assert(std::numeric_limits::is_iec559, "std::numeric_limits::is_iec559"); union { uint64_t bits; diff --git a/lib/cpp/src/thrift/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h index 746973d..bbc6816 100644 --- a/lib/cpp/src/thrift/protocol/TProtocol.h +++ b/lib/cpp/src/thrift/protocol/TProtocol.h @@ -47,7 +47,7 @@ // http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html template static inline To bitwise_cast(From from) { - static_assert(sizeof(From) == sizeof(To)); + static_assert(sizeof(From) == sizeof(To), "sizeof(From) == sizeof(To)"); // BAD!!! These are all broken with -O2. //return *reinterpret_cast(); // BAD!!!
[thrift] 08/22: remove boost::thread in CI
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git commit f23e6a5e23c8ad1feaaa6913314c7836246a2925 Author: cyy AuthorDate: Sat Jan 5 14:00:03 2019 +0800 remove boost::thread in CI --- build/appveyor/cl_setenv.bat | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/build/appveyor/cl_setenv.bat b/build/appveyor/cl_setenv.bat index 62856cb..c33366d 100644 --- a/build/appveyor/cl_setenv.bat +++ b/build/appveyor/cl_setenv.bat @@ -14,9 +14,7 @@ @ECHO OFF - IF "%PROFILE%" == "MSVC2010" ( - CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %PLATFORM% -) ELSE IF "%PROFILE%" == "MSVC2012" ( +IF "%PROFILE%" == "MSVC2012" ( CALL "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" %PLATFORM% ) ELSE IF "%PROFILE%" == "MSVC2013" ( CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% @@ -54,12 +52,7 @@ IF "%PROFILE:~0,4%" == "MSVC" ( SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM% SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty - :: MSVC2010 doesn't "do" std::thread - IF "%COMPILER%" == "vc100" ( -SET THREADMODEL=BOOST - ) ELSE ( -SET THREADMODEL=STD - ) + SET THREADMODEL=STD IF "%PYTHON_VERSION%" == "" ( SET WITH_PYTHON=OFF
svn commit: r31802 - in /dev/thrift: 0.10.0-rc0/ 0.10.0-rc1/ 0.11.0-rc0/ 0.12.0-rc0/
Author: jking Date: Mon Jan 7 21:17:48 2019 New Revision: 31802 Log: remove release candidates Removed: dev/thrift/0.10.0-rc0/ dev/thrift/0.10.0-rc1/ dev/thrift/0.11.0-rc0/ dev/thrift/0.12.0-rc0/
[thrift] branch master updated: add/move a couple build related tools around
This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git The following commit(s) were added to refs/heads/master by this push: new e824efc add/move a couple build related tools around e824efc is described below commit e824efcb7935e019998264b8982ad5e51858879e Author: James E. King III AuthorDate: Mon Jan 7 16:50:54 2019 -0500 add/move a couple build related tools around --- build/fixchanges.sh | 39 +++ veralign.sh => build/veralign.sh | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/build/fixchanges.sh b/build/fixchanges.sh new file mode 100755 index 000..6c57b54 --- /dev/null +++ b/build/fixchanges.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# +# fixchanges will take a file as input and look for text matching +# the pattern [THRIFT-] (the number of digits is not important) +# which is not a markdown link, and change it to be a markdown link. +# The tool writes to stdout so you can redirect it to a temporary +# file and then compare against the original file before replacing +# it. +# +# This tool was developed after the 0.12.0 release to assist with +# generation of CHANGES.md content. +# + +while IFS='' read -r line || [[ -n "$line" ]]; do +if [[ "$line" =~ ^(.*)\[(THRIFT-[[:digit:]]+)\][^\(](.*)$ ]]; then +echo "${BASH_REMATCH[1]}[${BASH_REMATCH[2]}](https://issues.apache.org/jira/browse/${BASH_REMATCH[2]}) ${BASH_REMATCH[3]}" +else +echo "$line" +fi +done < "$1" diff --git a/veralign.sh b/build/veralign.sh similarity index 99% rename from veralign.sh rename to build/veralign.sh index 380aa48..61744b4 100755 --- a/veralign.sh +++ b/build/veralign.sh @@ -43,7 +43,7 @@ declare -A FILES # These files require a manual touch: -FILES[CHANGES]=manual +FILES[CHANGES.md]=manual FILES[debian/changelog]=manual FILES[doap.rdf]=manual
svn commit: r1850697 - /thrift/cms-site/trunk/lib/path.pm
Author: jking Date: Mon Jan 7 22:11:40 2019 New Revision: 1850697 URL: http://svn.apache.org/viewvc?rev=1850697=rev Log: CMS commit to thrift by jking Modified: thrift/cms-site/trunk/lib/path.pm Modified: thrift/cms-site/trunk/lib/path.pm URL: http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/path.pm?rev=1850697=1850696=1850697=diff == --- thrift/cms-site/trunk/lib/path.pm (original) +++ thrift/cms-site/trunk/lib/path.pm Mon Jan 7 22:11:40 2019 @@ -1,5 +1,5 @@ package path; - + use ASF::Util qw/walk_content_tree Load/; use strict; use warnings;
svn commit: r1038673 - in /websites/staging/thrift/trunk/content: ./ tutorial/cpp.html
Author: buildbot Date: Mon Jan 7 22:12:03 2019 New Revision: 1038673 Log: Staging update by buildbot for thrift Modified: websites/staging/thrift/trunk/content/ (props changed) websites/staging/thrift/trunk/content/tutorial/cpp.html Propchange: websites/staging/thrift/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Mon Jan 7 22:12:03 2019 @@ -1 +1 @@ -1850464 +1850697 Modified: websites/staging/thrift/trunk/content/tutorial/cpp.html == --- websites/staging/thrift/trunk/content/tutorial/cpp.html (original) +++ websites/staging/thrift/trunk/content/tutorial/cpp.html Mon Jan 7 22:12:03 2019 @@ -120,7 +120,6 @@ h2:hover > .headerlink, h3:hover > .head #include thrift/protocol/TBinaryProtocol.h #include thrift/transport/TSocket.h #include thrift/transport/TTransportUtils.h -#include thrift/stdcxx.h #include ../gen-cpp/Calculator.h @@ -133,9 +132,9 @@ h2:hover > .headerlink, h3:hover > .head using namespace shared; int main() { - stdcxx::shared_ptrTTransport socket(new TSocket(localhost, 9090)); - stdcxx::shared_ptrTTransport transport(new TBufferedTransport(socket)); - stdcxx::shared_ptrTProtocol protocol(new TBinaryProtocol(transport)); + std::shared_ptrTTransport socket(new TSocket(localhost, 9090)); + std::shared_ptrTTransport transport(new TBufferedTransport(socket)); + std::shared_ptrTProtocol protocol(new TBinaryProtocol(transport)); CalculatorClient client(protocol); try { @@ -207,7 +206,6 @@ h2:hover > .headerlink, h3:hover > .head #include thrift/transport/TSocket.h #include thrift/transport/TTransportUtils.h #include thrift/TToString.h -#include thrift/stdcxx.h #include iostream #include stdexcept @@ -297,7 +295,7 @@ h2:hover > .headerlink, h3:hover > .head virtual ~CalculatorCloneFactory() {} virtual CalculatorIf* getHandler(const ::apache::thrift::TConnectionInfo connInfo) { -stdcxx::shared_ptrTSocket sock = stdcxx::dynamic_pointer_castTSocket(connInfo.transport); +std::shared_ptrTSocket sock = std::dynamic_pointer_castTSocket(connInfo.transport); cout Incoming connection\n; cout \tSocketInfo: sock-getSocketInfo() \n; cout \tPeerHost: sock-getPeerHost() \n; @@ -312,24 +310,25 @@ h2:hover > .headerlink, h3:hover > .head int main() { TThreadedServer server( -stdcxx::make_sharedCalculatorProcessorFactory(stdcxx::make_sharedCalculatorCloneFactory()), -stdcxx::make_sharedTServerSocket(9090), //port -stdcxx::make_sharedTBufferedTransportFactory(), -stdcxx::make_sharedTBinaryProtocolFactory()); +std::make_sharedCalculatorProcessorFactory(std::make_sharedCalculatorCloneFactory()), +std::make_sharedTServerSocket(9090), //port +std::make_sharedTBufferedTransportFactory(), +std::make_sharedTBinaryProtocolFactory()); /* // if you dont need per-connection state, do the following instead TThreadedServer server( - stdcxx::make_sharedCalculatorProcessor(stdcxx::make_sharedCalculatorHandler()), -stdcxx::make_sharedTServerSocket(9090), //port - stdcxx::make_sharedTBufferedTransportFactory(), - stdcxx::make_sharedTBinaryProtocolFactory()); + std::make_sharedCalculatorProcessor(std::make_sharedCalculatorHandler()), +std::make_sharedTServerSocket(9090), //port + std::make_sharedTBufferedTransportFactory(), +std::make_sharedTBinaryProtocolFactory()); */ /** * Here are some alternate server types... // This server only allows one connection at a time, but spawns no threads + TSimpleServer server( @@ -351,8 +350,7 @@ h2:hover > .headerlink, h3:hover > .head } h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible } - { -stdcxx::shared_ptrTSocket sock = stdcxx::dynamic_pointer_castTSocket(connInfo.transport); +std::shared_ptrTSocket sock = std::dynamic_pointer_castTSocket(connInfo.transport); cout Incoming connection\n; cout \tSocketInfo: sock-getSocketInfo() \n; cout \tPeerHost: sock-getPeerHost() \n;