summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-28 19:42:21 +0100
committerJose <jose@zeroc.com>2015-12-28 19:42:21 +0100
commit6e006573d5fb7bff5ec602c616b68a523d32b18d (patch)
tree6bf9bb78232b7eedaa0fa7410d0cf268d078f68d /cpp/src
parentDon't run tests with bluetooth on non-Linux platforms (diff)
downloadice-6e006573d5fb7bff5ec602c616b68a523d32b18d.tar.bz2
ice-6e006573d5fb7bff5ec602c616b68a523d32b18d.tar.xz
ice-6e006573d5fb7bff5ec602c616b68a523d32b18d.zip
Remove C++11 extensions to C++98 mapping
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/AsyncResult.cpp57
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp41
-rw-r--r--cpp/src/Ice/CommunicatorI.h4
-rw-r--r--cpp/src/Ice/ConnectionI.cpp40
-rw-r--r--cpp/src/Ice/ConnectionI.h3
-rw-r--r--cpp/src/Ice/Initialize.cpp49
-rw-r--r--cpp/src/Ice/Proxy.cpp354
-rw-r--r--cpp/src/slice2cpp/Gen.cpp274
8 files changed, 0 insertions, 822 deletions
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