From 18a6720fcc3ece576f5fb26283e239cda2bebadd Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 3 Feb 2016 10:42:29 +0100 Subject: Refactored invocation code to better suite new C++11 mapping --- cpp/src/Glacier2/.depend.mak | 14 - .../Glacier2CryptPermissionsVerifier/.depend.mak | 1 - cpp/src/Glacier2Lib/.depend.mak | 10 - cpp/src/Ice/.depend.mak | 126 -- cpp/src/Ice/ACM.h | 19 +- cpp/src/Ice/AsyncResult.cpp | 508 +------ cpp/src/Ice/BatchRequestQueue.cpp | 2 +- cpp/src/Ice/CollocatedRequestHandler.cpp | 84 +- cpp/src/Ice/CollocatedRequestHandler.h | 4 +- cpp/src/Ice/CommunicatorI.cpp | 143 +- cpp/src/Ice/CommunicatorI.h | 2 + cpp/src/Ice/ConnectRequestHandler.cpp | 98 +- cpp/src/Ice/ConnectRequestHandler.h | 2 + cpp/src/Ice/ConnectionFactory.cpp | 35 +- cpp/src/Ice/ConnectionI.cpp | 307 ++--- cpp/src/Ice/ConnectionI.h | 21 +- cpp/src/Ice/FactoryTable.cpp | 21 +- cpp/src/Ice/Incoming.cpp | 6 +- cpp/src/Ice/IncomingAsync.cpp | 23 +- cpp/src/Ice/InputStream.cpp | 19 +- cpp/src/Ice/InstrumentationI.cpp | 12 +- cpp/src/Ice/LocatorInfo.cpp | 10 +- cpp/src/Ice/NetworkProxy.h | 1 + cpp/src/Ice/Outgoing.cpp | 6 +- cpp/src/Ice/OutgoingAsync.cpp | 1347 +++++++++++------- cpp/src/Ice/Proxy.cpp | 848 ++---------- cpp/src/Ice/Reference.cpp | 27 +- cpp/src/Ice/ResponseHandler.h | 2 +- cpp/src/Ice/RetryQueue.cpp | 4 +- cpp/src/Ice/RouterInfo.h | 31 +- cpp/src/Ice/ValueFactoryManagerI.cpp | 6 +- cpp/src/Ice/ValueFactoryManagerI.h | 9 +- cpp/src/IceBox/.depend.mak | 5 - cpp/src/IceDB/.depend.mak | 1 - cpp/src/IceDB/IceDB.h | 11 +- cpp/src/IceDiscovery/.depend.mak | 4 - cpp/src/IceDiscovery/LookupI.h | 3 +- cpp/src/IceGrid/.depend.mak | 53 - cpp/src/IceGridLib/.depend.mak | 9 - cpp/src/IceLocatorDiscovery/.depend.mak | 2 - cpp/src/IcePatch2/.depend.mak | 4 - cpp/src/IcePatch2Lib/.depend.mak | 4 - cpp/src/IceSSL/.depend.mak | 14 - cpp/src/IceStorm/.depend.mak | 24 - cpp/src/IceStormLib/.depend.mak | 2 - cpp/src/Slice/CPlusPlusUtil.cpp | 232 +--- cpp/src/iceserviceinstall/.depend.mak | 2 - cpp/src/slice2cpp/Gen.cpp | 1442 ++++++++------------ cpp/src/slice2cpp/Gen.h | 13 +- 49 files changed, 1919 insertions(+), 3654 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/Glacier2/.depend.mak b/cpp/src/Glacier2/.depend.mak index 043a3219cbe..ccad6eb736c 100755 --- a/cpp/src/Glacier2/.depend.mak +++ b/cpp/src/Glacier2/.depend.mak @@ -44,7 +44,6 @@ Blobject.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -181,7 +180,6 @@ ClientBlobject.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -307,7 +305,6 @@ FilterI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -399,7 +396,6 @@ FilterManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -558,7 +554,6 @@ Glacier2Router.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -698,7 +693,6 @@ Instance.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -831,7 +825,6 @@ InstrumentationI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -950,7 +943,6 @@ ProxyVerifier.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1075,7 +1067,6 @@ RequestQueue.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1200,7 +1191,6 @@ RouterI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1353,7 +1343,6 @@ RoutingTable.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1481,7 +1470,6 @@ ServerBlobject.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1617,7 +1605,6 @@ SessionRouterI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1751,7 +1738,6 @@ Instrumentation.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Instrumentation.h" \ "$(includedir)\Ice\EndpointF.h" \ diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/.depend.mak b/cpp/src/Glacier2CryptPermissionsVerifier/.depend.mak index 9b4d56e5c5c..f5babd35ee8 100755 --- a/cpp/src/Glacier2CryptPermissionsVerifier/.depend.mak +++ b/cpp/src/Glacier2CryptPermissionsVerifier/.depend.mak @@ -21,7 +21,6 @@ CryptPermissionsVerifierI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/Glacier2Lib/.depend.mak b/cpp/src/Glacier2Lib/.depend.mak index 1010e49158a..ade6d0afc97 100755 --- a/cpp/src/Glacier2Lib/.depend.mak +++ b/cpp/src/Glacier2Lib/.depend.mak @@ -70,7 +70,6 @@ Application.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -191,7 +190,6 @@ NullPermissionsVerifier.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -330,7 +328,6 @@ SessionHelper.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -454,7 +451,6 @@ Metrics.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -539,7 +535,6 @@ PermissionsVerifierF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -608,7 +603,6 @@ PermissionsVerifier.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -694,7 +688,6 @@ Router.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -784,7 +777,6 @@ RouterF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -853,7 +845,6 @@ Session.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -939,7 +930,6 @@ SSLInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\BuiltinSequences.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ diff --git a/cpp/src/Ice/.depend.mak b/cpp/src/Ice/.depend.mak index 8283090951b..6ceeb3fc74c 100755 --- a/cpp/src/Ice/.depend.mak +++ b/cpp/src/Ice/.depend.mak @@ -215,7 +215,6 @@ Acceptor.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -295,7 +294,6 @@ ACM.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -426,7 +424,6 @@ Application.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -551,7 +548,6 @@ AsyncResult.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -689,7 +685,6 @@ BatchRequestQueue.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -790,7 +785,6 @@ Buffer.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -836,7 +830,6 @@ CollocatedRequestHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -972,7 +965,6 @@ CommunicatorI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1119,7 +1111,6 @@ ConnectionFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1278,7 +1269,6 @@ ConnectionI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1430,7 +1420,6 @@ ConnectionRequestHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1568,7 +1557,6 @@ ConnectRequestHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\EndpointF.h" \ @@ -1695,7 +1683,6 @@ DefaultsAndOverrides.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1792,7 +1779,6 @@ DispatchInterceptor.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -1864,7 +1850,6 @@ EndpointFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1986,7 +1971,6 @@ EndpointFactoryManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -2105,7 +2089,6 @@ EndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -2147,7 +2130,6 @@ EventHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2255,7 +2237,6 @@ Exception.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -2341,7 +2322,6 @@ FactoryTable.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2376,7 +2356,6 @@ FactoryTableInit.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2413,7 +2392,6 @@ GCObject.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -2446,7 +2424,6 @@ HttpParser.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -2478,7 +2455,6 @@ ImplicitContextI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LocalException.h" \ "$(includedir)\Ice\Identity.h" \ @@ -2530,7 +2506,6 @@ Incoming.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2668,7 +2643,6 @@ IncomingAsync.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2807,7 +2781,6 @@ Initialize.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2922,7 +2895,6 @@ InputStream.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3057,7 +3029,6 @@ Instance.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3231,7 +3202,6 @@ InstrumentationI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -3346,7 +3316,6 @@ IPEndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -3484,7 +3453,6 @@ LocatorInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -3608,7 +3576,6 @@ LoggerAdminI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3711,7 +3678,6 @@ LoggerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3751,7 +3717,6 @@ LoggerUtil.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3864,7 +3829,6 @@ MetricsAdminI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -3994,7 +3958,6 @@ MetricsObserverI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -4091,7 +4054,6 @@ Network.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -4216,7 +4178,6 @@ NetworkProxy.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -4306,7 +4267,6 @@ Object.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -4374,7 +4334,6 @@ ObjectAdapterFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ @@ -4466,7 +4425,6 @@ ObjectAdapterI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ @@ -4619,7 +4577,6 @@ ObserverHelper.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -4741,7 +4698,6 @@ OpaqueEndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -4840,7 +4796,6 @@ Outgoing.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -4973,7 +4928,6 @@ OutgoingAsync.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5102,7 +5056,6 @@ OutputStream.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5230,7 +5183,6 @@ PluginManagerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -5352,7 +5304,6 @@ PropertiesAdminI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ @@ -5438,7 +5389,6 @@ PropertiesI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -5540,7 +5490,6 @@ Protocol.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5572,7 +5521,6 @@ ProtocolInstance.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5694,7 +5642,6 @@ ProtocolPluginFacade.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5821,7 +5768,6 @@ Proxy.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5968,7 +5914,6 @@ ProxyFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ConnectionIF.h" \ "$(includedir)\Ice\RequestHandlerF.h" \ @@ -6093,7 +6038,6 @@ Reference.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -6244,7 +6188,6 @@ ReferenceFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -6395,7 +6338,6 @@ RegisterPluginsInit.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6480,7 +6422,6 @@ RequestHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -6580,7 +6521,6 @@ RequestHandlerFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -6696,7 +6636,6 @@ ResponseHandler.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -6749,7 +6688,6 @@ RetryQueue.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6853,7 +6791,6 @@ RouterInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -6955,7 +6892,6 @@ Selector.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -7070,7 +7006,6 @@ ServantManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -7196,7 +7131,6 @@ Service.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -7328,7 +7262,6 @@ SliceChecksums.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -7371,7 +7304,6 @@ SlicedData.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -7419,7 +7351,6 @@ StreamSocket.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -7542,7 +7473,6 @@ TcpAcceptor.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -7678,7 +7608,6 @@ TcpConnector.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -7817,7 +7746,6 @@ TcpEndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -7942,7 +7870,6 @@ TcpTransceiver.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8072,7 +7999,6 @@ ThreadPool.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8194,7 +8120,6 @@ TraceLevels.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -8283,7 +8208,6 @@ TraceUtil.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8393,7 +8317,6 @@ Transceiver.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8474,7 +8397,6 @@ UdpConnector.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -8606,7 +8528,6 @@ UdpEndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -8731,7 +8652,6 @@ UdpTransceiver.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8854,7 +8774,6 @@ Value.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -8908,7 +8827,6 @@ ValueFactoryManagerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -8946,7 +8864,6 @@ WSAcceptor.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9073,7 +8990,6 @@ WSConnector.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9202,7 +9118,6 @@ WSEndpoint.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -9332,7 +9247,6 @@ WSTransceiver.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9463,7 +9377,6 @@ DLLMain.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LocalException.h" \ "$(includedir)\Ice\Identity.h" \ @@ -9587,7 +9500,6 @@ BuiltinSequences.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9638,7 +9550,6 @@ Communicator.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -9731,7 +9642,6 @@ CommunicatorF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9758,7 +9668,6 @@ Connection.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -9832,7 +9741,6 @@ ConnectionF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9859,7 +9767,6 @@ Current.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -9909,7 +9816,6 @@ Endpoint.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -9962,7 +9868,6 @@ EndpointF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -9989,7 +9894,6 @@ EndpointTypes.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10016,7 +9920,6 @@ FacetMap.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10067,7 +9970,6 @@ Identity.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10117,7 +10019,6 @@ ImplicitContext.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LocalException.h" \ "$(includedir)\Ice\Identity.h" \ @@ -10170,7 +10071,6 @@ ImplicitContextF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10197,7 +10097,6 @@ Instrumentation.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -10249,7 +10148,6 @@ InstrumentationF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10276,7 +10174,6 @@ LocalException.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -10328,7 +10225,6 @@ Locator.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -10413,7 +10309,6 @@ LocatorF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -10482,7 +10377,6 @@ Logger.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10509,7 +10403,6 @@ LoggerF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10536,7 +10429,6 @@ Metrics.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -10619,7 +10511,6 @@ ObjectAdapter.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -10692,7 +10583,6 @@ ObjectAdapterF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10719,7 +10609,6 @@ ObjectFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10770,7 +10659,6 @@ Plugin.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -10822,7 +10710,6 @@ PluginF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -10849,7 +10736,6 @@ Process.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -10932,7 +10818,6 @@ ProcessF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11001,7 +10886,6 @@ Properties.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11086,7 +10970,6 @@ PropertiesAdmin.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11170,7 +11053,6 @@ PropertiesF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11239,7 +11121,6 @@ RemoteLogger.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11322,7 +11203,6 @@ Router.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11405,7 +11285,6 @@ RouterF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -11474,7 +11353,6 @@ ServantLocator.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\ObjectAdapterF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -11525,7 +11403,6 @@ ServantLocatorF.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -11552,7 +11429,6 @@ SliceChecksumDict.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -11603,7 +11479,6 @@ ValueFactory.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -11653,7 +11528,6 @@ Version.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ diff --git a/cpp/src/Ice/ACM.h b/cpp/src/Ice/ACM.h index 0290a179ab8..3328b5038d9 100644 --- a/cpp/src/Ice/ACM.h +++ b/cpp/src/Ice/ACM.h @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace IceInternal @@ -44,14 +45,13 @@ public: virtual void remove(const Ice::ConnectionIPtr&) = 0; virtual void reap(const Ice::ConnectionIPtr&) = 0; - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, + virtual ACMMonitorPtr acm(const IceUtil::Optional&, + const IceUtil::Optional&, const IceUtil::Optional&) = 0; virtual Ice::ACM getACM() = 0; }; -class FactoryACMMonitor : public ACMMonitor, public ::IceUtil::Mutex, - public Ice::EnableSharedFromThis +class FactoryACMMonitor : public ACMMonitor, public IceUtil::Mutex, public Ice::EnableSharedFromThis { public: @@ -62,8 +62,8 @@ public: virtual void remove(const Ice::ConnectionIPtr&); virtual void reap(const Ice::ConnectionIPtr&); - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, + virtual ACMMonitorPtr acm(const IceUtil::Optional&, + const IceUtil::Optional&, const IceUtil::Optional&); virtual Ice::ACM getACM(); @@ -86,7 +86,8 @@ private: std::vector _reapedConnections; }; -class ConnectionACMMonitor : public ACMMonitor, public ::IceUtil::Mutex, +class ConnectionACMMonitor : public ACMMonitor, + public IceUtil::Mutex, public Ice::EnableSharedFromThis { public: @@ -98,8 +99,8 @@ public: virtual void remove(const Ice::ConnectionIPtr&); virtual void reap(const Ice::ConnectionIPtr&); - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, + virtual ACMMonitorPtr acm(const IceUtil::Optional&, + const IceUtil::Optional&, const IceUtil::Optional&); virtual Ice::ACM getACM(); diff --git a/cpp/src/Ice/AsyncResult.cpp b/cpp/src/Ice/AsyncResult.cpp index 37a5581f11a..b8c33b60089 100644 --- a/cpp/src/Ice/AsyncResult.cpp +++ b/cpp/src/Ice/AsyncResult.cpp @@ -7,158 +7,16 @@ // // ********************************************************************** +#ifndef ICE_CPP11_MAPPING + #include #include -#include -#include -#include -#include -#include -#include +#include using namespace std; using namespace Ice; -using namespace IceInternal; -#ifndef ICE_CPP11_MAPPING IceUtil::Shared* Ice::upCast(AsyncResult* p) { return p; } -#endif - -const unsigned char Ice::AsyncResult::OK = 0x1; -const unsigned char Ice::AsyncResult::Done = 0x2; -const unsigned char Ice::AsyncResult::Sent = 0x4; -const unsigned char Ice::AsyncResult::EndCalled = 0x8; - -void -AsyncResult::cancel() -{ - cancel(InvocationCanceledException(__FILE__, __LINE__)); -} - -Int -AsyncResult::getHash() const -{ - return static_cast(reinterpret_cast(this) >> 4); -} - -CommunicatorPtr -AsyncResult::getCommunicator() const -{ - return _communicator; -} - -ConnectionPtr -AsyncResult::getConnection() const -{ - return ICE_NULLPTR; -} - -ObjectPrxPtr -AsyncResult::getProxy() const -{ - return ICE_NULLPTR; -} - -bool -AsyncResult::isCompleted() const -{ - IceUtil::Monitor::Lock sync(_monitor); - return _state & Done; -} - -void -AsyncResult::waitForCompleted() -{ - IceUtil::Monitor::Lock sync(_monitor); - while(!(_state & Done)) - { - _monitor.wait(); - } -} - -bool -AsyncResult::isSent() const -{ - IceUtil::Monitor::Lock sync(_monitor); - return _state & Sent; -} - -void -AsyncResult::waitForSent() -{ - IceUtil::Monitor::Lock sync(_monitor); - while(!(_state & Sent) && !ICE_EXCEPTION_GET(_exception)) - { - _monitor.wait(); - } -} - -void -AsyncResult::throwLocalException() const -{ - IceUtil::Monitor::Lock sync(_monitor); - if(ICE_EXCEPTION_GET(_exception)) - { - ICE_RETHROW_EXCEPTION(_exception); - } -} - -bool -AsyncResult::sentSynchronously() const -{ - return _sentSynchronously; -} - -#ifndef ICE_CPP11_MAPPING -LocalObjectPtr -AsyncResult::getCookie() const -{ - return _cookie; -} -#endif - -const std::string& -AsyncResult::getOperation() const -{ - return _operation; -} - -void -AsyncResult::__throwUserException() -{ - try - { - _is.startEncapsulation(); - _is.throwException(); - } - catch(const Ice::UserException&) - { - _is.endEncapsulation(); - throw; - } -} - -bool -AsyncResult::__wait() -{ - IceUtil::Monitor::Lock sync(_monitor); - if(_state & EndCalled) - { - throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "end_ method called more than once"); - } - _state |= EndCalled; - while(!(_state & Done)) - { - _monitor.wait(); - } - - if(ICE_EXCEPTION_GET(_exception)) - { - ICE_RETHROW_EXCEPTION(_exception); - } - - return _state & OK; -} void AsyncResult::__check(const AsyncResultPtr& r, const IceProxy::Ice::Object* prx, const string& operation) @@ -203,368 +61,12 @@ AsyncResult::__check(const AsyncResultPtr& r, const string& operation) { throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "AsyncResult == null"); } - else if(&r->_operation != &operation) + else if(r->getOperation() != operation) { throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "Incorrect operation for end_" + operation + - " method: " + r->_operation); + " method: " + r->getOperation()); } } -#ifdef ICE_CPP11_MAPPING -AsyncResult::AsyncResult(const CommunicatorPtr& communicator, - const IceInternal::InstancePtr& instance, - const string& op, - const CallbackBasePtr& callback) : - _instance(instance), - _sentSynchronously(false), - _is(instance.get(), Ice::currentProtocolEncoding), - _communicator(communicator), - _operation(op), - _callback(callback), - _state(0) -{ - if(!_callback) - { - throw IceUtil::IllegalArgumentException(__FILE__, __LINE__); - } -} -#else -AsyncResult::AsyncResult(const CommunicatorPtr& communicator, - const IceInternal::InstancePtr& instance, - const string& op, - const CallbackBasePtr& del, - const LocalObjectPtr& cookie) : - _instance(instance), - _sentSynchronously(false), - _is(instance.get(), Ice::currentProtocolEncoding), - _communicator(communicator), - _operation(op), - _callback(del), - _cookie(cookie), - _state(0) -{ - if(!_callback) - { - throw IceUtil::IllegalArgumentException(__FILE__, __LINE__); - } - const_cast(_callback) = _callback->verify(_cookie); -} #endif -AsyncResult::~AsyncResult() -{ -} - -bool -AsyncResult::sent(bool done) -{ - IceUtil::Monitor::Lock sync(_monitor); - assert(!ICE_EXCEPTION_GET(_exception)); - bool alreadySent = _state & Sent; - _state |= Sent; - if(done) - { - _state |= Done | OK; - _cancellationHandler = 0; - if(!_callback || !_callback->hasSentCallback()) - { - _observer.detach(); - } - } - - _monitor.notifyAll(); - return !alreadySent && _callback && _callback->hasSentCallback(); -} - -bool -AsyncResult::finished(bool ok) -{ - IceUtil::Monitor::Lock sync(_monitor); - _state |= Done; - if(ok) - { - _state |= OK; - } - _cancellationHandler = 0; - if(!_callback) - { - _observer.detach(); - } - _monitor.notifyAll(); - return _callback != ICE_NULLPTR; -} - -bool -AsyncResult::finished(const Ice::Exception& ex) -{ - IceUtil::Monitor::Lock sync(_monitor); - _state |= Done; - ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); - _cancellationHandler = 0; - _observer.failed(ex.ice_id()); - if(!_callback) - { - _observer.detach(); - } - _monitor.notifyAll(); - return _callback != ICE_NULLPTR; -} - -void -AsyncResult::invokeSentAsync() -{ - class AsynchronousSent : public DispatchWorkItem - { - public: - - AsynchronousSent(const ConnectionPtr& connection, const AsyncResultPtr& result) : - DispatchWorkItem(connection), _result(result) - { - } - - virtual void - run() - { - _result->invokeSent(); - } - - private: - - const AsyncResultPtr _result; - }; - - // - // This is called when it's not safe to call the sent callback - // synchronously from this thread. Instead the exception callback - // is called asynchronously from the client thread pool. - // - try - { - _instance->clientThreadPool()->dispatch(new AsynchronousSent(_cachedConnection, ICE_SHARED_FROM_THIS)); - } - catch(const Ice::CommunicatorDestroyedException&) - { - } -} - -void -AsyncResult::invokeCompletedAsync() -{ - class AsynchronousCompleted : public DispatchWorkItem - { - public: - - AsynchronousCompleted(const ConnectionPtr& connection, const AsyncResultPtr& result) : - DispatchWorkItem(connection), _result(result) - { - } - - virtual void - run() - { - _result->invokeCompleted(); - } - - private: - - const AsyncResultPtr _result; - }; - - // - // CommunicatorDestroyedCompleted is the only exception that can propagate directly - // from this method. - // - _instance->clientThreadPool()->dispatch(new AsynchronousCompleted(_cachedConnection, ICE_SHARED_FROM_THIS)); -} - -void -AsyncResult::invokeSent() -{ - assert(_callback); - - try - { - AsyncResultPtr self(ICE_SHARED_FROM_THIS); - _callback->sent(self); - } - catch(const std::exception& ex) - { - warning(ex); - } - catch(...) - { - warning(); - } - - if(_observer) - { - ObjectPrxPtr proxy = getProxy(); - if(!proxy || !proxy->ice_isTwoway()) - { - _observer.detach(); - } - } -} - -void -AsyncResult::invokeCompleted() -{ - assert(_callback); - - try - { - AsyncResultPtr self(ICE_SHARED_FROM_THIS); - _callback->completed(self); - } - catch(const std::exception& ex) - { - warning(ex); - } - catch(...) - { - warning(); - } - - _observer.detach(); -} - -void -AsyncResult::cancel(const Ice::LocalException& ex) -{ - CancellationHandlerPtr handler; - { - IceUtil::Monitor::Lock sync(_monitor); - ICE_RESET_EXCEPTION(_cancellationException, ex.ice_clone()); - if(!_cancellationHandler) - { - return; - } - handler = _cancellationHandler; - } - handler->asyncRequestCanceled(ICE_DYNAMIC_CAST(OutgoingAsyncBase, ICE_SHARED_FROM_THIS), ex); -} - -void -AsyncResult::cancelable(const CancellationHandlerPtr& handler) -{ - IceUtil::Monitor::Lock sync(_monitor); - - - if(ICE_EXCEPTION_GET(_cancellationException)) - { - try - { - ICE_RETHROW_EXCEPTION(_cancellationException); - } - catch(const Ice::LocalException&) - { - ICE_RESET_EXCEPTION(_cancellationException, ICE_NULLPTR); - throw; - } - } - _cancellationHandler = handler; -} - -void -AsyncResult::warning(const std::exception& exc) const -{ - if(_instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.AMICallback", 1) > 0) - { - Warning out(_instance->initializationData().logger); - const Exception* ex = dynamic_cast(&exc); - if(ex) - { - out << "Ice::Exception raised by AMI callback:\n" << *ex; - } - else - { - out << "std::exception raised by AMI callback:\n" << exc.what(); - } - } -} - -void -AsyncResult::warning() const -{ - if(_instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.AMICallback", 1) > 0) - { - Warning out(_instance->initializationData().logger); - out << "unknown exception raised by AMI callback"; - } -} - - -namespace -{ - -// -// Dummy class derived from CallbackBase -// We use this class for the __dummyCallback extern pointer in OutgoingAsync. In turn, -// this allows us to test whether the user supplied a null delegate instance to the -// generated begin_ method without having to generate a separate test to throw IllegalArgumentException -// in the inlined versions of the begin_ method. In other words, this reduces the amount of generated -// object code. -// -class DummyCallback : public CallbackBase -{ -public: - - DummyCallback() - { - } - - virtual void - completed(const Ice::AsyncResultPtr&) const - { - assert(false); - } - - virtual CallbackBasePtr - verify(const Ice::LocalObjectPtr&) - { - // - // Called by the AsyncResult constructor to verify the delegate. The dummy - // delegate is passed when the user used a begin_ method without delegate. - // By returning 0 here, we tell the AsyncResult that no delegates was - // provided. - // - return 0; - } - - virtual void - sent(const AsyncResultPtr&) const - { - assert(false); - } - - virtual bool - hasSentCallback() const - { - assert(false); - return false; - } -}; - -} - -// -// This gives a pointer value to compare against in the generated -// begin_ method to decide whether the caller passed a null pointer -// versus the generated inline version of the begin_ method having -// passed a pointer to the dummy delegate. -// -CallbackBasePtr IceInternal::__dummyCallback = ICE_MAKE_SHARED(DummyCallback); - -void -IceInternal::CallbackBase::checkCallback(bool obj, bool cb) -{ - if(!obj) - { - throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "callback object cannot be null"); - } - if(!cb) - { - throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "callback cannot be null"); - } -} - diff --git a/cpp/src/Ice/BatchRequestQueue.cpp b/cpp/src/Ice/BatchRequestQueue.cpp index ff152dc19ea..838ddee9bab 100644 --- a/cpp/src/Ice/BatchRequestQueue.cpp +++ b/cpp/src/Ice/BatchRequestQueue.cpp @@ -91,7 +91,7 @@ void BatchRequestQueue::prepareBatchRequest(OutputStream* os) { Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { ICE_RETHROW_EXCEPTION(_exception); } diff --git a/cpp/src/Ice/CollocatedRequestHandler.cpp b/cpp/src/Ice/CollocatedRequestHandler.cpp index 5e9dee2b5a3..f6ab4092aa5 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.cpp +++ b/cpp/src/Ice/CollocatedRequestHandler.cpp @@ -37,11 +37,7 @@ public: Int batchRequestNum) : _out(out), _os(os), -#ifdef ICE_CPP11_MAPPING - _handler(dynamic_pointer_cast(handler->shared_from_this())), -#else - _handler(handler), -#endif + _handler(handler->shared_from_this()), _requestId(requestId), _batchRequestNum(batchRequestNum) { @@ -190,9 +186,9 @@ CollocatedRequestHandler::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAs _asyncRequests.erase(p->second); } _sendAsyncRequests.erase(p); - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } _adapter->decDirectCount(); // invokeAll won't be called, decrease the direct count. return; @@ -206,9 +202,9 @@ CollocatedRequestHandler::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAs if(q->second.get() == o.get()) { _asyncRequests.erase(q); - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } return; } @@ -257,7 +253,7 @@ CollocatedRequestHandler::invokeRequest(OutgoingBase* out, int batchRequestNum) } AsyncStatus -CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int batchRequestNum) +CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int batchRequestNum, bool synchronous) { // // Increase the direct count to prevent the thread pool from being destroyed before @@ -278,20 +274,10 @@ CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int ba if(_response) { requestId = ++_requestId; -#ifdef ICE_CPP11_MAPPING - _asyncRequests.insert(make_pair(requestId, - dynamic_pointer_cast(outAsync->shared_from_this()))); -#else - _asyncRequests.insert(make_pair(requestId, outAsync)); -#endif + _asyncRequests.insert(make_pair(requestId, outAsync->shared_from_this())); } -#ifdef ICE_CPP11_MAPPING - _sendAsyncRequests.insert(make_pair( - dynamic_pointer_cast(outAsync->shared_from_this()), requestId)); -#else - _sendAsyncRequests.insert(make_pair(outAsync, requestId)); -#endif + _sendAsyncRequests.insert(make_pair(outAsync->shared_from_this(), requestId)); } catch(...) { @@ -301,17 +287,30 @@ CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int ba outAsync->attachCollocatedObserver(_adapter, requestId); -#ifdef ICE_CPP11_MAPPING - _adapter->getThreadPool()->dispatch(new InvokeAllAsync( - dynamic_pointer_cast(outAsync->shared_from_this()), - outAsync->getOs(), - dynamic_pointer_cast(shared_from_this()), - requestId, - batchRequestNum)); -#else - _adapter->getThreadPool()->dispatch(new InvokeAllAsync(outAsync, outAsync->getOs(), this, requestId, - batchRequestNum)); -#endif + if(!synchronous || !_response || _reference->getInvocationTimeout() > 0) + { + // Don't invoke from the user thread if async or invocation timeout is set + _adapter->getThreadPool()->dispatch(new InvokeAllAsync(outAsync->shared_from_this(), + outAsync->getOs(), + shared_from_this(), + requestId, + batchRequestNum)); + } + else if(_dispatcher) + { + _adapter->getThreadPool()->dispatchFromThisThread(new InvokeAllAsync(outAsync->shared_from_this(), + outAsync->getOs(), + shared_from_this(), + requestId, + batchRequestNum)); + } + else // Optimization: directly call invokeAll if there's no dispatcher. + { + if(sentAsync(outAsync)) + { + invokeAll(outAsync->getOs(), requestId, batchRequestNum); + } + } return AsyncStatusQueued; } @@ -349,7 +348,7 @@ CollocatedRequestHandler::sendResponse(Int requestId, OutputStream* os, Byte, bo if(q != _asyncRequests.end()) { is.swap(*q->second->getIs()); - if(q->second->completed()) + if(q->second->response()) { outAsync = q->second; } @@ -367,11 +366,11 @@ CollocatedRequestHandler::sendResponse(Int requestId, OutputStream* os, Byte, bo // if(amd) { - outAsync->invokeCompletedAsync(); + outAsync->invokeResponseAsync(); } else { - outAsync->invokeCompleted(); + outAsync->invokeResponse(); } } @@ -428,12 +427,7 @@ CollocatedRequestHandler::sentAsync(OutgoingAsyncBase* outAsync) { { Lock sync(*this); -#ifdef ICE_CPP11_MAPPING - if(_sendAsyncRequests.erase(outAsync ? - dynamic_pointer_cast(outAsync->shared_from_this()) : nullptr) == 0) -#else - if(_sendAsyncRequests.erase(outAsync) == 0) -#endif + if(_sendAsyncRequests.erase(outAsync->shared_from_this()) == 0) { return false; // The request timed-out. } @@ -533,7 +527,7 @@ CollocatedRequestHandler::handleException(int requestId, const Exception& ex, bo map::iterator q = _asyncRequests.find(requestId); if(q != _asyncRequests.end()) { - if(q->second->completed(ex)) + if(q->second->exception(ex)) { outAsync = q->second; } @@ -551,11 +545,11 @@ CollocatedRequestHandler::handleException(int requestId, const Exception& ex, bo // if(amd) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } else { - outAsync->invokeCompleted(); + outAsync->invokeException(); } } } diff --git a/cpp/src/Ice/CollocatedRequestHandler.h b/cpp/src/Ice/CollocatedRequestHandler.h index 809c79cb9e9..f7b9c7374e4 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.h +++ b/cpp/src/Ice/CollocatedRequestHandler.h @@ -66,13 +66,15 @@ public: virtual Ice::ConnectionIPtr waitForConnection(); void invokeRequest(OutgoingBase*, int); - AsyncStatus invokeAsyncRequest(OutgoingAsyncBase*, int); + AsyncStatus invokeAsyncRequest(OutgoingAsyncBase*, int, bool); bool sent(OutgoingBase*); bool sentAsync(OutgoingAsyncBase*); void invokeAll(Ice::OutputStream*, Ice::Int, Ice::Int); + using Ice::EnableSharedFromThis::shared_from_this; + private: void handleException(Ice::Int, const Ice::Exception&, bool); diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index 8d13727d9ea..c28ebed6fe7 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -212,104 +212,30 @@ const ::std::string __flushBatchRequests_name = "flushBatchRequests"; void Ice::CommunicatorI::flushBatchRequests() { - promise promise; - flushBatchRequests_async( - [&](exception_ptr ex) - { - promise.set_exception(move(ex)); - }, - [&](bool sentSynchronously) - { - promise.set_value(sentSynchronously); - }); - promise.get_future().get(); + Communicator::flushBatchRequests_async().get(); } ::std::function -Ice::CommunicatorI::flushBatchRequests_async( - function exception, - function sent) +Ice::CommunicatorI::flushBatchRequests_async(function ex, function sent) { - class FlushBatchRequestsCallback : public CallbackBase + class CommunicatorFlushBatchLambda : public CommunicatorFlushBatchAsync, public LambdaInvoke { public: - FlushBatchRequestsCallback(function exception, - function sent, - shared_ptr communicator) : - _exception(move(exception)), - _sent(move(sent)), - _communicator(move(communicator)) - { - } - - virtual void sent(const AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _communicator.get(), __flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return true; - } - - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const + CommunicatorFlushBatchLambda(const InstancePtr& instance, + std::function ex, + std::function sent) : + CommunicatorFlushBatchAsync(instance), LambdaInvoke(std::move(ex), std::move(sent)) { - try - { - AsyncResult::__check(result, _communicator.get(), __flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } } - - private: - - function _exception; - function _sent; - shared_ptr _communicator; }; - - OutgoingConnectionFactoryPtr connectionFactory = _instance->outgoingConnectionFactory(); - ObjectAdapterFactoryPtr adapterFactory = _instance->objectAdapterFactory(); - - auto self = dynamic_pointer_cast(shared_from_this()); - - auto result = make_shared(self, _instance, __flushBatchRequests_name, - make_shared(move(exception), move(sent), self)); - - connectionFactory->flushAsyncBatchRequests(result); - adapterFactory->flushAsyncBatchRequests(result); - - // - // Inform the callback that we have finished initiating all of the - // flush requests. - // - result->ready(); - return [result]() - { - result->cancel(); - }; + auto outAsync = make_shared(_instance, ex, sent); + outAsync->invoke(__flushBatchRequests_name); + return [outAsync]() { outAsync->cancel(); }; } + #else + void Ice::CommunicatorI::flushBatchRequests() { @@ -338,28 +264,37 @@ Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBa AsyncResultPtr Ice::CommunicatorI::__begin_flushBatchRequests(const IceInternal::CallbackBasePtr& cb, const LocalObjectPtr& cookie) { - OutgoingConnectionFactoryPtr connectionFactory = _instance->outgoingConnectionFactory(); - ObjectAdapterFactoryPtr adapterFactory = _instance->objectAdapterFactory(); + class CommunicatorFlushBatchAsyncWithCallback : public CommunicatorFlushBatchAsync, public CallbackCompletion + { + public: - // - // This callback object receives the results of all invocations - // of Connection::begin_flushBatchRequests. - // - CommunicatorFlushBatchAsyncPtr result = new CommunicatorFlushBatchAsync(ICE_SHARED_FROM_THIS, - _instance, - __flushBatchRequests_name, - cb, - cookie); + CommunicatorFlushBatchAsyncWithCallback(const Ice::CommunicatorPtr& communicator, + const InstancePtr& instance, + const CallbackBasePtr& callback, + const Ice::LocalObjectPtr& cookie) : + CommunicatorFlushBatchAsync(instance), CallbackCompletion(callback, cookie), _communicator(communicator) + { + _cookie = cookie; + } - connectionFactory->flushAsyncBatchRequests(result); - adapterFactory->flushAsyncBatchRequests(result); + virtual Ice::CommunicatorPtr getCommunicator() const + { + return _communicator; + } + + virtual const std::string& + getOperation() const + { + return __flushBatchRequests_name; + } + + private: - // - // Inform the callback that we have finished initiating all of the - // flush requests. - // - result->ready(); + Ice::CommunicatorPtr _communicator; + }; + CommunicatorFlushBatchAsyncPtr result = new CommunicatorFlushBatchAsyncWithCallback(this, _instance, cb, cookie); + result->invoke(__flushBatchRequests_name); return result; } diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 1fbca5761b6..f3127003e89 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -109,7 +109,9 @@ private: friend ICE_API ::IceInternal::InstancePtr IceInternal::getInstance(const ::Ice::CommunicatorPtr&); friend ICE_API ::IceUtil::TimerPtr IceInternal::getInstanceTimer(const ::Ice::CommunicatorPtr&); +#ifndef ICE_CPP11_MAPPING AsyncResultPtr __begin_flushBatchRequests(const IceInternal::CallbackBasePtr&, const LocalObjectPtr&); +#endif const ::IceInternal::InstancePtr _instance; diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp index ba4dec506d5..1ec03b87a25 100644 --- a/cpp/src/Ice/ConnectRequestHandler.cpp +++ b/cpp/src/Ice/ConnectRequestHandler.cpp @@ -43,13 +43,13 @@ ConnectRequestHandler::connect(const Ice::ObjectPrxPtr& proxy) { _proxies.insert(proxy); } - return _requestHandler ? _requestHandler : ICE_SHARED_FROM_THIS; + return _requestHandler ? _requestHandler : shared_from_this(); } RequestHandlerPtr ConnectRequestHandler::update(const RequestHandlerPtr& previousHandler, const RequestHandlerPtr& newHandler) { - return previousHandler.get() == this ? newHandler : ICE_SHARED_FROM_THIS; + return previousHandler.get() == this ? newHandler : shared_from_this(); } bool @@ -75,7 +75,7 @@ ConnectRequestHandler::sendAsyncRequest(const ProxyOutgoingAsyncBasePtr& out) Lock sync(*this); if(!_initialized) { - out->cancelable(ICE_SHARED_FROM_THIS); // This will throw if the request is canceled + out->cancelable(shared_from_this()); // This will throw if the request is canceled } if(!initialized()) @@ -94,7 +94,7 @@ ConnectRequestHandler::requestCanceled(OutgoingBase* out, const Ice::LocalExcept { { Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { return; // The request has been notified of a failure already. } @@ -121,7 +121,7 @@ ConnectRequestHandler::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync { { Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { return; // The request has been notified of a failure already. } @@ -133,9 +133,9 @@ ConnectRequestHandler::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync if(p->outAsync.get() == outAsync.get()) { _requests.erase(p); - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } return; } @@ -149,7 +149,7 @@ Ice::ConnectionIPtr ConnectRequestHandler::getConnection() { Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { ICE_RETHROW_EXCEPTION(_exception); return 0; // Keep the compiler happy. @@ -164,7 +164,7 @@ Ice::ConnectionIPtr ConnectRequestHandler::waitForConnection() { Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { #ifdef ICE_CPP11_MAPPING throw RetryException(_exception); @@ -175,12 +175,12 @@ ConnectRequestHandler::waitForConnection() // // Wait for the connection establishment to complete or fail. // - while(!_initialized && !ICE_EXCEPTION_GET(_exception)) + while(!_initialized && !ICE_EXCEPTION_ISSET(_exception)) { wait(); } - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { ICE_RETHROW_EXCEPTION(_exception); return 0; // Keep the compiler happy. @@ -196,7 +196,7 @@ ConnectRequestHandler::setConnection(const Ice::ConnectionIPtr& connection, bool { { Lock sync(*this); - assert(!ICE_EXCEPTION_GET(_exception) && !_connection); + assert(!ICE_EXCEPTION_ISSET(_exception) && !_connection); _connection = connection; _compress = compress; } @@ -206,11 +206,7 @@ ConnectRequestHandler::setConnection(const Ice::ConnectionIPtr& connection, bool // add this proxy to the router info object. // RouterInfoPtr ri = _reference->getRouterInfo(); -#ifdef ICE_CPP11_MAPPING - if(ri && !ri->addProxy(_proxy, dynamic_pointer_cast(shared_from_this()))) -#else - if(ri && !ri->addProxy(_proxy, this)) -#endif + if(ri && !ri->addProxy(_proxy, AddProxyCallback::shared_from_this())) { return; // The request handler will be initialized once addProxy returns. } @@ -225,7 +221,7 @@ void ConnectRequestHandler::setException(const Ice::LocalException& ex) { Lock sync(*this); - assert(!_initialized && !ICE_EXCEPTION_GET(_exception)); + assert(!_initialized && !ICE_EXCEPTION_ISSET(_exception)); ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); _proxies.clear(); @@ -239,17 +235,16 @@ ConnectRequestHandler::setException(const Ice::LocalException& ex) // try { - _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, ICE_SHARED_FROM_THIS); + _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, shared_from_this()); } catch(const Ice::CommunicatorDestroyedException&) { // Ignore } -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { @@ -261,29 +256,13 @@ ConnectRequestHandler::setException(const Ice::LocalException& ex) } else { - if(p->outAsync->completed(ex)) + if(p->outAsync->exception(ex)) { - p->outAsync->invokeCompletedAsync(); + p->outAsync->invokeExceptionAsync(); } } } } -#else - for(deque::const_iterator p = _requests.begin(); p != _requests.end(); ++p) - { - if(p->out) - { - p->out->completed(*_exception.get()); - } - else - { - if(p->outAsync->completed(*_exception.get())) - { - p->outAsync->invokeCompletedAsync(); - } - } - } -#endif _requests.clear(); notifyAll(); } @@ -310,12 +289,12 @@ ConnectRequestHandler::initialized() } else { - while(_flushing && !ICE_EXCEPTION_GET(_exception)) + while(_flushing && !ICE_EXCEPTION_ISSET(_exception)) { wait(); } - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { if(_connection) { @@ -375,9 +354,12 @@ ConnectRequestHandler::flushRequests() { #ifdef ICE_CPP11_MAPPING exception = ex.get(); +#else + exception.reset(ex.get()->ice_clone()); +#endif try { - rethrow_exception(exception); + ICE_RETHROW_EXCEPTION(exception); } catch(const Ice::LocalException& ee) { @@ -393,35 +375,17 @@ ConnectRequestHandler::flushRequests() req.outAsync->retryException(ee); } } -#else - exception.reset(ex.get()->ice_clone()); - // Remove the request handler before retrying. - _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, this); - - if(req.out) - { - req.out->retryException(*ex.get()); - } - else - { - req.outAsync->retryException(*ex.get()); - } -#endif } catch(const Ice::LocalException& ex) { -#ifdef ICE_CPP11_MAPPING - exception = ex.ice_clone(); -#else - exception.reset(ex.ice_clone()); -#endif + ICE_RESET_EXCEPTION(exception, ex.ice_clone()); if(req.out) { req.out->completed(ex); } - else if(req.outAsync->completed(ex)) + else if(req.outAsync->exception(ex)) { - req.outAsync->invokeCompletedAsync(); + req.outAsync->invokeExceptionAsync(); } } _requests.pop_front(); @@ -433,12 +397,12 @@ ConnectRequestHandler::flushRequests() // request handler to use the more efficient connection request // handler. // - if(_reference->getCacheConnection() && !ICE_EXCEPTION_GET(exception)) + if(_reference->getCacheConnection() && !ICE_EXCEPTION_ISSET(exception)) { _requestHandler = ICE_MAKE_SHARED(ConnectionRequestHandler, _reference, _connection, _compress); for(set::const_iterator p = _proxies.begin(); p != _proxies.end(); ++p) { - (*p)->__updateRequestHandler(ICE_SHARED_FROM_THIS, _requestHandler); + (*p)->__updateRequestHandler(shared_from_this(), _requestHandler); } } @@ -450,14 +414,14 @@ ConnectRequestHandler::flushRequests() #else _exception.swap(exception); #endif - _initialized = !ICE_EXCEPTION_GET(_exception); + _initialized = !ICE_EXCEPTION_ISSET(_exception); _flushing = false; // // Only remove once all the requests are flushed to // guarantee serialization. // - _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, ICE_SHARED_FROM_THIS); + _reference->getInstance()->requestHandlerFactory()->removeRequestHandler(_reference, shared_from_this()); _proxies.clear(); _proxy = ICE_NULLPTR; // Break cyclic reference count. diff --git a/cpp/src/Ice/ConnectRequestHandler.h b/cpp/src/Ice/ConnectRequestHandler.h index ce441a4489f..b9eb628c9a3 100644 --- a/cpp/src/Ice/ConnectRequestHandler.h +++ b/cpp/src/Ice/ConnectRequestHandler.h @@ -53,6 +53,8 @@ public: virtual void addedProxy(); + using Ice::EnableSharedFromThis::shared_from_this; + private: bool initialized(); diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 64f33ecb7e5..7a981d64ff0 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -77,8 +77,8 @@ remove(Map& m, const typename Map::key_type& k, const typename Map::mapped_type& assert(false); // Nothing was removed which is an error. } -template typename Map::mapped_type -find(const Map& m, const typename Map::key_type& k, function predicate) +template typename Map::mapped_type +find(const Map& m, const typename Map::key_type& k, Predicate predicate) { auto pr = m.equal_range(k); for(auto q = pr.first; q != pr.second; ++q) @@ -393,24 +393,9 @@ IceInternal::OutgoingConnectionFactory::findConnection(const vectordefaultsAndOverrides(); assert(!endpoints.empty()); -#ifdef ICE_CPP11_MAPPING - // - // COMPILERFIX: G++ 4.8 fails to deduce the type of the lambda callback if passed - // directly to find. - // - std::function cb = [](const ConnectionIPtr& conn) - { - return conn->isActiveOrHolding(); - }; -#endif for(vector::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) { - ConnectionIPtr connection = find(_connectionsByEndpoint, *p, -#ifdef ICE_CPP11_MAPPING - cb); -#else - Ice::constMemFun(&ConnectionI::isActiveOrHolding)); -#endif + ConnectionIPtr connection = find(_connectionsByEndpoint, *p, Ice::constMemFun(&ConnectionI::isActiveOrHolding)); if(connection) { if(defaultsAndOverrides->overrideCompress) @@ -440,19 +425,7 @@ IceInternal::OutgoingConnectionFactory::findConnection(const vector cb = [](const ConnectionIPtr& conn) - { - return conn->isActiveOrHolding(); - }; -#endif - - ConnectionIPtr connection = find(_connections, p->connector, -#ifdef ICE_CPP11_MAPPING - cb); -#else - Ice::constMemFun(&ConnectionI::isActiveOrHolding)); -#endif + ConnectionIPtr connection = find(_connections, p->connector, Ice::constMemFun(&ConnectionI::isActiveOrHolding)); if(connection) { if(defaultsAndOverrides->overrideCompress) diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 2c8688b7a00..48542bf5aae 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -296,9 +296,9 @@ Ice::ConnectionI::OutgoingMessage::completed(const Ice::LocalException& ex) } else if(outAsync) { - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompleted(); + outAsync->invokeException(); } } @@ -317,7 +317,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback) IceUtil::Monitor::Lock sync(*this); if(_state >= StateClosed) // The connection might already be closed if the communicator was destroyed. { - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } @@ -339,7 +339,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback) if(_state >= StateClosing) { - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } } @@ -487,7 +487,7 @@ Ice::ConnectionI::throwException() const { IceUtil::Monitor::Lock sync(*this); - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { assert(_state >= StateClosing); ICE_RETHROW_EXCEPTION(_exception); @@ -622,7 +622,7 @@ Ice::ConnectionI::sendRequest(OutgoingBase* out, bool compress, bool response, i // to send our request, we always try to send the request // again. // - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { #ifdef ICE_CPP11_MAPPING throw RetryException(_exception); @@ -688,7 +688,7 @@ Ice::ConnectionI::sendRequest(OutgoingBase* out, bool compress, bool response, i catch(const LocalException& ex) { setState(StateClosed, ex); - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } @@ -714,7 +714,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres // to send our request, we always try to send the request // again. // - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { #ifdef ICE_CPP11_MAPPING throw RetryException(_exception); @@ -780,7 +780,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres catch(const LocalException& ex) { setState(StateClosed, ex); - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } @@ -801,87 +801,40 @@ Ice::ConnectionI::getBatchRequestQueue() const return _batchRequestQueue; } +#ifdef ICE_CPP11_MAPPING void Ice::ConnectionI::flushBatchRequests() { - ConnectionFlushBatch out(this, _instance.get(), __flushBatchRequests_name); - out.invoke(); + Connection::flushBatchRequests_async().get(); } -#ifdef ICE_CPP11_MAPPING -function -Ice::ConnectionI::flushBatchRequests_async(function exception, - function sent) +std::function +Ice::ConnectionI::flushBatchRequests_async(::std::function ex, + ::std::function sent) { - class FlushBatchRequestsCallback : public CallbackBase + class ConnectionFlushBatchLambda : public ConnectionFlushBatchAsync, public LambdaInvoke { public: - FlushBatchRequestsCallback(function exception, - function sent, - shared_ptr connection) : - _exception(move(exception)), - _sent(move(sent)), - _connection(move(connection)) + ConnectionFlushBatchLambda(std::shared_ptr&& connection, + const InstancePtr& instance, + std::function ex, + std::function sent) : + ConnectionFlushBatchAsync(connection, instance), LambdaInvoke(std::move(ex), std::move(sent)) { } - - virtual void sent(const AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _connection.get(), __flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return true; - } - - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _connection.get(), __flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - } - - private: - - function _exception; - function _sent; - shared_ptr _connection; }; - - auto self = dynamic_pointer_cast(shared_from_this()); - - auto result = make_shared(self, _communicator, _instance, __flushBatchRequests_name, - make_shared(move(exception), move(sent), self)); - result->invoke(); - return [result]() - { - result->cancel(); - }; + auto outAsync = make_shared(shared_from_this(), _instance, ex, sent); + outAsync->invoke(__flushBatchRequests_name); + return [outAsync]() { outAsync->cancel(); }; } #else +void +Ice::ConnectionI::flushBatchRequests() +{ + ConnectionFlushBatch out(this, _instance.get(), __flushBatchRequests_name); + out.invoke(); +} AsyncResultPtr Ice::ConnectionI::begin_flushBatchRequests() @@ -905,14 +858,47 @@ Ice::ConnectionI::begin_flushBatchRequests(const Callback_Connection_flushBatchR AsyncResultPtr Ice::ConnectionI::__begin_flushBatchRequests(const CallbackBasePtr& cb, const LocalObjectPtr& cookie) { - ConnectionFlushBatchAsyncPtr result = new ConnectionFlushBatchAsync( - shared_from_this(), - _communicator, - _instance, - __flushBatchRequests_name, - cb, - cookie); - result->invoke(); + class ConnectionFlushBatchAsyncWithCallback : public ConnectionFlushBatchAsync, public CallbackCompletion + { + public: + + ConnectionFlushBatchAsyncWithCallback(const Ice::ConnectionIPtr& connection, + const Ice::CommunicatorPtr& communicator, + const InstancePtr& instance, + const CallbackBasePtr& callback, + const Ice::LocalObjectPtr& cookie) : + ConnectionFlushBatchAsync(connection, instance), + CallbackCompletion(callback, cookie), + _communicator(communicator), + _connection(connection) + { + _cookie = cookie; + } + + virtual Ice::CommunicatorPtr getCommunicator() const + { + return _communicator; + } + + virtual Ice::ConnectionPtr getConnection() const + { + return _connection; + } + + virtual const std::string& + getOperation() const + { + return __flushBatchRequests_name; + } + + private: + + Ice::CommunicatorPtr _communicator; + Ice::ConnectionPtr _connection; + }; + + ConnectionFlushBatchAsyncPtr result = new ConnectionFlushBatchAsyncWithCallback(this, _communicator, _instance, cb, cookie); + result->invoke(__flushBatchRequests_name); return result; } @@ -925,21 +911,14 @@ Ice::ConnectionI::end_flushBatchRequests(const AsyncResultPtr& r) #endif void -#ifdef ICE_CPP11_MAPPING -Ice::ConnectionI::setHeartbeatCallback(std::function)> callback) -#else -Ice::ConnectionI::setHeartbeatCallback(const Ice::HeartbeatCallbackPtr& callback) -#endif +Ice::ConnectionI::setHeartbeatCallback(ICE_IN(ICE_HEARTBEAT_CALLBACK) callback) { IceUtil::Monitor::Lock sync(*this); _heartbeatCallback = callback; } + void -#ifdef ICE_CPP11_MAPPING -Ice::ConnectionI::setCloseCallback(std::function)> callback) -#else -Ice::ConnectionI::setCloseCallback(const Ice::CloseCallbackPtr& callback) -#endif +Ice::ConnectionI::setCloseCallback(ICE_IN(ICE_CLOSE_CALLBACK) callback) { IceUtil::Monitor::Lock sync(*this); if(_state >= StateClosed) @@ -949,15 +928,12 @@ Ice::ConnectionI::setCloseCallback(const Ice::CloseCallbackPtr& callback) class CallbackWorkItem : public DispatchWorkItem { public: -#ifdef ICE_CPP11_MAPPING - CallbackWorkItem(const ConnectionIPtr& connection, - std::function)> callback) : + + CallbackWorkItem(const ConnectionIPtr& connection, ICE_IN(ICE_CLOSE_CALLBACK) callback) : _connection(connection), +#ifdef ICE_CPP11_MAPPING _callback(move(callback)) #else - CallbackWorkItem(const ConnectionIPtr& connection, - const Ice::CloseCallbackPtr& callback) : - _connection(connection), _callback(callback) #endif { @@ -1192,9 +1168,9 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con o->canceled(false); _sendStreams.erase(o); } - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } } return; @@ -1215,9 +1191,9 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con { _asyncRequests.erase(_asyncRequestsHint); _asyncRequestsHint = _asyncRequests.end(); - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } } return; @@ -1236,9 +1212,9 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con { assert(p != _asyncRequestsHint); _asyncRequests.erase(p); - if(outAsync->completed(ex)) + if(outAsync->exception(ex)) { - outAsync->invokeCompletedAsync(); + outAsync->invokeExceptionAsync(); } } return; @@ -1266,7 +1242,7 @@ Ice::ConnectionI::sendResponse(Int, OutputStream* os, Byte compressFlag, bool /* if(_state >= StateClosed) { - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } @@ -1305,7 +1281,7 @@ Ice::ConnectionI::sendNoResponse() if(_state >= StateClosed) { - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); ICE_RETHROW_EXCEPTION(_exception); } @@ -1828,10 +1804,10 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vectorreceivedReply) { - OutgoingAsyncPtr outAsync = ICE_DYNAMIC_CAST(OutgoingAsync, p->outAsync); - if(outAsync->completed()) + OutgoingAsyncPtr o = ICE_DYNAMIC_CAST(OutgoingAsync, p->outAsync); + if(o->response()) { - outAsync->invokeCompleted(); + o->invokeResponse(); } } #else @@ -1847,7 +1823,7 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vectorinvokeCompleted(); + outAsync->invokeResponse(); ++dispatchedCount; } @@ -1964,20 +1940,15 @@ Ice::ConnectionI::finish(bool close) { string verb = _connector ? "establish" : "accept"; Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat); -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::Exception& ex) { out << "failed to " << verb << " " << _endpoint->protocol() << " connection\n" << toString() << "\n" << ex; } -#else - out << "failed to " << verb << " " << _endpoint->protocol() << " connection\n" << toString() - << "\n" << *_exception.get(); -#endif } } else @@ -1990,10 +1961,9 @@ Ice::ConnectionI::finish(bool close) // // Trace the cause of unexpected connection closures // -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { @@ -2006,16 +1976,6 @@ Ice::ConnectionI::finish(bool close) out << "\n" << ex; } } -#else - if(!(dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()))) - { - out << "\n" << *_exception.get(); - } -#endif } } @@ -2026,18 +1986,14 @@ Ice::ConnectionI::finish(bool close) if(_startCallback) { -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const LocalException& ex) { _startCallback->connectionStartFailed(shared_from_this(), ex); } -#else - _startCallback->connectionStartFailed(shared_from_this(), *_exception.get()); -#endif _startCallback = 0; } @@ -2067,9 +2023,9 @@ Ice::ConnectionI::finish(bool close) if(message->receivedReply) { OutgoingAsyncPtr outAsync = ICE_DYNAMIC_CAST(OutgoingAsync, message->outAsync); - if(outAsync->completed()) + if(outAsync->response()) { - outAsync->invokeCompleted(); + outAsync->invokeResponse(); } } _sendStreams.pop_front(); @@ -2077,10 +2033,9 @@ Ice::ConnectionI::finish(bool close) #endif } -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { @@ -2100,30 +2055,12 @@ Ice::ConnectionI::finish(bool close) } } } -#else - for(deque::iterator o = _sendStreams.begin(); o != _sendStreams.end(); ++o) - { - o->completed(*_exception.get()); - if(o->requestId) // Make sure finished isn't called twice. - { - if(o->out) - { - _requests.erase(o->requestId); - } - else - { - _asyncRequests.erase(o->requestId); - } - } - } -#endif _sendStreams.clear(); // Must be cleared before _requests because of Outgoing* references in OutgoingMessage } -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { @@ -2136,28 +2073,12 @@ Ice::ConnectionI::finish(bool close) for(map::const_iterator q = _asyncRequests.begin(); q != _asyncRequests.end(); ++q) { - if(q->second->completed(ex)) + if(q->second->exception(ex)) { - q->second->invokeCompleted(); + q->second->invokeException(); } } } -#else - for(map::const_iterator p = _requests.begin(); p != _requests.end(); ++p) - { - p->second->completed(*_exception.get()); - } - - _requests.clear(); - - for(map::const_iterator q = _asyncRequests.begin(); q != _asyncRequests.end(); ++q) - { - if(q->second->completed(*_exception.get())) - { - q->second->invokeCompleted(); - } - } -#endif _asyncRequests.clear(); @@ -2378,7 +2299,7 @@ Ice::ConnectionI::setState(State state, const LocalException& ex) return; } - if(!ICE_EXCEPTION_GET(_exception)) + if(!ICE_EXCEPTION_ISSET(_exception)) { // // If we are in closed state, an exception must be set. @@ -2510,18 +2431,15 @@ Ice::ConnectionI::setState(State state) return; } -#ifdef ICE_CPP11_MAPPING try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { _batchRequestQueue->destroy(ex); } -#else - _batchRequestQueue->destroy(*_exception.get()); -#endif + // // Don't need to close now for connections so only close the transceiver // if the selector request it. @@ -2580,12 +2498,11 @@ Ice::ConnectionI::setState(State state) newState, _observer.get())); } -#ifdef ICE_CPP11_MAPPING - if(_observer && state == StateClosed && _exception) + if(_observer && state == StateClosed && ICE_EXCEPTION_ISSET(_exception)) { try { - rethrow_exception(_exception); + ICE_RETHROW_EXCEPTION(_exception); } catch(const Ice::LocalException& ex) { @@ -2600,20 +2517,6 @@ Ice::ConnectionI::setState(State state) } } } -#else - if(_observer && state == StateClosed && _exception.get()) - { - if(!(dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - dynamic_cast(_exception.get()) || - (dynamic_cast(_exception.get()) && _state >= StateClosing))) - { - _observer->failed(_exception->ice_id()); - } - } -#endif } _state = state; @@ -2708,7 +2611,7 @@ Ice::ConnectionI::heartbeat() catch(const LocalException& ex) { setState(StateClosed, ex); - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); } } } @@ -3540,7 +3443,7 @@ Ice::ConnectionI::parseMessage(InputStream& stream, Int& invokeNum, Int& request message->receivedReply = true; outAsync = 0; } - else if(outAsync->completed()) + else if(outAsync->response()) { ++dispatchCount; } @@ -3549,7 +3452,7 @@ Ice::ConnectionI::parseMessage(InputStream& stream, Int& invokeNum, Int& request outAsync = 0; } #else - if(outAsync->completed()) + if(outAsync->response()) { ++dispatchCount; } diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 1d44498610b..05e12bbe3ee 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -188,10 +188,10 @@ public: IceInternal::BatchRequestQueuePtr getBatchRequestQueue() const; - virtual void flushBatchRequests(); // From Connection. + virtual void flushBatchRequests(); #ifdef ICE_CPP11_MAPPING - virtual ::std::function + virtual std::function flushBatchRequests_async(::std::function, ::std::function = nullptr); #else @@ -203,13 +203,9 @@ public: virtual void end_flushBatchRequests(const AsyncResultPtr&); #endif -#ifdef ICE_CPP11_MAPPING - virtual void setCloseCallback(::std::function)>); - virtual void setHeartbeatCallback(::std::function)>); -#else - virtual void setCloseCallback(const Ice::CloseCallbackPtr&); - virtual void setHeartbeatCallback(const Ice::HeartbeatCallbackPtr&); -#endif + virtual void setCloseCallback(ICE_IN(ICE_CLOSE_CALLBACK)); + virtual void setHeartbeatCallback(ICE_IN(ICE_HEARTBEAT_CALLBACK)); + virtual void setACM(const IceUtil::Optional&, const IceUtil::Optional&, const IceUtil::Optional&); @@ -264,6 +260,8 @@ public: virtual ~ConnectionI(); + using EnableSharedFromThis::shared_from_this; + private: ConnectionI(const Ice::CommunicatorPtr&, const IceInternal::InstancePtr&, const IceInternal::ACMMonitorPtr&, @@ -324,7 +322,9 @@ private: void reap(); +#ifndef ICE_CPP11_MAPPING AsyncResultPtr __begin_flushBatchRequests(const IceInternal::CallbackBasePtr&, const LocalObjectPtr&); +#endif Ice::CommunicatorPtr _communicator; const IceInternal::InstancePtr _instance; @@ -394,7 +394,6 @@ private: ICE_CLOSE_CALLBACK _closeCallback; ICE_HEARTBEAT_CALLBACK _heartbeatCallback; - }; } diff --git a/cpp/src/Ice/FactoryTable.cpp b/cpp/src/Ice/FactoryTable.cpp index d8b37ec8b58..e7fec2162ab 100644 --- a/cpp/src/Ice/FactoryTable.cpp +++ b/cpp/src/Ice/FactoryTable.cpp @@ -66,13 +66,8 @@ IceInternal::FactoryTable::removeExceptionFactory(const string& t) // // Add a factory to the value factory table. // -#ifdef ICE_CPP11_MAPPING void -IceInternal::FactoryTable::addValueFactory(const string& t, function<::Ice::ValuePtr (string)> f) -#else -void -IceInternal::FactoryTable::addValueFactory(const string& t, const ::Ice::ValueFactoryPtr& f) -#endif +IceInternal::FactoryTable::addValueFactory(const string& t, ICE_IN(ICE_VALUE_FACTORY) f) { IceUtil::Mutex::Lock lock(_m); assert(f); @@ -90,23 +85,13 @@ IceInternal::FactoryTable::addValueFactory(const string& t, const ::Ice::ValueFa // // Return the value factory for a given type ID // -#ifdef ICE_CPP11_MAPPING -function -IceInternal::FactoryTable::getValueFactory(const string& t) const -{ - IceUtil::Mutex::Lock lock(_m); - VFTable::const_iterator i = _vft.find(t); - return i != _vft.end() ? i->second.first : nullptr; -} -#else -Ice::ValueFactoryPtr +ICE_VALUE_FACTORY IceInternal::FactoryTable::getValueFactory(const string& t) const { IceUtil::Mutex::Lock lock(_m); VFTable::const_iterator i = _vft.find(t); - return i != _vft.end() ? i->second.first : Ice::ValueFactoryPtr(); + return i != _vft.end() ? i->second.first : ICE_VALUE_FACTORY(); } -#endif // // Remove a factory from the value factory table. If the factory diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index fafdb3cce83..691c43a91d2 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -557,16 +557,16 @@ IceInternal::Incoming::killAsync() } void -IceInternal::Incoming::setActive(IncomingAsync& cb) +IceInternal::Incoming::setActive(IncomingAsyncPtr cb) { assert(_cb == 0); // // acquires a ref-count // #ifdef ICE_CPP11_MAPPING - _cb = cb.shared_from_this(); + _cb = move(cb); #else - _cb = &cb; + _cb = cb; #endif } diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp index 835963b9c0d..e1748a06828 100644 --- a/cpp/src/Ice/IncomingAsync.cpp +++ b/cpp/src/Ice/IncomingAsync.cpp @@ -56,23 +56,14 @@ Init init; IceInternal::IncomingAsync::IncomingAsync(Incoming& in) : IncomingBase(in), _instanceCopy(_os.instance()), -#ifdef ICE_CPP11_MAPPING - _responseHandlerCopy(dynamic_pointer_cast(_responseHandler->shared_from_this())), -#else - _responseHandlerCopy(_responseHandler), -#endif + _responseHandlerCopy(_responseHandler->shared_from_this()), // Acquire reference on response handler _retriable(in.isRetriable()), _active(true) { #ifndef ICE_CPP11_MAPPING if(_retriable) { - // - // With C++11 maping we cannot call setActive from the ctor as - // it creates a smart pointer to this object, and with shared_ptr - // this requires a fully constructed object. - // - in.setActive(*this); + in.setActive(this); } #endif } @@ -81,10 +72,10 @@ IceInternal::IncomingAsync::IncomingAsync(Incoming& in) : IncomingAsyncPtr IceInternal::IncomingAsync::create(Incoming& in) { - IncomingAsyncPtr self(new IncomingAsync(in)); + IncomingAsyncPtr self = make_shared(in); if(in.isRetriable()) { - in.setActive(*self.get()); + in.setActive(self->shared_from_this()); } return self; } @@ -136,7 +127,7 @@ IceInternal::IncomingAsync::ice_exception(const ::std::exception& ex) { return; } - + IceUtilInternal::MutexPtrLock lock(globalMutex); if(!_active) { @@ -187,7 +178,7 @@ IceInternal::IncomingAsync::ice_exception() { return; } - + IceUtilInternal::MutexPtrLock lock(globalMutex); if(!_active) { @@ -306,7 +297,7 @@ IceInternal::IncomingAsync::__validateResponse(bool ok) { return false; } - + IceUtilInternal::MutexPtrLock lock(globalMutex); if(!_active) { diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp index 535d26a5d96..b89ce6e0177 100644 --- a/cpp/src/Ice/InputStream.cpp +++ b/cpp/src/Ice/InputStream.cpp @@ -1321,6 +1321,7 @@ Ice::InputStream::skipOpts() void Ice::InputStream::throwUnmarshalOutOfBoundsException(const char* file, int line) { + assert(false); throw UnmarshalOutOfBoundsException(file, line); } @@ -2087,14 +2088,7 @@ Ice::InputStream::EncapsDecoder11::throwException(const UserExceptionFactoryPtr& // if(_current->sliceFlags & FLAG_IS_LAST_SLICE) { - if(mostDerivedId.length() > 2 && mostDerivedId[0] == ':' && mostDerivedId[1] == ':') - { - throw UnknownUserException(__FILE__, __LINE__, mostDerivedId.substr(2)); - } - else - { - throw UnknownUserException(__FILE__, __LINE__, mostDerivedId); - } + throw UnknownUserException(__FILE__, __LINE__, mostDerivedId); } startSlice(); @@ -2262,14 +2256,7 @@ Ice::InputStream::EncapsDecoder11::skipSlice() } else { - if(_current->typeId.length() > 2 && _current->typeId[0] == ':' && _current->typeId[1] == ':') - { - throw UnknownUserException(__FILE__, __LINE__, _current->typeId.substr(2)); - } - else - { - throw UnknownUserException(__FILE__, __LINE__, _current->typeId); - } + throw UnknownUserException(__FILE__, __LINE__, _current->typeId); } } diff --git a/cpp/src/Ice/InstrumentationI.cpp b/cpp/src/Ice/InstrumentationI.cpp index edd64592523..6ae577f0c90 100644 --- a/cpp/src/Ice/InstrumentationI.cpp +++ b/cpp/src/Ice/InstrumentationI.cpp @@ -22,6 +22,12 @@ using namespace IceInternal; using namespace Ice::Instrumentation; using namespace IceMX; +#ifdef ICE_CPP11_MAPPING +# define ICE_OBJECT_PRX Ice::ObjectPrx +#else +# define ICE_OBJECT_PRX IceProxy::Ice::Object +#endif + namespace { @@ -344,8 +350,8 @@ public: add("operation", &InvocationHelper::getOperation); add("identity", &InvocationHelper::getIdentity); - add("facet", &InvocationHelper::getProxy, &IceProxy::Ice::Object::ice_getFacet); - add("encoding", &InvocationHelper::getProxy, &IceProxy::Ice::Object::ice_getEncodingVersion); + add("facet", &InvocationHelper::getProxy, &ICE_OBJECT_PRX::ice_getFacet); + add("encoding", &InvocationHelper::getProxy, &ICE_OBJECT_PRX::ice_getEncodingVersion); add("mode", &InvocationHelper::getMode); add("proxy", &InvocationHelper::getProxy); @@ -562,7 +568,7 @@ public: } return _endpointInfo; } - + private: const ConnectionInfoPtr& _connectionInfo; diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp index 4bc0c4cc165..fa2f11cfdd3 100644 --- a/cpp/src/Ice/LocatorInfo.cpp +++ b/cpp/src/Ice/LocatorInfo.cpp @@ -418,7 +418,7 @@ IceInternal::LocatorInfo::Request::addCallback(const ReferencePtr& ref, RequestCallbackPtr callback = new RequestCallback(ref, ttl, cb); { IceUtil::Monitor::Lock sync(_monitor); - if(!_response && !ICE_EXCEPTION_GET(_exception)) + if(!_response && !ICE_EXCEPTION_ISSET(_exception)) { _callbacks.push_back(callback); if(wellKnownRef) // This request is to resolve the endpoints of a cached well-known object reference @@ -441,7 +441,7 @@ IceInternal::LocatorInfo::Request::addCallback(const ReferencePtr& ref, } else { - assert(ICE_EXCEPTION_GET(_exception)); + assert(ICE_EXCEPTION_ISSET(_exception)); #ifdef ICE_CPP11_MAPPING try { @@ -464,7 +464,7 @@ IceInternal::LocatorInfo::Request::getEndpoints(const ReferencePtr& ref, bool& cached) { IceUtil::Monitor::Lock sync(_monitor); - if(!_response && !ICE_EXCEPTION_GET(_exception)) + if(!_response && !ICE_EXCEPTION_ISSET(_exception)) { if(wellKnownRef) // This request is to resolve the endpoints of a cached well-known object reference { @@ -478,13 +478,13 @@ IceInternal::LocatorInfo::Request::getEndpoints(const ReferencePtr& ref, sync.acquire(); } - while(!_response && !ICE_EXCEPTION_GET(_exception)) + while(!_response && !ICE_EXCEPTION_ISSET(_exception)) { _monitor.wait(); } } - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { #ifdef ICE_CPP11_MAPPING try diff --git a/cpp/src/Ice/NetworkProxy.h b/cpp/src/Ice/NetworkProxy.h index e6349989550..b1b7050008b 100644 --- a/cpp/src/Ice/NetworkProxy.h +++ b/cpp/src/Ice/NetworkProxy.h @@ -11,6 +11,7 @@ #define ICE_NETWORK_PROXY_H #include +#include namespace IceInternal { diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index acd1a5e829e..060b6782ae3 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -206,7 +206,7 @@ ProxyOutgoingBase::invokeImpl() } } - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { ICE_RETHROW_EXCEPTION(_exception); } @@ -644,11 +644,11 @@ ConnectionFlushBatch::invoke() else if(!_connection->sendRequest(this, false, false, batchRequestNum)) { Monitor::Lock sync(_monitor); - while(!ICE_EXCEPTION_GET(_exception) && !_sent) + while(!ICE_EXCEPTION_ISSET(_exception) && !_sent) { _monitor.wait(); } - if(ICE_EXCEPTION_GET(_exception)) + if(ICE_EXCEPTION_ISSET(_exception)) { ICE_RETHROW_EXCEPTION(_exception); } diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 5c06c76a3fe..34828d5262d 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -17,6 +17,9 @@ #include #include #include +#include +#include +#include using namespace std; using namespace Ice; @@ -29,78 +32,542 @@ IceUtil::Shared* IceInternal::upCast(OutgoingAsync* p) { return p; } IceUtil::Shared* IceInternal::upCast(CommunicatorFlushBatchAsync* p) { return p; } #endif +const unsigned char OutgoingAsyncBase::OK = 0x1; +const unsigned char OutgoingAsyncBase::Sent = 0x2; +#ifndef ICE_CPP11_MAPPING +const unsigned char OutgoingAsyncBase::Done = 0x4; +const unsigned char OutgoingAsyncBase::EndCalled = 0x8; +#endif + bool OutgoingAsyncBase::sent() { - return sent(true); + return sentImpl(true); } bool -OutgoingAsyncBase::completed(const Exception& ex) +OutgoingAsyncBase::exception(const Exception& ex) { - return finished(ex); + return exceptionImpl(ex); } bool -OutgoingAsyncBase::completed() +OutgoingAsyncBase::response() { assert(false); // Must be overriden by request that can handle responses return false; } -InputStream* -OutgoingAsyncBase::getIs() +void +OutgoingAsyncBase::invokeSentAsync() { - return 0; // Must be overriden by request that can handle responses + class AsynchronousSent : public DispatchWorkItem + { + public: + + AsynchronousSent(const ConnectionPtr& connection, const OutgoingAsyncBasePtr& outAsync) : + DispatchWorkItem(connection), _outAsync(outAsync) + { + } + + virtual void + run() + { + _outAsync->invokeSent(); + } + + private: + + const OutgoingAsyncBasePtr _outAsync; + }; + + // + // This is called when it's not safe to call the sent callback + // synchronously from this thread. Instead the exception callback + // is called asynchronously from the client thread pool. + // + try + { + _instance->clientThreadPool()->dispatch(new AsynchronousSent(_cachedConnection, shared_from_this())); + } + catch(const Ice::CommunicatorDestroyedException&) + { + } } +void +OutgoingAsyncBase::invokeExceptionAsync() +{ + class AsynchronousException : public DispatchWorkItem + { + public: + + AsynchronousException(const ConnectionPtr& c, const OutgoingAsyncBasePtr& outAsync) : + DispatchWorkItem(c), _outAsync(outAsync) + { + } + + virtual void + run() + { + _outAsync->invokeException(); + } + + private: + + const OutgoingAsyncBasePtr _outAsync; + }; + + // + // CommunicatorDestroyedCompleted is the only exception that can propagate directly + // from this method. + // + _instance->clientThreadPool()->dispatch(new AsynchronousException(_cachedConnection, shared_from_this())); +} + +void +OutgoingAsyncBase::invokeResponseAsync() +{ + class AsynchronousResponse : public DispatchWorkItem + { + public: + + AsynchronousResponse(const ConnectionPtr& connection, const OutgoingAsyncBasePtr& outAsync) : + DispatchWorkItem(connection), _outAsync(outAsync) + { + } + + virtual void + run() + { + _outAsync->invokeResponse(); + } + + private: + + const OutgoingAsyncBasePtr _outAsync; + }; + + // + // CommunicatorDestroyedCompleted is the only exception that can propagate directly + // from this method. + // + _instance->clientThreadPool()->dispatch(new AsynchronousResponse(_cachedConnection, shared_from_this())); +} + +void +OutgoingAsyncBase::invokeSent() +{ + try + { + handleInvokeSent(_sentSynchronously, this); + } + catch(const std::exception& ex) + { + warning(ex); + } + catch(...) + { + warning(); + } + + if(_observer && _doneInSent) + { + _observer.detach(); + } +} + +void +OutgoingAsyncBase::invokeException() +{ + try + { + try + { + ICE_RETHROW_EXCEPTION(_ex); + } + catch(const Ice::Exception& ex) + { + handleInvokeException(ex, this); + } + } + catch(const std::exception& ex) + { + warning(ex); + } + catch(...) + { + warning(); + } + + _observer.detach(); +} + +void +OutgoingAsyncBase::invokeResponse() +{ + if(ICE_EXCEPTION_ISSET(_ex)) + { + invokeException(); + return; + } + + try + { #ifdef ICE_CPP11_MAPPING -OutgoingAsyncBase::OutgoingAsyncBase(const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& delegate) : - AsyncResult(communicator, instance, operation, delegate), + try + { + handleInvokeResponse(_state & OK, this); + } + catch(const Ice::Exception& ex) + { + if(handleException(ex)) + { + handleInvokeException(ex, this); + } + } + catch(const exception_ptr& ex) + { + rethrow_exception(ex); + } #else -OutgoingAsyncBase::OutgoingAsyncBase(const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - AsyncResult(communicator, instance, operation, delegate, cookie), + handleInvokeResponse(_state & OK, this); #endif - _os(instance.get(), Ice::currentProtocolEncoding) + } + catch(const std::exception& ex) + { + warning(ex); + } + catch(...) + { + warning(); + } + + _observer.detach(); +} + +void +OutgoingAsyncBase::cancelable(const CancellationHandlerPtr& handler) +{ + Lock sync(_m); + if(ICE_EXCEPTION_ISSET(_cancellationException)) + { + try + { + ICE_RETHROW_EXCEPTION(_cancellationException); + } + catch(const Ice::LocalException&) + { + ICE_RESET_EXCEPTION(_cancellationException, ICE_NULLPTR); + throw; + } + } + _cancellationHandler = handler; +} + +void +OutgoingAsyncBase::cancel() +{ + cancel(Ice::InvocationCanceledException(__FILE__, __LINE__)); +} + +OutgoingAsyncBase::OutgoingAsyncBase(const InstancePtr& instance) : + _instance(instance), + _sentSynchronously(false), + _doneInSent(false), + _state(0), + _os(instance.get(), Ice::currentProtocolEncoding), + _is(instance.get(), Ice::currentProtocolEncoding) { } bool -OutgoingAsyncBase::sent(bool done) +OutgoingAsyncBase::sentImpl(bool done) { + Lock sync(_m); + bool alreadySent = _state & Sent; + _state |= Sent; if(done) { + _doneInSent = true; _childObserver.detach(); + _cancellationHandler = 0; } - return AsyncResult::sent(done); + +#ifndef ICE_CPP11_MAPPING + if(done) + { + _state |= Done | OK; + } + _m.notifyAll(); +#endif + + bool invoke = handleSent(done, alreadySent); + if(!invoke && _doneInSent) + { + _observer.detach(); + } + return invoke; } bool -OutgoingAsyncBase::finished(const Exception& ex) +OutgoingAsyncBase::exceptionImpl(const Exception& ex) { + Lock sync(_m); + ICE_RESET_EXCEPTION(_ex, ex.ice_clone()); if(_childObserver) { _childObserver.failed(ex.ice_id()); _childObserver.detach(); } - return AsyncResult::finished(ex); + _cancellationHandler = 0; + _observer.failed(ex.ice_id()); + +#ifndef ICE_CPP11_MAPPING + _state |= Done; + _m.notifyAll(); +#endif + + bool invoke = handleException(ex); + if(!invoke) + { + _observer.detach(); + } + return invoke; } -Ice::ObjectPrxPtr -ProxyOutgoingAsyncBase::getProxy() const +bool +OutgoingAsyncBase::responseImpl(bool ok) { - return _proxy; + Lock sync(_m); + if(ok) + { + _state |= OK; + } + + _cancellationHandler = 0; + +#ifndef ICE_CPP11_MAPPING + _state |= Done; + _m.notifyAll(); +#endif + + bool invoke; + try + { + invoke = handleResponse(ok); + } + catch(const Ice::Exception& ex) + { + ICE_RESET_EXCEPTION(_ex, ex.ice_clone()); + invoke = handleException(ex); + } + if(!invoke) + { + _observer.detach(); + } + return invoke; +} + +void +OutgoingAsyncBase::cancel(const Ice::LocalException& ex) +{ + CancellationHandlerPtr handler; + { + Lock sync(_m); + ICE_RESET_EXCEPTION(_cancellationException, ex.ice_clone()); + if(!_cancellationHandler) + { + return; + } + handler = _cancellationHandler; + } + handler->asyncRequestCanceled(shared_from_this(), ex); +} + +#ifndef ICE_CPP11_MAPPING + +Int +OutgoingAsyncBase::getHash() const +{ + return static_cast(reinterpret_cast(this) >> 4); +} + +CommunicatorPtr +OutgoingAsyncBase::getCommunicator() const +{ + return 0; +} + +ConnectionPtr +OutgoingAsyncBase::getConnection() const +{ + return 0; +} + +ObjectPrxPtr +OutgoingAsyncBase::getProxy() const +{ + return 0; +} + +Ice::LocalObjectPtr +OutgoingAsyncBase::getCookie() const +{ + return _cookie; +} + +const std::string& +OutgoingAsyncBase::getOperation() const +{ + assert(false); // Must be overriden + static string empty; + return empty; } bool -ProxyOutgoingAsyncBase::completed(const Exception& exc) +OutgoingAsyncBase::isCompleted() const +{ + Lock sync(_m); + return _state & Done; +} + +void +OutgoingAsyncBase::waitForCompleted() +{ + Lock sync(_m); + while(!(_state & Done)) + { + _m.wait(); + } +} + +bool +OutgoingAsyncBase::isSent() const +{ + Lock sync(_m); + return _state & Sent; +} + +void +OutgoingAsyncBase::waitForSent() +{ + Lock sync(_m); + while(!(_state & Sent) && !_ex.get()) + { + _m.wait(); + } +} + +bool +OutgoingAsyncBase::sentSynchronously() const +{ + return _sentSynchronously; +} + +void +OutgoingAsyncBase::throwLocalException() const +{ + Lock sync(_m); + if(_ex.get()) + { + _ex->ice_throw(); + } +} + +bool +OutgoingAsyncBase::__wait() +{ + Lock sync(_m); + if(_state & EndCalled) + { + throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "end_ method called more than once"); + } + _state |= EndCalled; + while(!(_state & Done)) + { + _m.wait(); + } + + if(_ex.get()) + { + _ex->ice_throw(); + } + return _state & OK; +} + +Ice::InputStream* +OutgoingAsyncBase::__startReadParams() +{ + _is.startEncapsulation(); + return &_is; +} + +void +OutgoingAsyncBase::__endReadParams() +{ + _is.endEncapsulation(); +} + +void +OutgoingAsyncBase::__readEmptyParams() +{ + _is.skipEmptyEncapsulation(); +} + +void +OutgoingAsyncBase::__readParamEncaps(const ::Ice::Byte*& encaps, ::Ice::Int& sz) +{ + _is.readEncapsulation(encaps, sz); +} + +void +OutgoingAsyncBase::__throwUserException() +{ + try + { + _is.startEncapsulation(); + _is.throwException(); + } + catch(const Ice::UserException&) + { + _is.endEncapsulation(); + throw; + } +} + +#endif + +void +OutgoingAsyncBase::warning(const std::exception& exc) const +{ + if(_instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.AMICallback", 1) > 0) + { + Ice::Warning out(_instance->initializationData().logger); + const Ice::Exception* ex = dynamic_cast(&exc); + if(ex) + { + out << "Ice::Exception raised by AMI callback:\n" << *ex; + } + else + { + out << "std::exception raised by AMI callback:\n" << exc.what(); + } + } +} + +void +OutgoingAsyncBase::warning() const +{ + if(_instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.AMICallback", 1) > 0) + { + Ice::Warning out(_instance->initializationData().logger); + out << "unknown exception raised by AMI callback"; + } +} + +bool +ProxyOutgoingAsyncBase::exception(const Exception& exc) { if(_childObserver) { @@ -111,11 +578,7 @@ ProxyOutgoingAsyncBase::completed(const Exception& exc) _cachedConnection = 0; if(_proxy->__reference()->getInvocationTimeout() == -2) { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->cancel(dynamic_pointer_cast(shared_from_this())); -#else - _instance->timer()->cancel(this); -#endif + _instance->timer()->cancel(shared_from_this()); } // @@ -129,20 +592,29 @@ ProxyOutgoingAsyncBase::completed(const Exception& exc) // the retry interval is 0. This method can be called with the // connection locked so we can't just retry here. // -#ifdef ICE_CPP11_MAPPING - _instance->retryQueue()->add(dynamic_pointer_cast(shared_from_this()), - handleException(exc)); -#else - _instance->retryQueue()->add(this, handleException(exc)); -#endif + _instance->retryQueue()->add(shared_from_this(), _proxy->__handleException(exc, _handler, _mode, _sent, _cnt)); return false; } catch(const Exception& ex) { - return finished(ex); // No retries, we're done + return exceptionImpl(ex); // No retries, we're done } } +void +ProxyOutgoingAsyncBase::cancelable(const CancellationHandlerPtr& handler) +{ + if(_proxy->__reference()->getInvocationTimeout() == -2 && _cachedConnection) + { + const int timeout = _cachedConnection->timeout(); + if(timeout > 0) + { + _instance->timer()->schedule(shared_from_this(), IceUtil::Time::milliSeconds(timeout)); + } + } + OutgoingAsyncBase::cancelable(handler); +} + void ProxyOutgoingAsyncBase::retryException(const Exception& ex) { @@ -155,40 +627,17 @@ ProxyOutgoingAsyncBase::retryException(const Exception& ex) // connection to be done. // _proxy->__updateRequestHandler(_handler, 0); // Clear request handler and always retry. -#ifdef ICE_CPP11_MAPPING - _instance->retryQueue()->add(dynamic_pointer_cast(shared_from_this()), 0); -#else - _instance->retryQueue()->add(this, 0); -#endif + _instance->retryQueue()->add(shared_from_this(), 0); } catch(const Ice::Exception& exc) { - if(completed(exc)) + if(exception(exc)) { - invokeCompletedAsync(); + invokeExceptionAsync(); } } } -void -ProxyOutgoingAsyncBase::cancelable(const CancellationHandlerPtr& handler) -{ - if(_proxy->__reference()->getInvocationTimeout() == -2 && _cachedConnection) - { - const int timeout = _cachedConnection->timeout(); - if(timeout > 0) - { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->schedule(dynamic_pointer_cast(shared_from_this()), - IceUtil::Time::milliSeconds(timeout)); -#else - _instance->timer()->schedule(this, IceUtil::Time::milliSeconds(timeout)); -#endif - } - } - AsyncResult::cancelable(handler); -} - void ProxyOutgoingAsyncBase::retry() { @@ -200,9 +649,9 @@ ProxyOutgoingAsyncBase::abort(const Ice::Exception& ex) { assert(!_childObserver); - if(finished(ex)) + if(exceptionImpl(ex)) { - invokeCompletedAsync(); + invokeExceptionAsync(); } else if(dynamic_cast(&ex)) { @@ -215,18 +664,22 @@ ProxyOutgoingAsyncBase::abort(const Ice::Exception& ex) } } -#ifdef ICE_CPP11_MAPPING -ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate) : - OutgoingAsyncBase(prx->ice_getCommunicator(), prx->__reference()->getInstance(), operation, delegate), -#else -ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - OutgoingAsyncBase(prx->ice_getCommunicator(), prx->__reference()->getInstance(), operation, delegate, cookie), +#ifndef ICE_CPP11_MAPPING +Ice::ObjectPrx +ProxyOutgoingAsyncBase::getProxy() const +{ + return _proxy; +} + +Ice::CommunicatorPtr +ProxyOutgoingAsyncBase::getCommunicator() const +{ + return _proxy->ice_getCommunicator(); +} #endif + +ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(const ObjectPrxPtr& prx) : + OutgoingAsyncBase(prx->__reference()->getInstance()), _proxy(prx), _mode(ICE_ENUM(OperationMode, Normal)), _cnt(0), @@ -234,6 +687,10 @@ ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(const ObjectPrxPtr& prx, { } +ProxyOutgoingAsyncBase::~ProxyOutgoingAsyncBase() +{ +} + void ProxyOutgoingAsyncBase::invokeImpl(bool userThread) { @@ -244,12 +701,7 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread) int invocationTimeout = _proxy->__reference()->getInvocationTimeout(); if(invocationTimeout > 0) { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->schedule(dynamic_pointer_cast(shared_from_this()), - IceUtil::Time::milliSeconds(invocationTimeout)); -#else - _instance->timer()->schedule(this, IceUtil::Time::milliSeconds(invocationTimeout)); -#endif + _instance->timer()->schedule(shared_from_this(), IceUtil::Time::milliSeconds(invocationTimeout)); } } else @@ -263,12 +715,7 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread) { _sent = false; _handler = _proxy->__getRequestHandler(); -#ifdef ICE_CPP11_MAPPING - AsyncStatus status = _handler->sendAsyncRequest( - dynamic_pointer_cast(shared_from_this())); -#else - AsyncStatus status = _handler->sendAsyncRequest(this); -#endif + AsyncStatus status = _handler->sendAsyncRequest(shared_from_this()); if(status & AsyncStatusSent) { if(userThread) @@ -300,15 +747,10 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread) _childObserver.failed(ex.ice_id()); _childObserver.detach(); } - int interval = handleException(ex); + int interval = _proxy->__handleException(ex, _handler, _mode, _sent, _cnt); if(interval > 0) { -#ifdef ICE_CPP11_MAPPING - _instance->retryQueue()->add(dynamic_pointer_cast(shared_from_this()), - interval); -#else - _instance->retryQueue()->add(this, interval); -#endif + _instance->retryQueue()->add(shared_from_this(), interval); return; } else @@ -328,63 +770,45 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread) { throw; } - else if(finished(ex)) // No retries, we're done + else if(exceptionImpl(ex)) // No retries, we're done { - invokeCompletedAsync(); + invokeExceptionAsync(); } } } bool -ProxyOutgoingAsyncBase::sent(bool done) +ProxyOutgoingAsyncBase::sentImpl(bool done) { _sent = true; if(done) { if(_proxy->__reference()->getInvocationTimeout() != -1) { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->cancel(dynamic_pointer_cast(shared_from_this())); -#else - _instance->timer()->cancel(this); -#endif + _instance->timer()->cancel(shared_from_this()); } } - return OutgoingAsyncBase::sent(done); + return OutgoingAsyncBase::sentImpl(done); } bool -ProxyOutgoingAsyncBase::finished(const Exception& ex) +ProxyOutgoingAsyncBase::exceptionImpl(const Exception& ex) { if(_proxy->__reference()->getInvocationTimeout() != -1) { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->cancel(dynamic_pointer_cast(shared_from_this())); -#else - _instance->timer()->cancel(this); -#endif + _instance->timer()->cancel(shared_from_this()); } - return OutgoingAsyncBase::finished(ex); + return OutgoingAsyncBase::exceptionImpl(ex); } bool -ProxyOutgoingAsyncBase::finished(bool ok) +ProxyOutgoingAsyncBase::responseImpl(bool ok) { if(_proxy->__reference()->getInvocationTimeout() != -1) { -#ifdef ICE_CPP11_MAPPING - _instance->timer()->cancel(dynamic_pointer_cast(shared_from_this())); -#else - _instance->timer()->cancel(this); -#endif + _instance->timer()->cancel(shared_from_this()); } - return AsyncResult::finished(ok); -} - -int -ProxyOutgoingAsyncBase::handleException(const Exception& exc) -{ - return _proxy->__handleException(exc, _handler, _mode, _sent, _cnt); + return OutgoingAsyncBase::responseImpl(ok); } void @@ -400,19 +824,10 @@ ProxyOutgoingAsyncBase::runTimerTask() } } -#ifdef ICE_CPP11_MAPPING -OutgoingAsync::OutgoingAsync(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate) : - ProxyOutgoingAsyncBase(prx, operation, delegate), -#else -OutgoingAsync::OutgoingAsync(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - ProxyOutgoingAsyncBase(prx, operation, delegate, cookie), -#endif - _encoding(getCompatibleEncoding(prx->__reference()->getEncoding())) +OutgoingAsync::OutgoingAsync(const ObjectPrxPtr& prx) : + ProxyOutgoingAsyncBase(prx), + _encoding(getCompatibleEncoding(prx->__reference()->getEncoding())), + _synchronous(false) { } @@ -465,91 +880,37 @@ OutgoingAsync::prepare(const string& operation, OperationMode mode, const Contex if(&context != &Ice::noExplicitContext) { - // - // Explicit context - // - _os.write(context); - } - else - { - // - // Implicit context - // - const ImplicitContextIPtr& implicitContext = ref->getInstance()->getImplicitContext(); - const Context& prxContext = ref->getContext()->getValue(); - if(implicitContext == 0) - { - _os.write(prxContext); - } - else - { - implicitContext->write(prxContext, &_os); - } - } -} - -bool -OutgoingAsync::sent() -{ - return ProxyOutgoingAsyncBase::sent(!_proxy->ice_isTwoway()); // done = true if it's not a two-way proxy -} - -AsyncStatus -OutgoingAsync::invokeRemote(const ConnectionIPtr& connection, bool compress, bool response) -{ - _cachedConnection = connection; -#ifdef ICE_CPP11_MAPPING - return connection->sendAsyncRequest(dynamic_pointer_cast(shared_from_this()), compress, response, 0); -#else - return connection->sendAsyncRequest(this, compress, response, 0); -#endif -} - -AsyncStatus -OutgoingAsync::invokeCollocated(CollocatedRequestHandler* handler) -{ - return handler->invokeAsyncRequest(this, 0); -} - -void -OutgoingAsync::abort(const Exception& ex) -{ - const Reference::Mode mode = _proxy->__reference()->getMode(); - if(mode == Reference::ModeBatchOneway || mode == Reference::ModeBatchDatagram) + // + // Explicit context + // + _os.write(context); + } + else { // - // If we didn't finish a batch oneway or datagram request, we - // must notify the connection about that we give up ownership - // of the batch stream. + // Implicit context // - _proxy->__getBatchRequestQueue()->abortBatchRequest(&_os); + const ImplicitContextIPtr& implicitContext = ref->getInstance()->getImplicitContext(); + const Context& prxContext = ref->getContext()->getValue(); + if(implicitContext == 0) + { + _os.write(prxContext); + } + else + { + implicitContext->write(prxContext, &_os); + } } - - ProxyOutgoingAsyncBase::abort(ex); } -void -OutgoingAsync::invoke() +bool +OutgoingAsync::sent() { - const Reference::Mode mode = _proxy->__reference()->getMode(); - if(mode == Reference::ModeBatchOneway || mode == Reference::ModeBatchDatagram) - { - _sentSynchronously = true; - _proxy->__getBatchRequestQueue()->finishBatchRequest(&_os, _proxy, getOperation()); - finished(true); - return; // Don't call sent/completed callback for batch AMI requests - } - - // - // NOTE: invokeImpl doesn't throw so this can be called from the - // try block with the catch block calling abort() in case of an - // exception. - // - invokeImpl(true); // userThread = true + return ProxyOutgoingAsyncBase::sentImpl(!_proxy->ice_isTwoway()); // done = true if it's not a two-way proxy } bool -OutgoingAsync::completed() +OutgoingAsync::response() { // // NOTE: this method is called from ConnectionI.parseMessage @@ -685,29 +1046,116 @@ OutgoingAsync::completed() } } - return finished(replyStatus == replyOK); + return responseImpl(replyStatus == replyOK); } catch(const Exception& ex) { - return completed(ex); + return exception(ex); + } +} + +AsyncStatus +OutgoingAsync::invokeRemote(const ConnectionIPtr& connection, bool compress, bool response) +{ + _cachedConnection = connection; + return connection->sendAsyncRequest(shared_from_this(), compress, response, 0); +} + +AsyncStatus +OutgoingAsync::invokeCollocated(CollocatedRequestHandler* handler) +{ + return handler->invokeAsyncRequest(this, 0, _synchronous); +} + +void +OutgoingAsync::abort(const Exception& ex) +{ + const Reference::Mode mode = _proxy->__reference()->getMode(); + if(mode == Reference::ModeBatchOneway || mode == Reference::ModeBatchDatagram) + { + // + // If we didn't finish a batch oneway or datagram request, we + // must notify the connection about that we give up ownership + // of the batch stream. + // + _proxy->__getBatchRequestQueue()->abortBatchRequest(&_os); + } + + ProxyOutgoingAsyncBase::abort(ex); +} + +void +OutgoingAsync::invoke(const string& operation) +{ + const Reference::Mode mode = _proxy->__reference()->getMode(); + if(mode == Reference::ModeBatchOneway || mode == Reference::ModeBatchDatagram) + { + _sentSynchronously = true; + _proxy->__getBatchRequestQueue()->finishBatchRequest(&_os, _proxy, operation); + responseImpl(true); + return; // Don't call sent/completed callback for batch AMI requests } + + // + // NOTE: invokeImpl doesn't throw so this can be called from the + // try block with the catch block calling abort() in case of an + // exception. + // + invokeImpl(true); // userThread = true } #ifdef ICE_CPP11_MAPPING -ProxyFlushBatchAsync::ProxyFlushBatchAsync(const ObjectPrxPtr& proxy, - const string& operation, - const CallbackBasePtr& delegate) : - ProxyOutgoingAsyncBase(proxy, operation, delegate) -#else -ProxyFlushBatchAsync::ProxyFlushBatchAsync(const ObjectPrxPtr& proxy, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - ProxyOutgoingAsyncBase(proxy, operation, delegate, cookie) +void +OutgoingAsync::invoke(const string& operation, + Ice::OperationMode mode, + Ice::FormatType format, + const Ice::Context& context, + const function& write) +{ + try + { + prepare(operation, mode, context); + if(write) + { + _os.startEncapsulation(_encoding, format); + write(&_os); + _os.endEncapsulation(); + } + else + { + _os.writeEmptyEncapsulation(_encoding); + } + invoke(operation); + } + catch(const Ice::Exception& ex) + { + abort(ex); + } +} + +void +OutgoingAsync::throwUserException() +{ + try + { + _is.startEncapsulation(); + _is.throwException(); + } + catch(const UserException& ex) + { + _is.endEncapsulation(); + if(_userException) + { + _userException(ex); + } + throw UnknownUserException(__FILE__, __LINE__, ex.ice_id()); + } +} + #endif + +ProxyFlushBatchAsync::ProxyFlushBatchAsync(const ObjectPrxPtr& proxy) : ProxyOutgoingAsyncBase(proxy) { - _observer.attach(proxy, operation, ::Ice::noExplicitContext); - _batchRequestNum = proxy->__getBatchRequestQueue()->swap(&_os); } AsyncStatus @@ -725,12 +1173,7 @@ ProxyFlushBatchAsync::invokeRemote(const ConnectionIPtr& connection, bool compre } } _cachedConnection = connection; -#ifdef ICE_CPP11_MAPPING - return connection->sendAsyncRequest(dynamic_pointer_cast(shared_from_this()), - compress, false, _batchRequestNum); -#else - return connection->sendAsyncRequest(this, compress, false, _batchRequestNum); -#endif + return connection->sendAsyncRequest(shared_from_this(), compress, false, _batchRequestNum); } AsyncStatus @@ -747,39 +1190,29 @@ ProxyFlushBatchAsync::invokeCollocated(CollocatedRequestHandler* handler) return AsyncStatusSent; } } - return handler->invokeAsyncRequest(this, _batchRequestNum); + return handler->invokeAsyncRequest(this, _batchRequestNum, false); } void -ProxyFlushBatchAsync::invoke() +ProxyFlushBatchAsync::invoke(const string& operation) { checkSupportedProtocol(getCompatibleProtocol(_proxy->__reference()->getProtocol())); + _observer.attach(_proxy, operation, ::Ice::noExplicitContext); + _batchRequestNum = _proxy->__getBatchRequestQueue()->swap(&_os); invokeImpl(true); // userThread = true } -#ifdef ICE_CPP11_MAPPING -ProxyGetConnection::ProxyGetConnection(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate) : - ProxyOutgoingAsyncBase(prx, operation, delegate) -#else -ProxyGetConnection::ProxyGetConnection(const ObjectPrxPtr& prx, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - ProxyOutgoingAsyncBase(prx, operation, delegate, cookie) -#endif +ProxyGetConnection::ProxyGetConnection(const ObjectPrxPtr& prx) : ProxyOutgoingAsyncBase(prx) { - _observer.attach(prx, operation, ::Ice::noExplicitContext); } AsyncStatus ProxyGetConnection::invokeRemote(const ConnectionIPtr& connection, bool, bool) { _cachedConnection = connection; - if(finished(true)) + if(responseImpl(true)) { - invokeCompletedAsync(); + invokeResponseAsync(); } return AsyncStatusSent; } @@ -787,38 +1220,23 @@ ProxyGetConnection::invokeRemote(const ConnectionIPtr& connection, bool, bool) AsyncStatus ProxyGetConnection::invokeCollocated(CollocatedRequestHandler*) { - if(finished(true)) + if(responseImpl(true)) { - invokeCompletedAsync(); + invokeResponseAsync(); } return AsyncStatusSent; } void -ProxyGetConnection::invoke() +ProxyGetConnection::invoke(const string& operation) { + _observer.attach(_proxy, operation, ::Ice::noExplicitContext); invokeImpl(true); // userThread = true } -#ifdef ICE_CPP11_MAPPING -ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(const ConnectionIPtr& connection, - const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& delegate) : - OutgoingAsyncBase(communicator, instance, operation, delegate), -#else -ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(const ConnectionIPtr& connection, - const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& delegate, - const LocalObjectPtr& cookie) : - OutgoingAsyncBase(communicator, instance, operation, delegate, cookie), -#endif - _connection(connection) +ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(const ConnectionIPtr& connection, const InstancePtr& instance) : + OutgoingAsyncBase(instance), _connection(connection) { - _observer.attach(instance.get(), operation); } ConnectionPtr @@ -828,8 +1246,9 @@ ConnectionFlushBatchAsync::getConnection() const } void -ConnectionFlushBatchAsync::invoke() +ConnectionFlushBatchAsync::invoke(const string& operation) { + _observer.attach(_instance.get(), operation); try { AsyncStatus status; @@ -844,12 +1263,7 @@ ConnectionFlushBatchAsync::invoke() } else { -#ifdef ICE_CPP11_MAPPING - status = _connection->sendAsyncRequest( - dynamic_pointer_cast(shared_from_this()), false, false, batchRequestNum); -#else - status = _connection->sendAsyncRequest(this, false, false, batchRequestNum); -#endif + status = _connection->sendAsyncRequest(shared_from_this(), false, false, batchRequestNum); } if(status & AsyncStatusSent) @@ -870,44 +1284,30 @@ ConnectionFlushBatchAsync::invoke() } catch(const Ice::LocalException& ee) { - if(completed(ee)) + if(exception(ee)) { - invokeCompletedAsync(); + invokeExceptionAsync(); } } #else - if(completed(*ex.get())) + if(exception(*ex.get())) { - invokeCompletedAsync(); + invokeExceptionAsync(); } #endif } catch(const Exception& ex) { - if(completed(ex)) + if(exception(ex)) { - invokeCompletedAsync(); + invokeExceptionAsync(); } } } -#ifdef ICE_CPP11_MAPPING -CommunicatorFlushBatchAsync::CommunicatorFlushBatchAsync(const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& cb) : - AsyncResult(communicator, instance, operation, cb) -#else -CommunicatorFlushBatchAsync::CommunicatorFlushBatchAsync(const CommunicatorPtr& communicator, - const InstancePtr& instance, - const string& operation, - const CallbackBasePtr& cb, - const LocalObjectPtr& cookie) : - AsyncResult(communicator, instance, operation, cb, cookie) -#endif +CommunicatorFlushBatchAsync::CommunicatorFlushBatchAsync(const InstancePtr& instance) : + OutgoingAsyncBase(instance) { - _observer.attach(instance.get(), operation); - // // _useCount is initialized to 1 to prevent premature callbacks. // The caller must invoke ready() after all flush requests have @@ -926,24 +1326,20 @@ CommunicatorFlushBatchAsync::flushConnection(const ConnectionIPtr& con) FlushBatch(const CommunicatorFlushBatchAsyncPtr& outAsync, const InstancePtr& instance, InvocationObserver& observer) : -#ifdef ICE_CPP11_MAPPING - OutgoingAsyncBase(outAsync->getCommunicator(), instance, outAsync->getOperation(), __dummyCallback), -#else - OutgoingAsyncBase(outAsync->getCommunicator(), instance, outAsync->getOperation(), __dummyCallback, 0), -#endif - _outAsync(outAsync), - _observer(observer) + OutgoingAsyncBase(instance), _outAsync(outAsync), _observer(observer) { } - virtual bool sent() + virtual bool + sent() { _childObserver.detach(); _outAsync->check(false); return false; } - virtual bool completed(const Exception& ex) + virtual bool + exception(const Exception& ex) { _childObserver.failed(ex.ice_id()); _childObserver.detach(); @@ -951,30 +1347,56 @@ CommunicatorFlushBatchAsync::flushConnection(const ConnectionIPtr& con) return false; } - private: - - virtual InvocationObserver& getObserver() + virtual InvocationObserver& + getObserver() { return _observer; } + virtual bool handleSent(bool, bool) + { + return false; + } + + virtual bool handleException(const Ice::Exception&) + { + return false; + } + + virtual bool handleResponse(bool) + { + return false; + } + + virtual void handleInvokeSent(bool, OutgoingAsyncBase*) const + { + assert(false); + } + + virtual void handleInvokeException(const Ice::Exception&, OutgoingAsyncBase*) const + { + assert(false); + } + + virtual void handleInvokeResponse(bool, OutgoingAsyncBase*) const + { + assert(false); + } + + private: + const CommunicatorFlushBatchAsyncPtr _outAsync; InvocationObserver& _observer; }; { - IceUtil::Monitor::Lock sync(_monitor); + Lock sync(_m); ++_useCount; } try { -#ifdef ICE_CPP11_MAPPING - auto flushBatch = make_shared( - dynamic_pointer_cast(shared_from_this()), _instance, _observer); -#else - OutgoingAsyncBasePtr flushBatch = new FlushBatch(this, _instance, _observer); -#endif + OutgoingAsyncBasePtr flushBatch = ICE_MAKE_SHARED(FlushBatch, shared_from_this(), _instance, _observer); int batchRequestNum = con->getBatchRequestQueue()->swap(flushBatch->getOs()); if(batchRequestNum == 0) { @@ -993,8 +1415,11 @@ CommunicatorFlushBatchAsync::flushConnection(const ConnectionIPtr& con) } void -CommunicatorFlushBatchAsync::ready() +CommunicatorFlushBatchAsync::invoke(const string& operation) { + _observer.attach(_instance.get(), operation); + _instance->outgoingConnectionFactory()->flushAsyncBatchRequests(shared_from_this()); + _instance->objectAdapterFactory()->flushAsyncBatchRequests(shared_from_this()); check(true); } @@ -1002,7 +1427,7 @@ void CommunicatorFlushBatchAsync::check(bool userThread) { { - IceUtil::Monitor::Lock sync(_monitor); + Lock sync(_m); assert(_useCount > 0); if(--_useCount > 0) { @@ -1010,7 +1435,7 @@ CommunicatorFlushBatchAsync::check(bool userThread) } } - if(sent(true)) + if(sentImpl(true)) { if(userThread) { @@ -1025,246 +1450,124 @@ CommunicatorFlushBatchAsync::check(bool userThread) } #ifdef ICE_CPP11_MAPPING -OnewayClosureCallback::OnewayClosureCallback( - const string& name, - const shared_ptr& proxy, - function response, - function exception, - function sent) : - __name(name), - __proxy(proxy), - __response(response), - __exception(exception), - __sent(sent) + +bool +LambdaInvoke::handleSent(bool, bool alreadySent) { + return _sent != nullptr && !alreadySent; // Invoke the sent callback only if not already invoked. } -void -OnewayClosureCallback::sent(const AsyncResultPtr& __result) const +bool +LambdaInvoke::handleException(const Ice::Exception&) { - if(__sent) - { - __sent(__result->sentSynchronously()); - } + return _exception != nullptr; // Invoke the callback } bool -OnewayClosureCallback::hasSentCallback() const +LambdaInvoke::handleResponse(bool) { - return __sent != nullptr; + return _response != nullptr; } void -OnewayClosureCallback::completed(const AsyncResultPtr& __result) const +LambdaInvoke::handleInvokeSent(bool sentSynchronously, OutgoingAsyncBase*) const { - try - { - AsyncResult::__check(__result, __proxy.get(), __name); - bool ok = __result->__wait(); - if(__proxy->__reference()->getMode() == Reference::ModeTwoway) - { - if(!ok) - { - try - { - __result->__throwUserException(); - } - catch(const UserException& __ex) - { - throw UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); - } - } - __result->__readEmptyParams(); - if(__response) - { - try - { - __response(); - } - catch(...) - { - throw current_exception(); - } - } - } - } - catch(const exception_ptr& ex) - { - rethrow_exception(ex); - } - catch(const Ice::Exception&) - { - if(__exception) - { - __exception(current_exception()); - } - } + _sent(sentSynchronously); } -function -OnewayClosureCallback::invoke( - const string& __name, - const shared_ptr& __proxy, - Ice::OperationMode __mode, - Ice::FormatType __format, - function __marshal, - function __response, - function __exception, - function __sent, - const Ice::Context& __context) +void +LambdaInvoke::handleInvokeException(const Ice::Exception& ex, OutgoingAsyncBase*) const { - auto __result = make_shared(__proxy, __name, - make_shared(__name, __proxy, move(__response), move(__exception), move(__sent))); try { - __result->prepare(__name, __mode, __context); - if(__marshal) - { - __marshal(__result->startWriteParams(__format)); - __result->endWriteParams(); - } - else - { - __result->writeEmptyParams(); - } - __result->invoke(); - } - catch(const exception_ptr& ex) - { - rethrow_exception(ex); + ex.ice_throw(); } - catch(const Exception& __ex) + catch(const Ice::Exception&) { - __result->abort(__ex); + _exception(current_exception()); } - - return [__result]() - { - __result->cancel(); - }; } -TwowayClosureCallback::TwowayClosureCallback( - const string& name, - const shared_ptr& proxy, - bool readEmptyParams, - function read, - function userException, - function exception, - function sent) : - __name(name), - __proxy(proxy), - __readEmptyParams(readEmptyParams), - __read(move(read)), - __userException(move(userException)), - __exception(move(exception)), - __sent(move(sent)) +void +LambdaInvoke::handleInvokeResponse(bool ok, OutgoingAsyncBase*) const { + _response(ok); } -void -TwowayClosureCallback::sent(const AsyncResultPtr& result) const +#else // C++98 + +namespace +{ + +// +// Dummy class derived from CallbackBase +// We use this class for the __dummyCallback extern pointer in OutgoingAsync. In turn, +// this allows us to test whether the user supplied a null delegate instance to the +// generated begin_ method without having to generate a separate test to throw IllegalArgumentException +// in the inlined versions of the begin_ method. In other words, this reduces the amount of generated +// object code. +// +class DummyCallback : public CallbackBase { - if(__sent != nullptr) +public: + + DummyCallback() { - __sent(result->sentSynchronously()); } -} -bool -TwowayClosureCallback::hasSentCallback() const -{ - return __sent != nullptr; -} + virtual void + completed(const Ice::AsyncResultPtr&) const + { + assert(false); + } -void -TwowayClosureCallback::completed(const AsyncResultPtr& __result) const -{ - try + virtual CallbackBasePtr + verify(const Ice::LocalObjectPtr&) { - AsyncResult::__check(__result, __proxy.get(), __name); - if(!__result->__wait()) - { - try - { - __result->__throwUserException(); - } - catch(const Ice::UserException& __ex) - { - if(__userException) - { - __userException(__ex); - } - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_id()); - } - } - else - { - if(__readEmptyParams) - { - __result->__readEmptyParams(); - __read(0); - } - else - { - __read(__result->__startReadParams()); - } - } + // + // Called by the AsyncResult constructor to verify the delegate. The dummy + // delegate is passed when the user used a begin_ method without delegate. + // By returning 0 here, we tell the AsyncResult that no delegates was + // provided. + // + return 0; } - catch(const exception_ptr& ex) + + virtual void + sent(const AsyncResultPtr&) const { - rethrow_exception(ex); + assert(false); } - catch(const Ice::Exception&) + + virtual bool + hasSentCallback() const { - if(__exception) - { - __exception(current_exception()); - } + assert(false); + return false; } +}; + } -function -TwowayClosureCallback::invoke( - const string& __name, - const shared_ptr& __proxy, - OperationMode __mode, - FormatType __format, - function __write, - bool __readEmptyParams, - function __read, - function __userException, - function __exception, - function __sent, - const Context& __context) -{ - assert(__proxy); - auto __result = make_shared(__proxy, __name, - make_shared(__name, __proxy, __readEmptyParams, move(__read), - move(__userException), move(__exception), move(__sent))); - __proxy->__checkAsyncTwowayOnly(__name); - try +// +// This gives a pointer value to compare against in the generated +// begin_ method to decide whether the caller passed a null pointer +// versus the generated inline version of the begin_ method having +// passed a pointer to the dummy delegate. +// +CallbackBasePtr IceInternal::__dummyCallback = new DummyCallback; + +void +CallbackBase::checkCallback(bool obj, bool cb) +{ + if(!obj) { - __result->prepare(__name, __mode, __context); - if(__write) - { - __write(__result->startWriteParams(__format)); - __result->endWriteParams(); - } - else - { - __result->writeEmptyParams(); - } - __result->invoke(); + throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "callback object cannot be null"); } - catch(const Exception& __ex) + if(!cb) { - __result->abort(__ex); + throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "callback cannot be null"); } - - return [__result]() - { - __result->cancel(); - }; } + #endif diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 3a5c15d7cc9..3b1744cf176 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -31,7 +31,9 @@ using namespace IceInternal; namespace Ice { + const Context noExplicitContext; + } namespace @@ -67,704 +69,50 @@ Ice::ObjectPrx::operator<(const ObjectPrx& r) const return _reference < r._reference; } -bool -Ice::ObjectPrx::ice_isA(const string& typeId, const ::Ice::Context& context) -{ - promise p; - ice_isA_async(typeId, - [&](bool value) - { - p.set_value(value); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - return p.get_future().get(); -} - -function -Ice::ObjectPrx::ice_isA_async(const string& typeId, - function response, - function exception, - function sent, - const ::Ice::Context& context) -{ - return TwowayClosureCallback::invoke(ice_isA_name, shared_from_this(), OperationMode::Nonmutating, DefaultFormat, - [&typeId](Ice::OutputStream* os) - { - os->write(typeId); - }, - false, - [response](Ice::InputStream* is) - { - bool ret; - is->read(ret); - is->endEncapsulation(); - if(response) - { - response(ret); - } - }, - nullptr, move(exception), move(sent), context); -} - void -Ice::ObjectPrx::ice_ping(const ::Ice::Context& context) -{ - switch(_reference->getMode()) - { - case Reference::ModeTwoway: - { - promise p; - ice_ping_async( - [&]() - { - p.set_value(); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - p.get_future().get(); - break; - } - case Reference::ModeOneway: - case Reference::ModeDatagram: - { - promise p; - ice_ping_async( - nullptr, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - [&](bool) - { - p.set_value(); - }, - context); - p.get_future().get(); - break; - } - case Reference::ModeBatchOneway: - case Reference::ModeBatchDatagram: - { - ice_ping_async(nullptr, nullptr, nullptr, context); - } - } -} - -function -Ice::ObjectPrx::ice_ping_async(function response, - function exception, - function sent, - const ::Ice::Context& context) -{ - return OnewayClosureCallback::invoke(ice_ping_name, shared_from_this(), OperationMode::Nonmutating, DefaultFormat, - nullptr, response, exception, sent, context); -} - -string -Ice::ObjectPrx::ice_id(const ::Ice::Context& context) -{ - promise p; - ice_id_async( - [&](string id) - { - p.set_value(move(id)); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - return p.get_future().get(); -} - -function -Ice::ObjectPrx::ice_id_async(function response, - function exception, - function sent, - const ::Ice::Context& context) -{ - return TwowayClosureCallback::invoke( - ice_id_name, shared_from_this(), OperationMode::Nonmutating, DefaultFormat, nullptr, false, - [response](Ice::InputStream* is) - { - string ret; - is->read(ret); - is->endEncapsulation(); - if(response) - { - response(move(ret)); - } - }, - nullptr, exception, sent, context); -} - - -vector -Ice::ObjectPrx::ice_ids(const ::Ice::Context& context) +Ice::ObjectPrx::__ice_isA(const shared_ptr>& outAsync, + const string& typeId, + const Context& ctx) { - promise> p; - ice_ids_async( - [&](vector ids) - { - p.set_value(move(ids)); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - return p.get_future().get(); -} - -function -Ice::ObjectPrx::ice_ids_async(function)> response, - function exception, - function sent, - const ::Ice::Context& context) -{ - return TwowayClosureCallback::invoke( - ice_ids_name, shared_from_this(), OperationMode::Nonmutating, DefaultFormat, nullptr, false, - [response](Ice::InputStream* is) - { - vector ret; - is->read(ret); - is->endEncapsulation(); - if(response) - { - response(move(ret)); - } - }, - nullptr, exception, sent, context); -} - -function -Ice::ObjectPrx::ice_getConnection_async( - function)> response, - function exception, - function sent) -{ - - class ConnectionCallback : public CallbackBase - { - public: - - ConnectionCallback(function)> response, - function exception, - function sent, - shared_ptr proxy) : - _response(move(response)), - _exception(move(exception)), - _sent(move(sent)), - _proxy(move(proxy)) - { - } - - virtual void sent(const AsyncResultPtr& result) const - { - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return _sent != nullptr; - } - - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const - { - shared_ptr<::Ice::Connection> conn; - try - { - AsyncResult::__check(result, _proxy.get(), ice_getConnection_name); - result->__wait(); - conn = _proxy->ice_getCachedConnection(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - - if(_response) - { - _response(move(conn)); - } - } - - private: - - function)> _response; - function _exception; - function _sent; - shared_ptr _proxy; - }; - - - auto result = make_shared(shared_from_this(), ice_getConnection_name, - make_shared(move(response), move(exception), move(sent), shared_from_this())); - try - { - result->invoke(); - } - catch(const Exception& ex) - { - result->abort(ex); - } - - return [result]() - { - result->cancel(); - }; + __checkAsyncTwowayOnly("__ice_isA"); + outAsync->invoke(ice_isA_name, OperationMode::Nonmutating, DefaultFormat, ctx, + [&](Ice::OutputStream* os) + { + os->write(typeId); + }, + nullptr); } void -Ice::ObjectPrx::ice_flushBatchRequests() +Ice::ObjectPrx::__ice_ping(const shared_ptr>& outAsync, const Context& ctx) { - promise p; - ice_flushBatchRequests_async( - [&](exception_ptr ex) - { - p.set_exception(ex); - }, - [&](bool) - { - p.set_value(); - }); - p.get_future().get(); + outAsync->invoke(ice_ping_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr); } -function -Ice::ObjectPrx::ice_flushBatchRequests_async(function exception, function sent) +void +Ice::ObjectPrx::__ice_ids(const shared_ptr>>& outAsync, const Context& ctx) { - class FlushBatchRequestsCallback : public CallbackBase - { - public: - - FlushBatchRequestsCallback(function exception, - function sent, - shared_ptr proxy) : - _exception(move(exception)), - _sent(move(sent)), - _proxy(move(proxy)) - { - } - - virtual void sent(const AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _proxy.get(), ice_flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return true; - } - - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _proxy.get(), ice_flushBatchRequests_name); - result->__wait(); - } - catch(const ::Ice::Exception&) - { - _exception(current_exception()); - } - } - - private: - - function _exception; - function _sent; - shared_ptr _proxy; - }; - - auto result = make_shared(shared_from_this(), ice_flushBatchRequests_name, - make_shared(exception, sent, shared_from_this())); - try - { - result->invoke(); - } - catch(const Exception& ex) - { - result->abort(ex); - } - return [result]() - { - result->cancel(); - }; + __checkAsyncTwowayOnly("__ice_ids"); + outAsync->invoke(ice_ids_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr); } -bool -Ice::ObjectPrx::ice_invoke(const string& operation, - ::Ice::OperationMode mode, - const vector<::Ice::Byte>& inParams, - vector<::Ice::Byte>& outParams, - const ::Ice::Context& context) +void +Ice::ObjectPrx::__ice_id(const shared_ptr>& outAsync, const Context& ctx) { - switch(_reference->getMode()) - { - case Reference::ModeTwoway: - { - promise p; - ice_invoke_async(operation, mode, inParams, - [&](bool ok, vector<::Ice::Byte> outEncaps) - { - outParams = move(outEncaps); - p.set_value(ok); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - return p.get_future().get(); - } - case Reference::ModeOneway: - case Reference::ModeDatagram: - { - promise p; - ice_invoke_async(operation, mode, inParams, - nullptr, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - [&](bool) - { - p.set_value(true); - }, - context); - return p.get_future().get(); - } - default: - { - ice_invoke_async(operation, mode, inParams, nullptr, nullptr, nullptr, context); - return true; - } - } + __checkAsyncTwowayOnly("__ice_id"); + outAsync->invoke(ice_id_name, OperationMode::Nonmutating, DefaultFormat, ctx, nullptr, nullptr); } -bool -Ice::ObjectPrx::ice_invoke(const string& operation, - ::Ice::OperationMode mode, - const pair& inParams, - vector<::Ice::Byte>& outParams, - const ::Ice::Context& context) +void +Ice::ObjectPrx::__ice_getConnection(const shared_ptr& outAsync) { - switch(_reference->getMode()) - { - case Reference::ModeTwoway: - { - promise p; - ice_invoke_async(operation, mode, inParams, - [&](bool ok, pair outEncaps) - { - vector(outEncaps.first, outEncaps.second).swap(outParams); - p.set_value(ok); - }, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - nullptr, context); - return p.get_future().get(); - } - case Reference::ModeOneway: - case Reference::ModeDatagram: - { - promise p; - ice_invoke_async(operation, mode, inParams, - nullptr, - [&](exception_ptr ex) - { - p.set_exception(move(ex)); - }, - [&](bool) - { - p.set_value(true); - }, - context); - return p.get_future().get(); - } - default: - { - ice_invoke_async(operation, mode, inParams, nullptr, nullptr, nullptr, context); - return true; - } - } + outAsync->invoke(ice_getConnection_name); } -function -Ice::ObjectPrx::ice_invoke_async(const string& operation, - ::Ice::OperationMode mode, - const vector<::Ice::Byte>& inEncaps, - function)> response, - function exception, - function sent, - const ::Ice::Context& context) -{ - pair inPair; - if(inEncaps.empty()) - { - inPair.first = inPair.second = 0; - } - else - { - inPair.first = &inEncaps[0]; - inPair.second = inPair.first + inEncaps.size(); - } - - class InvokeCallback : public CallbackBase - { - public: - - InvokeCallback(shared_ptr proxy, - function)> response = nullptr, - function exception = nullptr, - function sent = nullptr) : - _proxy(move(proxy)), - _response(move(response)), - _exception(move(exception)), - _sent(move(sent)) - { - } - - virtual void sent(const AsyncResultPtr& result) const - { - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return _sent != nullptr; - } - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _proxy.get(), ice_invoke_name); - bool ok = result->__wait(); - if(_proxy->_reference->getMode() == Reference::ModeTwoway) - { - const Byte* v; - Int sz; - result->__readParamEncaps(v, sz); - if(_response) - { - _response(ok, vector(v, v + sz)); - } - } - } - catch(const ::Ice::Exception&) - { - if(_exception) - { - _exception(current_exception()); - } - } - } - - private: - - shared_ptr _proxy; - function)> _response; - function _exception; - function _sent; - }; - - if(ice_isBatchOneway() || ice_isBatchDatagram()) - { - auto result = make_shared(shared_from_this(), ice_invoke_name, - make_shared(shared_from_this())); - try - { - result->prepare(operation, mode, context); - result->writeParamEncaps(inPair.first, static_cast(inEncaps.size())); - result->invoke(); - if(sent) - { - sent(true); - } - } - catch(const Exception& ex) - { - result->abort(ex); - } - return [result]() - { - result->cancel(); - }; - } - else - { - auto result = make_shared(shared_from_this(), ice_invoke_name, - make_shared(shared_from_this(), move(response), move(exception), move(sent))); - try - { - result->prepare(operation, mode, context); - result->writeParamEncaps(inPair.first, static_cast(inEncaps.size())); - result->invoke(); - } - catch(const Exception& ex) - { - result->abort(ex); - } - - return [result]() - { - result->cancel(); - }; - } -} - -function -Ice::ObjectPrx::ice_invoke_async(const string& operation, - ::Ice::OperationMode mode, - const pair& inEncaps, - function)> response, - function exception, - function sent, - const ::Ice::Context& context) +void +Ice::ObjectPrx::__ice_flushBatchRequests(const shared_ptr& outAsync) { - class InvokeCallback : public CallbackBase - { - public: - - InvokeCallback(shared_ptr proxy, - function)> response = nullptr, - function exception = nullptr, - function sent = nullptr) : - _proxy(move(proxy)), - _response(move(response)), - _exception(move(exception)), - _sent(move(sent)) - { - } - - virtual void sent(const AsyncResultPtr& result) const - { - if(_sent) - { - _sent(result->sentSynchronously()); - } - } - - virtual bool hasSentCallback() const - { - return _sent != nullptr; - } - - virtual void - completed(const ::Ice::AsyncResultPtr& result) const - { - try - { - AsyncResult::__check(result, _proxy.get(), ice_invoke_name); - bool ok = result->__wait(); - if(_proxy->_reference->getMode() == Reference::ModeTwoway) - { - pair v; - Int sz; - result->__readParamEncaps(v.first, sz); - v.second = v.first + sz; - if(_response) - { - _response(ok, move(v)); - } - } - } - catch(const ::Ice::Exception&) - { - if(_exception) - { - _exception(current_exception()); - } - } - } - - private: - - shared_ptr _proxy; - function)> _response; - function _exception; - function _sent; - }; - - if(ice_isBatchOneway() || ice_isBatchDatagram()) - { - auto result = make_shared(shared_from_this(), ice_invoke_name, - make_shared(shared_from_this())); - try - { - result->prepare(operation, mode, context); - result->writeParamEncaps(inEncaps.first, static_cast(inEncaps.second - inEncaps.first)); - result->invoke(); - if(sent) - { - sent(true); - } - } - catch(const Exception& ex) - { - result->abort(ex); - } - - return [result]() - { - result->cancel(); - }; - } - else - { - auto result = make_shared(shared_from_this(), ice_invoke_name, - make_shared(shared_from_this(), move(response), move(exception), move(sent))); - try - { - result->prepare(operation, mode, context); - result->writeParamEncaps(inEncaps.first, static_cast(inEncaps.second - inEncaps.first)); - result->invoke(); - } - catch(const Exception& ex) - { - result->abort(ex); - } - - return [result]() - { - result->cancel(); - }; - } + outAsync->invoke(ice_flushBatchRequests_name); } shared_ptr @@ -865,14 +213,14 @@ IceProxy::Ice::Object::__begin_ice_isA(const string& typeId, const ::Ice::LocalObjectPtr& cookie) { __checkAsyncTwowayOnly(ice_isA_name); - OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_isA_name, del, cookie); + OutgoingAsyncPtr __result = new CallbackOutgoing(this, ice_isA_name, del, cookie); try { __result->prepare(ice_isA_name, Nonmutating, ctx); ::Ice::OutputStream* __os = __result->startWriteParams(DefaultFormat); __os->write(typeId); __result->endWriteParams(); - __result->invoke(); + __result->invoke(ice_isA_name); } catch(const Exception& __ex) { @@ -932,12 +280,12 @@ IceProxy::Ice::Object::__begin_ice_ping(const Context& ctx, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie) { - OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_ping_name, del, cookie); + OutgoingAsyncPtr __result = new CallbackOutgoing(this, ice_ping_name, del, cookie); try { __result->prepare(ice_ping_name, Nonmutating, ctx); __result->writeEmptyParams(); - __result->invoke(); + __result->invoke(ice_ping_name); } catch(const Exception& __ex) { @@ -1006,12 +354,12 @@ IceProxy::Ice::Object::__begin_ice_ids(const Context& ctx, const ::Ice::LocalObjectPtr& cookie) { __checkAsyncTwowayOnly(ice_ids_name); - OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_ids_name, del, cookie); + OutgoingAsyncPtr __result = new CallbackOutgoing(this, ice_ids_name, del, cookie); try { __result->prepare(ice_ids_name, Nonmutating, ctx); __result->writeEmptyParams(); - __result->invoke(); + __result->invoke(ice_ids_name); } catch(const Exception& __ex) { @@ -1049,12 +397,12 @@ IceProxy::Ice::Object::__begin_ice_id(const Context& ctx, const ::Ice::LocalObjectPtr& cookie) { __checkAsyncTwowayOnly(ice_id_name); - OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_id_name, del, cookie); + OutgoingAsyncPtr __result = new CallbackOutgoing(this, ice_id_name, del, cookie); try { __result->prepare(ice_id_name, Nonmutating, ctx); __result->writeEmptyParams(); - __result->invoke(); + __result->invoke(ice_id_name); } catch(const Exception& __ex) { @@ -1177,12 +525,12 @@ IceProxy::Ice::Object::__begin_ice_invoke(const string& operation, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie) { - OutgoingAsyncPtr __result = new OutgoingAsync(this, ice_invoke_name, del, cookie); + OutgoingAsyncPtr __result = new CallbackOutgoing(this, ice_invoke_name, del, cookie); try { __result->prepare(operation, mode, ctx); __result->writeParamEncaps(inEncaps.first, static_cast(inEncaps.second - inEncaps.first)); - __result->invoke(); + __result->invoke(operation); } catch(const Exception& __ex) { @@ -1209,10 +557,29 @@ IceProxy::Ice::Object::___end_ice_invoke(pair& outEnca IceProxy::Ice::Object::begin_ice_flushBatchRequestsInternal(const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie) { - ProxyFlushBatchAsyncPtr result = new ProxyFlushBatchAsync(this, ice_flushBatchRequests_name, del, cookie); + class ProxyFlushBatchAsyncWithCallback : public ProxyFlushBatchAsync, public CallbackCompletion + { + public: + + ProxyFlushBatchAsyncWithCallback(const ::Ice::ObjectPrx& proxy, + const CallbackBasePtr& cb, + const ::Ice::LocalObjectPtr& cookie) : + ProxyFlushBatchAsync(proxy), CallbackCompletion(cb, cookie) + { + _cookie = cookie; + } + + virtual const std::string& + getOperation() const + { + return ice_flushBatchRequests_name; + } + }; + + ProxyFlushBatchAsyncPtr result = new ProxyFlushBatchAsyncWithCallback(this, del, cookie); try { - result->invoke(); + result->invoke(ice_flushBatchRequests_name); } catch(const Exception& ex) { @@ -1299,14 +666,70 @@ IceProxy::Ice::Object::__newInstance() const return new Object; } +ConnectionPtr +IceProxy::Ice::Object::ice_getConnection() +{ + InvocationObserver observer(this, "ice_getConnection", ::Ice::noExplicitContext); + int cnt = 0; + while(true) + { + RequestHandlerPtr handler; + try + { + handler = __getRequestHandler(); + return handler->waitForConnection(); // Wait for the connection to be established. + } + catch(const IceInternal::RetryException&) + { + __updateRequestHandler(handler, 0); // Clear request handler and retry. + } + catch(const Exception& ex) + { + try + { + int interval = __handleException(ex, handler, ICE_ENUM(OperationMode, Idempotent), false, cnt); + observer.retried(); + if(interval > 0) + { + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); + } + } + catch(const Exception& exc) + { + observer.failed(exc.ice_id()); + throw; + } + } + } +} + AsyncResultPtr IceProxy::Ice::Object::begin_ice_getConnectionInternal(const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie) { - ProxyGetConnectionPtr result = new ProxyGetConnection(this, ice_getConnection_name, del, cookie); + class ProxyGetConnectionWithCallback : public ProxyGetConnection, public CallbackCompletion + { + public: + + ProxyGetConnectionWithCallback(const ::Ice::ObjectPrx& proxy, + const ::IceInternal::CallbackBasePtr& cb, + const ::Ice::LocalObjectPtr& cookie) : + ProxyGetConnection(proxy), CallbackCompletion(cb, cookie) + { + _cookie = cookie; + } + + virtual const std::string& + getOperation() const + { + return ice_getConnection_name; + } + }; + + ProxyGetConnectionPtr result = new ProxyGetConnectionWithCallback(this, del, cookie); try { - result->invoke(); + result->invoke(ice_getConnection_name); } catch(const Exception& ex) { @@ -1893,43 +1316,6 @@ ICE_OBJECT_PRX::ice_getConnectionId() const return _reference->getConnectionId(); } -ConnectionPtr -ICE_OBJECT_PRX::ice_getConnection() -{ - InvocationObserver observer(ICE_SHARED_FROM_THIS, "ice_getConnection", ::Ice::noExplicitContext); - int cnt = 0; - while(true) - { - RequestHandlerPtr handler; - try - { - handler = __getRequestHandler(); - return handler->waitForConnection(); // Wait for the connection to be established. - } - catch(const IceInternal::RetryException&) - { - __updateRequestHandler(handler, 0); // Clear request handler and retry. - } - catch(const Exception& ex) - { - try - { - int interval = __handleException(ex, handler, ICE_ENUM(OperationMode, Idempotent), false, cnt); - observer.retried(); - if(interval > 0) - { - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); - } - } - catch(const Exception& exc) - { - observer.failed(exc.ice_id()); - throw; - } - } - } -} - ConnectionPtr ICE_OBJECT_PRX::ice_getCachedConnection() const { diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index ea872f3562a..8cd9c704970 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1358,7 +1358,7 @@ IceInternal::RoutableReference::operator==(const Reference& r) const // TODO: With C++14 we could use the vesion that receives four iterators and we don't need to explicitly // check the sizesa are equal. // - if(_endpoints.size() != rhs->_endpoints.size() || + if(_endpoints.size() != rhs->_endpoints.size() || !equal(_endpoints.begin(), _endpoints.end(), rhs->_endpoints.begin(), Ice::TargetEquals>())) #else if(_endpoints != rhs->_endpoints) @@ -1493,7 +1493,7 @@ IceInternal::RoutableReference::operator<(const Reference& r) const #ifdef ICE_CPP11_MAPPING if(lexicographical_compare(_endpoints.begin(), _endpoints.end(), rhs->_endpoints.begin(), rhs->_endpoints.end(), Ice::TargetLess>())) -#else +#else if(_endpoints < rhs->_endpoints) #endif { @@ -1777,31 +1777,24 @@ IceInternal::RoutableReference::createConnection(const vector& all virtual void setException(const Ice::LocalException& ex) { - if(!ICE_EXCEPTION_GET(_exception)) + if(!ICE_EXCEPTION_ISSET(_exception)) { ICE_RESET_EXCEPTION(_exception, ex.ice_clone()); } -#ifdef ICE_CPP11_MAPPING - try - { - rethrow_exception(_exception); - } - catch(const Ice::LocalException& ee) + if(++_i == _endpoints.size()) { - if(++_i == _endpoints.size()) + try + { + ICE_RETHROW_EXCEPTION(_exception); + } + catch(const Ice::LocalException& ee) { _callback->setException(ee); return; } } -#else - if(++_i == _endpoints.size()) - { - _callback->setException(*_exception.get()); - return; - } -#endif + const bool more = _i != _endpoints.size() - 1; vector endpoint; endpoint.push_back(_endpoints[_i]); diff --git a/cpp/src/Ice/ResponseHandler.h b/cpp/src/Ice/ResponseHandler.h index 724f784fc59..ae24d104f76 100644 --- a/cpp/src/Ice/ResponseHandler.h +++ b/cpp/src/Ice/ResponseHandler.h @@ -28,7 +28,7 @@ class OutputStream; namespace IceInternal { -class ResponseHandler : public virtual ICE_SHARED +class ResponseHandler : public Ice::EnableSharedFromThis { public: diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp index 84a8997bd4a..0b27961783c 100644 --- a/cpp/src/Ice/RetryQueue.cpp +++ b/cpp/src/Ice/RetryQueue.cpp @@ -59,9 +59,9 @@ IceInternal::RetryTask::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsyn Trace out(_instance->initializationData().logger, _instance->traceLevels()->retryCat); out << "operation retry canceled\n" << ex; } - if(_outAsync->completed(ex)) + if(_outAsync->exception(ex)) { - _outAsync->invokeCompletedAsync(); + _outAsync->invokeExceptionAsync(); } } } diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h index 43974e5331e..b33fced06d3 100644 --- a/cpp/src/Ice/RouterInfo.h +++ b/cpp/src/Ice/RouterInfo.h @@ -10,7 +10,6 @@ #ifndef ICE_ROUTER_INFO_H #define ICE_ROUTER_INFO_H -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include @@ -44,13 +44,13 @@ public: private: #ifdef ICE_CPP11_MAPPING - using RouterTableMap = std::map, + using RouterTableMap = std::map, RouterInfoPtr, Ice::TargetLess>>; #else typedef std::map RouterTableMap; #endif - + RouterTableMap _table; RouterTableMap::iterator _tableHint; }; @@ -62,23 +62,20 @@ public: class GetClientEndpointsCallback : public virtual Ice::LocalObject { public: - + virtual void setEndpoints(const std::vector&) = 0; virtual void setException(const Ice::LocalException&) = 0; }; typedef IceUtil::Handle GetClientEndpointsCallbackPtr; - class AddProxyCallback -#ifndef ICE_CPP11_MAPPING - : public virtual IceUtil::Shared -#endif + class AddProxyCallback : public Ice::EnableSharedFromThis { public: - + virtual void addedProxy() = 0; virtual void setException(const Ice::LocalException&) = 0; }; - ICE_DEFINE_PTR(AddProxyCallbackPtr, AddProxyCallback); + ICE_DEFINE_PTR(AddProxyCallbackPtr, AddProxyCallback); RouterInfo(const Ice::RouterPrxPtr&); @@ -100,34 +97,34 @@ public: std::vector getClientEndpoints(); void getClientEndpoints(const GetClientEndpointsCallbackPtr&); std::vector getServerEndpoints(); - + class AddProxyCookie : public Ice::LocalObject { public: - + AddProxyCookie(const AddProxyCallbackPtr cb, const Ice::ObjectPrxPtr& proxy) : _cb(cb), _proxy(proxy) { } - + AddProxyCallbackPtr cb() const { return _cb; } - + Ice::ObjectPrxPtr proxy() const { return _proxy; } - + private: - + const AddProxyCallbackPtr _cb; const Ice::ObjectPrxPtr _proxy; }; typedef IceUtil::Handle AddProxyCookiePtr; - + void addProxyResponse(const Ice::ObjectProxySeq&, const AddProxyCookiePtr&); void addProxyException(const Ice::Exception&, const AddProxyCookiePtr&); void addProxy(const Ice::ObjectPrxPtr&); diff --git a/cpp/src/Ice/ValueFactoryManagerI.cpp b/cpp/src/Ice/ValueFactoryManagerI.cpp index 3f914041734..0161ed6533b 100644 --- a/cpp/src/Ice/ValueFactoryManagerI.cpp +++ b/cpp/src/Ice/ValueFactoryManagerI.cpp @@ -16,11 +16,7 @@ using namespace Ice; using namespace IceInternal; void -#ifdef ICE_CPP11_MAPPING -IceInternal::ValueFactoryManagerI::add(function factory, const string& id) -#else -IceInternal::ValueFactoryManagerI::add(const Ice::ValueFactoryPtr& factory, const string& id) -#endif +IceInternal::ValueFactoryManagerI::add(ICE_IN(ICE_VALUE_FACTORY) factory, const string& id) { IceUtil::Mutex::Lock sync(*this); diff --git a/cpp/src/Ice/ValueFactoryManagerI.h b/cpp/src/Ice/ValueFactoryManagerI.h index bdddb42cb65..b75a1669373 100644 --- a/cpp/src/Ice/ValueFactoryManagerI.h +++ b/cpp/src/Ice/ValueFactoryManagerI.h @@ -28,13 +28,8 @@ public: ValueFactoryManagerI(); -#ifdef ICE_CPP11_MAPPING - virtual void add(std::function (std::string)>, const std::string&); - virtual std::function (const std::string&)> find(const std::string&) const; -#else - virtual void add(const Ice::ValueFactoryPtr&, const std::string&); - virtual Ice::ValueFactoryPtr find(const std::string&) const; -#endif + virtual void add(ICE_IN(ICE_VALUE_FACTORY), const std::string&); + virtual ICE_VALUE_FACTORY find(const std::string&) const; private: diff --git a/cpp/src/IceBox/.depend.mak b/cpp/src/IceBox/.depend.mak index 7753740655c..85ba68b8d21 100755 --- a/cpp/src/IceBox/.depend.mak +++ b/cpp/src/IceBox/.depend.mak @@ -42,7 +42,6 @@ Service.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -173,7 +172,6 @@ ServiceManagerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -320,7 +318,6 @@ Admin.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -435,7 +432,6 @@ IceBox.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -522,7 +518,6 @@ Exception.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IceDB/.depend.mak b/cpp/src/IceDB/.depend.mak index bdc812bf22e..f09456810ca 100755 --- a/cpp/src/IceDB/.depend.mak +++ b/cpp/src/IceDB/.depend.mak @@ -33,7 +33,6 @@ IceDB.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index 16a60a4afee..9f3fd3f409d 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -138,7 +139,7 @@ private: // // Write [in] T into [in/out] MDB_val using [in] context C // [in] MDB_val contains the destination array -// write returns true on success, and false if the provided +// write returns true on success, and false if the provided // array is too small. // On failure, MDB_val.mv_size contains the marshaled key // size if known, and 0 if not know. @@ -253,9 +254,9 @@ public: { unsigned char kbuf[maxKeySize]; MDB_val mkey = {maxKeySize, kbuf}; - + if(Codec::write(key, mkey, _marshalingContext)) - { + { MDB_val mdata; if(DbiBase::get(txn, &mkey, &mdata)) { @@ -326,7 +327,7 @@ public: else { return false; - } + } } C marshalingContext() const @@ -416,7 +417,7 @@ public: else { return false; - } + } } bool find(const K& key, D& data) diff --git a/cpp/src/IceDiscovery/.depend.mak b/cpp/src/IceDiscovery/.depend.mak index 1c5b5f8f713..e121a66f9f0 100755 --- a/cpp/src/IceDiscovery/.depend.mak +++ b/cpp/src/IceDiscovery/.depend.mak @@ -26,7 +26,6 @@ LocatorI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -122,7 +121,6 @@ LookupI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -246,7 +244,6 @@ PluginI.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\Ice\PropertiesF.h" \ @@ -357,7 +354,6 @@ IceDiscovery.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IceDiscovery/LookupI.h b/cpp/src/IceDiscovery/LookupI.h index 49350c52106..92e4759a641 100644 --- a/cpp/src/IceDiscovery/LookupI.h +++ b/cpp/src/IceDiscovery/LookupI.h @@ -15,6 +15,7 @@ #include #include +#include namespace IceDiscovery { @@ -23,7 +24,6 @@ class LookupI; #ifdef ICE_CPP11_MAPPING - template class Request : public IceUtil::TimerTask { public: @@ -200,6 +200,7 @@ private: IceUtil::Time _latency; }; typedef IceUtil::Handle AdapterRequestPtr; + #endif class LookupI : public Lookup, diff --git a/cpp/src/IceGrid/.depend.mak b/cpp/src/IceGrid/.depend.mak index 1352f5126a0..7fa31a24dac 100755 --- a/cpp/src/IceGrid/.depend.mak +++ b/cpp/src/IceGrid/.depend.mak @@ -77,7 +77,6 @@ Client.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -203,7 +202,6 @@ DescriptorBuilder.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -319,7 +317,6 @@ DescriptorHelper.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -460,7 +457,6 @@ DescriptorParser.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -589,7 +585,6 @@ FileParserI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -707,7 +702,6 @@ Parser.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\Ice\PropertiesF.h" \ @@ -847,7 +841,6 @@ Util.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -973,7 +966,6 @@ Internal.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1074,7 +1066,6 @@ IceLocatorDiscovery.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1174,7 +1165,6 @@ Grammar.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1309,7 +1299,6 @@ Scanner.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1447,7 +1436,6 @@ IceGridDB.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1572,7 +1560,6 @@ DBTypes.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1681,7 +1668,6 @@ AdminRouter.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1793,7 +1779,6 @@ FileCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1887,7 +1872,6 @@ PlatformInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2007,7 +1991,6 @@ SessionManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2131,7 +2114,6 @@ TraceLevels.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2234,7 +2216,6 @@ Activator.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2377,7 +2358,6 @@ NodeAdminRouter.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -2526,7 +2506,6 @@ NodeI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2679,7 +2658,6 @@ NodeSessionManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2824,7 +2802,6 @@ ServerAdapterI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2972,7 +2949,6 @@ ServerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3114,7 +3090,6 @@ AdapterCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -3279,7 +3254,6 @@ AdminCallbackRouter.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3408,7 +3382,6 @@ AdminI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3588,7 +3561,6 @@ AdminSessionI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -3763,7 +3735,6 @@ Allocatable.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -3893,7 +3864,6 @@ AllocatableObjectCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -4043,7 +4013,6 @@ Database.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -4187,7 +4156,6 @@ FileUserAccountMapperI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -4279,7 +4247,6 @@ InternalRegistryI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -4456,7 +4423,6 @@ LocatorI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -4622,7 +4588,6 @@ LocatorRegistryI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -4771,7 +4736,6 @@ NodeCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -4942,7 +4906,6 @@ NodeSessionI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5089,7 +5052,6 @@ ObjectCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -5246,7 +5208,6 @@ PluginFacadeI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\Ice\ProxyFactoryF.h" \ "$(includedir)\Ice\ConnectionIF.h" \ @@ -5367,7 +5328,6 @@ QueryI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -5505,7 +5465,6 @@ ReapThread.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5626,7 +5585,6 @@ RegistryAdminRouter.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5791,7 +5749,6 @@ RegistryI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -5977,7 +5934,6 @@ ReplicaCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -6106,7 +6062,6 @@ ReplicaSessionI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6266,7 +6221,6 @@ ReplicaSessionManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6416,7 +6370,6 @@ ServerCache.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6584,7 +6537,6 @@ SessionI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -6742,7 +6694,6 @@ SessionServantManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Identity.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -6886,7 +6837,6 @@ Topics.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -7016,7 +6966,6 @@ WellKnownObjectsManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -7159,7 +7108,6 @@ IceGridNode.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -7324,7 +7272,6 @@ IceGridRegistry.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ diff --git a/cpp/src/IceGridLib/.depend.mak b/cpp/src/IceGridLib/.depend.mak index 5b0fe9c76ca..ea47c155705 100755 --- a/cpp/src/IceGridLib/.depend.mak +++ b/cpp/src/IceGridLib/.depend.mak @@ -101,7 +101,6 @@ PluginFacadeI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -196,7 +195,6 @@ Admin.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -291,7 +289,6 @@ Descriptor.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -377,7 +374,6 @@ Exception.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\FactoryTableInit.h" \ "$(includedir)\Ice\FactoryTable.h" \ "$(includedir)\IceUtil\Mutex.h" \ @@ -435,7 +431,6 @@ FileParser.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -531,7 +526,6 @@ PluginFacade.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -627,7 +621,6 @@ Registry.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -726,7 +719,6 @@ Session.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -818,7 +810,6 @@ UserAccountMapper.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IceLocatorDiscovery/.depend.mak b/cpp/src/IceLocatorDiscovery/.depend.mak index 1524b3631a9..db111d553d2 100755 --- a/cpp/src/IceLocatorDiscovery/.depend.mak +++ b/cpp/src/IceLocatorDiscovery/.depend.mak @@ -48,7 +48,6 @@ PluginI.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\Ice\PropertiesF.h" \ @@ -157,7 +156,6 @@ IceLocatorDiscovery.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IcePatch2/.depend.mak b/cpp/src/IcePatch2/.depend.mak index 2bf4b8a93ee..0b0dd26624d 100755 --- a/cpp/src/IcePatch2/.depend.mak +++ b/cpp/src/IcePatch2/.depend.mak @@ -38,7 +38,6 @@ FileServerI.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -171,7 +170,6 @@ Server.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -303,7 +301,6 @@ Client.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -436,7 +433,6 @@ Calc.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ diff --git a/cpp/src/IcePatch2Lib/.depend.mak b/cpp/src/IcePatch2Lib/.depend.mak index d80decac2df..71fdb237909 100755 --- a/cpp/src/IcePatch2Lib/.depend.mak +++ b/cpp/src/IcePatch2Lib/.depend.mak @@ -45,7 +45,6 @@ ClientUtil.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -186,7 +185,6 @@ Util.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\Ice\PropertiesF.h" \ @@ -296,7 +294,6 @@ FileInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\BuiltinSequences.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -349,7 +346,6 @@ FileServer.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IceSSL/.depend.mak b/cpp/src/IceSSL/.depend.mak index b75ca6003ea..a6d8278c1eb 100755 --- a/cpp/src/IceSSL/.depend.mak +++ b/cpp/src/IceSSL/.depend.mak @@ -38,7 +38,6 @@ ConnectionInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -113,7 +112,6 @@ EndpointInfo.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Endpoint.h" \ "$(includedir)\Ice\Version.h" \ @@ -175,7 +173,6 @@ AcceptorI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -327,7 +324,6 @@ Certificate.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -403,7 +399,6 @@ ConnectorI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -550,7 +545,6 @@ EndpointI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\Version.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -688,7 +682,6 @@ Instance.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -815,7 +808,6 @@ PluginI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -952,7 +944,6 @@ RFC2253.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -1027,7 +1018,6 @@ SChannelEngine.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -1136,7 +1126,6 @@ SChannelTransceiverI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -1275,7 +1264,6 @@ SSLEngine.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -1381,7 +1369,6 @@ TrustManager.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1491,7 +1478,6 @@ Util.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ diff --git a/cpp/src/IceStorm/.depend.mak b/cpp/src/IceStorm/.depend.mak index e8cabb73e5c..683970fb6f5 100755 --- a/cpp/src/IceStorm/.depend.mak +++ b/cpp/src/IceStorm/.depend.mak @@ -104,7 +104,6 @@ Instance.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -256,7 +255,6 @@ InstrumentationI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\EndpointF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -385,7 +383,6 @@ NodeI.obj: \ "$(includedir)\Ice\LocalObjectF.h" \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\Ice\PropertiesF.h" \ @@ -519,7 +516,6 @@ Observers.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -649,7 +645,6 @@ Service.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\Ice\LoggerF.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ @@ -812,7 +807,6 @@ Subscriber.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -956,7 +950,6 @@ TopicI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1102,7 +1095,6 @@ TopicManagerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1249,7 +1241,6 @@ TraceLevels.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1331,7 +1322,6 @@ TransientTopicI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1471,7 +1461,6 @@ TransientTopicManagerI.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1624,7 +1613,6 @@ Util.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -1746,7 +1734,6 @@ Election.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1836,7 +1823,6 @@ IceStormInternal.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -1927,7 +1913,6 @@ Instrumentation.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2015,7 +2000,6 @@ LinkRecord.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2107,7 +2091,6 @@ LLURecord.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2158,7 +2141,6 @@ SubscriberRecord.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -2261,7 +2243,6 @@ Admin.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2389,7 +2370,6 @@ Parser.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2521,7 +2501,6 @@ Grammar.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2650,7 +2629,6 @@ Scanner.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2782,7 +2760,6 @@ IceStormDB.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -2905,7 +2882,6 @@ DBTypes.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/IceStormLib/.depend.mak b/cpp/src/IceStormLib/.depend.mak index 4c3e3a981e8..318fa9ba4ec 100755 --- a/cpp/src/IceStormLib/.depend.mak +++ b/cpp/src/IceStormLib/.depend.mak @@ -34,7 +34,6 @@ IceStorm.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ @@ -122,7 +121,6 @@ Metrics.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\Ice\Proxy.h" \ "$(includedir)\IceUtil\Mutex.h" \ "$(includedir)\IceUtil\Lock.h" \ diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index dda3930be9e..2951197dcd9 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -288,7 +288,8 @@ writeParamEndCode(Output& out, const TypePtr& type, bool optional, const string& } void -writeMarshalUnmarshalParams(Output& out, const ParamDeclList& params, const OperationPtr& op, bool marshal, bool prepend, int typeCtx) +writeMarshalUnmarshalParams(Output& out, const ParamDeclList& params, const OperationPtr& op, bool marshal, + bool prepend, int typeCtx) { string prefix = prepend ? paramPrefix : ""; @@ -514,7 +515,7 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx { if(cpp11) { - if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocalOperation)) + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) { return "::std::shared_ptr<::Ice::Value>"; } @@ -533,30 +534,19 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - // - // C++11 mapping accepts cpp11:type metadata for classes and proxies - // if(cpp11) { - string t; - if(cpp11 && findMetaData("cpp11:type:", cl, t)) + if(cl->definition() && cl->definition()->isDelegate()) { - return t; + return classDefToDelegateString(cl->definition()); } - else if(cl->definition() && cl->definition()->isDelegate()) + else if(cl->isInterface() && !cl->isLocal()) { - return classDefToDelegateString(cl->definition()); + return "std::shared_ptr<::Ice::Value>"; } else { - if(cl->isInterface() && !cl->isLocal()) - { - return "std::shared_ptr<::Ice::Value>"; - } - else - { - return "::std::shared_ptr<" + cl->scoped() + ">"; - } + return "::std::shared_ptr<" + cl->scoped() + ">"; } } else @@ -678,51 +668,27 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m "const ::Ice::ValuePtr&" }; - static const char* cpp11InputLocalBuiltinTable[] = - { - "::Ice::Byte", - "bool", - "short", - "int", - "long long int", - "float", - "double", - "const ::std::string&", - "const ::std::shared_ptr<::Ice::Object>&", - "const ::std::shared_ptr<::Ice::ObjectPrx>&", - "const ::std::shared_ptr&", - "const ::std::shared_ptr<::Ice::Value>&" - }; - static const char* cpp11InputBuiltinTable[] = - { - "::Ice::Byte", - "bool", - "short", - "int", - "long long int", - "float", - "double", - "::std::string&", - "::std::shared_ptr<::Ice::Object>", - "::std::shared_ptr<::Ice::ObjectPrx>", - "::std::shared_ptr", - "::std::shared_ptr<::Ice::Value>" - }; + { + "::Ice::Byte", + "bool", + "short", + "int", + "long long int", + "float", + "double", + "const ::std::string&", + "const ::std::shared_ptr<::Ice::Object>&", + "const ::std::shared_ptr<::Ice::ObjectPrx>&", + "const ::std::shared_ptr&", + "const ::std::shared_ptr<::Ice::Value>&" + }; typeCtx |= TypeContextInParam; if(optional) { - if(cpp11 && !(typeCtx & TypeContextLocalOperation) && - !(typeCtx & TypeContextAMD)) - { - return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) +">"; - } - else - { - return "const IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) +">&"; - } + return "const IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) +">&"; } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -730,40 +696,19 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m { if(builtin->kind() == Builtin::KindString) { - if(cpp11 && !(typeCtx & TypeContextLocalOperation) && !(typeCtx & TypeContextAMD)) - { - return stringTypeToString(type, metaData, typeCtx); - } - else - { - return string("const ") + stringTypeToString(type, metaData, typeCtx) + "&"; - } + return string("const ") + stringTypeToString(type, metaData, typeCtx) + "&"; } else { if(cpp11) { - if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocalOperation)) + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) { - if(typeCtx & TypeContextAMD) - { - return "const ::std::shared_ptr<::Ice::Value>&"; - } - else - { - return "::std::shared_ptr<::Ice::Value>"; - } + return "const ::std::shared_ptr<::Ice::Value>&"; } else { - if(typeCtx & TypeContextLocalOperation || typeCtx & TypeContextAMD) - { - return cpp11InputLocalBuiltinTable[builtin->kind()]; - } - else - { - return cpp11InputBuiltinTable[builtin->kind()]; - } + return cpp11InputBuiltinTable[builtin->kind()]; } } else @@ -776,52 +721,19 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - string t; if(cpp11) { - if(findMetaData("cpp11:type:", cl, t)) + if(cl->definition() && cl->definition()->isDelegate()) { - return t; + return classDefToDelegateString(cl->definition(), typeCtx, cpp11); } - else if(cl->isLocal() || (typeCtx & TypeContextLocalOperation)) + else if(cl->isInterface() && !cl->isLocal()) { - if(cl->definition() && cl->definition()->isDelegate()) - { - return classDefToDelegateString(cl->definition(), typeCtx, cpp11); - } - else if(typeCtx & TypeContextDelegate) - { - return "::std::shared_ptr<" + fixKwd(cl->scoped()) + ">"; - } - else - { - return "const ::std::shared_ptr<" + fixKwd(cl->scoped()) + ">&"; - } + return "const ::std::shared_ptr<::Ice::Value>&"; } else { - if(typeCtx & TypeContextAMD) - { - if(cl->isInterface()) - { - return "const ::std::shared_ptr<::Ice::Value>&"; - } - else - { - return "const ::std::shared_ptr<" + fixKwd(cl->scoped()) + ">&"; - } - } - else - { - if(cl->isInterface()) - { - return "::std::shared_ptr<::Ice::Value>"; - } - else - { - return "::std::shared_ptr<" + fixKwd(cl->scoped()) + ">"; - } - } + return "const ::std::shared_ptr<" + fixKwd(cl->scoped()) + ">&"; } } else @@ -835,14 +747,7 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m { if(cpp11) { - if(st->isLocal() || (typeCtx & TypeContextLocalOperation) || (typeCtx & TypeContextAMD)) - { - return "const " + fixKwd(st->scoped()) + "&"; - } - else - { - return fixKwd(st->scoped()); - } + return "const " + fixKwd(st->scoped()) + "&"; } else { @@ -863,34 +768,13 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m if(cpp11) { ClassDefPtr def = proxy->_class()->definition(); - // - // Non local classes without operations map to the base - // proxy class shared_ptr - // - if(typeCtx & TypeContextLocalOperation) + if(def && !def->isInterface() && def->allOperations().empty()) { - if(def && !def->isInterface() && def->allOperations().empty()) - { - return "const ::std::shared_ptr<::Ice::ObjectPrx>&"; - } - else - { - return "const ::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">&"; - } + return "const ::std::shared_ptr<::Ice::ObjectPrx>&"; } else { - string t; - if(def && !def->isInterface() && def->allOperations().empty()) - { - t = "::std::shared_ptr<::Ice::ObjectPrx>"; - } - else - { - t = "::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">"; - } - - return (typeCtx & TypeContextAMD) ? ("const " + t + "&") : t; + return "const ::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">&"; } } else @@ -908,40 +792,19 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { - if(cpp11 && !(typeCtx & TypeContextLocalOperation) && !(typeCtx & TypeContextAMD)) - { - return sequenceTypeToString(seq, metaData, typeCtx); - } - else - { - return "const " + sequenceTypeToString(seq, metaData, typeCtx) + "&"; - } + return "const " + sequenceTypeToString(seq, metaData, typeCtx) + "&"; } DictionaryPtr dict = DictionaryPtr::dynamicCast(type); if(dict) { - if(cpp11 && !(typeCtx & TypeContextLocalOperation) && !(typeCtx & TypeContextAMD)) - { - return dictionaryTypeToString(dict, metaData, typeCtx); - } - else - { - return "const " + dictionaryTypeToString(dict, metaData, typeCtx) + "&"; - } + return "const " + dictionaryTypeToString(dict, metaData, typeCtx) + "&"; } ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) { - if(cpp11 && !(typeCtx & TypeContextLocalOperation) && !(typeCtx & TypeContextAMD)) - { - return fixKwd(contained->scoped()); - } - else - { - return "const " + fixKwd(contained->scoped()) + "&"; - } + return "const " + fixKwd(contained->scoped()) + "&"; } return "???"; @@ -998,7 +861,7 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& { if(cpp11) { - if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocalOperation)) + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) { return "::std::shared_ptr<::Ice::Value>"; } @@ -1019,7 +882,11 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& { if(cpp11) { - if(cl->isInterface() && !cl->isLocal()) + if(cl->definition() && cl->definition()->isDelegate()) + { + return classDefToDelegateString(cl->definition(), typeCtx, cpp11) + "&"; + } + else if(cl->isInterface() && !cl->isLocal()) { return "::std::shared_ptr<::Ice::Value>&"; } @@ -1556,14 +1423,6 @@ Slice::classDefToDelegateString(const ClassDefPtr& cl, int typeCtx, bool cpp11) string t = "::std::function<" + retS + " ("; - if(cpp11) - { - // inputTypeToString usually passes local operation values by - // reference. This is not the desired behavior for delegates - typeCtx &= ~TypeContextLocalOperation; - typeCtx |= TypeContextDelegate; - } - ParamDeclList paramList = cl->allOperations().front()->parameters(); for(ParamDeclList::iterator q = paramList.begin(); q != paramList.end(); ++q) { @@ -1580,6 +1439,5 @@ Slice::classDefToDelegateString(const ClassDefPtr& cl, int typeCtx, bool cpp11) } t += ")>"; - return t; } diff --git a/cpp/src/iceserviceinstall/.depend.mak b/cpp/src/iceserviceinstall/.depend.mak index 2dcbab7a06e..fef1c314c1f 100755 --- a/cpp/src/iceserviceinstall/.depend.mak +++ b/cpp/src/iceserviceinstall/.depend.mak @@ -34,7 +34,6 @@ ServiceInstaller.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ @@ -164,7 +163,6 @@ Install.obj: \ "$(includedir)\Ice\StreamHelpers.h" \ "$(includedir)\IceUtil\ScopedArray.h" \ "$(includedir)\IceUtil\Iterator.h" \ - "$(includedir)\Ice\Traits.h" \ "$(includedir)\IceUtil\Optional.h" \ "$(includedir)\IceUtil\UndefSysMacros.h" \ "$(includedir)\IceUtil\PopDisableWarnings.h" \ diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index c496fec26e4..105af99958e 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -484,7 +484,6 @@ Slice::Gen::generate(const UnitPtr& p) H << "\n#include "; H << "\n#include "; H << "\n#include "; - H << "\n#include "; H << "\n#include "; if(p->hasContentsWithMetaData("amd")) { @@ -497,9 +496,7 @@ Slice::Gen::generate(const UnitPtr& p) } else if(p->hasLocalClassDefsWithAsync()) { - H << "\n#include "; - H << "\n#include "; - C << "\n#include "; + H << "\n#include "; } else if(p->hasNonLocalClassDecls()) { @@ -591,11 +588,8 @@ Slice::Gen::generate(const UnitPtr& p) C << nl << "#ifdef ICE_CPP11_MAPPING // C++11 mapping"; C.restoreIndent(); { - Cpp11ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport); - p->visit(&proxyDeclVisitor, false); - - Cpp11ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport); - p->visit(&objectDeclVisitor, false); + Cpp11DeclVisitor declVisitor(H, C, _dllExport); + p->visit(&declVisitor, false); Cpp11TypesVisitor typesVisitor(H, C, _dllExport); p->visit(&typesVisitor, false); @@ -717,7 +711,7 @@ Slice::Gen::generate(const UnitPtr& p) generateChecksumMap(p); } - + H << sp; H.zeroIndent(); H << nl << "#endif"; @@ -886,7 +880,6 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) H << nl << "virtual ~" << name << "() throw();"; H << sp; - if(!p->isLocal()) { string initName = p->flattenedScope() + p->name() + "_init"; @@ -982,7 +975,7 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p) C << scoped.substr(2) << "::~" << name << "() throw()"; C << sb; C << eb; - + H << nl << "virtual ::std::string ice_id() const;"; C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_id() const"; C << sb; @@ -1537,7 +1530,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) string scope = fixKwd(p->scope()); string scoped = fixKwd(p->scoped()); ClassList bases = p->bases(); - + if(bases.size() > 1) { // @@ -1560,7 +1553,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) H.dec(); H << nl << "public:"; H.inc(); - + H << sp << nl << "virtual Object* __newInstance() const = 0;"; H << eb << ';'; } @@ -1599,8 +1592,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << _dllExport - << "::IceProxy::Ice::Object* ::IceProxy" << scope << "upCast(::IceProxy" << scoped - << "* p) { return p; }"; + << "::IceProxy::Ice::Object* ::IceProxy" << scope << "upCast(::IceProxy" << scoped << "* p) { return p; }"; C << sp; C << nl << "void" << nl << "::IceProxy" << scope << "__read(::Ice::InputStream* __is, " @@ -1956,8 +1948,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { C << nl << "__checkAsyncTwowayOnly(" << flatName << ");"; } - C << nl << "::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, "; - C << flatName << ", __del, __cookie);"; + C << nl << "::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::CallbackOutgoing(this, " << flatName + << ", __del, __cookie);"; C << nl << "try"; C << sb; C << nl << "__result->prepare(" << flatName << ", " << operationModeToString(p->sendMode()) << ", __ctx);"; @@ -1975,7 +1967,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) } C << nl << "__result->endWriteParams();"; } - C << nl << "__result->invoke();"; + C << nl << "__result->invoke(" << flatName << ");"; C << eb; C << nl << "catch(const ::Ice::Exception& __ex)"; C << sb; @@ -2774,8 +2766,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(preserved && !basePreserved) { C << sp; - C << nl << "void" << nl << scoped.substr(2) - << "::__write(::Ice::OutputStream* __os) const"; + C << nl << "void" << nl << scoped.substr(2) << "::__write(::Ice::OutputStream* __os) const"; C << sb; C << nl << "__os->startObject(__slicedData);"; C << nl << "__writeImpl(__os);"; @@ -2792,8 +2783,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) } C << sp; - C << nl << "void" << nl << scoped.substr(2) - << "::__writeImpl(::Ice::OutputStream* __os) const"; + C << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(::Ice::OutputStream* __os) const"; C << sb; C << nl << "__os->startSlice(ice_staticId(), " << p->compactId() << (!base ? ", true" : ", false") << ");"; writeMarshalUnmarshalDataMembers(C, p->dataMembers(), p->orderedOptionalDataMembers(), true); @@ -2824,13 +2814,13 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!p->isAbstract()) { string initName = p->flattenedScope() + p->name() + "_init"; - C << sp << nl << "const ::IceInternal::DefaultValueFactoryInit< " << scoped << "> " + C << nl << "const ::IceInternal::DefaultValueFactoryInit<" << scoped << "> " << initName << "(\"" << p->scoped() << "\");"; } if(p->compactId() >= 0) { string initName = p->flattenedScope() + p->name() + "_compactIdInit"; - C << sp << nl << "const ::IceInternal::CompactIdInit " + C << nl << "const ::IceInternal::CompactIdInit " << initName << "(\"" << p->scoped() << "\", " << p->compactId() << ");"; } C << nl << "}"; @@ -3067,7 +3057,7 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) paramsDeclAMD += "const ::Ice::Current& __current)"; argsAMD += "__current)"; - bool isConst = (p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const"); + string isConst = ((p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const")) ? " const" : ""; bool amd = !cl->isLocal() && (cl->hasMetaData("amd") || p->hasMetaData("amd")); string deprecateSymbol = getDeprecateSymbol(p, cl); @@ -3075,24 +3065,21 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) H << sp; if(!amd) { - H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params - << (isConst ? " const" : "") << " = 0;"; + H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << " = 0;"; } else { - H << nl << deprecateSymbol << "virtual void " << name << "_async" << paramsAMD - << (isConst ? " const" : "") << " = 0;"; + H << nl << deprecateSymbol << "virtual void " << name << "_async" << paramsAMD << isConst << " = 0;"; } if(!cl->isLocal()) { H << nl << "::Ice::DispatchStatus ___" << name - << "(::IceInternal::Incoming&, const ::Ice::Current&)" << (isConst ? " const" : "") << ';'; + << "(::IceInternal::Incoming&, const ::Ice::Current&)" << isConst << ';'; C << sp; C << nl << "::Ice::DispatchStatus" << nl << scope.substr(2) << "___" << name - << "(::IceInternal::Incoming& __inS"; - C << ", const ::Ice::Current& __current)" << (isConst ? " const" : ""); + << "(::IceInternal::Incoming& __inS" << ", const ::Ice::Current& __current)" << isConst; C << sb; if(!amd) { @@ -3343,7 +3330,7 @@ void Slice::Gen::ObjectVisitor::emitGCVisitCode(const TypePtr& p, const string& prefix, const string& name, int level) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(p); - if((builtin && + if((builtin && (BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindObject || BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindValue)) || ClassDeclPtr::dynamicCast(p)) { @@ -3930,38 +3917,38 @@ Slice::Gen::ImplVisitor::defaultValue(const TypePtr& type, const StringList& met else { ProxyPtr prx = ProxyPtr::dynamicCast(type); - + if(ProxyPtr::dynamicCast(type) || ClassDeclPtr::dynamicCast(type)) { return "0"; } - + StructPtr st = StructPtr::dynamicCast(type); if(st) { return fixKwd(st->scoped()) + "()"; } - + EnumPtr en = EnumPtr::dynamicCast(type); if(en) { EnumeratorList enumerators = en->getEnumerators(); return fixKwd(en->scope() + enumerators.front()->name()); } - + SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { return typeToString(seq, metaData, _useWstring, true) + "()"; } - + DictionaryPtr dict = DictionaryPtr::dynamicCast(type); if(dict) { return fixKwd(dict->scoped()) + "()"; } } - + assert(false); return "???"; } @@ -4022,7 +4009,8 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) { OperationPtr op = (*r); string opName = op->name(); - + string isConst = ((op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const")) ? " const" : ""; + string classScopedAMD = scope + "AMD_" + ClassDefPtr::dynamicCast(op->container())->name(); TypePtr ret = op->returnType(); @@ -4045,10 +4033,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } H << ',' << nl << "const Ice::Current&"; H.restoreIndent(); - - bool isConst = (op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const"); - - H << ")" << (isConst ? " const" : "") << ';'; + H << ")" << isConst << ';'; C << sp << nl << "void" << nl << scope << name << "I::" << opName << "_async("; C.useCurrentPosAsIndent(); @@ -4063,7 +4048,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } C << ',' << nl << "const Ice::Current& current"; C.restoreIndent(); - C << ")" << (isConst ? " const" : ""); + C << ")" << isConst; C << sb; string result = "r"; @@ -4126,9 +4111,9 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } H.restoreIndent(); - bool isConst = (op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const"); + string isConst = ((op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const")) ? " const" : ""; - H << ")" << (isConst ? " const" : "") << ';'; + H << ")" << isConst << ';'; C << sp << nl << retS << nl; C << scope.substr(2) << name << "I::" << fixKwd(opName) << '('; @@ -4160,7 +4145,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } C.restoreIndent(); C << ')'; - C << (isConst ? " const" : ""); + C << isConst; C << sb; if(ret) @@ -4960,7 +4945,7 @@ Slice::Gen::MetaDataVisitor::validate(const SyntaxTreeBasePtr& cont, const Strin { ClassDefPtr cl = ClassDefPtr::dynamicCast(cont); - if(cl && ((cpp && ss == "virtual") || + if(cl && ((cpp && ss == "virtual") || (cpp11 && cl->isLocal() && ss.find("type:") == 0) || (cl->isLocal() && ss == "comparable"))) { @@ -5039,60 +5024,159 @@ Slice::Gen::getHeaderExt(const string& file, const UnitPtr& unit) } // C++11 visitors -Slice::Gen::Cpp11ObjectDeclVisitor::Cpp11ObjectDeclVisitor(Output& h, Output& c, const string& dllExport) : +Slice::Gen::Cpp11DeclVisitor::Cpp11DeclVisitor(Output& h, Output& c, const string& dllExport) : H(h), C(c), _dllExport(dllExport) { } bool -Slice::Gen::Cpp11ObjectDeclVisitor::visitModuleStart(const ModulePtr& p) +Slice::Gen::Cpp11DeclVisitor::visitUnitStart(const UnitPtr& p) { - if(!p->hasClassDecls()) + if(!p->hasClassDecls() && !p->hasNonLocalExceptions()) { return false; } - - string name = fixKwd(p->name()); - - H << sp << nl << "namespace " << name << nl << '{'; C << sp << nl << "namespace" << nl << "{"; return true; } void -Slice::Gen::Cpp11ObjectDeclVisitor::visitModuleEnd(const ModulePtr&) +Slice::Gen::Cpp11DeclVisitor::visitUnitEnd(const UnitPtr& p) { - H << sp << nl << '}'; C << sp << nl << "}"; } +bool +Slice::Gen::Cpp11DeclVisitor::visitModuleStart(const ModulePtr& p) +{ + if(p->hasClassDecls()) + { + H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{' << sp; + } + return true; +} + void -Slice::Gen::Cpp11ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) +Slice::Gen::Cpp11DeclVisitor::visitModuleEnd(const ModulePtr& p) { - string t; - if(p->isLocal() && findMetaData("cpp11:type", p, t)) + if(p->hasClassDecls()) { - return; + H << sp << nl << '}'; } - if(p->definition() && p->definition()->isDelegate()) +} + +void +Slice::Gen::Cpp11DeclVisitor::visitClassDecl(const ClassDeclPtr& p) +{ + ClassDefPtr def = p->definition(); + if(def && def->isDelegate()) { return; } - string name = fixKwd(p->name()); - string scoped = fixKwd(p->scoped()); + H << nl << "class " << fixKwd(p->name()) << ';'; + if(p->isInterface() || (def && !def->allOperations().empty())) + { + H << nl << "class " << p->name() << "Prx;"; + } +} - H << sp << nl << "class " << name << ';'; +bool +Slice::Gen::Cpp11DeclVisitor::visitClassDefStart(const ClassDefPtr& p) +{ + if(p->isLocal()) + { + return false; + } + + if(!p->isInterface()) + { + C << sp; + + C << nl << "const ::IceInternal::DefaultValueFactoryInit<" << fixKwd(p->scoped()) << "> "; + C << p->flattenedScope() + p->name() + "_init" << "(\"" << p->scoped() << "\");"; + + if(p->compactId() >= 0) + { + string n = p->flattenedScope() + p->name() + "_compactIdInit "; + C << "const ::IceInternal::CompactIdInit " << n << "(\"" << p->scoped() << "\", " << p->compactId() << ");"; + } + } + + OperationList allOps = p->allOperations(); + if(p->isInterface() || !allOps.empty()) + { + C << sp; + + ClassList allBases = p->allBases(); + StringList ids; + transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); + StringList other; + other.push_back(p->scoped()); + other.push_back("::Ice::Object"); + other.sort(); + ids.merge(other); + ids.unique(); + + C << nl << "const ::std::string " << p->flattenedScope() << p->name() << "_ids[" << ids.size() << "] ="; + C << sb; + for(StringList::const_iterator r = ids.begin(); r != ids.end();) + { + C << nl << '"' << *r << '"'; + if(++r != ids.end()) + { + C << ','; + } + } + C << eb << ';'; + + StringList allOpNames; + transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); + allOpNames.push_back("ice_id"); + allOpNames.push_back("ice_ids"); + allOpNames.push_back("ice_isA"); + allOpNames.push_back("ice_ping"); + allOpNames.sort(); + allOpNames.unique(); + + C << nl << "const ::std::string " << p->flattenedScope() << p->name() << "_ops[] ="; + C << sb; + for(StringList::const_iterator q = allOpNames.begin(); q != allOpNames.end();) + { + C << nl << '"' << *q << '"'; + if(++q != allOpNames.end()) + { + C << ','; + } + } + C << eb << ';'; + } + + return true; +} + +bool +Slice::Gen::Cpp11DeclVisitor::visitExceptionStart(const ExceptionPtr& p) +{ + if(p->isLocal()) + { + return false; + } + + C << sp; + C << nl << "const ::IceInternal::DefaultUserExceptionFactoryInit<" << fixKwd(p->scoped()) << "> "; + C << p->flattenedScope() + p->name() + "_init" << "(\"" << p->scoped() << "\");"; + return false; } void -Slice::Gen::Cpp11ObjectDeclVisitor::visitOperation(const OperationPtr& p) +Slice::Gen::Cpp11DeclVisitor::visitOperation(const OperationPtr& p) { ClassDefPtr cl = ClassDefPtr::dynamicCast(p->container()); if(cl && !cl->isLocal()) { string flatName = p->flattenedScope() + p->name() + "_name"; - C << sp << nl << "const ::std::string " << flatName << " = \"" << p->name() << "\";"; + C << nl << "const ::std::string " << flatName << " = \"" << p->name() << "\";"; } } @@ -5110,9 +5194,7 @@ Slice::Gen::Cpp11TypesVisitor::visitModuleStart(const ModulePtr& p) } _useWstring = setUseWstring(p, _useWstringHist, _useWstring); - H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{'; - return true; } @@ -5120,7 +5202,6 @@ void Slice::Gen::Cpp11TypesVisitor::visitModuleEnd(const ModulePtr&) { H << sp << nl << '}'; - _useWstring = resetUseWstring(_useWstringHist); } @@ -5141,7 +5222,7 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) DataMemberList dataMembers = p->dataMembers(); DataMemberList allDataMembers = p->allDataMembers(); DataMemberList baseDataMembers; - + vector params; vector allTypes; vector allParamDecls; @@ -5186,11 +5267,10 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) H << nl << "public:"; H.inc(); - if(p->isLocal()) { - H << sp << nl << name << "(const char* __ice_file, int __ice_line) : " - << (base ? fixKwd(base->scoped()) : "::Ice::LocalException") << "(__ice_file, __ice_line)"; + H << sp << nl << name << "(const char* __ice_file, int __ice_line) : "; + H << (base ? fixKwd(base->scoped()) : "::Ice::LocalException") << "(__ice_file, __ice_line)"; H << sb; H << eb; } @@ -5232,7 +5312,7 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) H << ", "; } } - + for(DataMemberList::const_iterator q = baseDataMembers.begin(); q != baseDataMembers.end(); ++q) { if(q != baseDataMembers.begin()) @@ -5248,7 +5328,7 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) H << fixKwd("__ice_" + (*q)->name()); } } - + H << ")"; if(!dataMembers.empty()) { @@ -5286,24 +5366,17 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p) } H << sp; - - if(!p->isLocal()) - { - string initName = p->flattenedScope() + p->name() + "_init"; - - C << sp << nl << "namespace"; - C << nl << "{"; - - C << sp << nl << "const ::IceInternal::DefaultUserExceptionFactoryInit< " << scoped << "> " - << initName << "(\"" << p->scoped() << "\");"; - - C << sp << nl << "}"; - } - H << nl << "virtual ::std::string ice_id() const;"; C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_id() const"; C << sb; - C << nl << "return \"" << p->scoped() << "\";"; + if(p->isLocal()) + { + C << nl << "return \"" << p->scoped() << "\";" << ";"; + } + else + { + C << nl << "return " << p->flattenedScope() << p->name() << "_init.typeId" << ";"; + } C << eb; StringList metaData = p->getMetaData(); @@ -5352,25 +5425,23 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) ExceptionPtr base = p->base(); bool basePreserved = p->inheritsMetaData("preserve-slice"); bool preserved = p->hasMetaData("preserve-slice"); + string typeId = p->flattenedScope() + p->name() + "_init.typeId"; if(preserved && !basePreserved) { H << sp << nl << "virtual void __write(::Ice::OutputStream*) const;"; H << nl << "virtual void __read(::Ice::InputStream*);"; - - string baseName = base ? fixKwd(base->scoped()) : string("::Ice::UserException"); } H.dec(); H << sp << nl << "protected:"; H.inc(); - + H << sp; H << nl << "virtual void __writeImpl(::Ice::OutputStream*) const;"; H << nl << "virtual void __readImpl(::Ice::InputStream*);"; if(preserved && !basePreserved) { - H << sp << nl << "::std::shared_ptr<::Ice::SlicedData> __slicedData;"; C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(::Ice::OutputStream* __os) const"; @@ -5390,7 +5461,7 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) C << sp << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(::Ice::OutputStream* __os) const"; C << sb; - C << nl << "__os->startSlice(\"" << p->scoped() << "\", -1, " << (!base ? "true" : "false") << ");"; + C << nl << "__os->startSlice(" << typeId << ", -1, " << (!base ? "true" : "false") << ");"; writeMarshalUnmarshalDataMembers(C, p->dataMembers(), p->orderedOptionalDataMembers(), true); C << nl << "__os->endSlice();"; if(base) @@ -5541,7 +5612,7 @@ Slice::Gen::Cpp11TypesVisitor::visitSequence(const SequencePtr& p) { string name = fixKwd(p->name()); TypePtr type = p->type(); - int typeCtx = p->isLocal() ? (_useWstring | TypeContextLocalOperation) : _useWstring; + int typeCtx = p->isLocal() ? (_useWstring | TypeContextLocal) : _useWstring; string s = typeToString(type, p->typeMetaData(), typeCtx, true); StringList metaData = p->getMetaData(); @@ -5563,7 +5634,7 @@ Slice::Gen::Cpp11TypesVisitor::visitDictionary(const DictionaryPtr& p) { string name = fixKwd(p->name()); string dictType = findMetaData(p->getMetaData()); - int typeCtx = p->isLocal() ? (_useWstring | TypeContextLocalOperation) : _useWstring; + int typeCtx = p->isLocal() ? (_useWstring | TypeContextLocal) : _useWstring; if(dictType.empty()) { // @@ -5590,60 +5661,6 @@ Slice::Gen::Cpp11TypesVisitor::visitDictionary(const DictionaryPtr& p) } } -Slice::Gen::Cpp11ProxyDeclVisitor::Cpp11ProxyDeclVisitor(Output& h, Output&, const string& dllExport) : - H(h), _dllExport(dllExport) -{ -} - -bool -Slice::Gen::Cpp11ProxyDeclVisitor::visitUnitStart(const UnitPtr& p) -{ - if(!p->hasNonLocalClassDecls()) - { - return false; - } - return true; -} - -void -Slice::Gen::Cpp11ProxyDeclVisitor::visitUnitEnd(const UnitPtr&) -{ -} - -bool -Slice::Gen::Cpp11ProxyDeclVisitor::visitModuleStart(const ModulePtr& p) -{ - if(!p->hasNonLocalClassDecls()) - { - return false; - } - H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{'; - return true; -} - -void -Slice::Gen::Cpp11ProxyDeclVisitor::visitModuleEnd(const ModulePtr&) -{ - H << sp << nl << '}'; -} - -void -Slice::Gen::Cpp11ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p) -{ - if(!p->isLocal()) - { - string name = fixKwd(p->name()); - string scoped = fixKwd(p->scoped()); - - ClassDefPtr def = p->definition(); - if(p->isInterface() || (def && !def->allOperations().empty())) - { - H << nl << "class " << p->name() << "Prx;"; - } - } -} - - Slice::Gen::Cpp11ProxyVisitor::Cpp11ProxyVisitor(Output& h, Output& c, const string& dllExport) : H(h), C(c), _dllExport(dllExport), _useWstring(false) { @@ -5670,10 +5687,7 @@ Slice::Gen::Cpp11ProxyVisitor::visitModuleStart(const ModulePtr& p) _useWstring = setUseWstring(p, _useWstringHist, _useWstring); - string name = fixKwd(p->name()); - - H << sp << nl << "namespace " << name << nl << '{'; - + H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{'; return true; } @@ -5744,13 +5758,11 @@ Slice::Gen::Cpp11ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p) H.dec(); H << sp << nl << "protected: "; H.inc(); - H << nl << prx << "() = default;"; + H << sp << nl << prx << "() = default;"; H << nl << "friend ::std::shared_ptr<" << prx << "> IceInternal::createProxy<" << prx << ">();"; H << eb << ';'; string suffix = p->isInterface() ? "" : "Disp"; - - string scoped = fixKwd(p->scoped() + "Prx"); C << sp; @@ -5793,6 +5805,14 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) string returnValueS = "returnValue"; + bool lambdaOutParamsHasOpt = false; + if(ret) + { + lambdaOutParams.push_back(retS); + lambdaOutParamsDecl.push_back(retS + " returnValue"); + lambdaOutParamsHasOpt |= p->returnIsOptional(); + } + for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) { string paramName = fixKwd(paramPrefix + (*q)->name()); @@ -5811,7 +5831,6 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) typeString = inputTypeToString((*q)->type(), (*q)->optional(), metaData, _useWstring, true); } - if(!(*q)->isOutParam()) { params.push_back(typeString); @@ -5831,6 +5850,7 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) lambdaOutParams.push_back(typeString); lambdaOutParamsDecl.push_back(typeString + ' ' + paramName); + lambdaOutParamsHasOpt |= (*q)->optional(); outParams.push_back(*q); if((*q)->name() == "returnValue") @@ -5842,526 +5862,394 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) string scoped = fixKwd(cl->scope() + cl->name() + "Prx" + "::").substr(2); - string deprecateSymbol = getDeprecateSymbol(p, cl); - H << sp << nl << deprecateSymbol << retS << ' ' << fixKwd(name) << spar << paramsDecl - << "const ::Ice::Context& __ctx = Ice::noExplicitContext" << epar << ";"; - - C << sp; - C << nl << retS; - C << nl << scoped << fixKwd(p->name()) << spar << paramsDecl << "const ::Ice::Context& __ctx" << epar; - C << sb; - C << nl << "::std::promise<" << retS << "> __promise;"; - if(!p->returnsData()) - { - C << nl << "if(ice_isTwoway())"; - C << sb; - } - - C << nl << name << "_async("; - C.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end();) + string futureT; + if(lambdaOutParams.empty()) { - C << fixKwd(paramPrefix + (*q)->name()) << ","; - if(++q != inParams.end()) - { - C << " "; - } + futureT = "void"; } - if(!inParams.empty()) + else if(lambdaOutParams.size() == 1) { - C << nl; + futureT = lambdaOutParams[0]; } - C << "[&]("; - if(retS != "void") + else { - C << retS << " __ret"; + futureT = "Result_" + name; } - if(!outParams.empty()) + + if(lambdaOutParams.size() > 1) { - if(retS != "void") + // We need to generate a Result_ struct. + H << sp; + H << nl << "struct Result_" << name; + H << sb; + for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) { - C << ", "; + string typeString = typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); + H << nl << typeString << " " << fixKwd((*q)->name()) << ";"; } - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end();) + if(ret) { - C << typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) - << " " << "__o_" << (*q)->name(); - if(++q != outParams.end()) - { - C << ","; - } + H << nl << retS << " " << returnValueS << ";"; } + H << eb << ";"; } - C << ")"; - C << sb; - if(!outParams.empty()) + + string deprecateSymbol = getDeprecateSymbol(p, cl); + + // + // Synchronous operation + // + H << sp << nl << deprecateSymbol << retS << ' ' << fixKwd(name) << spar << paramsDecl; + H << "const ::Ice::Context& __ctx = Ice::noExplicitContext" << epar; + H << sb; + H << nl; + if(lambdaOutParams.size() == 1) { - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) + if(ret) { - C << nl << paramPrefix << (*q)->name() << " = "; - bool movable = isMovable((*q)->type()); - if(movable) - { - C << "::std::move("; - } - C << "__o_" << (*q)->name(); - if(movable) - { - C << ")"; - } - C << ";"; + H << "return "; + } + else + { + H << paramPrefix << (*outParams.begin())->name() << " = "; } } - C << nl << "__promise.set_value("; - if(retS != "void") - { - C << (isMovable(ret) ? "::std::move(__ret)" : "__ret"); - } - C << ");"; - C << eb << ","; - C << nl << "[&](::std::exception_ptr __ex)"; - C << sb; - C << nl << "__promise.set_exception(::std::move(__ex));"; - C << eb << ","; - C << nl << "nullptr, __ctx);"; - C.restoreIndent(); - C << nl; - if(retS != "void") + else if(lambdaOutParams.size() > 1) { - C << "return "; + H << "auto __result = "; } - C << "__promise.get_future().get();"; - - if(!p->returnsData()) + if(futureT == "void") { - C << eb; - C << nl << "else if(ice_isOneway() || ice_isDatagram())"; - C << sb; - - C << nl << name << "_async("; - C.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end();) + H << nl << "makePromiseOutgoing"; + } + else + { + H << nl << "makePromiseOutgoing<" << futureT << ">"; + } + H << spar << "true, this" << string("&" + scoped + "__" + name); + for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) + { + H << fixKwd(paramPrefix + (*q)->name()); + } + H << "__ctx" << epar << ".get();"; + if(lambdaOutParams.size() > 1) + { + for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) { - C << fixKwd(paramPrefix + (*q)->name()) << ","; - if(++q != inParams.end()) + H << nl << paramPrefix << (*q)->name() << " = "; + if(isMovable((*q)->type())) { - C << " "; + H << "::std::move(__result." << fixKwd((*q)->name()) << ");"; + } + else + { + H << "__result." << fixKwd((*q)->name()) << ";"; } } - if(!inParams.empty()) - { - C << nl; - } - C << "nullptr,"; - C << nl << "[&](::std::exception_ptr __ex)"; - C << sb; - C << nl << "__promise.set_exception(::std::move(__ex));"; - C << eb << ","; - C << nl << "[&](bool)"; - C << sb; - C << nl << "__promise.set_value();"; - C << eb << ","; - C << nl << "__ctx);"; - C.restoreIndent(); - C << nl << "__promise.get_future().get();"; - - C << eb; - C << nl << "else"; - C << sb; - C << nl << name << "_async("; - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) + if(ret) { - C << fixKwd(paramPrefix + (*q)->name()) << ","; + if(isMovable(ret)) + { + H << nl << "return ::std::move(__result." << returnValueS << ");"; + } + else + { + H << nl << "return __result." << returnValueS << ";"; + } } - C << " nullptr, nullptr, nullptr, __ctx);"; - C << nl << "__promise.set_value();"; - C << eb; } + H << eb; - C << eb; - + // + // Lambda based asynchronous operation + // H << sp; H << nl << "::std::function"; H << nl << name << "_async("; H.useCurrentPosAsIndent(); - for(vector::const_iterator i = lambdaParams.begin(); i != lambdaParams.end();) + if(!lambdaParamsDecl.empty()) { - H << *i << ","; - if(++i != lambdaParams.end()) + for(vector::const_iterator q = lambdaParamsDecl.begin(); q != lambdaParamsDecl.end(); ++q) { - H << " "; + H << *q << ", "; } - } - if(!lambdaParams.empty()) - { H << nl; } - H << "::std::function __response,"; + H << nl << "::std::function __ex = nullptr,"; + H << nl << "::std::function __sent = nullptr,"; + H << nl << "const ::Ice::Context& __ctx = Ice::noExplicitContext)"; + H.restoreIndent(); + H << sb; + if(lambdaOutParams.size() > 1) { - H << retS; - if(!lambdaOutParams.empty()) + H << nl << "auto __responseCb = [__response](" << futureT << "&& result)"; + H << sb; + H << nl << "__response" << spar; + if(ret) { - H << ", "; + if(isMovable(ret)) + { + H << "::std::move(result." + returnValueS + ")"; + } + else + { + H << "result." + returnValueS; + } } - } - for(vector::const_iterator i = lambdaOutParams.begin(); i != lambdaOutParams.end();) - { - H << (*i); - if(++i != lambdaOutParams.end()) + for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) { - H << ", "; + if(isMovable((*q)->type())) + { + H << "::std::move(result." + fixKwd((*q)->name()) + ")"; + } + else + { + H << "result." + fixKwd((*q)->name()); + } } + H << epar << ";" << eb << ";"; } - H << ")>,"; - H << nl << "::std::function __exception = nullptr," - << nl << "::std::function __sent = nullptr," - << nl << "const ::Ice::Context& __ctx = Ice::noExplicitContext);"; - H.restoreIndent(); - - C << sp; - C << nl << "::std::function"; - C << nl << scoped << fixKwd(p->name() + "_async") << "("; - C.useCurrentPosAsIndent(); - for(vector::const_iterator i = lambdaParamsDecl.begin(); i != lambdaParamsDecl.end();) + if(futureT == "void") { - C << *i << ","; - if(++i != lambdaParamsDecl.end()) - { - C << " "; - } + H << nl << "return makeLambdaOutgoing" << spar; } - if(!lambdaParamsDecl.empty()) + else { - C << nl; + H << nl << "return makeLambdaOutgoing<" << futureT << ">" << spar; } - C << "::std::function 1 ? "__responseCb" : "__response") << "__ex" << "__sent" << "this"; + H << string("&" + scoped + "__" + name); + for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) { - C << retS; - if(!lambdaOutParams.empty()) - { - C << ", "; - } + H << fixKwd(paramPrefix + (*q)->name()); } - for(vector::const_iterator i = lambdaOutParams.begin(); i != lambdaOutParams.end();) + H << "__ctx" << epar << ";"; + H << eb; + + // + // Promise based asynchronous operation + // + H << sp; + H << nl << "template class P = ::std::promise>"; + H << nl << deprecateSymbol << "auto " << name << "_async" << spar << futureParamsDecl; + H << "const ::Ice::Context& __ctx = Ice::noExplicitContext" << epar; + H.inc(); + H << nl << "-> decltype(::std::declval>().get_future())"; + H.dec(); + H << sb; + if(futureT == "void") { - C << (*i); - if(++i != lambdaOutParams.end()) - { - C << ", "; - } + H << nl << "return makePromiseOutgoing

" << spar; } - C << ")> __response,"; - C << nl << "::std::function __exception," - << nl << "::std::function __sent," - << nl << "const ::Ice::Context& __ctx)"; - C.restoreIndent(); + else + { + H << nl << "return makePromiseOutgoing<" << futureT << ", P>" << spar; + } + H << "false, this" << string("&" + scoped + "__" + name); + for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) + { + H << fixKwd(paramPrefix + (*q)->name()); + } + H << "__ctx" << epar << ";"; + H << eb; + + // + // Private implementation + // + H << sp; + H << nl << "void __" << name << spar; + H << "const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<" + futureT + ">>&"; + H << lambdaParams; + H << "const ::Ice::Context& = Ice::noExplicitContext"; + H << epar << ";"; + + C << sp; + C << nl << "void" << nl << scoped << "__" << name << spar; + C << "const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<" + futureT + ">>& __outAsync"; + C << lambdaParamsDecl << "const ::Ice::Context& __ctx"; + C << epar; C << sb; - C << nl << "return ::IceInternal::" << (p->returnsData() ? "Twoway" : "Oneway") << "ClosureCallback::invoke("; + if(p->returnsData()) + { + C << nl << "__checkAsyncTwowayOnly(" << flatName << ");"; + } + C << nl << "__outAsync->invoke(" << flatName << ", "; + C << operationModeToString(p->sendMode(), true) << ", " << opFormatTypeToString(p) << ", __ctx, "; C.inc(); - C << nl << flatName << ", shared_from_this(), " - << operationModeToString(p->sendMode(), true) << ", " - << opFormatTypeToString(p) << ","; + C << nl; if(inParams.empty()) { - C << " nullptr,"; + C << "nullptr"; } else { - C << nl << "[&](::Ice::OutputStream* __os)"; + C << "[&](::Ice::OutputStream* __os)"; C << sb; writeMarshalCode(C, inParams, 0, true, TypeContextInParam); if(p->sendsClasses(false)) { C << nl << "__os->writePendingObjects();"; } - C << eb << ","; + C << eb; } + C << "," << nl; - if(p->returnsData()) + ExceptionList throws = p->throws(); + if(throws.empty()) { - if(ret || !outParams.empty()) + C << "nullptr"; + } + else + { + throws.sort(); + throws.unique(); + + // + // Arrange exceptions into most-derived to least-derived order. If we don't + // do this, a base exception handler can appear before a derived exception + // handler, causing compiler warnings and resulting in the base exception + // being marshaled instead of the derived exception. + // + throws.sort(Slice::DerivedToBaseCompare()); + + C << "[](const ::Ice::UserException& __ex)"; + C << sb; + C << nl << "try"; + C << sb; + C << nl << "__ex.ice_throw();"; + C << eb; + // + // Generate a catch block for each legal user exception. + // + for(ExceptionList::const_iterator i = throws.begin(); i != throws.end(); ++i) { - C << nl << "false" << ","; - C << nl << "[__response](::Ice::InputStream* __is)"; - C << sb; - writeAllocateCode(C, outParams, p, true, _useWstring | TypeContextAMIEnd | TypeContextReadClosure, true); - writeUnmarshalCode(C, outParams, p, true, _useWstring | TypeContextAMIEnd); - if(p->returnsClasses(false)) - { - C << nl << "__is->readPendingObjects();"; - } - C << nl << "__is->endEncapsulation();"; - C << nl << "if(__response)"; - C << sb; - C << nl << "try"; + string scoped = (*i)->scoped(); + C << nl << "catch(const " << fixKwd((*i)->scoped()) << "&)"; C << sb; - C << nl << "__response("; - if(ret) + C << nl << "throw;"; + C << eb; + } + C << nl << "catch(const ::Ice::UserException&)"; + C << sb; + C << eb; + C << eb; + } + + if(lambdaOutParams.size() > 1) + { + // + // Generate a read method if there are more than one ret/out parameter. If there's + // only one, we rely on the default read method from LambdaOutgoing. + // + C << "," << nl << "[&](::Ice::InputStream* __is)"; + C << sb; + C << nl << futureT << " v;"; + ParamDeclList optionals; + for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) + { + if((*q)->optional()) { - C << (isMovable(ret) ? "::std::move(__ret)" : "__ret"); - if(!outParams.empty()) - { - C << ", "; - } + optionals.push_back(*q); } - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end();) + else { - string p = fixKwd(paramPrefix + (*q)->name()); - C << (isMovable((*q)->type()) ? ("::std::move(" + p + ")") : p); - if(++q != outParams.end()) - { - C << ","; - } + string name = "v." + fixKwd((*q)->name()); + writeMarshalUnmarshalCode(C, (*q)->type(), false, 0, name, false, (*q)->getMetaData()); } - C << ");"; - C << eb; - C << nl << "catch(...)"; - C << sb; - C << nl << "throw std::current_exception();"; - C << eb; - C << eb; - C << eb << ","; } - else + if(ret && !retIsOpt) { - C << nl << "true" << ","; - C << nl << "[__response](::Ice::InputStream*)"; - C << sb; - C << nl << "if(__response)"; - C << sb; - C << nl << "try"; - C << sb; - C << nl << "__response();"; - C << eb; - C << nl << "catch(...)"; - C << sb; - C << nl << "throw std::current_exception();"; - C << eb; - C << eb; - C << eb << ","; + string name = "v." + returnValueS; + writeMarshalUnmarshalCode(C, ret, false, 0, name, false, p->getMetaData()); } - ExceptionList throws = p->throws(); - if(!throws.empty()) + // + // Sort optional parameters by tag. + // + class SortFn { - throws.sort(); - throws.unique(); - - // - // Arrange exceptions into most-derived to least-derived order. If we don't - // do this, a base exception handler can appear before a derived exception - // handler, causing compiler warnings and resulting in the base exception - // being marshaled instead of the derived exception. - // - -#if defined(__SUNPRO_CC) - throws.sort(derivedToBaseCompare); -#else - throws.sort(Slice::DerivedToBaseCompare()); -#endif - C << nl << "[](const ::Ice::UserException& __ex)"; - C << sb; - C << nl << "try"; - C << sb; - C << nl << "__ex.ice_throw();"; - C << eb; - // - // Generate a catch block for each legal user exception. - // - for(ExceptionList::const_iterator i = throws.begin(); i != throws.end(); ++i) + public: + static bool compare(const ParamDeclPtr& lhs, const ParamDeclPtr& rhs) { - string scoped = (*i)->scoped(); - C << nl << "catch(const " << fixKwd((*i)->scoped()) << "&)"; - C << sb; - C << nl << "throw;"; - C << eb; + return lhs->tag() < rhs->tag(); } - C << nl << "catch(const ::Ice::UserException&)"; - C << sb; - C << eb; - C << eb << ","; - } - else - { - C << nl << "nullptr, "; - } - } - else - { - C << nl << "__response,"; - } - C << nl << "::std::move(__exception), ::std::move(__sent), __ctx);"; - C.dec(); - C << eb; - - string futureT; - - if(retS == "void" && outParams.empty()) - { - futureT = "void"; - } - else if(outParams.empty()) - { - futureT = retS; - } - else if(retS == "void" && outParams.size() == 1) - { - ParamDeclPtr param = outParams.front(); - futureT = typeToString(param->type(), param->optional(), param->getMetaData(), _useWstring, true); - } - else - { - futureT = "Result_" + name; - } + }; + optionals.sort(SortFn::compare); - if(futureT.find("Result_") == 0) - { - // We need to generate a Result_ struct. - H << sp; - H << nl << "struct Result_" << name; - H << sb; - if(retS != "void") + // + // Marshal optional parameters. + // + bool checkReturnType = ret && retIsOpt; + for(ParamDeclList::const_iterator q = optionals.begin(); q != optionals.end(); ++q) { - H << nl << retS << " " << returnValueS << ";"; + if(checkReturnType && p->returnTag() < (*q)->tag()) + { + string name = "v." + returnValueS; + writeMarshalUnmarshalCode(C, ret, true, p->returnTag(), name, false, p->getMetaData()); + checkReturnType = false; + } + string name = "v." + fixKwd((*q)->name()); + writeMarshalUnmarshalCode(C, (*q)->type(), true, (*q)->tag(), name, false, (*q)->getMetaData()); } - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) + if(checkReturnType) { - H << nl << typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) - << " " << (*q)->name() << ";"; + string name = "v." + returnValueS; + writeMarshalUnmarshalCode(C, ret, true, p->returnTag(), name, false, p->getMetaData()); } - H << eb << ";"; - } - - H << sp; - H << nl << "template class P = ::std::promise>"; - H << nl << deprecateSymbol << "auto " << name << "_async" << spar << futureParamsDecl - << "const ::Ice::Context& __ctx = Ice::noExplicitContext" << epar; - H.inc(); - H << nl << "-> decltype(::std::declval>().get_future())"; - H.dec(); - H << sb; - H << nl << "using Promise = P<" << futureT << ">;"; - H << nl << "auto __promise = ::std::make_shared();"; - if(!p->returnsData()) - { - H << nl << "if(ice_isTwoway())"; - H << sb; - } - H << nl << name << "_async("; - H.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end();) - { - H << fixKwd(paramPrefix + (*q)->name()) << ","; - if(++q != inParams.end()) + if(p->returnsClasses(false)) { - H << " "; + C << nl << "__is->readPendingObjects();"; } + C << nl << "return v;"; + C << eb; } - if(!inParams.empty()) - { - H << nl; - } - H << "[__promise]("; - - if(retS != "void") + else if(lambdaOutParamsHasOpt) { - H << retS << " __ret"; - if(!lambdaOutParams.empty()) + // + // If there's only one optional ret/out parameter, we still need to generate + // a read method, we can't rely on the default read method which wouldn't + // known which tag to use. + // + C << "," << nl << "[&](::Ice::InputStream* __is)"; + C << sb; + C << nl << futureT << " v;"; + if(p->returnIsOptional()) { - H << ", "; + writeMarshalUnmarshalCode(C, ret, true, p->returnTag(), "v", false, p->getMetaData()); } - } - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end();) - { - H << typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) - << " " << paramPrefix << (*q)->name(); - if(++q != outParams.end()) + else { - H << ","; + assert(outParams.size() == 1); + ParamDeclPtr q = (*outParams.begin()); + writeMarshalUnmarshalCode(C, q->type(), true, q->tag(), "v", false, q->getMetaData()); } + C << nl << "return v;"; + C << eb; } - H << ")"; - H << sb; - if(retS == "void" && outParams.empty()) - { - H << nl << "__promise->set_value();"; - } - else if(outParams.empty()) - { - H << nl << "__promise->set_value(" << (isMovable(ret) ? "::std::move(__ret)" : "__ret") << ");"; - } - else if(retS == "void" && outParams.size() == 1) - { - H << nl << "__promise->set_value(" << paramPrefix << outParams.front()->name() << ");"; - } - else + else if(p->returnsClasses(false)) { - H << nl << "Result_" << name << " __result;"; - if(retS != "void") + C << "," << nl << "[&](::Ice::InputStream* __is)"; + C << sb; + C << nl << futureT << " v;"; + if(ret) { - H << nl << "__result." << returnValueS << " = " << (isMovable(ret) ? "::std::move(__ret)" : "__ret") << ";"; + writeMarshalUnmarshalCode(C, ret, false, 0, "v", false, p->getMetaData()); } - for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) + else { - H << nl << "__result." << (*q)->name() << " = " - << (isMovable((*q)->type()) ? ("::std::move(" + paramPrefix + (*q)->name() + ")") : (paramPrefix + (*q)->name())) - << ";"; + assert(outParams.size() == 1); + ParamDeclPtr q = (*outParams.begin()); + writeMarshalUnmarshalCode(C, q->type(), false, 0, "v", false, q->getMetaData()); } - H << nl << "__promise->set_value(::std::move(__result));"; + C << nl << "__is->readPendingObjects();"; + C << nl << "return v;"; + C << eb; } - H << eb << ","; - H << nl << "[__promise](::std::exception_ptr __ex)"; - H << sb; - H << nl << "__promise->set_exception(::std::move(__ex));"; - H << eb << ","; - H << nl << "nullptr, __ctx);"; - H.restoreIndent(); - - if(!p->returnsData()) - { - H << eb; - H << nl << "else if(ice_isOneway() || ice_isDatagram())"; - H << sb; - - H << nl << name << "_async("; - H.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end();) - { - H << fixKwd(paramPrefix + (*q)->name()) << ","; - if(++q != inParams.end()) - { - H << " "; - } - } - H << nl << "nullptr,"; - H << nl << "[__promise](::std::exception_ptr __ex)"; - H << sb; - H << nl << "__promise->set_exception(::std::move(__ex));"; - H << eb << ","; - H << nl << "[__promise](bool)"; - H << sb; - H << nl << "__promise->set_value();"; - H << eb << ","; - H << nl << "__ctx);"; - H.restoreIndent(); - - H << eb; - H << nl << "else"; - H << sb; - H << nl << name << "_async("; - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) - { - H << fixKwd(paramPrefix + (*q)->name()) << ","; - } - H << "nullptr, nullptr, nullptr, __ctx);"; - H << eb; - } + C.dec(); - H << nl << "return __promise->get_future();"; - H << eb; + C << ");" << eb; } void @@ -6437,7 +6325,7 @@ Slice::Gen::Cpp11ObjectVisitor::emitDataMember(const DataMemberPtr& p) { string name = fixKwd(p->name()); H << sp << nl << typeToString(p->type(), p->optional(), p->getMetaData(), _useWstring, true) << ' ' << name; - + string defaultValue = p->defaultValue(); if(!defaultValue.empty()) { @@ -6495,12 +6383,6 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p) { return false; } - string t; - if(findMetaData("cpp11:type:", p->getMetaData(), t)) - { - H << sp << "typedef " << t << " " << fixKwd(p->name()) << ";"; - return false; - } if(p->isDelegate()) { return false; @@ -6678,8 +6560,9 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p) string scoped = fixKwd(p->scoped()); string scope = fixKwd(p->scope()); + int typeCtx = _useWstring | TypeContextLocal; TypePtr ret = p->returnType(); - string retS = returnTypeToString(ret, p->returnIsOptional(), p->getMetaData(), _useWstring | TypeContextLocalOperation, true); + string retS = returnTypeToString(ret, p->returnIsOptional(), p->getMetaData(), typeCtx, true); string params = "("; string paramsDecl = "("; @@ -6702,12 +6585,12 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p) if(isOutParam) { outParams.push_back(*q); - typeString = outputTypeToString(type, (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextLocalOperation, true); + typeString = outputTypeToString(type, (*q)->optional(), (*q)->getMetaData(), typeCtx, true); } else { inParams.push_back(*q); - typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextLocalOperation, true); + typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), typeCtx, true); } if(q != paramList.begin()) @@ -6725,7 +6608,7 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p) if(isOutParam) { - outDecls.push_back(inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextLocalOperation, true)); + outDecls.push_back(typeString); } } @@ -6733,13 +6616,12 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p) paramsDecl += ')'; args += ')'; - bool isConst = (p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const"); + string isConst = ((p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const")) ? " const" : ""; string deprecateSymbol = getDeprecateSymbol(p, cl); H << sp; - H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params - << (isConst ? " const" : "") << " = 0;"; + H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << " = 0;"; if(cl->hasMetaData("async-oneway") || p->hasMetaData("async-oneway")) { @@ -6755,7 +6637,7 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitOperation(const OperationPtr& p) string typeString; if(!(*r)->isOutParam()) { - typeString = inputTypeToString((*r)->type(), (*r)->optional(), metaData, _useWstring | TypeContextLocalOperation, true); + typeString = inputTypeToString((*r)->type(), (*r)->optional(), metaData, typeCtx, true); paramsDeclAMI.push_back(typeString + ' ' + paramName); } } @@ -6905,16 +6787,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList allBases = p->allBases(); StringList ids; -#if defined(__IBMCPP__) && defined(NDEBUG) - // - // VisualAge C++ 6.0 does not see that ClassDef is a Contained, - // when inlining is on. The code below issues a warning: better - // than an error! - // - transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); -#else transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped)); -#endif StringList other; other.push_back(p->scoped()); other.push_back("::Ice::Object"); @@ -6927,50 +6800,27 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefStart(const ClassDefPtr& p) StringList::difference_type scopedPos = IceUtilInternal::distance(firstIter, scopedIter); H << sp; - H << nl << "virtual bool ice_isA" - << "(::std::string, const ::Ice::Current& = ::Ice::noExplicitCurrent) const;"; - H << nl << "virtual ::std::vector< ::std::string> ice_ids" - << "(const ::Ice::Current& = ::Ice::noExplicitCurrent) const;"; + H << nl << "virtual bool ice_isA(::std::string, const ::Ice::Current& = ::Ice::noExplicitCurrent) const;"; + H << nl << "virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::noExplicitCurrent) const;"; H << nl << "virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::noExplicitCurrent) const;"; H << nl << "static const ::std::string& ice_staticId();"; - string flatName = p->flattenedScope() + p->name() + (p->isInterface() ? "" : "Disp") + "_ids"; - - C << sp << nl << "namespace"; - C << nl << "{"; - C << nl << "const ::std::string " << flatName << '[' << ids.size() << "] ="; - C << sb; - - for(StringList::const_iterator r = ids.begin(); r != ids.end();) - { - C << nl << '"' << *r << '"'; - if(++r != ids.end()) - { - C << ','; - } - } - - C << eb << ';'; - C << sp << nl << "}"; + string flatName = p->flattenedScope() + p->name() + "_ids"; C << sp; - C << nl << "bool" << nl << scoped.substr(2) - << "::ice_isA(::std::string _s, const ::Ice::Current&) const"; + C << nl << "bool" << nl << scoped.substr(2) << "::ice_isA(::std::string _s, const ::Ice::Current&) const"; C << sb; C << nl << "return ::std::binary_search(" << flatName << ", " << flatName << " + " << ids.size() << ", _s);"; C << eb; C << sp; - C << nl << "::std::vector< ::std::string>" << nl << scoped.substr(2) - << "::ice_ids(const ::Ice::Current&) const"; + C << nl << "::std::vector< ::std::string>" << nl << scoped.substr(2) << "::ice_ids(const ::Ice::Current&) const"; C << sb; - C << nl << "return ::std::vector< ::std::string>(&" << flatName << "[0], &" << flatName - << '[' << ids.size() << "]);"; + C << nl << "return ::std::vector< ::std::string>(&" << flatName << "[0], &" << flatName << '[' << ids.size() << "]);"; C << eb; C << sp; - C << nl << "const ::std::string&" << nl << scoped.substr(2) - << "::ice_id(const ::Ice::Current&) const"; + C << nl << "const ::std::string&" << nl << scoped.substr(2) << "::ice_id(const ::Ice::Current&) const"; C << sb; C << nl << "return " << flatName << '[' << scopedPos << "];"; C << eb; @@ -6978,8 +6828,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefStart(const ClassDefPtr& p) C << sp; C << nl << "const ::std::string&" << nl << scoped.substr(2) << "::ice_staticId()"; C << sb; - C << nl << "static const ::std::string typeId = \"" << *scopedIter << "\";"; - C << nl << "return typeId;"; + C << nl << "return " << flatName << '[' << scopedPos << "];"; C << eb; return true; } @@ -7003,16 +6852,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!allOps.empty()) { StringList allOpNames; -#if defined(__IBMCPP__) && defined(NDEBUG) -// -// See comment for transform above -// - transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), - ::IceUtil::constMemFun(&Contained::name)); -#else - transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), - ::IceUtil::constMemFun(&Contained::name)); -#endif + transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), ::IceUtil::constMemFun(&Contained::name)); allOpNames.push_back("ice_id"); allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); @@ -7020,38 +6860,21 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefEnd(const ClassDefPtr& p) allOpNames.sort(); allOpNames.unique(); - H << sp; - H << nl - << "virtual ::Ice::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&);"; + string flatName = p->flattenedScope() + p->name() + "_ops"; - string flatName = p->flattenedScope() + name + "_all"; - C << sp << nl << "namespace"; - C << nl << "{"; - C << nl << "const ::std::string " << flatName << "[] ="; - C << sb; + H << sp; + H << nl << "virtual ::Ice::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&);"; - for(StringList::const_iterator q = allOpNames.begin(); q != allOpNames.end();) - { - C << nl << '"' << *q << '"'; - if(++q != allOpNames.end()) - { - C << ','; - } - } - C << eb << ';'; - C << sp << nl << "}"; C << sp; C << nl << "::Ice::DispatchStatus" << nl << scoped.substr(2) - << "::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)"; + << "::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& c)"; C << sb; C << nl << "::std::pair< const ::std::string*, const ::std::string*> r = " - << "::std::equal_range(" << flatName << ", " << flatName << " + " << allOpNames.size() - << ", current.operation);"; + << "::std::equal_range(" << flatName << ", " << flatName << " + " << allOpNames.size() << ", c.operation);"; C << nl << "if(r.first == r.second)"; C << sb; - C << nl << "throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, " - << "current.facet, current.operation);"; + C << nl << "throw ::Ice::OperationNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation);"; C << eb; C << sp; C << nl << "switch(r.first - " << flatName << ')'; @@ -7061,28 +6884,14 @@ Slice::Gen::Cpp11InterfaceVisitor::visitClassDefEnd(const ClassDefPtr& p) { C << nl << "case " << i++ << ':'; C << sb; - C << nl << "return ___" << *q << "(in, current);"; + C << nl << "return ___" << *q << "(in, c);"; C << eb; } C << eb; C << sp; C << nl << "assert(false);"; - C << nl << "throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, " - << "current.facet, current.operation);"; + C << nl << "throw ::Ice::OperationNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation);"; C << eb; - - // - // Check if we need to generate ice_operationAttributes() - // - map attributesMap; - for(OperationList::iterator r = allOps.begin(); r != allOps.end(); ++r) - { - int attributes = (*r)->attributes(); - if(attributes != 0) - { - attributesMap.insert(map::value_type((*r)->name(), attributes)); - } - } } H << eb << ';'; @@ -7145,7 +6954,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) else { inParams.push_back(*q); - typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); + typeString = typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); } if(q != paramList.begin()) @@ -7180,7 +6989,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) paramsAMD += ", "; argsAMD += ", "; } - paramsAMD += inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); + paramsAMD += typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); if(isMovable((*q)->type())) { argsAMD += "::std::move(" + fixKwd(string(paramPrefix) + (*q)->name()) + ")"; @@ -7193,7 +7002,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) if(ret) { - string typeString = inputTypeToString(ret, p->returnIsOptional(), p->getMetaData(), _useWstring | TypeContextAMD, true); + string typeString = inputTypeToString(ret, p->returnIsOptional(), p->getMetaData(), _useWstring, true); responseParams = typeString; responseParamsDecl = typeString + " __ret"; if(!outParams.empty()) @@ -7210,13 +7019,12 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) responseParams += ", "; responseParamsDecl += ", "; } - string paramName = fixKwd(string(paramPrefix) + (*q)->name()); - string typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextAMD, true); + string typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); responseParams += typeString; - responseParamsDecl += typeString + " " + paramName; + responseParamsDecl += typeString + " " + fixKwd(string(paramPrefix) + (*q)->name()); } - bool isConst = (p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const"); + string isConst = ((p->mode() == Operation::Nonmutating) || p->hasMetaData("cpp:const")) ? " const" : ""; bool amd = (cl->hasMetaData("amd") || p->hasMetaData("amd")); ExceptionList throws = p->throws(); @@ -7239,8 +7047,7 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) H << sp; if(!amd) { - H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params - << (isConst ? " const" : "") << " = 0;"; + H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << isConst << " = 0;"; } else { @@ -7252,25 +7059,23 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) H << "," << nl; } H << "::std::function," << nl - << "::std::function, const Ice::Current&)" - << (isConst ? " const" : "") << " = 0;"; + << "::std::function, const Ice::Current&)" << isConst << " = 0;"; H.restoreIndent(); } H << sp; - H << nl << "::Ice::DispatchStatus ___" << name << "(::IceInternal::Incoming&, const ::Ice::Current&)" - << (isConst ? " const" : "") << ';'; + H << nl << "::Ice::DispatchStatus ___" << name << "(::IceInternal::Incoming&, const ::Ice::Current&)" << isConst << ';'; C << sp; C << nl << "::Ice::DispatchStatus" << nl << scope.substr(2) << "___" << name << "(::IceInternal::Incoming& __inS" - << ", const ::Ice::Current& __current)" << (isConst ? " const" : ""); + << ", const ::Ice::Current& __current)" << isConst; C << sb; C << nl << "__checkMode(" << operationModeToString(p->mode(), true) << ", __current.mode);"; if(!inParams.empty()) { C << nl << "::Ice::InputStream* __is = __inS.startReadParams();"; - writeAllocateCode(C, inParams, 0, true, _useWstring | TypeContextInParam | TypeContextReadClosure, true); + writeAllocateCode(C, inParams, 0, true, _useWstring | TypeContextInParam, true); writeUnmarshalCode(C, inParams, 0, true, TypeContextInParam); if(p->sendsClasses(false)) { @@ -7507,6 +7312,7 @@ Slice::Gen::Cpp11ValueVisitor::visitClassDefEnd(const ClassDefPtr& p) string scoped = fixKwd(p->scoped()); string scope = fixKwd(p->scope()); string name = fixKwd(p->name()); + string typeId = p->flattenedScope() + p->name() + "_init.typeId"; ClassList bases = p->bases(); ClassDefPtr base; if(!bases.empty() && !bases.front()->isInterface()) @@ -7526,15 +7332,14 @@ Slice::Gen::Cpp11ValueVisitor::visitClassDefEnd(const ClassDefPtr& p) H.dec(); H << sp << nl << "protected:"; H.inc(); - + H << sp; H << nl << "virtual void __writeImpl(::Ice::OutputStream*) const;"; H << nl << "virtual void __readImpl(::Ice::InputStream*);"; if(preserved && !basePreserved) { C << sp; - C << nl << "void" << nl << scoped.substr(2) - << "::__write(::Ice::OutputStream* __os) const"; + C << nl << "void" << nl << scoped.substr(2) << "::__write(::Ice::OutputStream* __os) const"; C << sb; C << nl << "__os->startObject(__slicedData);"; C << nl << "__writeImpl(__os);"; @@ -7551,10 +7356,9 @@ Slice::Gen::Cpp11ValueVisitor::visitClassDefEnd(const ClassDefPtr& p) } C << sp; - C << nl << "void" << nl << scoped.substr(2) - << "::__writeImpl(::Ice::OutputStream* __os) const"; + C << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(::Ice::OutputStream* __os) const"; C << sb; - C << nl << "__os->startSlice(ice_staticId(), " << p->compactId() << (!base ? ", true" : ", false") << ");"; + C << nl << "__os->startSlice(" << typeId << ", " << p->compactId() << (!base ? ", true" : ", false") << ");"; writeMarshalUnmarshalDataMembers(C, p->dataMembers(), p->orderedOptionalDataMembers(), true); C << nl << "__os->endSlice();"; if(base) @@ -7578,25 +7382,9 @@ Slice::Gen::Cpp11ValueVisitor::visitClassDefEnd(const ClassDefPtr& p) C << sp; C << nl << "const ::std::string&" << nl << scoped.substr(2) << "::ice_staticId()"; C << sb; - C << nl << "static const ::std::string typeId = \"" << p->scoped() << "\";"; - C << nl << "return typeId;"; + C << nl << "return " << typeId << ";"; C << eb; - C << sp << nl << "namespace"; - C << nl << "{"; - - string initName = p->flattenedScope() + p->name() + "_init"; - C << sp << nl << "const ::IceInternal::DefaultValueFactoryInit< " << scoped << "> " - << initName << "(\"" << p->scoped() << "\");"; - - if(p->compactId() >= 0) - { - string initName = p->flattenedScope() + p->name() + "_compactIdInit"; - C << sp << nl << "const ::IceInternal::CompactIdInit " - << initName << "(\"" << p->scoped() << "\", " << p->compactId() << ");"; - } - C << nl << "}"; - // // Emit data members. Access visibility may be specified by metadata. // @@ -7790,8 +7578,7 @@ bool Slice::Gen::Cpp11StreamVisitor::visitModuleStart(const ModulePtr& m) { if(!m->hasNonLocalContained(Contained::ContainedTypeStruct) && - !m->hasNonLocalContained(Contained::ContainedTypeEnum) && - !m->hasNonLocalContained(Contained::ContainedTypeException)) + !m->hasNonLocalContained(Contained::ContainedTypeEnum)) { return false; } @@ -7804,10 +7591,12 @@ Slice::Gen::Cpp11StreamVisitor::visitModuleStart(const ModulePtr& m) H << sp; H << nl << "namespace Ice" << nl << '{'; - C << sp; - C << nl << "namespace Ice" << nl << '{'; + if(m->hasNonLocalContained(Contained::ContainedTypeStruct)) + { + C << sp; + C << nl << "namespace Ice" << nl << '{'; + } } - return true; } @@ -7820,95 +7609,75 @@ Slice::Gen::Cpp11StreamVisitor::visitModuleEnd(const ModulePtr& m) // Only emit this for the top-level module. // H << nl << '}'; - C << nl << '}'; - } -} - -bool -Slice::Gen::Cpp11StreamVisitor::visitExceptionStart(const ExceptionPtr& p) -{ - if(!p->isLocal()) - { - string scoped = p->scoped(); - H << nl << "template<>"; - H << nl << "struct StreamableTraits< " << fixKwd(scoped) << ">"; - H << sb; - H << nl << "static const StreamHelperCategory helper = StreamHelperCategoryUserException;"; - H << eb << ";" << nl; + if(m->hasNonLocalContained(Contained::ContainedTypeStruct)) + { + C << nl << '}'; + } } - return false; } bool Slice::Gen::Cpp11StreamVisitor::visitStructStart(const StructPtr& p) { - if(!p->isLocal()) + if(p->isLocal()) { - string scoped = fixKwd(p->scoped()); - - H << nl << "template<>"; - - H << nl << "struct StreamableTraits< " << scoped << ">"; + return false; + } - H << sb; - H << nl << "static const StreamHelperCategory helper = StreamHelperCategoryStruct;"; + string scoped = fixKwd(p->scoped()); - H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; - if(p->isVariableLength()) - { - H << nl << "static const bool fixedLength = false;"; - } - else - { - H << nl << "static const bool fixedLength = true;"; - } - H << eb << ";" << nl; + H << nl << "template<>"; + H << nl << "struct StreamableTraits< " << scoped << ">"; + H << sb; + H << nl << "static const StreamHelperCategory helper = StreamHelperCategoryStruct;"; + H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; + H << nl << "static const bool fixedLength = " << (p->isVariableLength() ? "false" : "true") << ";"; + H << eb << ";" << nl; - DataMemberList dataMembers = p->dataMembers(); + DataMemberList dataMembers = p->dataMembers(); - H << nl << "template"; - H << nl << "struct StreamWriter< " << scoped << ", S>"; - H << sb; - H << nl << "static void write(S* __os, const " << scoped << "& v)"; - H << sb; - for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) - { - writeMarshalUnmarshalDataMemberInHolder(H, "v.", *q, true); - } - H << eb; - H << eb << ";" << nl; + H << nl << "template"; + H << nl << "struct StreamWriter<" << scoped << ", S>"; + H << sb; + H << nl << "static void write(S* __os, const " << scoped << "& v)"; + H << sb; + for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) + { + writeMarshalUnmarshalDataMemberInHolder(H, "v.", *q, true); + } + H << eb; + H << eb << ";" << nl; - H << nl << "template"; - H << nl << "struct StreamReader< " << scoped << ", S>"; - H << sb; - H << nl << "static void read(S* __is, " << scoped << "& v)"; - H << sb; - for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) - { - writeMarshalUnmarshalDataMemberInHolder(H, "v.", *q, false); - } - H << eb; - H << eb << ";" << nl; + H << nl << "template"; + H << nl << "struct StreamReader<" << scoped << ", S>"; + H << sb; + H << nl << "static void read(S* __is, " << scoped << "& v)"; + H << sb; + for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) + { + writeMarshalUnmarshalDataMemberInHolder(H, "v.", *q, false); + } + H << eb; + H << eb << ";" << nl; - if(!_dllExport.empty()) - { - // - // We tell "importers" that the implementation exports these instantiations - // - H << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined("; - H << _dllExport.substr(0, _dllExport.size() - 1) + "_EXPORTS) && !defined(ICE_STATIC_LIBS)"; - H << nl << "template struct " << _dllExport << "StreamWriter< " << scoped << ", ::Ice::OutputStream>;"; - H << nl << "template struct " << _dllExport << "StreamReader< " << scoped << ", ::Ice::InputStream>;"; - H << nl << "#endif" << nl; + if(!_dllExport.empty()) + { + // + // We tell "importers" that the implementation exports these instantiations + // + H << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined("; + H << _dllExport.substr(0, _dllExport.size() - 1) + "_EXPORTS) && !defined(ICE_STATIC_LIBS)"; + H << nl << "template struct " << _dllExport << "StreamWriter< " << scoped << ", ::Ice::OutputStream>;"; + H << nl << "template struct " << _dllExport << "StreamReader< " << scoped << ", ::Ice::InputStream>;"; + H << nl << "#endif" << nl; - // - // The instantations: - // - C << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(ICE_STATIC_LIBS)"; - C << nl << "template struct " << _dllExport << "StreamWriter< " << scoped << ", ::Ice::OutputStream>;"; - C << nl << "template struct " << _dllExport << "StreamReader< " << scoped << ", ::Ice::InputStream>;"; - C << nl << "#endif"; - } + // + // The instantations: + // + C << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(ICE_STATIC_LIBS)"; + C << nl << "template struct " << _dllExport << "StreamWriter< " << scoped << ", ::Ice::OutputStream>;"; + C << nl << "template struct " << _dllExport << "StreamReader< " << scoped << ", ::Ice::InputStream>;"; + C << nl << "#endif"; } return false; } @@ -7962,11 +7731,6 @@ Slice::Gen::Cpp11CompatibilityVisitor::visitModuleEnd(const ModulePtr&) void Slice::Gen::Cpp11CompatibilityVisitor::visitClassDecl(const ClassDeclPtr& p) { - string t; - if(p->isLocal() && findMetaData("cpp11:type", p, t)) - { - return; - } if(p->definition() && p->definition()->isDelegate()) { return; @@ -8033,38 +7797,38 @@ Slice::Gen::Cpp11ImplVisitor::defaultValue(const TypePtr& type, const StringList else { ProxyPtr prx = ProxyPtr::dynamicCast(type); - + if(ProxyPtr::dynamicCast(type) || ClassDeclPtr::dynamicCast(type)) { return "nullptr"; } - + StructPtr st = StructPtr::dynamicCast(type); if(st) { return fixKwd(st->scoped()) + "()"; } - + EnumPtr en = EnumPtr::dynamicCast(type); if(en) { EnumeratorList enumerators = en->getEnumerators(); return fixKwd(en->scoped() + "::" + enumerators.front()->name()); } - + SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { return typeToString(seq, metaData, _useWstring, true) + "()"; } - + DictionaryPtr dict = DictionaryPtr::dynamicCast(type); if(dict) { return fixKwd(dict->scoped()) + "()"; } } - + assert(false); return "???"; } @@ -8120,7 +7884,7 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) H << nl << "class " << name << "I : "; H.useCurrentPosAsIndent(); H << "public virtual "; - + if(p->isInterface() || p->isLocal()) { H << fixKwd(name); @@ -8145,7 +7909,7 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) TypePtr ret = op->returnType(); string retS = returnTypeToString(ret, op->returnIsOptional(), op->getMetaData(), _useWstring, true); - + ParamDeclList params = op->parameters(); ParamDeclList outParams; ParamDeclList inParams; @@ -8168,18 +7932,16 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) H << sp << nl << "virtual void " << opName << "_async("; H.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) { - H << inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) - << "," << nl; + H << typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) << "," << nl; } - + if(ret) { - string typeString = inputTypeToString(ret, op->returnIsOptional(), op->getMetaData(), _useWstring | TypeContextAMD, true); - responseParams = typeString; - responseParamsDecl = typeString + " __ret"; + string typeS = inputTypeToString(ret, op->returnIsOptional(), op->getMetaData(), _useWstring, true); + responseParams = typeS; + responseParamsDecl = typeS + " __ret"; if(!outParams.empty()) { responseParams += ", "; @@ -8194,31 +7956,29 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) responseParams += ", "; responseParamsDecl += ", "; } - string paramName = fixKwd(string(paramPrefix) + (*q)->name()); - string typeString = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring | TypeContextAMD, true); - responseParams += typeString; - responseParamsDecl += typeString + " " + paramName; + string typeS = inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); + responseParams += typeS; + responseParamsDecl += typeS + " " + fixKwd(string(paramPrefix) + (*q)->name()); } - bool isConst = (op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const"); + string isConst = ((op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const")) ? " const" : ""; H << "std::function,"; H << nl << "std::function,"; - H << nl << "const Ice::Current&)" << (isConst ? " const" : "") << ';'; + H << nl << "const Ice::Current&)" << isConst << ';'; H.restoreIndent(); - C << sp << nl << "void" << nl << scope << name << "I::" << fixKwd(opName + "_async") << "("; + C << sp << nl << "void" << nl << scope << name << "I::" << opName << "_async("; C.useCurrentPosAsIndent(); - for(ParamDeclList::const_iterator q = inParams.begin(); q != inParams.end(); ++q) { - C << inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true) - << ' ' << fixKwd((*q)->name()) << "," << nl; + C << typeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), _useWstring, true); + C << ' ' << fixKwd((*q)->name()) << "," << nl; } C << "std::function " << opName << "_response,"; C << nl << "std::function,"; - C << nl << "const Ice::Current& current)" << (isConst ? " const" : ""); + C << nl << "const Ice::Current& current)" << isConst; C.restoreIndent(); C << sb; @@ -8268,7 +8028,7 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - typeString = inputTypeToString((*q)->type(), (*q)->optional(), metaData, _useWstring, true); + typeString = typeToString((*q)->type(), (*q)->optional(), metaData, _useWstring, true); } H << typeString; } @@ -8282,9 +8042,9 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } H.restoreIndent(); - bool isConst = (op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const"); + string isConst = ((op->mode() == Operation::Nonmutating) || op->hasMetaData("cpp:const")) ? " const" : ""; - H << ")" << (isConst ? " const" : "") << ';'; + H << ")" << isConst << ';'; C << sp << nl << retS << nl; C << scope.substr(2) << name << "I::" << fixKwd(opName) << '('; @@ -8304,7 +8064,7 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - C << inputTypeToString((*q)->type(), (*q)->optional(), metaData, _useWstring, true)<< " /*" + C << typeToString((*q)->type(), (*q)->optional(), metaData, _useWstring, true)<< " /*" << fixKwd((*q)->name()) << "*/"; } } @@ -8318,9 +8078,9 @@ Slice::Gen::Cpp11ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } C.restoreIndent(); C << ')'; - C << (isConst ? " const" : ""); + C << isConst; C << sb; - + for(ParamDeclList::const_iterator q = outParams.begin(); q != outParams.end(); ++q) { C << nl << fixKwd((*q)->name()) << " = " << defaultValue((*q)->type(), op->getMetaData()) << ";"; diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index 03944065a74..45a1a577019 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -341,15 +341,19 @@ private: // // C++11 Visitors // - class Cpp11ObjectDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor + class Cpp11DeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: - Cpp11ObjectDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&); + Cpp11DeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&); + virtual bool visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); virtual void visitClassDecl(const ClassDeclPtr&); + virtual bool visitClassDefStart(const ClassDefPtr&); + virtual bool visitExceptionStart(const ExceptionPtr&); virtual void visitOperation(const OperationPtr&); private: @@ -557,7 +561,6 @@ private: virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); virtual bool visitStructStart(const StructPtr&); - virtual bool visitExceptionStart(const ExceptionPtr&); virtual void visitEnum(const EnumPtr&); private: @@ -583,7 +586,7 @@ private: ::IceUtilInternal::Output& H; std::string _dllExport; }; - + class Cpp11ImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor { public: @@ -607,7 +610,7 @@ private: // Generate code to return a dummy value // void writeReturn(::IceUtilInternal::Output&, const TypePtr&, const StringList&); - + // // Get the default value returned for a type // -- cgit v1.2.3