summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-04-20 11:57:42 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-04-20 11:57:42 +0200
commitf6b52a538e9270d29bc9c015f7cc8223bafa3151 (patch)
tree4a460e07f54719dcb29af98258b3533b3b4057a7 /cpp/src
parentVisual Studio 2010 support (diff)
downloadice-f6b52a538e9270d29bc9c015f7cc8223bafa3151.tar.bz2
ice-f6b52a538e9270d29bc9c015f7cc8223bafa3151.tar.xz
ice-f6b52a538e9270d29bc9c015f7cc8223bafa3151.zip
Fixed ICE-7744 - Changed back C++11 flushBatchRequests to return void
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp5
-rw-r--r--cpp/src/Ice/CommunicatorI.h3
-rw-r--r--cpp/src/Ice/ConnectionI.cpp6
-rw-r--r--cpp/src/Ice/ConnectionI.h2
-rw-r--r--cpp/src/slice2cpp/Gen.cpp28
5 files changed, 21 insertions, 23 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 66be6c81207..bb3f32bbf05 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -371,11 +371,6 @@ const ::std::string flushBatchRequests_name = "flushBatchRequests";
}
#ifdef ICE_CPP11_MAPPING
-void
-Ice::CommunicatorI::flushBatchRequests(CompressBatch compress)
-{
- Communicator::flushBatchRequestsAsync(compress).get();
-}
::std::function<void()>
Ice::CommunicatorI::flushBatchRequestsAsync(CompressBatch compress,
diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h
index 3111c621633..bc261102cc2 100644
--- a/cpp/src/Ice/CommunicatorI.h
+++ b/cpp/src/Ice/CommunicatorI.h
@@ -103,14 +103,13 @@ public:
virtual ValueFactoryManagerPtr getValueFactoryManager() const;
- virtual void flushBatchRequests(CompressBatch);
-
#ifdef ICE_CPP11_MAPPING
virtual ::std::function<void()>
flushBatchRequestsAsync(CompressBatch,
::std::function<void(::std::exception_ptr)>,
::std::function<void(bool)> = nullptr);
#else
+ virtual void flushBatchRequests(CompressBatch);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch, const CallbackPtr&, const LocalObjectPtr& = 0);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch,
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index ca9453a055a..b2c04d7fb1d 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -784,12 +784,6 @@ Ice::ConnectionI::getBatchRequestQueue() const
}
#ifdef ICE_CPP11_MAPPING
-void
-Ice::ConnectionI::flushBatchRequests(CompressBatch compress)
-{
- Connection::flushBatchRequestsAsync(compress).get();
-}
-
std::function<void()>
Ice::ConnectionI::flushBatchRequestsAsync(CompressBatch compress,
::std::function<void(::std::exception_ptr)> ex,
diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h
index 8605c4a014a..19969700913 100644
--- a/cpp/src/Ice/ConnectionI.h
+++ b/cpp/src/Ice/ConnectionI.h
@@ -175,7 +175,6 @@ public:
IceInternal::BatchRequestQueuePtr getBatchRequestQueue() const;
- virtual void flushBatchRequests(CompressBatch);
#ifdef ICE_CPP11_MAPPING
virtual std::function<void()>
@@ -183,6 +182,7 @@ public:
::std::function<void(::std::exception_ptr)>,
::std::function<void(bool)> = nullptr);
#else
+ virtual void flushBatchRequests(CompressBatch);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch, const CallbackPtr&, const LocalObjectPtr& = 0);
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch,
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index c8bd53530e6..eefc51457c5 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3346,7 +3346,7 @@ Slice::Gen::ObjectVisitor::emitOneShotConstructor(const ClassDefPtr& p)
DataMemberList dataMembers = p->dataMembers();
int typeContext = p->isLocal() ? (_useWstring | TypeContextLocal) : _useWstring;
-
+
for(DataMemberList::const_iterator q = allDataMembers.begin(); q != allDataMembers.end(); ++q)
{
@@ -6333,7 +6333,7 @@ Slice::Gen::Cpp11ObjectVisitor::emitDataMember(const DataMemberPtr& p)
ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
if(cl->isLocal())
{
- typeContext |= TypeContextLocal;
+ typeContext |= TypeContextLocal;
}
H << nl << typeToString(p->type(), p->optional(), p->getMetaData(), typeContext) << ' ' << name;
@@ -6647,8 +6647,6 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p)
string deprecateSymbol = getDeprecateSymbol(p, cl);
- H << sp;
- H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << noExcept << " = 0;";
if(cl->hasMetaData("async-oneway") || p->hasMetaData("async-oneway"))
{
@@ -6671,6 +6669,13 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p)
}
H << sp;
+ H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << spar << paramsDeclAMI << epar
+ << isConst << noExcept;
+ H << sb;
+ H << nl << name << "Async" << spar << paramsArgAMI << epar << ".get();";
+ H << eb;
+
+ H << sp;
H << nl << "virtual ::std::function<void()>";
H << nl << name << "Async(";
H.useCurrentPosAsIndent();
@@ -6690,10 +6695,10 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p)
H << nl << "template<template<typename> class P = ::std::promise>";
H << nl << deprecateSymbol << "auto " << name << "Async" << spar << paramsDeclAMI << epar;
H.inc();
- H << nl << "-> decltype(::std::declval<P<bool>>().get_future())";
+ H << nl << "-> decltype(::std::declval<P<void>>().get_future())";
H.dec();
H << sb;
- H << nl << "using Promise = P<bool>;";
+ H << nl << "using Promise = P<void>;";
H << nl << "auto promise = ::std::make_shared<Promise>();";
H << nl << name << "Async(";
@@ -6710,15 +6715,20 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p)
H << sb;
H << nl << "promise->set_exception(::std::move(ex));";
H << eb << ",";
- H << nl << "[promise](bool b)";
+ H << nl << "[promise](bool)";
H << sb;
- H << nl << "promise->set_value(b);";
+ H << nl << "promise->set_value();";
H << eb << ");";
H.restoreIndent();
H << nl << "return promise->get_future();";
H << eb;
}
+ else
+ {
+ H << sp;
+ H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << noExcept << " = 0;";
+ }
}
Slice::Gen::Cpp11InterfaceVisitor::Cpp11InterfaceVisitor(::IceUtilInternal::Output& h,
@@ -7468,7 +7478,7 @@ Slice::Gen::Cpp11ObjectVisitor::emitOneShotConstructor(const ClassDefPtr& p)
{
vector<string> allParamDecls;
DataMemberList dataMembers = p->dataMembers();
-
+
int typeContext = _useWstring | TypeContextCpp11;
if(p->isLocal())
{