diff options
24 files changed, 22 insertions, 3125 deletions
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index 54668f76618..cff386804a2 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -151,12 +151,6 @@ USE_READLINE ?= no # #CPP11_MAPPING ?= yes -# -# Define CPP11 as yes if you want to enable C++11 features in GCC or -# Clang. -# -#CPP11 ?= yes - # ---------------------------------------------------------------------- # Don't change anything below this line! # ---------------------------------------------------------------------- diff --git a/cpp/include/Ice/AsyncResult.h b/cpp/include/Ice/AsyncResult.h index 5b4e7d3f347..e682f2d0ee9 100644 --- a/cpp/include/Ice/AsyncResult.h +++ b/cpp/include/Ice/AsyncResult.h @@ -24,10 +24,6 @@ #include <Ice/BasicStream.h> #include <Ice/VirtualShared.h> -#ifdef ICE_CPP11_COMPILER -# include <functional> // for std::function -#endif - namespace IceInternal { @@ -248,104 +244,6 @@ private: Callback _sent; }; -#ifdef ICE_CPP11_COMPILER - -template<typename T> struct callback_type -{ - static const int value = 1; -}; - -template<> struct callback_type<void(const ::Ice::AsyncResultPtr&)> -{ - static const int value = 2; -}; - -template<> struct callback_type<void(const ::Ice::Exception&)> -{ - static const int value = 3; -}; - -template<typename Callable, typename = void> struct callable_type -{ - static const int value = 1; -}; - -template<class Callable> struct callable_type<Callable, typename ::std::enable_if< - ::std::is_class<Callable>::value && - !::std::is_bind_expression<Callable>::value>::type> -{ - template<typename T, T> struct TypeCheck; - template<typename T> struct AsyncResultCallback - { - typedef void (T::*ok)(const ::Ice::AsyncResultPtr&) const; - }; - template<typename T> struct ExceptionCallback - { - typedef void (T::*ok)(const ::Ice::Exception&) const; - }; - - typedef char (&other)[1]; - typedef char (&asyncResult)[2]; - typedef char (&exception)[3]; - - template<typename T> static other check(...); - template<typename T> static asyncResult check(TypeCheck<typename AsyncResultCallback<T>::ok, &T::operator()>*); - template<typename T> static exception check(TypeCheck<typename ExceptionCallback<T>::ok, &T::operator()>*); - - enum { value = sizeof(check<Callable>(0)) }; -}; - -template<> struct callable_type<void(*)(const ::Ice::AsyncResultPtr&)> -{ - static const int value = 2; -}; - -template<> struct callable_type<void(*)(const ::Ice::Exception&)> -{ - static const int value = 3; -}; - -template<typename Callable, typename Callback> struct is_callable -{ - static const bool value = callable_type<Callable>::value == callback_type<Callback>::value; -}; - -// -// COMPILERFIX: we have to use this function specialization to workaround an issue where -// VS2012 and GCC 4.6 can't resolve the begin_xxx overloads if we just use std::function. -// We use some SNIFAE here to help the compiler with the overload resolution. -// -template<class S> class Function : public std::function<S> -{ - -public: - - template<typename T> Function(T f, typename ::std::enable_if<is_callable<T, S>::value>::type* = 0) - : std::function<S>(f) - { - } - - Function() - { - } - - Function(::std::nullptr_t) : ::std::function<S>(nullptr) - { - } -}; - -#else - -template<class S> class Function -{ -public: - Function() - { - } -}; - -#endif - } namespace Ice @@ -370,13 +268,6 @@ newCallback(T* instance, return new ::IceInternal::AsyncCallback<T>(instance, cb, sentcb); } -# ifdef ICE_CPP11_COMPILER - -ICE_API CallbackPtr -newCallback(const ::IceInternal::Function<void (const AsyncResultPtr&)>&, - const ::IceInternal::Function<void (const AsyncResultPtr&)>& = - ::IceInternal::Function<void (const AsyncResultPtr&)>()); -# endif #endif } diff --git a/cpp/include/Ice/BatchRequestInterceptor.h b/cpp/include/Ice/BatchRequestInterceptor.h index 79c0f6b5e64..ad2623fdb56 100644 --- a/cpp/include/Ice/BatchRequestInterceptor.h +++ b/cpp/include/Ice/BatchRequestInterceptor.h @@ -14,10 +14,6 @@ #include <Ice/ProxyF.h> #include <Ice/VirtualShared.h> -#ifdef ICE_CPP11_COMPILER -# include <functional> -#endif - namespace Ice { @@ -43,11 +39,6 @@ public: }; ICE_DEFINE_PTR(BatchRequestInterceptorPtr, BatchRequestInterceptor); -#ifdef ICE_CPP11_COMPILER -ICE_API BatchRequestInterceptorPtr -newBatchRequestInterceptor(const ::std::function<void (const BatchRequest&, int, int)>&); -#endif - }; #endif diff --git a/cpp/include/Ice/Dispatcher.h b/cpp/include/Ice/Dispatcher.h index 841df0147b8..8d67c4b446e 100644 --- a/cpp/include/Ice/Dispatcher.h +++ b/cpp/include/Ice/Dispatcher.h @@ -14,9 +14,6 @@ #include <IceUtil/Shared.h> #include <IceUtil/Handle.h> #include <Ice/ConnectionF.h> -#ifdef ICE_CPP11_COMPILER -# include <functional> -#endif namespace Ice { @@ -41,11 +38,6 @@ public: typedef IceUtil::Handle<Dispatcher> DispatcherPtr; -#ifdef ICE_CPP11_COMPILER -ICE_API DispatcherPtr -newDispatcher(const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)>&); -#endif - } #endif diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 091fc55b2f9..a64758f2969 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -498,49 +498,6 @@ ICE_API ::std::ostream& operator<<(::std::ostream&, const Ice::ObjectPrx&); } #else // C++98 mapping -# ifdef ICE_CPP11_COMPILER -namespace IceInternal -{ - -class ICE_API Cpp11FnCallbackNC : public CallbackBase -{ -public: - - Cpp11FnCallbackNC(const ::std::function<void (const ::Ice::Exception&)>&, - const ::std::function<void (bool)>&); - - virtual CallbackBasePtr verify(const ::Ice::LocalObjectPtr&); - - virtual void sent(const ::Ice::AsyncResultPtr&) const; - - virtual bool hasSentCallback() const; - -protected: - - void exception(const ::Ice::AsyncResultPtr&, const ::Ice::Exception& ex) const; - - ::std::function<void (const ::Ice::Exception&)> _exception; - ::std::function<void (bool)> _sent; -}; - -class ICE_API Cpp11FnOnewayCallbackNC : public Cpp11FnCallbackNC -{ -public: - - Cpp11FnOnewayCallbackNC(const ::std::function<void ()>&, - const ::std::function<void (const ::Ice::Exception&)>&, - const ::std::function<void (bool)>&); - - virtual void - completed(const ::Ice::AsyncResultPtr&) const; - -private: - - ::std::function<void ()> _cb; -}; - -} -# endif namespace IceProxy { @@ -611,45 +568,6 @@ public: bool ice_isA(const ::std::string& typeId, const ::Ice::Context& = ::Ice::noExplicitContext); -# ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr - begin_ice_isA(const ::std::string&, - const ::Ice::Context&, - const ::IceInternal::Function<void (bool)>&, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); - - ::Ice::AsyncResultPtr - begin_ice_isA(const ::std::string& typeId, - const ::IceInternal::Function<void (bool)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_isA(typeId, ::Ice::noExplicitContext, response, exception, sent); - } - - ::Ice::AsyncResultPtr - begin_ice_isA(const ::std::string& typeId, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_isA(typeId, ::Ice::noExplicitContext, ::Ice::newCallback(completed, sent), 0); - } - - ::Ice::AsyncResultPtr - begin_ice_isA(const ::std::string& typeId, - const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_isA(typeId, ctx, ::Ice::newCallback(completed, sent), 0); - } -# endif - ::Ice::AsyncResultPtr begin_ice_isA(const ::std::string& typeId, const ::Ice::Context& __ctx = ::Ice::noExplicitContext) { @@ -690,44 +608,6 @@ public: void ice_ping(const ::Ice::Context& = ::Ice::noExplicitContext); -# ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr - begin_ice_ping(const ::Ice::Context& ctx, - const ::IceInternal::Function<void ()>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return __begin_ice_ping(ctx, new ::IceInternal::Cpp11FnOnewayCallbackNC(response, exception, sent), 0); - } - - ::Ice::AsyncResultPtr - begin_ice_ping(const ::IceInternal::Function<void ()>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_ping(::Ice::noExplicitContext, response, exception, sent); - } - - ::Ice::AsyncResultPtr - begin_ice_ping(const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_ping(::Ice::noExplicitContext, ::Ice::newCallback(completed, sent), 0); - } - - ::Ice::AsyncResultPtr - begin_ice_ping(const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_ping(ctx, ::Ice::newCallback(completed, sent), 0); - } -# endif - ::Ice::AsyncResultPtr begin_ice_ping(const ::Ice::Context& __ctx = ::Ice::noExplicitContext) { return __begin_ice_ping(__ctx, ::IceInternal::__dummyCallback, 0); @@ -761,41 +641,6 @@ public: ::std::vector< ::std::string> ice_ids(const ::Ice::Context& context = ::Ice::noExplicitContext); -# ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr - begin_ice_ids(const ::Ice::Context&, - const ::IceInternal::Function<void (const ::std::vector< ::std::string>&)>&, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); - - ::Ice::AsyncResultPtr - begin_ice_ids(const ::IceInternal::Function<void (const ::std::vector< ::std::string>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_ids(::Ice::noExplicitContext, response, exception, sent); - } - - ::Ice::AsyncResultPtr - begin_ice_ids(const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_ids(::Ice::noExplicitContext, ::Ice::newCallback(completed, sent), 0); - } - - ::Ice::AsyncResultPtr - begin_ice_ids(const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_ids(ctx, ::Ice::newCallback(completed, sent), 0); - } -# endif - ::Ice::AsyncResultPtr begin_ice_ids(const ::Ice::Context& __ctx = ::Ice::noExplicitContext) { return __begin_ice_ids(__ctx, ::IceInternal::__dummyCallback, 0); @@ -831,41 +676,6 @@ public: ::std::string ice_id(const ::Ice::Context& context = ::Ice::noExplicitContext); -# ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr - begin_ice_id(const ::Ice::Context&, - const ::IceInternal::Function<void (const ::std::string&)>&, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); - - ::Ice::AsyncResultPtr - begin_ice_id(const ::IceInternal::Function<void (const ::std::string&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_id(::Ice::noExplicitContext, response, exception, sent); - } - - ::Ice::AsyncResultPtr - begin_ice_id(const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_id(::Ice::noExplicitContext, ::Ice::newCallback(completed, sent), 0); - } - - ::Ice::AsyncResultPtr - begin_ice_id(const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& sent = - ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()) - { - return __begin_ice_id(ctx, ::Ice::newCallback(completed, sent), 0); - } -# endif - ::Ice::AsyncResultPtr begin_ice_id(const ::Ice::Context& __ctx = ::Ice::noExplicitContext) { return __begin_ice_id(__ctx, ::IceInternal::__dummyCallback, 0); @@ -913,53 +723,6 @@ public: ::std::vector< ::Ice::Byte>&, const ::Ice::Context& context = ::Ice::noExplicitContext); -# ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr begin_ice_invoke( - const ::std::string&, - ::Ice::OperationMode, - const ::std::vector< ::Ice::Byte>&, - const ::Ice::Context&, - const ::IceInternal::Function<void (bool, const ::std::vector< ::Ice::Byte>&)>&, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); - - ::Ice::AsyncResultPtr begin_ice_invoke( - const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::vector< ::Ice::Byte>& inParams, - const ::IceInternal::Function<void (bool, const ::std::vector< ::Ice::Byte>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_invoke(operation, mode, inParams, ::Ice::noExplicitContext, response, exception, sent); - } - - ::Ice::AsyncResultPtr begin_ice_invoke( - const ::std::string&, - ::Ice::OperationMode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - const ::Ice::Context&, - const ::IceInternal::Function<void (bool, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&)>&, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); - - ::Ice::AsyncResultPtr begin_ice_invoke( - const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, - const ::IceInternal::Function<void (bool, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>(), - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_invoke(operation, mode, inParams, ::Ice::noExplicitContext, response, exception, sent); - } - -# endif - ::Ice::AsyncResultPtr begin_ice_invoke(const ::std::string& operation, ::Ice::OperationMode mode, const ::std::vector< ::Ice::Byte>& inParams) @@ -1141,19 +904,6 @@ public: ::Ice::ConnectionPtr ice_getConnection(); -#ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr begin_ice_getConnection( - const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& completed) - { - return begin_ice_getConnectionInternal(::Ice::newCallback(completed, 0), 0); - } - - ::Ice::AsyncResultPtr begin_ice_getConnection( - const ::IceInternal::Function<void (const ::Ice::ConnectionPtr&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception = - ::IceInternal::Function<void (const ::Ice::Exception&)>()); -#endif - ::Ice::AsyncResultPtr begin_ice_getConnection() { return begin_ice_getConnectionInternal(::IceInternal::__dummyCallback, 0); @@ -1177,16 +927,6 @@ public: void ice_flushBatchRequests(); -#ifdef ICE_CPP11_COMPILER - ::Ice::AsyncResultPtr begin_ice_flushBatchRequests( - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()) - { - return begin_ice_flushBatchRequestsInternal( - new ::IceInternal::Cpp11FnOnewayCallbackNC(nullptr, exception, sent), 0); - } -#endif - ::Ice::AsyncResultPtr begin_ice_flushBatchRequests() { return begin_ice_flushBatchRequestsInternal(::IceInternal::__dummyCallback, 0); diff --git a/cpp/src/Ice/AsyncResult.cpp b/cpp/src/Ice/AsyncResult.cpp index 69ba7d0b5ab..8eb8c862f1f 100644 --- a/cpp/src/Ice/AsyncResult.cpp +++ b/cpp/src/Ice/AsyncResult.cpp @@ -556,63 +556,6 @@ public: // CallbackBasePtr IceInternal::__dummyCallback = ICE_MAKE_SHARED(DummyCallback); -#ifndef ICE_CPP11_MAPPING -# ifdef ICE_CPP11_COMPILER - -Ice::CallbackPtr -Ice::newCallback(const ::IceInternal::Function<void (const AsyncResultPtr&)>& completed, - const ::IceInternal::Function<void (const AsyncResultPtr&)>& sent) -{ - class Cpp11CB : public GenericCallbackBase - { - public: - - Cpp11CB(const ::std::function<void (const AsyncResultPtr&)>& completed, - const ::std::function<void (const AsyncResultPtr&)>& sent) : - _completed(completed), - _sent(sent) - { - checkCallback(true, completed != nullptr); - } - - virtual void - completed(const AsyncResultPtr& result) const - { - _completed(result); - } - - virtual CallbackBasePtr - verify(const LocalObjectPtr&) - { - return this; // Nothing to do, the cookie is not type-safe. - } - - virtual void - sent(const AsyncResultPtr& result) const - { - if(_sent != nullptr) - { - _sent(result); - } - } - - virtual bool - hasSentCallback() const - { - return _sent != nullptr; - } - - private: - - ::std::function< void (const AsyncResultPtr&)> _completed; - ::std::function< void (const AsyncResultPtr&)> _sent; - }; - - return new Cpp11CB(completed, sent); -} -# endif -#endif - void IceInternal::CallbackBase::checkCallback(bool obj, bool cb) { diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index 13d082a1af1..d762295875b 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -357,47 +357,6 @@ Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBa } AsyncResultPtr -Ice::CommunicatorI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, - const IceInternal::Function<void (bool)>& sent) -{ -#ifdef ICE_CPP11_COMPILER - class Cpp11CB : public IceInternal::Cpp11FnCallbackNC - { - - public: - - Cpp11CB(const IceInternal::Function<void (const Exception&)>& excb, - const IceInternal::Function<void (bool)>& sentcb) : - IceInternal::Cpp11FnCallbackNC(excb, sentcb) - { - CallbackBase::checkCallback(true, excb != nullptr); - } - - virtual void - completed(const AsyncResultPtr& __result) const - { - CommunicatorPtr __com = __result->getCommunicator(); - assert(__com); - try - { - __com->end_flushBatchRequests(__result); - assert(false); - } - catch(const Exception& ex) - { - IceInternal::Cpp11FnCallbackNC::exception(__result, ex); - } - } - }; - - return __begin_flushBatchRequests(ICE_MAKE_SHARED(Cpp11CB, exception, sent), 0); -#else - assert(false); // Ice not built with C++11 support. - return 0; -#endif -} - -AsyncResultPtr Ice::CommunicatorI::__begin_flushBatchRequests(const IceInternal::CallbackBasePtr& cb, const LocalObjectPtr& cookie) { OutgoingConnectionFactoryPtr connectionFactory = _instance->outgoingConnectionFactory(); diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 7db2f29d330..afa5fc6a3ff 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -83,10 +83,6 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Communicator_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); - virtual AsyncResultPtr begin_flushBatchRequests( - const IceInternal::Function<void (const Exception&)>&, - const IceInternal::Function<void (bool)>& = IceInternal::Function<void (bool)>()); - virtual void end_flushBatchRequests(const AsyncResultPtr&); #endif diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index f86bf0e6b58..f3b191a8d6d 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -896,46 +896,6 @@ Ice::ConnectionI::begin_flushBatchRequests(const Callback_Connection_flushBatchR } AsyncResultPtr -Ice::ConnectionI::begin_flushBatchRequests(const IceInternal::Function<void (const Exception&)>& exception, - const IceInternal::Function<void (bool)>& sent) -{ -#ifdef ICE_CPP11_COMPILER - class Cpp11CB : public IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const IceInternal::Function<void (const Exception&)>& excb, - const IceInternal::Function<void (bool)>& sentcb) : - IceInternal::Cpp11FnCallbackNC(excb, sentcb) - { - CallbackBase::checkCallback(true, excb != nullptr); - } - - virtual void - completed(const AsyncResultPtr& __result) const - { - ConnectionPtr __con = __result->getConnection(); - assert(__con); - try - { - __con->end_flushBatchRequests(__result); - assert(false); - } - catch(const Exception& ex) - { - IceInternal::Cpp11FnCallbackNC::exception(__result, ex); - } - } - }; - - return __begin_flushBatchRequests(ICE_MAKE_SHARED(Cpp11CB, exception, sent), 0); -#else - assert(false); // Ice not built with C++11 support. - return 0; -#endif -} - -AsyncResultPtr Ice::ConnectionI::__begin_flushBatchRequests(const CallbackBasePtr& cb, const LocalObjectPtr& cookie) { ConnectionFlushBatchAsyncPtr result = new ConnectionFlushBatchAsync( diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 6911b4fea1c..acc35441cb9 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -197,9 +197,6 @@ public: virtual AsyncResultPtr begin_flushBatchRequests(const CallbackPtr&, const LocalObjectPtr& = 0); virtual AsyncResultPtr begin_flushBatchRequests(const Callback_Connection_flushBatchRequestsPtr&, const LocalObjectPtr& = 0); - virtual AsyncResultPtr begin_flushBatchRequests( - const ::IceInternal::Function<void (const ::Ice::Exception&)>&, - const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()); virtual void end_flushBatchRequests(const AsyncResultPtr&); #endif diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index b73d7e1810c..a524b3999f7 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -433,52 +433,3 @@ IceInternal::getInstanceTimer(const CommunicatorPtr& communicator) return p->_instance->timer(); } -#ifdef ICE_CPP11_COMPILER -Ice::DispatcherPtr -Ice::newDispatcher(const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)>& cb) -{ - class Cpp11Dispatcher : public Dispatcher - { - public: - - Cpp11Dispatcher(const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)>& cb) : - _cb(cb) - { - } - - virtual void dispatch(const DispatcherCallPtr& call, const ConnectionPtr& conn) - { - _cb(call, conn); - } - - private: - const ::std::function<void (const DispatcherCallPtr&, const ConnectionPtr)> _cb; - }; - - return new Cpp11Dispatcher(cb); -} - -Ice::BatchRequestInterceptorPtr -Ice::newBatchRequestInterceptor(const ::std::function<void (const BatchRequest&, int, int)>& cb) -{ - class Cpp11BatchRequestInterceptor : public BatchRequestInterceptor - { - public: - - Cpp11BatchRequestInterceptor(const ::std::function<void (const BatchRequest&, int, int)>& cb) : - _cb(cb) - { - } - - virtual void enqueue(const BatchRequest& request, int count, int size) - { - _cb(request, count, size); - } - - private: - const ::std::function<void (const BatchRequest&, int, int)> _cb; - }; - - return ICE_MAKE_SHARED(Cpp11BatchRequestInterceptor, cb); -} -#endif diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 009ebdb314a..4417227565e 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -563,73 +563,6 @@ IceInternal::checkedCastImpl(const ObjectPrxPtr& b, const string& f, const strin return ICE_NULLPTR; } -#ifdef ICE_CPP11_COMPILER - -IceInternal::Cpp11FnCallbackNC::Cpp11FnCallbackNC(const ::std::function<void (const ::Ice::Exception&)>& excb, - const ::std::function<void (bool)>& sentcb) : - _exception(excb), - _sent(sentcb) -{ -} - -IceInternal::CallbackBasePtr -IceInternal::Cpp11FnCallbackNC::verify(const ::Ice::LocalObjectPtr&) -{ - return this; -} - -void -IceInternal::Cpp11FnCallbackNC::sent(const ::Ice::AsyncResultPtr& result) const -{ - if(_sent != nullptr) - { - _sent(result->sentSynchronously()); - } -} - -bool -IceInternal::Cpp11FnCallbackNC::hasSentCallback() const -{ - return _sent != nullptr; -} - -void -IceInternal::Cpp11FnCallbackNC::exception(const ::Ice::AsyncResultPtr&, const ::Ice::Exception& ex) const -{ - if(_exception != nullptr) - { - _exception(ex); - } -} - -IceInternal::Cpp11FnOnewayCallbackNC::Cpp11FnOnewayCallbackNC(const ::std::function<void ()>& cb, - const ::std::function<void (const ::Ice::Exception&)>& excb, - const ::std::function<void (bool)>& sentcb) : - Cpp11FnCallbackNC(excb, sentcb), - _cb(cb) -{ - CallbackBase::checkCallback(true, cb || excb != nullptr); -} - -void -IceInternal::Cpp11FnOnewayCallbackNC::completed(const ::Ice::AsyncResultPtr& result) const -{ - try - { - result->getProxy()->__end(result, result->getOperation()); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(result, ex); - return; - } - if(_cb != nullptr) - { - _cb(); - } -} -#endif - bool IceProxy::Ice::Object::operator==(const Object& r) const { @@ -704,293 +637,6 @@ IceProxy::Ice::Object::__begin_ice_isA(const string& typeId, return __result; } -#ifdef ICE_CPP11_COMPILER - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_isA(const ::std::string& typeId, - const ::Ice::Context& ctx, - const ::IceInternal::Function<void (bool)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (bool)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, - const ::std::function<void (bool)>& sentFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc), - _response(responseFunc) - { - CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - ::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy()); - bool __ret; - try - { - __ret = __proxy->end_ice_isA(__result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret); - } - } - - private: - - ::std::function<void (bool)> _response; - }; - - return __begin_ice_isA(typeId, ctx, new Cpp11CB(response, exception, sent), 0); -} - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_id(const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::std::string&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (const ::std::string&)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, - const ::std::function<void (bool)>& sentFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc), - _response(responseFunc) - { - CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - ::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy()); - ::std::string __ret; - try - { - __ret = __proxy->end_ice_id(__result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret); - } - } - - private: - - ::std::function<void (const ::std::string&)> _response; - }; - return __begin_ice_id(ctx, new Cpp11CB(response, exception, sent), 0); -} - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_ids( - const ::Ice::Context& ctx, - const ::IceInternal::Function<void (const ::std::vector< ::std::string>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (const ::std::vector< ::std::string>&)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, - const ::std::function<void (bool)>& sentFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc), - _response(responseFunc) - { - CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - ::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy()); - ::std::vector< ::std::string> __ret; - try - { - __ret = __proxy->end_ice_ids(__result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret); - } - } - - private: - - ::std::function<void (const ::std::vector< ::std::string>&)> _response; - }; - return __begin_ice_ids(ctx, new Cpp11CB(response, exception, sent), 0); -} - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_invoke( - const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::vector< ::Ice::Byte>& inParams, - const ::Ice::Context& ctx, - const ::IceInternal::Function<void (bool, const ::std::vector< ::Ice::Byte>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (bool, const ::std::vector< ::Ice::Byte>&)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, - const ::std::function<void (bool)>& sentFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc), - _response(responseFunc) - { - CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - ::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy()); - bool __ret; - ::std::vector< ::Ice::Byte> p1; - try - { - __ret = __proxy->end_ice_invoke(p1, __result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret, p1); - } - } - - private: - - ::std::function<void (bool, const ::std::vector< ::Ice::Byte>&)> _response; - }; - - return __begin_ice_invoke(operation, mode, inParams, ctx, new Cpp11CB(response, exception, sent), 0); -} - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_invoke( - const ::std::string& operation, - ::Ice::OperationMode mode, - const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& inParams, - const ::Ice::Context& ctx, - const ::IceInternal::Function<void (bool, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception, - const ::IceInternal::Function<void (bool)>& sent) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (bool, const ::std::pair<const ::Ice::Byte*, - const ::Ice::Byte*>&)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, - const ::std::function<void (bool)>& sentFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc), - _response(responseFunc) - { - CallbackBase::checkCallback(true, _response || _exception != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - bool __ret; - ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*> p1; - try - { - __ret = __result->getProxy()->___end_ice_invoke(p1, __result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret, p1); - } - } - - private: - - ::std::function<void (bool, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&)> _response; - }; - return __begin_ice_invoke(operation, mode, inParams, ctx, new Cpp11CB(response, exception, sent), 0); -} - -Ice::AsyncResultPtr -IceProxy::Ice::Object::begin_ice_getConnection( - const ::IceInternal::Function<void (const ::Ice::ConnectionPtr&)>& response, - const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception) -{ - class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC - { - public: - - Cpp11CB(const ::std::function<void (const ::Ice::ConnectionPtr&)>& responseFunc, - const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc) : - ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, nullptr), - _response(responseFunc) - { - CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr); - } - - virtual void completed(const ::Ice::AsyncResultPtr& __result) const - { - ::Ice::ObjectPrx __proxy = ::Ice::ObjectPrx::uncheckedCast(__result->getProxy()); - ::Ice::ConnectionPtr __ret; - try - { - __ret = __proxy->end_ice_getConnection(__result); - } - catch(const ::Ice::Exception& ex) - { - Cpp11FnCallbackNC::exception(__result, ex); - return; - } - if(_response != nullptr) - { - _response(__ret); - } - } - - private: - - ::std::function<void (const ::Ice::ConnectionPtr&)> _response; - }; - return begin_ice_getConnectionInternal(new Cpp11CB(response, exception), 0); -} - -#endif - - bool IceProxy::Ice::Object::end_ice_isA(const AsyncResultPtr& __result) { diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index f3e9549097d..fa645a4f360 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1957,140 +1957,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) H << nl << deprecateSymbol << retS << ' ' << fixKwd(name) << spar << paramsDecl << "const ::Ice::Context& __ctx = ::Ice::noExplicitContext" << epar << ";"; - H.zeroIndent(); - H << nl << "#ifdef ICE_CPP11_COMPILER"; - H.restoreIndent(); - - string retEndArg = getEndArg(ret, p->getMetaData(), "__ret"); - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - H.zeroIndent(); - H << nl << "#if !defined(_MSC_VER) || _MSC_VER > 1700"; - H.restoreIndent(); - H << nl << "//"; - H << nl << "// COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with"; - H << nl << "// std::function due to lack of variadic templates."; - H << nl << "//"; - } - - H << nl << "::Ice::AsyncResultPtr"; - H << nl << "begin_" << name << spar << paramsDeclAMI - << "const ::IceInternal::Function<void " << spar; - if(!retInS.empty()) - { - H << retInS; - } - H << outDecls << epar << ">& __response, " - << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception = " - "::IceInternal::Function<void (const ::Ice::Exception&)>(), " - << "const ::IceInternal::Function<void (bool)>& __sent = ::IceInternal::Function<void (bool)>()" << epar; - - H << sb; - if(p->returnsData()) - { - H << nl << "return begin_" << name << spar << argsAMI << "::Ice::noExplicitContext, __response, __exception, __sent" << epar << ";"; - } - else - { - H << nl << "return __begin_" << name << spar << argsAMI - << "::Ice::noExplicitContext, new ::IceInternal::Cpp11FnOnewayCallbackNC(__response, __exception, __sent)" << epar << ";"; - - } - H << eb; - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); - } - - H << nl << "::Ice::AsyncResultPtr"; - H << nl << "begin_" << name << spar << paramsDeclAMI - << "const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& __completed" - << "const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& __sent = " - "::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()" << epar; - H << sb; - H << nl << "return __begin_" << name << spar << argsAMI << "::Ice::noExplicitContext, ::Ice::newCallback(__completed, __sent), 0" << epar << ";"; - H << eb; - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - H.zeroIndent(); - H << nl << "#if !defined(_MSC_VER) || _MSC_VER > 1700"; - H.restoreIndent(); - H << nl << "//"; - H << nl << "// COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with"; - H << nl << "// std::function due to lack of variadic templates."; - H << nl << "//"; - } - - H << nl << "::Ice::AsyncResultPtr"; - H << nl << "begin_" << name << spar << paramsDeclAMI << "const ::Ice::Context& __ctx" - << "const ::IceInternal::Function<void " << spar; - if(!retInS.empty()) - { - H << retInS; - } - - if(p->returnsData()) - { - H << outDecls << epar << ">&, " - << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& = " - << "::IceInternal::Function<void (const ::Ice::Exception&)>(), " - << "const ::IceInternal::Function<void (bool)>& = ::IceInternal::Function<void (bool)>()" - << epar << ";"; - } - else - { - H << outDecls << epar << ">& __response, " - << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception = " - << "::IceInternal::Function<void (const ::Ice::Exception&)>(), " - << "const ::IceInternal::Function<void (bool)>& __sent = ::IceInternal::Function<void (bool)>()" << epar; - H << sb; - H << nl << "return __begin_" << name << spar << argsAMI - << "__ctx, new ::IceInternal::Cpp11FnOnewayCallbackNC(__response, __exception, __sent), 0" << epar << ";"; - H << eb; - } - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); - } - - H << nl << "::Ice::AsyncResultPtr"; - H << nl << "begin_" << name << spar << paramsDeclAMI - << "const ::Ice::Context& __ctx" - << "const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& __completed" - << "const ::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>& __sent = " - "::IceInternal::Function<void (const ::Ice::AsyncResultPtr&)>()" << epar; - H << sb; - H << nl << "return __begin_" << name << spar << argsAMI << "__ctx, ::Ice::newCallback(__completed, __sent)" << epar << ";"; - H << eb; - - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); - H << sp << nl << "::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << "const ::Ice::Context& __ctx = ::Ice::noExplicitContext" << epar; H << sb; @@ -2295,140 +2161,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) C << nl << "return __result;"; C << eb; - if(p->returnsData()) - { - C << nl << nl << "#ifdef ICE_CPP11_COMPILER"; - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - - C << nl << "#if !defined(_MSC_VER) || _MSC_VER > 1700"; - - C << nl << "//"; - C << nl << "// COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with"; - C << nl << "// std::function due to lack of variadic templates."; - C << nl << "//"; - } - - C << sp << nl << "::Ice::AsyncResultPtr" << nl - << "IceProxy" << scope << "begin_" << name << spar << paramsDeclAMI - << "const ::Ice::Context& __ctx" << "const ::IceInternal::Function<void " << spar; - - if(!retInS.empty()) - { - C << retInS; - } - C << outDecls; - - C << epar << ">& __response, " - << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, " - << "const ::IceInternal::Function<void (bool)>& __sent" << epar; - - C << sb; - C << nl << "class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC"; - C << sb; - C.dec(); - C << nl << "public:"; - C.inc(); - C << sp << nl << "Cpp11CB" << spar << "const ::std::function<void " << spar; - if(!retInS.empty()) - { - C << retInS; - } - C << outDecls; - C << epar << ">& responseFunc, " - << "const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, " - << "const ::std::function<void (bool)>& sentFunc" << epar << " :"; - C.inc(); - C << nl << "::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),"; - C << nl << "_response(responseFunc)"; - C.dec(); - C << sb; - C << nl << "CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);"; - C << eb; - - // - // completed. - // - C << sp << nl << "virtual void completed(const ::Ice::AsyncResultPtr& __result) const"; - C << sb; - C << nl << clScope << clName << "Prx __proxy = " << clScope << clName - << "Prx::uncheckedCast(__result->getProxy());"; - writeAllocateCode(C, outParams, p, true, _useWstring | TypeContextInParam | TypeContextAMICallPrivateEnd); - C << nl << "try"; - C << sb; - C << nl; - if(!usePrivateEnd(p)) - { - if(ret) - { - C << retEndArg << " = "; - } - C << "__proxy->end_" << p->name() << spar << outEndArgs << "__result" << epar << ';'; - } - else - { - C << "__proxy->___end_" << p->name() << spar << outEndArgs; - if(ret) - { - C << retEndArg; - } - C << "__result" << epar << ';'; - } - writeEndCode(C, outParams, p, true); - C << eb; - C << nl << "catch(const ::Ice::Exception& ex)"; - C << sb; - C << nl << "Cpp11FnCallbackNC::exception(__result, ex);"; - C << nl << "return;"; - C << eb; - C << nl << "if(_response != nullptr)"; - C << sb; - C << nl << "_response" << spar; - if(ret) - { - C << "__ret"; - } - C << outParamNamesAMI; - C << epar << ';'; - C << eb; - C << eb; - - C.dec(); - C << nl << nl << "private:"; - C.inc(); - C << nl; - C << nl << "::std::function<void " << spar; - - if(!retInS.empty()) - { - C << retInS; - } - C << outDecls; - - C << epar << "> _response;"; - - C << eb << ';'; - - C << nl << "return __begin_" << name << spar << argsAMI << "__ctx" - << "new Cpp11CB(__response, __exception, __sent)" << epar << ';'; - C << eb; - - // - // COMPILERFIX VC compilers up to VC110 don't support more than 10 parameters with std::function due to - // lack of variadic templates. - // - if(outDecls.size() > 10 || (outDecls.size() > 9 && !retInS.empty())) - { - C << nl << "#endif"; - } - C << nl << "#endif"; // ICE_CPP11_COMPILER - } - C << sp << nl << retS << nl << "IceProxy" << scope << "end_" << name << spar << outParamsDeclAMI << "const ::Ice::AsyncResultPtr& __result" << epar; C << sb; @@ -3784,12 +3516,6 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) } } - H << nl << "// Only supported with C++ 11 support enabled"; - H << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI - << "const ::IceInternal::Function<void (const ::Ice::Exception&)>& exception" - << "const ::IceInternal::Function<void (bool)>& sent = ::IceInternal::Function<void (bool)>()" - << epar << " = 0;"; - H << sp << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI << epar << " = 0;"; H << sp << nl << "virtual ::Ice::AsyncResultPtr begin_" << name << spar << paramsDeclAMI diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index f46bf6fdb36..3b160131099 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -2219,56 +2219,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 async callback... " << flush; - { - AsyncCallbackPtr cb = new AsyncCallback(); - Ice::Context ctx; - - p->begin_ice_isA(Test::TestIntf::ice_staticId(), [=](const ::Ice::AsyncResultPtr& r){ cb->isA(r); }); - cb->check(); - p->begin_ice_isA(Test::TestIntf::ice_staticId(), ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->isA(r); }); - cb->check(); - - p->begin_ice_ping([=](const ::Ice::AsyncResultPtr& r){ cb->ping(r); }); - cb->check(); - p->begin_ice_ping(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->ping(r); }); - cb->check(); - - p->begin_ice_id([=](const ::Ice::AsyncResultPtr& r){ cb->id(r); }); - cb->check(); - p->begin_ice_id(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->id(r); }); - cb->check(); - - p->begin_ice_ids([=](const ::Ice::AsyncResultPtr& r){ cb->ids(r); }); - cb->check(); - p->begin_ice_ids(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->ids(r); }); - cb->check(); - - if(!collocated) - { - p->begin_ice_getConnection([=](const ::Ice::AsyncResultPtr& r){ cb->connection(r); }); - cb->check(); - } - - p->begin_op([=](const ::Ice::AsyncResultPtr& r){ cb->op(r); }); - cb->check(); - p->begin_op(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->op(r); }); - cb->check(); - - p->begin_opWithResult([=](const ::Ice::AsyncResultPtr& r){ cb->opWithResult(r); }); - cb->check(); - p->begin_opWithResult(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->opWithResult(r); }); - cb->check(); - - p->begin_opWithUE([=](const ::Ice::AsyncResultPtr& r){ cb->opWithUE(r); }); - cb->check(); - p->begin_opWithUE(ctx, [=](const ::Ice::AsyncResultPtr& r){ cb->opWithUE(r); }); - cb->check(); - } - cout << "ok" << endl; -#endif - cout << "testing response callback... " << flush; { ResponseCallbackPtr cb = new ResponseCallback(); @@ -2364,63 +2314,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 response callback... " << flush; - { - ResponseCallbackPtr cb = new ResponseCallback(); - Ice::Context ctx; - - p->begin_ice_isA(Test::TestIntf::ice_staticId(), [=](bool is){ cb->isA(is); }); - cb->check(); - - p->begin_ice_isA(Test::TestIntf::ice_staticId(), ctx, [=](bool is){ cb->isA(is); }); - cb->check(); - - p->begin_ice_ping([=](){ cb->ping(); }); - cb->check(); - - p->begin_ice_ping(ctx, [=](){ cb->ping(); }); - cb->check(); - - p->begin_ice_id([=](const string& id){ cb->id(id); }); - cb->check(); - - p->begin_ice_id(ctx, [=](const string& id){ cb->id(id); }); - cb->check(); - - p->begin_ice_ids([=](const Ice::StringSeq& ids){ cb->ids(ids); }); - cb->check(); - - p->begin_ice_ids(ctx, [=](const Ice::StringSeq& ids){ cb->ids(ids); }); - cb->check(); - - if(!collocated) - { - p->begin_ice_getConnection([=](const Ice::ConnectionPtr& conn){ cb->connection(conn); }); - cb->check(); - } - - p->begin_op([=](){ cb->op(); }); - cb->check(); - - p->begin_op(ctx, [=](){ cb->op(); }); - cb->check(); - - p->begin_opWithResult([=](int ret){ cb->opWithResult(ret); }); - cb->check(); - - p->begin_opWithResult(ctx, [=](int ret){ cb->opWithResult(ret); }); - cb->check(); - - p->begin_opWithUE([](){ test(false); }, [=](const Ice::Exception& ex){ cb->opWithUE(ex); }); - cb->check(); - - p->begin_opWithUE(ctx, [](){ test(false); }, [=](const Ice::Exception& ex){ cb->opWithUE(ex); }); - cb->check(); - } - cout << "ok" << endl; -#endif - cout << "testing local exceptions... " << flush; { Test::TestIntfPrx indirect = Test::TestIntfPrx::uncheckedCast(p->ice_adapterId("dummy")); @@ -2558,37 +2451,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing local exceptions with C++11 response callback... " << flush; - { - Test::TestIntfPrx i = Test::TestIntfPrx::uncheckedCast(p->ice_adapterId("dummy")); - ExceptionCallbackPtr cb = new ExceptionCallback(); - - i->begin_ice_isA(Test::TestIntf::ice_staticId(), std::function<void (bool)>([](bool){ test(false); }), [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - i->begin_ice_ping([](){ test(false); }, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - i->begin_ice_id([](const string&){ test(false); }, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - i->begin_ice_ids([](const Ice::StringSeq&){ test(false); }, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - if(!collocated) - { - i->begin_ice_getConnection([](const Ice::ConnectionPtr&){ test(false); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - } - - i->begin_op([](){ test(false); }, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - } - cout << "ok" << endl; -#endif - cout << "testing exception callback... " << flush; { Test::TestIntfPrx i = Test::TestIntfPrx::uncheckedCast(p->ice_adapterId("dummy")); @@ -2638,38 +2500,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 exception callback... " << flush; - { - Test::TestIntfPrx i = Test::TestIntfPrx::uncheckedCast(p->ice_adapterId("dummy")); - ExceptionCallbackPtr cb = new ExceptionCallback(); - - i->begin_ice_isA(Test::TestIntf::ice_staticId(), nullptr, [=](const Ice::Exception& ex){cb->ex(ex); }); - cb->check(); - - if(!collocated) - { - i->begin_ice_getConnection(nullptr, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - } - - i->begin_op(nullptr, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - i->begin_opWithUE(nullptr, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - // Ensures no exception is called when response is received - p->begin_ice_isA(Test::TestIntf::ice_staticId(), nullptr, [=](const Ice::Exception& ex){ cb->noEx(ex); }); - p->begin_op(nullptr, [=](const Ice::Exception& ex){ cb->noEx(ex); }); - - // If response is a user exception, it should be received. - p->begin_opWithUE(nullptr, [=](const Ice::Exception& ex){ cb->opWithUE(ex); }); - cb->check(); - } - cout << "ok" << endl; -#endif - cout << "testing sent callback... " << flush; { SentCallbackPtr cb = new SentCallback; @@ -2746,75 +2576,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 sent callback... " << flush; - { - SentCallbackPtr cb = new SentCallback; - - p->begin_ice_isA("", [=](bool v){ cb->isA(v); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - p->begin_ice_ping([=](){ cb->ping(); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - p->begin_ice_id([=](const string& id){ cb->id(id); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - p->begin_ice_ids([=](const Ice::StringSeq& ids){ cb->ids(ids); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - - p->begin_op([=](){ cb->op(); }, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - p->begin_op([=](){ cb->op(); }, - nullptr, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - p->begin_op(nullptr, - [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - - vector<SentCallbackPtr> cbs; - Ice::ByteSeq seq; - seq.resize(1024); - testController->holdAdapter(); - try - { - cb = new SentCallback(); - while(p->begin_opWithPayload(seq, nullptr, [=](const Ice::Exception& ex){ cb->ex(ex); }, - [=](bool sent){ cb->sent(sent); })->sentSynchronously()) - { - cbs.push_back(cb); - cb = new SentCallback(); - } - } - catch(...) - { - testController->resumeAdapter(); - throw; - } - testController->resumeAdapter(); - for(vector<SentCallbackPtr>::const_iterator r = cbs.begin(); r != cbs.end(); r++) - { - (*r)->check(); - } - } - cout << "ok" << endl; -#endif - cout << "testing illegal arguments... " << flush; { Ice::AsyncResultPtr result; @@ -2962,32 +2723,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing unexpected exceptions from C++11 callback... " << flush; - { - Test::TestIntfPrx q = Test::TestIntfPrx::uncheckedCast(p->ice_adapterId("dummy")); - ThrowType throwEx[] = { LocalException, UserException, StandardException, OtherException }; - - for(int i = 0; i < 4; ++i) - { - ThrowerPtr cb = new Thrower(throwEx[i]); - - p->begin_op([=](){ cb->op(); }, [=](const Ice::Exception& ex){ cb->noEx(ex); }); - cb->check(); - - p->begin_op([=](){ cb->op(); }, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - - p->begin_op([=](){ cb->noOp(); }, [=](const Ice::Exception& ex){ cb->noEx(ex); }, [=](bool sent){ cb->sent(sent); }); - cb->check(); - - q->begin_op(nullptr, [=](const Ice::Exception& ex){ cb->ex(ex); }); - cb->check(); - } - } - cout << "ok" << endl; -#endif - cout << "testing batch requests with proxy... " << flush; { test(p->ice_batchOneway()->begin_ice_flushBatchRequests()->sentSynchronously()); @@ -3135,45 +2870,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 batch requests with proxy... " << flush; - { - - { - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = p->ice_batchOneway(); - b1->opBatch(); - b1->opBatch(); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = b1->begin_ice_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - - cb->check(); - test(r->isSent()); - test(r->isCompleted()); - test(p->waitForBatch(2)); - } - - if(p->ice_getConnection() && protocol != "bt") - { - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = p->ice_batchOneway(); - b1->opBatch(); - b1->ice_getConnection()->close(false); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = b1->begin_ice_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); - test(r->isCompleted()); - test(p->waitForBatch(1)); - } - } - cout << "ok" << endl; -#endif - if(p->ice_getConnection()) // No collocation optimization { cout << "testing batch requests with connection... " << flush; @@ -3333,52 +3029,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 batch requests with connection... " << flush; - { - if(p->ice_getConnection()) - { - // - // Without cookie. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - b1->opBatch(); - b1->opBatch(); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = b1->ice_getConnection()->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); - test(r->isCompleted()); - test(p->waitForBatch(2)); - } - - if(p->ice_getConnection() && protocol != "bt") - { - // - // Exception without cookie. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - b1->opBatch(); - b1->ice_getConnection()->close(false); - FlushExCallbackPtr cb = new FlushExCallback(); - Ice::AsyncResultPtr r = b1->ice_getConnection()->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(!r->isSent()); - test(r->isCompleted()); - test(p->opBatchCount() == 0); - } - } - cout << "ok" << endl; -#endif - cout << "testing batch requests with communicator... " << flush; { CookiePtr cookie = new Cookie(5); @@ -3694,135 +3344,6 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } } cout << "ok" << endl; - -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 batch requests with communicator... " << flush; - { - { - // - // Without cookie - 1 connection. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - b1->opBatch(); - b1->opBatch(); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = communicator->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); - test(r->isCompleted()); - test(p->waitForBatch(2)); - } - - if(protocol != "bt") - { - // - // Exception without cookie - 1 connection. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - b1->opBatch(); - b1->ice_getConnection()->close(false); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = communicator->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); // Exceptions are ignored! - test(r->isCompleted()); - test(p->opBatchCount() == 0); - } - - { - // - // 2 connections. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - Test::TestIntfPrx b2 = Test::TestIntfPrx::uncheckedCast( - p->ice_connectionId("2")->ice_getConnection()->createProxy( - p->ice_getIdentity())->ice_batchOneway()); - - b2->ice_getConnection(); // Ensure connection is established. - b1->opBatch(); - b1->opBatch(); - b2->opBatch(); - b2->opBatch(); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = communicator->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); - test(r->isCompleted()); - test(p->waitForBatch(4)); - } - - if(protocol != "bt") - { - // - // Exception - 2 connections - 1 failure. - // - // All connections should be flushed even if there are failures on some connections. - // Exceptions should not be reported. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - Test::TestIntfPrx b2 = Test::TestIntfPrx::uncheckedCast( - p->ice_connectionId("2")->ice_getConnection()->createProxy( - p->ice_getIdentity())->ice_batchOneway()); - - b2->ice_getConnection(); // Ensure connection is established. - b1->opBatch(); - b2->opBatch(); - b1->ice_getConnection()->close(false); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = communicator->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); // Exceptions are ignored! - test(r->isCompleted()); - test(p->waitForBatch(1)); - } - - if(protocol != "bt") - { - // - // Exception - 2 connections - 2 failures. - // - // The sent callback should be invoked even if all connections fail. - // - test(p->opBatchCount() == 0); - Test::TestIntfPrx b1 = Test::TestIntfPrx::uncheckedCast( - p->ice_getConnection()->createProxy(p->ice_getIdentity())->ice_batchOneway()); - Test::TestIntfPrx b2 = Test::TestIntfPrx::uncheckedCast( - p->ice_connectionId("2")->ice_getConnection()->createProxy( - p->ice_getIdentity())->ice_batchOneway()); - - b2->ice_getConnection(); // Ensure connection is established. - b1->opBatch(); - b2->opBatch(); - b1->ice_getConnection()->close(false); - b2->ice_getConnection()->close(false); - FlushCallbackPtr cb = new FlushCallback(); - Ice::AsyncResultPtr r = communicator->begin_flushBatchRequests( - [=](const Ice::Exception& ex){ cb->exception(ex);}, - [=](bool sent){ cb->sent(sent); }); - cb->check(); - test(r->isSent()); // Exceptions are ignored! - test(r->isCompleted()); - test(p->opBatchCount() == 0); - } - } - cout << "ok" << endl; -#endif } cout << "testing AsyncResult operations... " << flush; { diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 625990d7adc..42937e63c50 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -2274,723 +2274,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - - cout << "testing alternate strings with new C++11 AMI callbacks... " << flush; - { - Util::string_view in = "Hello World!"; - - CallbackPtr cb = new Callback(); - - t->begin_opString(in, - [=](const Util::string_view& p1, const Util::string_view& p2) - { - cb->opString(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - } - cout << "ok" << endl; - - - cout << "testing alternate sequences with C++11 AMI callbacks... " << flush; - - { - Test::DoubleSeq in(5); - in[0] = 3.14; - in[1] = 1 / 3; - in[2] = 0.375; - in[3] = 4 / 3; - in[4] = -5.725; - Ice::Double inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const Ice::Double*, const Ice::Double*> inPair(inArray, inArray + 5); - - CallbackPtr cb = new Callback(); - t->begin_opDoubleArray(inPair, - [=](const pair<const Ice::Double*, const Ice::Double*>& p1, const pair<const Ice::Double*, const Ice::Double*>& p2) - { - cb->opDoubleArray(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - bool inArray[5]; - for(int i = 0; i < 5; ++i) - { - inArray[i] = in[i]; - } - pair<const bool*, const bool*> inPair(inArray, inArray + 5); - - CallbackPtr cb = new Callback(); - t->begin_opBoolArray(inPair, - [=](const pair<const bool*, const bool*>& p1, const pair<const bool*, const bool*>& p2) - { - cb->opBoolArray(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Ice::Byte in[5]; - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - pair<const Ice::Byte*, const Ice::Byte*> inPair(in, in + 5); - - CallbackPtr cb = new Callback(); - t->begin_opByteArray(inPair, - [=](const pair<const Ice::Byte*, const Ice::Byte*>& p1, - const pair<const Ice::Byte*, const Ice::Byte*>& p2) - { - cb->opByteArray(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::VariableList in; - Test::Variable inArray[5]; - inArray[0].s = "These"; - in.push_back(inArray[0]); - inArray[1].s = "are"; - in.push_back(inArray[1]); - inArray[2].s = "five"; - in.push_back(inArray[2]); - inArray[3].s = "short"; - in.push_back(inArray[3]); - inArray[4].s = "strings."; - in.push_back(inArray[4]); - pair<const Test::Variable*, const Test::Variable*> inPair(inArray, inArray + 5); - - CallbackPtr cb = new Callback(); - t->begin_opVariableArray(inPair, - [=](const pair<const Test::Variable*, const Test::Variable*>& p1, - const pair<const Test::Variable*, const Test::Variable*>& p2) - { - cb->opVariableArray(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator> inPair(in.begin(), in.end()); - - CallbackPtr cb = new Callback(); - t->begin_opBoolRange(inPair, - [=](const pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& p1, - const pair<Test::BoolSeq::const_iterator, Test::BoolSeq::const_iterator>& p2) - { - cb->opBoolRange(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - CallbackPtr cb = new Callback(); - t->begin_opByteRange(inPair, - [=](const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& p1, - const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& p2) - { - cb->opByteRange(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::VariableList in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator> inPair(in.begin(), in.end()); - - CallbackPtr cb = new Callback(); - t->begin_opVariableRange(inPair, - [=](const pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& p1, - const pair<Test::VariableList::const_iterator, Test::VariableList::const_iterator>& p2) - { - cb->opVariableRange(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator> inPair(in.begin(), in.end()); - - CallbackPtr cb = new Callback(); - t->begin_opByteRangeType(inPair, - [=](const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& p1, - const pair<Test::ByteList::const_iterator, Test::ByteList::const_iterator>& p2) - { - cb->opByteRangeType(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - Test::VariableList in; - deque<Test::Variable> inSeq; - Test::Variable v; - v.s = "These"; - in.push_back(v); - inSeq.push_back(v); - v.s = "are"; - in.push_back(v); - inSeq.push_back(v); - v.s = "five"; - in.push_back(v); - inSeq.push_back(v); - v.s = "short"; - in.push_back(v); - inSeq.push_back(v); - v.s = "strings."; - in.push_back(v); - inSeq.push_back(v); - pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator> inPair(inSeq.begin(), - inSeq.end()); - - CallbackPtr cb = new Callback(); - t->begin_opVariableRangeType(inPair, - [=](const pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator>& p1, - const pair<deque<Test::Variable>::const_iterator, deque<Test::Variable>::const_iterator>& p2) - { - cb->opVariableRangeType(p1, p2, newInParam(inPair)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(inPair)); - }); - cb->check(); - } - - { - deque<bool> in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - - CallbackPtr cb = new Callback(); - t->begin_opBoolSeq(in, - [=](const deque<bool>& p1, const deque<bool>& p2) - { - cb->opBoolSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<bool> in; - in.push_back(false); - in.push_back(true); - in.push_back(true); - in.push_back(false); - in.push_back(true); - - CallbackPtr cb = new Callback(); - t->begin_opBoolList(in, - [=](const list<bool>& p1, const list<bool>& p2) - { - cb->opBoolList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque< ::Ice::Byte> in(5); - in[0] = '1'; - in[1] = '2'; - in[2] = '3'; - in[3] = '4'; - in[4] = '5'; - - CallbackPtr cb = new Callback(); - t->begin_opByteSeq(in, - [=](const deque< ::Ice::Byte>& p1, const deque< ::Ice::Byte>& p2) - { - cb->opByteSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list< ::Ice::Byte> in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - CallbackPtr cb = new Callback(); - t->begin_opByteList(in, - [=](const list< ::Ice::Byte>& p1, const list< ::Ice::Byte>& p2) - { - cb->opByteList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - MyByteSeq in(5); - int i = 0; - for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) - { - *p = '1' + i++; - } - - CallbackPtr cb = new Callback(); - t->begin_opMyByteSeq(in, - [=](const MyByteSeq& p1, const MyByteSeq& p2) - { - cb->opMyByteSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<string> in(5); - in[0] = "These"; - in[1] = "are"; - in[2] = "five"; - in[3] = "short"; - in[4] = "strings."; - - CallbackPtr cb = new Callback(); - t->begin_opStringSeq(in, - [=](const deque<string>& p1, const deque<string>& p2) - { - cb->opStringSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<string> in; - in.push_back("These"); - in.push_back("are"); - in.push_back("five"); - in.push_back("short"); - in.push_back("strings."); - - CallbackPtr cb = new Callback(); - t->begin_opStringList(in, - [=](const list<string>& p1, const list<string>& p2) - { - cb->opStringList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::Fixed> in(5); - in[0].s = 1; - in[1].s = 2; - in[2].s = 3; - in[3].s = 4; - in[4].s = 5; - - CallbackPtr cb = new Callback(); - t->begin_opFixedSeq(in, - [=](const deque<Test::Fixed>& p1, const deque<Test::Fixed>& p2) - { - cb->opFixedSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::Fixed> in(5); - short num = 1; - for(list<Test::Fixed>::iterator p = in.begin(); p != in.end(); ++p) - { - (*p).s = num++; - } - - CallbackPtr cb = new Callback(); - t->begin_opFixedList(in, - [=](const list<Test::Fixed> p1, const list<Test::Fixed> p2) - { - cb->opFixedList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::Variable> in(5); - in[0].s = "These"; - in[1].s = "are"; - in[2].s = "five"; - in[3].s = "short"; - in[4].s = "strings."; - - CallbackPtr cb = new Callback(); - t->begin_opVariableSeq(in, - [=](const deque<Test::Variable>& p1, const deque<Test::Variable>& p2) - { - cb->opVariableSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::Variable> in; - Test::Variable v; - v.s = "These"; - in.push_back(v); - v.s = "are"; - in.push_back(v); - v.s = "five"; - in.push_back(v); - v.s = "short"; - in.push_back(v); - v.s = "strings."; - in.push_back(v); - - CallbackPtr cb = new Callback(); - t->begin_opVariableList(in, - [=](const list<Test::Variable>& p1, const list<Test::Variable>& p2) - { - cb->opVariableList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::StringStringDict> in(5); - in[0]["A"] = "a"; - in[1]["B"] = "b"; - in[2]["C"] = "c"; - in[3]["D"] = "d"; - in[4]["E"] = "e"; - - CallbackPtr cb = new Callback(); - t->begin_opStringStringDictSeq(in, - [=](const deque<Test::StringStringDict>& p1, const deque<Test::StringStringDict>& p2) - { - cb->opStringStringDictSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::StringStringDict> in; - Test::StringStringDict ssd; - ssd["A"] = "a"; - in.push_back(ssd); - ssd["B"] = "b"; - in.push_back(ssd); - ssd["C"] = "c"; - in.push_back(ssd); - ssd["D"] = "d"; - in.push_back(ssd); - ssd["E"] = "e"; - in.push_back(ssd); - - CallbackPtr cb = new Callback(); - t->begin_opStringStringDictList(in, - [=](const list<Test::StringStringDict>& p1, - const list<Test::StringStringDict>& p2) - { - cb->opStringStringDictList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::E> in(5); - in[0] = Test::E1; - in[1] = Test::E2; - in[2] = Test::E3; - in[3] = Test::E1; - in[4] = Test::E3; - - CallbackPtr cb = new Callback(); - t->begin_opESeq(in, - [=](const deque<Test::E>& p1, const deque<Test::E>& p2) - { - cb->opESeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::E> in; - in.push_back(Test::E1); - in.push_back(Test::E2); - in.push_back(Test::E3); - in.push_back(Test::E1); - in.push_back(Test::E3); - - CallbackPtr cb = new Callback(); - t->begin_opEList(in, - [=](const list<Test::E>& p1, const list<Test::E>& p2) - { - cb->opEList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004")); - - CallbackPtr cb = new Callback(); - t->begin_opCPrxSeq(in, - [=](const deque<Test::CPrx>& p1, const deque<Test::CPrx>& p2) - { - cb->opCPrxSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004"))); - - CallbackPtr cb = new Callback(); - t->begin_opCPrxList(in, - [=](const list<Test::CPrx>& p1, const list<Test::CPrx>& p2) - { - cb->opCPrxList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - deque<Test::CPtr> in(5); - in[0] = new Test::C(); - in[1] = in[0]; - in[2] = in[0]; - in[3] = in[0]; - in[4] = in[0]; - - CallbackPtr cb = new Callback(); - t->begin_opCSeq(in, - [=](const deque<Test::CPtr>& p1, const deque<Test::CPtr>& p2) - { - cb->opCSeq(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - list<Test::CPtr> in; - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - in.push_back(new Test::C()); - - CallbackPtr cb = new Callback(); - t->begin_opCList(in, - [=](const list<Test::CPtr>& p1, const list<Test::CPtr>& p2) - { - cb->opCList(p1, p2, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - - { - Test::ByteSeq in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - - CallbackPtr cb = new Callback(); - t->begin_opOutArrayByteSeq(in, - [=](const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>& p1) - { - cb->opOutArrayByteSeq(p1, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - - { - Test::ByteSeq in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - - CallbackPtr cb = new Callback(); - t->begin_opOutRangeByteSeq(in, - [=](const ::std::pair< ::Test::ByteSeq::const_iterator, ::Test::ByteSeq::const_iterator>& p1) - { - cb->opOutRangeByteSeq(p1, newInParam(in)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(in)); - }); - cb->check(); - } - cout << "ok" << endl; -#endif cout << "testing alternate dictionaries with new AMI... " << flush; { @@ -3120,86 +2403,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing alternate dictionaries with new C++11 AMI callbacks... " << flush; - { - { - Test::IntStringDict idict; - - idict[1] = "one"; - idict[2] = "two"; - idict[3] = "three"; - idict[-1] = "minus one"; - - Test::IntStringDict out; - out[5] = "five"; - - CallbackPtr cb = new Callback(); - - t->begin_opIntStringDict(idict, - [=](const Test::IntStringDict& ret, const Test::IntStringDict& out) - { - cb->opIntStringDict(ret, out, newInParam(idict)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(idict)); - }); - cb->check(); - } - - { - Test::CustomMap<std::string, Ice::Int> idict; - - idict["one"] = 1; - idict["two"] = 2; - idict["three"] = 3; - idict["minus one"] = -1; - - Test::CustomMap<std::string, Ice::Int> out; - out["five"] = 5; - - CallbackPtr cb = new Callback(); - - t->begin_opVarDict(idict, - [=](const Test::CustomMap<Ice::Long, Ice::Long>& ret, - const Test::CustomMap<std::string, Ice::Int>& out) - { - cb->opVarDict(ret, out, newInParam(idict)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(idict)); - }); - cb->check(); - } - - { - std::map<int, Util::string_view> idict; - - idict[1] = "one"; - idict[2] = "two"; - idict[3] = "three"; - idict[-1] = "minus one"; - - CallbackPtr cb = new Callback(); - - t->begin_opCustomIntStringDict(idict, - [=](const std::map<int, Util::string_view>& ret, - const std::map<int, Util::string_view>& out) - { - cb->opCustomIntStringDict(ret, out, newInParam(idict)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(idict)); - }); - cb->check(); - } - } - cout << "ok" << endl; -#endif - cout << "testing class mapped structs ... " << flush; Test::ClassStructPtr cs = new Test::ClassStruct(); cs->y = 10; @@ -3237,25 +2440,6 @@ allTests(const Ice::CommunicatorPtr& communicator) cb->check(); } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing class mapped structs with C++11 AMI... " << flush; - { - CallbackPtr cb = new Callback(); - t->begin_opClassStruct(cs, csseq1, - [=](const ::Test::ClassStructPtr& p1, - const ::Test::ClassStructPtr& p2, - const ::Test::ClassStructSeq& p3) - { - cb->opClassStruct(p1, p2, p3, newInParam(make_pair(cs, csseq1))); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(make_pair(cs, csseq1))); - }); - cb->check(); - } - cout << "ok" << endl; -#endif cout << "testing wstring... " << flush; @@ -3302,21 +2486,6 @@ allTests(const Ice::CommunicatorPtr& communicator) newInParam(wstr)); cb->check(); } -#ifdef ICE_CPP11_COMPILER - { - CallbackPtr cb = new Callback(); - wsc1->begin_opString(wstr, - [=](const wstring& p1, const wstring& p2) - { - cb->opString(p1, p2, newInParam(wstr)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(wstr)); - }); - cb->check(); - } -#endif ret = wsc2->opString(wstr, out); test(out == wstr); @@ -3341,21 +2510,6 @@ allTests(const Ice::CommunicatorPtr& communicator) &Callback::noEx), newInParam(wstr)); cb->check(); } -#ifdef ICE_CPP11_COMPILER - { - CallbackPtr cb = new Callback(); - wsc2->begin_opString(wstr, - [=](const wstring& p1, const wstring& p2) - { - cb->opString(p1, p2, newInParam(wstr)); - }, - [=](const Ice::Exception& ex) - { - cb->noEx(ex, newInParam(wstr)); - }); - cb->check(); - } -#endif Test1::WstringStruct wss1; wss1.s = wstr; @@ -3397,17 +2551,6 @@ allTests(const Ice::CommunicatorPtr& communicator) wsc1->begin_throwExcept(wstr, Ice::newCallback(cb, &Callback::throwExcept1), newInParam(wstr)); cb->check(); } -#ifdef ICE_CPP11_COMPILER - { - CallbackPtr cb = new Callback(); - wsc1->begin_throwExcept(wstr, nullptr, - [=](const Ice::Exception& ex) - { - cb->throwExcept1(ex, wstr); - }); - cb->check(); - } -#endif try { @@ -3435,17 +2578,6 @@ allTests(const Ice::CommunicatorPtr& communicator) wsc2->begin_throwExcept(wstr, Ice::newCallback(cb, &Callback::throwExcept2), newInParam(wstr)); cb->check(); } -#ifdef ICE_CPP11_COMPILER - { - CallbackPtr cb = new Callback(); - wsc2->begin_throwExcept(wstr, nullptr, - [=](const Ice::Exception& ex) - { - cb->throwExcept2(ex, wstr); - }); - cb->check(); - } -#endif cout << "ok" << endl; diff --git a/cpp/test/Ice/custom/CustomMap.h b/cpp/test/Ice/custom/CustomMap.h index 863fcf5101d..e3046ca3e8f 100644 --- a/cpp/test/Ice/custom/CustomMap.h +++ b/cpp/test/Ice/custom/CustomMap.h @@ -21,17 +21,10 @@ namespace Test { -#ifdef ICE_CPP11_COMPILER -template<typename K, typename V> -class CustomMap : public std::unordered_map<K, V> -{ -}; -#else template<typename K, typename V> class CustomMap : public std::map<K, V> { }; -#endif } diff --git a/cpp/test/Ice/dispatcher/AllTests.cpp b/cpp/test/Ice/dispatcher/AllTests.cpp index f22928ea7b3..5282e214814 100644 --- a/cpp/test/Ice/dispatcher/AllTests.cpp +++ b/cpp/test/Ice/dispatcher/AllTests.cpp @@ -124,11 +124,7 @@ allTests(const Ice::CommunicatorPtr& communicator) Test::TestIntfControllerPrxPtr testController = ICE_UNCHECKED_CAST(Test::TestIntfControllerPrx, obj); -#ifdef ICE_CPP11_COMPILER - cout << "testing C++11 dispatcher... " << flush; -#else cout << "testing dispatcher... " << flush; -#endif { p->op(); diff --git a/cpp/test/Ice/dispatcher/Client.cpp b/cpp/test/Ice/dispatcher/Client.cpp index 5bdcdfd2af2..117e3a089fc 100644 --- a/cpp/test/Ice/dispatcher/Client.cpp +++ b/cpp/test/Ice/dispatcher/Client.cpp @@ -63,19 +63,12 @@ main(int argc, char* argv[]) // initData.properties->setProperty("Ice.TCP.SndSize", "50000"); -#if defined(ICE_CPP11_MAPPING) +#ifdef ICE_CPP11_MAPPING Ice::DispatcherPtr dispatcher = new Dispatcher(); initData.dispatcher = [=](function<void ()> call, const shared_ptr<Ice::Connection>& conn) { dispatcher->dispatch(new DispatcherCall(call), conn); }; -#elif defined(ICE_CPP11_COMPILER) - Ice::DispatcherPtr dispatcher = new Dispatcher(); - initData.dispatcher = Ice::newDispatcher( - [=](const Ice::DispatcherCallPtr& call, const Ice::ConnectionPtr& conn) - { - dispatcher->dispatch(call, conn); - }); #else initData.dispatcher = new Dispatcher(); #endif diff --git a/cpp/test/Ice/dispatcher/Collocated.cpp b/cpp/test/Ice/dispatcher/Collocated.cpp index afa55d366ba..8ea09bc118c 100644 --- a/cpp/test/Ice/dispatcher/Collocated.cpp +++ b/cpp/test/Ice/dispatcher/Collocated.cpp @@ -71,19 +71,12 @@ main(int argc, char* argv[]) { Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); -#if defined(ICE_CPP11_MAPPING) +#ifdef ICE_CPP11_MAPPING Ice::DispatcherPtr dispatcher = new Dispatcher(); initData.dispatcher = [=](function<void ()> call, const shared_ptr<Ice::Connection>& conn) { dispatcher->dispatch(new DispatcherCall(call), conn); }; -#elif defined(ICE_CPP11_COMPILER) - Ice::DispatcherPtr dispatcher = new Dispatcher(); - initData.dispatcher = Ice::newDispatcher( - [=](const Ice::DispatcherCallPtr& call, const Ice::ConnectionPtr& conn) - { - dispatcher->dispatch(call, conn); - }); #else initData.dispatcher = new Dispatcher(); #endif diff --git a/cpp/test/Ice/dispatcher/Server.cpp b/cpp/test/Ice/dispatcher/Server.cpp index 923a40db870..eb5750affd0 100644 --- a/cpp/test/Ice/dispatcher/Server.cpp +++ b/cpp/test/Ice/dispatcher/Server.cpp @@ -79,19 +79,12 @@ main(int argc, char* argv[]) // initData.properties->setProperty("Ice.TCP.RcvSize", "50000"); -#if defined(ICE_CPP11_MAPPING) +#ifdef ICE_CPP11_MAPPING Ice::DispatcherPtr dispatcher = new Dispatcher(); initData.dispatcher = [=](function<void ()> call, const shared_ptr<Ice::Connection>& conn) { dispatcher->dispatch(new DispatcherCall(call), conn); }; -#elif defined(ICE_CPP11_COMPILER) - Ice::DispatcherPtr dispatcher = new Dispatcher(); - initData.dispatcher = Ice::newDispatcher( - [=](const Ice::DispatcherCallPtr& call, const Ice::ConnectionPtr& conn) - { - dispatcher->dispatch(call, conn); - }); #else initData.dispatcher = new Dispatcher(); #endif diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp index d17f2417e93..d5bca9a277d 100644 --- a/cpp/test/Ice/invoke/AllTests.cpp +++ b/cpp/test/Ice/invoke/AllTests.cpp @@ -525,59 +525,5 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; -#ifdef ICE_CPP11_COMPILER - cout << "testing asynchronous ice_invoke with C++11 style callbacks... " << flush; - - { - Ice::ByteSeq inEncaps, outEncaps; - Ice::OutputStreamPtr out = Ice::createOutputStream(communicator); - out->startEncapsulation(); - out->write(testString); - out->endEncapsulation(); - out->finished(inEncaps); - - CallbackPtr cb = new Callback(communicator, false); - Ice::Context ctx; - cl->begin_ice_invoke("opString", Ice::Normal, inEncaps, ctx, - [=](bool ret, const vector< ::Ice::Byte>& args) - { - cb->opStringNC(ret, args); - }); - cb->check(); - - cb = new Callback(communicator, false); - pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inEncaps[0], &inEncaps[0] + inEncaps.size()); - cl->begin_ice_invoke("opString", Ice::Normal, inPair, - [=](bool ret, const pair<const Ice::Byte*, const Ice::Byte*>& args) - { - cb->opStringPairNC(ret, args); - }); - cb->check(); - } - - { - Ice::ByteSeq inEncaps, outEncaps; - - CallbackPtr cb = new Callback(communicator, false); - cl->begin_ice_invoke("opException", Ice::Normal, inEncaps, - [=](bool ret, const vector< ::Ice::Byte>& args) - { - cb->opExceptionNC(ret, args); - } - ); - cb->check(); - - pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(static_cast< ::Ice::Byte*>(0), static_cast< ::Ice::Byte*>(0)); - cb = new Callback(communicator, false); - cl->begin_ice_invoke("opException", Ice::Normal, inPair, - [=](bool ret, const pair<const Ice::Byte*, const Ice::Byte*>& args) - { - cb->opExceptionPairNC(ret, args); - }); - cb->check(); - } - - cout << "ok" << endl; -#endif return cl; } diff --git a/cpp/test/Ice/operations/BatchOneways.cpp b/cpp/test/Ice/operations/BatchOneways.cpp index 6e9ff288ff8..c32dfcb9efc 100644 --- a/cpp/test/Ice/operations/BatchOneways.cpp +++ b/cpp/test/Ice/operations/BatchOneways.cpp @@ -155,13 +155,6 @@ batchOneways(const Test::MyClassPrxPtr& p) { interceptor->enqueue(request, count, size); }; -#elif defined(ICE_CPP11_COMPILER) - // Ensure lambda factory method works. - initData.batchRequestInterceptor = Ice::newBatchRequestInterceptor( - [=](const Ice::BatchRequest& request, int count, int size) - { - interceptor->enqueue(request, count, size); - }); #else initData.batchRequestInterceptor = interceptor; #endif diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index c4342818256..e82ffd29184 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -242,25 +242,32 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { } } -#ifdef ICE_CPP11_COMPILER -# ifndef ICE_CPP11_MAPPING +#ifdef ICE_CPP11_MAPPING { CallbackPtr cb = new Callback; - p->begin_ice_ping(nullptr, - [=](const Ice::Exception& ex){ cb->noException(ex); }, - [=](bool sent){ cb->sent(sent); }); + p->ice_ping_async(nullptr, + [=](exception_ptr e) + { + try + { + rethrow_exceptino(e); + } + catch(const Ice::Exception& ex) + { + cb->noException(ex); + } + }, + [=](bool sent) + { + cb->sent(sent); + }); cb->check(); } -# endif { try { -# ifdef ICE_CPP11_MAPPING p->ice_isA_async(Test::MyClass::ice_staticId()); -# else - p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool){ test(false); }); -# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -271,11 +278,7 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { try { -# ifdef ICE_CPP11_MAPPING p->ice_id_async(); -# else - p->begin_ice_id([=](const string&){ test(false); }); -# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -286,11 +289,7 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { try { -# ifdef ICE_CPP11_MAPPING p->ice_ids_async(); -# else - p->begin_ice_ids([=](const Ice::StringSeq&){ test(false); }); -# endif test(false); } catch(const IceUtil::IllegalArgumentException&) @@ -298,7 +297,6 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) } } -# ifndef ICE_CPP11_MAPPING { CallbackPtr cb = new Callback; p->begin_opVoid(nullptr, @@ -333,6 +331,5 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { } } -# endif #endif } diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 95c72642fcf..17029bc12b8 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -2665,11 +2665,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& #endif cb->check(); } -#ifdef ICE_CPP11_COMPILER + +#ifdef ICE_CPP11_MAPPING { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->ice_ping_async(); try { @@ -2685,15 +2685,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& cerr << ex.what() << endl; test(false); } -# else - p->begin_ice_ping([=](){ cb->ping(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->ice_isA_async(Test::MyClass::ice_staticId()); try { @@ -2707,15 +2703,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_ice_isA(Test::MyClass::ice_staticId(), [=](bool isA){ cb->isA(isA); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->ice_id_async(); try { @@ -2729,15 +2721,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_ice_id([=](const string& id){ cb->id(id); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->ice_ids_async(); try { @@ -2751,15 +2739,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_ice_ids([=](const Ice::StringSeq& ids){ cb->ids(ids); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opVoid_async(); try { @@ -2774,15 +2758,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opVoid([=](){ cb->opVoid(); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByte_async(Ice::Byte(0xff), Ice::Byte(0x0f)); try { @@ -2797,17 +2777,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), - [=](const Ice::Byte& p1, const Ice::Byte& p2){ cb->opByte(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opBool_async(true, false); try { @@ -2822,18 +2796,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - Test::Callback_MyClass_opBoolPtr callback = Test::newCallback_MyClass_opBool(cb, - &Callback::opBool, - &Callback::exCB); - p->begin_opBool(true, false, [=](bool p1, bool p2){ cb->opBool(p1, p2); }, [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opShortIntLong_async(10, 11, 12); try { @@ -2848,17 +2815,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opShortIntLong(10, 11, 12, - [=](Ice::Long p1, Ice::Short p2, Ice::Int p3, Ice::Long p4){ cb->opShortIntLong(p1, p2, p3, p4); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opFloatDouble_async(3.14f, 1.1E10); try { @@ -2873,17 +2834,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opFloatDouble(Ice::Float(3.14), Ice::Double(1.1E10), - [=](Ice::Double p1, Ice::Float p2, Ice::Double p3){ cb->opFloatDouble(p1, p2, p3); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opString_async("hello", "world"); try { @@ -2898,17 +2853,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opString("hello", "world", - [=](const string& p1, const string& p2){ cb->opString(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opMyEnum_async(Test::MyEnum::enum2); try { @@ -2923,17 +2872,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyEnum(ICE_ENUM(Test::MyEnum, enum2), - [=](Test::MyEnum p1, Test::MyEnum p2){ cb->opMyEnum(p1, p2); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback(communicator); -# ifdef ICE_CPP11_MAPPING auto f = p->opMyClass_async(p); try { @@ -2948,14 +2891,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyClass(p, - [=](const Test::MyClassPrx& p1, const Test::MyClassPrx p2, const Test::MyClassPrx p3) - { - cb->opMyClass(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -2970,7 +2905,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& si2.s.s = "def"; CallbackPtr cb = new Callback(communicator); -# ifdef ICE_CPP11_MAPPING auto f = p->opStruct_async(si1, si2); try { @@ -2985,14 +2919,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStruct(si1, si2, - [=](const Test::Structure& p1, const Test::Structure& p2) - { - cb->opStruct(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -#endif cb->check(); } @@ -3011,7 +2937,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& bsi2.push_back(Ice::Byte(0xf4)); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByteS_async(bsi1, bsi2); try { @@ -3026,17 +2951,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - Test::Callback_MyClass_opByteSPtr callback = Test::newCallback_MyClass_opByteS(cb, - &Callback::opByteS, - &Callback::exCB); - p->begin_opByteS(bsi1, bsi2, - [=](const Test::ByteS& p1, const Test::ByteS& p2) - { - cb->opByteS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3051,7 +2965,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& bsi2.push_back(false); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opBoolS_async(bsi1, bsi2); try { @@ -3066,14 +2979,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opBoolS(bsi1, bsi2, - [=](const Test::BoolS& p1, const Test::BoolS& p2) - { - cb->opBoolS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3096,7 +3001,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& lsi.push_back(20); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opShortIntLongS_async(ssi, isi, lsi); try { @@ -3111,14 +3015,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opShortIntLongS(ssi, isi, lsi, - [=](const Test::LongS& p1, const Test::ShortS& p2, const Test::IntS& p3, const Test::LongS& p4) - { - cb->opShortIntLongS(p1, p2, p3, p4); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3134,7 +3030,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi.push_back(Ice::Double(1.3E10)); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opFloatDoubleS_async(fsi, dsi); try { @@ -3149,14 +3044,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opFloatDoubleS(fsi, dsi, - [=](const Test::DoubleS& p1, const Test::FloatS& p2, const Test::DoubleS& p3) - { - cb->opFloatDoubleS(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3171,7 +3058,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& ssi2.push_back("xyz"); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringS_async(ssi1, ssi2); try { @@ -3186,14 +3072,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringS(ssi1, ssi2, - [=](const Test::StringS& p1, const Test::StringS& p2) - { - cb->opStringS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3213,7 +3091,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& bsi2[1].push_back(Ice::Byte(0xf1)); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByteSS_async(bsi1, bsi2); try { @@ -3228,14 +3105,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opByteSS(bsi1, bsi2, - [=](const Test::ByteSS& p1, const Test::ByteSS& p2) - { - cb->opByteSS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3253,7 +3122,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi[0].push_back(Ice::Double(1.3E10)); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opFloatDoubleSS_async(fsi, dsi); try { @@ -3268,14 +3136,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opFloatDoubleSS(fsi, dsi, - [=](const Test::DoubleSS& p1, const Test::FloatSS& p2, const Test::DoubleSS& p3) - { - cb->opFloatDoubleSS(p1, p2, p3); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3292,7 +3152,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& ssi2[2].push_back("xyz"); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringSS_async(ssi1, ssi2); try { @@ -3307,14 +3166,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringSS(ssi1, ssi2, - [=](const Test::StringSS& p1, const Test::StringSS& p2) - { - cb->opStringSS(p1, p2); - }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -3328,7 +3179,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2[101] = true; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByteBoolD_async(di1, di2); try { @@ -3343,17 +3193,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opByteBoolD(di1, di2, - [=](const Test::ByteBoolD& p1, const Test::ByteBoolD& p2) - { - cb->opByteBoolD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3367,7 +3206,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2[1101] = 0; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opShortIntD_async(di1, di2); try { @@ -3382,17 +3220,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opShortIntD(di1, di2, - [=](const Test::ShortIntD& p1, const Test::ShortIntD& p2) - { - cb->opShortIntD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3406,7 +3233,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2[999999130] = Ice::Float(0.5); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opLongFloatD_async(di1, di2); try { @@ -3421,17 +3247,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opLongFloatD(di1, di2, - [=](const Test::LongFloatD& p1, const Test::LongFloatD& p2) - { - cb->opLongFloatD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3445,7 +3260,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2["BAR"] = "abc 0.5"; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringStringD_async(di1, di2); try { @@ -3460,17 +3274,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringStringD(di1, di2, - [=](const Test::StringStringD& p1, const Test::StringStringD& p2) - { - cb->opStringStringD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3484,7 +3287,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2["Hello!!"] = ICE_ENUM(Test::MyEnum, enum2); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringMyEnumD_async(di1, di2); try { @@ -3499,17 +3301,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringMyEnumD(di1, di2, - [=](const Test::StringMyEnumD& p1, const Test::StringMyEnumD& p2) - { - cb->opStringMyEnumD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3528,7 +3319,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& di2[s23] = ICE_ENUM(Test::MyEnum, enum2); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opMyStructMyEnumD_async(di1, di2); try { @@ -3543,17 +3333,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyStructMyEnumD(di1, di2, - [=](const Test::MyStructMyEnumD& p1, const Test::MyStructMyEnumD& p2) - { - cb->opMyStructMyEnumD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3579,7 +3358,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByteBoolDS_async(dsi1, dsi2); try { @@ -3594,17 +3372,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opByteBoolDS(dsi1, dsi2, - [=](const Test::ByteBoolDS& p1, const Test::ByteBoolDS& p2) - { - cb->opByteBoolDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3629,7 +3396,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opShortIntDS_async(dsi1, dsi2); try { @@ -3644,17 +3410,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opShortIntDS(dsi1, dsi2, - [=](const Test::ShortIntDS& p1, const Test::ShortIntDS& p2) - { - cb->opShortIntDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3679,7 +3434,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opLongFloatDS_async(dsi1, dsi2); try { @@ -3694,17 +3448,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opLongFloatDS(dsi1, dsi2, - [=](const Test::LongFloatDS& p1, const Test::LongFloatDS& p2) - { - cb->opLongFloatDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3729,7 +3472,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringStringDS_async(dsi1, dsi2); try { @@ -3744,17 +3486,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringStringDS(dsi1, dsi2, - [=](const Test::StringStringDS& p1, const Test::StringStringDS& p2) - { - cb->opStringStringDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3779,7 +3510,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringMyEnumDS_async(dsi1, dsi2); try { @@ -3794,17 +3524,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringMyEnumDS(dsi1, dsi2, - [=](const Test::StringMyEnumDS& p1, const Test::StringMyEnumDS& p2) - { - cb->opStringMyEnumDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3827,7 +3546,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opMyEnumStringDS_async(dsi1, dsi2); try { @@ -3842,17 +3560,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyEnumStringDS(dsi1, dsi2, - [=](const Test::MyEnumStringDS& p1, const Test::MyEnumStringDS& p2) - { - cb->opMyEnumStringDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3883,7 +3590,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& dsi2[0] = di3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opMyStructMyEnumDS_async(dsi1, dsi2); try { @@ -3898,17 +3604,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyStructMyEnumDS(dsi1, dsi2, - [=](const Test::MyStructMyEnumDS& p1, const Test::MyStructMyEnumDS& p2) - { - cb->opMyStructMyEnumDS(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3931,7 +3626,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[Ice::Byte(0xf1)] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opByteByteSD_async(sdi1, sdi2); try { @@ -3946,17 +3640,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opByteByteSD(sdi1, sdi2, - [=](const Test::ByteByteSD& p1, const Test::ByteByteSD& p2) - { - cb->opByteByteSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -3978,7 +3661,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[false] = si1; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opBoolBoolSD_async(sdi1, sdi2); try { @@ -3993,17 +3675,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opBoolBoolSD(sdi1, sdi2, - [=](const Test::BoolBoolSD& p1, const Test::BoolBoolSD& p2) - { - cb->opBoolBoolSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4028,7 +3699,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[4] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opShortShortSD_async(sdi1, sdi2); try { @@ -4043,17 +3713,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opShortShortSD(sdi1, sdi2, - [=](const Test::ShortShortSD& p1, const Test::ShortShortSD& p2) - { - cb->opShortShortSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4078,7 +3737,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[400] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opIntIntSD_async(sdi1, sdi2); try { @@ -4093,17 +3751,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opIntIntSD(sdi1, sdi2, - [=](const Test::IntIntSD& p1, const Test::IntIntSD& p2) - { - cb->opIntIntSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4128,7 +3775,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[999999992] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opLongLongSD_async(sdi1, sdi2); try { @@ -4143,17 +3789,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opLongLongSD(sdi1, sdi2, - [=](const Test::LongLongSD& p1, const Test::LongLongSD& p2) - { - cb->opLongLongSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4178,7 +3813,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2["aBc"] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringFloatSD_async(sdi1, sdi2); try { @@ -4193,17 +3827,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringFloatSD(sdi1, sdi2, - [=](const Test::StringFloatSD& p1, const Test::StringFloatSD& p2) - { - cb->opStringFloatSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4228,7 +3851,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[""] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringDoubleSD_async(sdi1, sdi2); try { @@ -4243,17 +3865,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringDoubleSD(sdi1, sdi2, - [=](const Test::StringDoubleSD& p1, const Test::StringDoubleSD& p2) - { - cb->opStringDoubleSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4280,7 +3891,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2["ghi"] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opStringStringSD_async(sdi1, sdi2); try { @@ -4295,17 +3905,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opStringStringSD(sdi1, sdi2, - [=](const Test::StringStringSD& p1, const Test::StringStringSD& p2) - { - cb->opStringStringSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4331,7 +3930,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& sdi2[ICE_ENUM(Test::MyEnum, enum1)] = si3; CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opMyEnumMyEnumSD_async(sdi1, sdi2); try { @@ -4346,17 +3944,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opMyEnumMyEnumSD(sdi1, sdi2, - [=](const Test::MyEnumMyEnumSD& p1, const Test::MyEnumMyEnumSD& p2) - { - cb->opMyEnumMyEnumSD(p1, p2); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } @@ -4371,7 +3958,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& s.push_back(i); } CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opIntS_async(s); try { @@ -4385,17 +3971,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opIntS(s, - [=](const Test::IntS& p1) - { - cb->opIntS(p1); - }, - [=](const Ice::Exception& ex) - { - cb->exCB(ex); - }); -# endif cb->check(); } } @@ -4404,7 +3979,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Ice::Double d = 1278312346.0 / 13.0; Test::DoubleS ds(5, d); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opDoubleMarshaling_async(d, ds); try { @@ -4419,17 +3993,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opDoubleMarshaling(d, ds, - [=](){ cb->opDoubleMarshaling(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opIdempotent_async(); try { @@ -4444,16 +4012,11 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opIdempotent([=](){ cb->opIdempotent(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } { CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = p->opNonmutating_async(); try { @@ -4468,10 +4031,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - p->begin_opNonmutating([=](){ cb->opNonmutating(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } @@ -4479,7 +4038,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::MyDerivedClassPrxPtr derived = ICE_CHECKED_CAST(Test::MyDerivedClassPrx, p); test(derived); CallbackPtr cb = new Callback; -# ifdef ICE_CPP11_MAPPING auto f = derived->opDerived_async(); try { @@ -4494,10 +4052,6 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { test(false); } -# else - derived->begin_opDerived([=](){ cb->opDerived(); }, - [=](const Ice::Exception& ex){ cb->exCB(ex); }); -# endif cb->check(); } #endif |