zeroc-ice 3.7.11 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (895) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Communicator.cpp +159 -376
  3. data/dist/IceRuby/Communicator.h +8 -9
  4. data/dist/IceRuby/Config.h +23 -89
  5. data/dist/IceRuby/Connection.cpp +111 -219
  6. data/dist/IceRuby/Connection.h +8 -12
  7. data/dist/IceRuby/DefaultSliceLoader.cpp +45 -0
  8. data/dist/IceRuby/DefaultSliceLoader.h +25 -0
  9. data/dist/IceRuby/Endpoint.cpp +63 -65
  10. data/dist/IceRuby/Endpoint.h +7 -11
  11. data/dist/IceRuby/ImplicitContext.cpp +26 -31
  12. data/dist/IceRuby/ImplicitContext.h +6 -10
  13. data/dist/IceRuby/Init.cpp +27 -40
  14. data/dist/IceRuby/Logger.cpp +23 -28
  15. data/dist/IceRuby/Logger.h +8 -12
  16. data/dist/IceRuby/Operation.cpp +177 -219
  17. data/dist/IceRuby/Operation.h +15 -18
  18. data/dist/IceRuby/Properties.cpp +133 -89
  19. data/dist/IceRuby/Properties.h +6 -10
  20. data/dist/IceRuby/Proxy.cpp +179 -649
  21. data/dist/IceRuby/Proxy.h +11 -12
  22. data/dist/IceRuby/RubySliceLoader.cpp +39 -0
  23. data/dist/IceRuby/RubySliceLoader.h +27 -0
  24. data/dist/IceRuby/Slice.cpp +88 -94
  25. data/dist/IceRuby/Slice.h +3 -7
  26. data/dist/IceRuby/Types.cpp +987 -1190
  27. data/dist/IceRuby/Types.h +390 -461
  28. data/dist/IceRuby/Util.cpp +214 -473
  29. data/dist/IceRuby/Util.h +378 -479
  30. data/dist/ice/cpp/include/Ice/AsyncResponseHandler.h +85 -0
  31. data/dist/ice/cpp/include/Ice/BatchRequest.h +39 -0
  32. data/dist/ice/cpp/include/Ice/BatchRequestQueueF.h +4 -10
  33. data/dist/ice/cpp/include/Ice/Buffer.h +116 -111
  34. data/dist/ice/cpp/include/Ice/Communicator.h +411 -0
  35. data/dist/ice/cpp/include/Ice/CommunicatorF.h +16 -0
  36. data/dist/ice/cpp/include/Ice/Config.h +46 -62
  37. data/dist/ice/cpp/include/Ice/Connection.h +410 -0
  38. data/dist/ice/cpp/include/Ice/ConnectionF.h +36 -0
  39. data/dist/ice/cpp/include/Ice/ConnectionIF.h +6 -28
  40. data/dist/ice/cpp/include/Ice/CtrlCHandler.h +56 -0
  41. data/dist/ice/cpp/include/Ice/Current.h +60 -0
  42. data/dist/ice/cpp/include/Ice/DefaultSliceLoader.h +160 -0
  43. data/dist/ice/cpp/include/Ice/Demangle.h +17 -0
  44. data/dist/ice/cpp/include/Ice/Endpoint.h +298 -0
  45. data/dist/ice/cpp/include/Ice/EndpointF.h +44 -0
  46. data/dist/ice/cpp/include/Ice/EndpointSelectionType.h +21 -0
  47. data/dist/ice/cpp/include/Ice/Exception.h +46 -151
  48. data/dist/ice/cpp/include/Ice/FacetMap.h +16 -0
  49. data/dist/ice/cpp/include/Ice/Format.h +11 -27
  50. data/dist/ice/cpp/include/Ice/Ice.h +53 -48
  51. data/dist/ice/cpp/include/Ice/IconvStringConverter.h +165 -326
  52. data/dist/ice/cpp/include/Ice/ImplicitContext.h +76 -0
  53. data/dist/ice/cpp/include/Ice/IncomingRequest.h +75 -0
  54. data/dist/ice/cpp/include/Ice/Initialize.h +113 -927
  55. data/dist/ice/cpp/include/Ice/InputStream.h +748 -1320
  56. data/dist/ice/cpp/include/Ice/InstanceF.h +4 -10
  57. data/dist/ice/cpp/include/Ice/Instrumentation.h +319 -0
  58. data/dist/ice/cpp/include/Ice/LocalException.h +58 -0
  59. data/dist/ice/cpp/include/Ice/LocalExceptions.h +870 -0
  60. data/dist/ice/cpp/include/Ice/Logger.h +62 -0
  61. data/dist/ice/cpp/include/Ice/LoggerUtil.h +124 -147
  62. data/dist/ice/cpp/include/Ice/MarshaledResult.h +50 -0
  63. data/dist/ice/cpp/include/Ice/NativePropertiesAdmin.h +41 -71
  64. data/dist/ice/cpp/include/Ice/Object.h +151 -490
  65. data/dist/ice/cpp/include/Ice/ObjectAdapter.h +324 -0
  66. data/dist/ice/cpp/include/Ice/ObjectAdapterF.h +16 -0
  67. data/dist/ice/cpp/include/Ice/ObjectF.h +5 -19
  68. data/dist/ice/cpp/include/Ice/ObserverHelper.h +115 -132
  69. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +392 -748
  70. data/dist/ice/cpp/include/Ice/OutgoingResponse.h +129 -0
  71. data/dist/ice/cpp/include/Ice/OutputStream.h +756 -956
  72. data/dist/ice/cpp/include/Ice/Plugin.h +73 -0
  73. data/dist/ice/cpp/include/Ice/PluginFactory.h +77 -0
  74. data/dist/ice/cpp/include/{IceUtil → Ice}/PopDisableWarnings.h +8 -6
  75. data/dist/ice/cpp/include/Ice/Properties.h +307 -0
  76. data/dist/ice/cpp/include/Ice/PropertiesF.h +19 -0
  77. data/dist/ice/cpp/include/Ice/Proxy.h +665 -5094
  78. data/dist/ice/cpp/include/Ice/ProxyF.h +2 -44
  79. data/dist/ice/cpp/include/Ice/ProxyFunctions.h +209 -0
  80. data/dist/ice/cpp/include/Ice/PushDisableWarnings.h +29 -0
  81. data/dist/ice/cpp/include/Ice/ReferenceF.h +4 -19
  82. data/dist/ice/cpp/include/Ice/RequestHandlerF.h +8 -18
  83. data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +276 -0
  84. data/dist/ice/cpp/include/Ice/SSL/Config.h +54 -0
  85. data/dist/ice/cpp/include/Ice/SSL/ConnectionInfo.h +107 -0
  86. data/dist/ice/cpp/include/Ice/SSL/ConnectionInfoF.h +39 -0
  87. data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +40 -0
  88. data/dist/ice/cpp/include/Ice/SSL/SSLException.h +32 -0
  89. data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +286 -0
  90. data/dist/ice/cpp/include/Ice/ServantLocator.h +51 -0
  91. data/dist/ice/cpp/include/Ice/Service.h +182 -342
  92. data/dist/ice/cpp/include/Ice/SliceLoader.h +67 -0
  93. data/dist/ice/cpp/include/Ice/SlicedData.h +113 -160
  94. data/dist/ice/cpp/include/Ice/SlicedDataF.h +17 -27
  95. data/dist/ice/cpp/include/Ice/StreamHelpers.h +532 -1070
  96. data/dist/ice/cpp/include/Ice/StreamableTraits.h +291 -0
  97. data/dist/ice/cpp/include/Ice/StringConverter.h +152 -63
  98. data/dist/ice/cpp/include/Ice/StringUtil.h +114 -0
  99. data/dist/ice/cpp/include/Ice/TimerTask.h +24 -0
  100. data/dist/ice/cpp/include/Ice/TupleCompare.h +103 -0
  101. data/dist/ice/cpp/include/Ice/UUID.h +6 -9
  102. data/dist/ice/cpp/include/Ice/UserException.h +46 -0
  103. data/dist/ice/cpp/include/Ice/UserExceptionFactory.h +4 -79
  104. data/dist/ice/cpp/include/Ice/Value.h +103 -115
  105. data/dist/ice/cpp/include/Ice/ValueF.h +6 -11
  106. data/dist/ice/cpp/include/IceDiscovery/IceDiscovery.h +16 -1877
  107. data/dist/ice/cpp/include/IceLocatorDiscovery/IceLocatorDiscovery.h +16 -1185
  108. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +46 -146
  109. data/dist/ice/cpp/include/generated/Ice/Context.h +40 -0
  110. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +49 -93
  111. data/dist/ice/cpp/include/generated/Ice/Identity.h +70 -226
  112. data/dist/ice/cpp/include/generated/Ice/Locator.h +494 -3850
  113. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +443 -0
  114. data/dist/ice/cpp/include/generated/Ice/Metrics.h +937 -4603
  115. data/dist/ice/cpp/include/generated/Ice/OperationMode.h +73 -0
  116. data/dist/ice/cpp/include/generated/Ice/Process.h +197 -929
  117. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +249 -1301
  118. data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +39 -0
  119. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +637 -2620
  120. data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +94 -0
  121. data/dist/ice/cpp/include/generated/Ice/Router.h +429 -1783
  122. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +18 -65
  123. data/dist/ice/cpp/include/generated/Ice/Version.h +73 -318
  124. data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +498 -0
  125. data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +387 -0
  126. data/dist/ice/cpp/src/Ice/Acceptor.h +28 -24
  127. data/dist/ice/cpp/src/Ice/AcceptorF.h +6 -14
  128. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories.h +16 -0
  129. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +43 -0
  130. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_min.cpp +17 -0
  131. data/dist/ice/cpp/src/Ice/ArgVector.cpp +17 -18
  132. data/dist/ice/cpp/src/Ice/ArgVector.h +19 -25
  133. data/dist/ice/cpp/src/Ice/Base64.cpp +66 -66
  134. data/dist/ice/cpp/src/Ice/Base64.h +14 -19
  135. data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +70 -121
  136. data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +37 -47
  137. data/dist/ice/cpp/src/Ice/Buffer.cpp +73 -41
  138. data/dist/ice/cpp/src/Ice/CheckIdentity.h +21 -0
  139. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +215 -249
  140. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +38 -60
  141. data/dist/ice/cpp/src/Ice/Communicator.cpp +399 -0
  142. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +140 -0
  143. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.h +39 -0
  144. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +63 -184
  145. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +30 -51
  146. data/dist/ice/cpp/src/Ice/ConnectRequestHandlerF.h +4 -14
  147. data/dist/ice/cpp/src/Ice/Connection.cpp +44 -0
  148. data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +578 -792
  149. data/dist/ice/cpp/src/Ice/ConnectionFactory.h +200 -200
  150. data/dist/ice/cpp/src/Ice/ConnectionFactoryF.h +6 -19
  151. data/dist/ice/cpp/src/Ice/ConnectionI.cpp +1674 -1782
  152. data/dist/ice/cpp/src/Ice/ConnectionI.h +333 -293
  153. data/dist/ice/cpp/src/Ice/ConnectionOptions.h +22 -0
  154. data/dist/ice/cpp/src/Ice/Connector.h +25 -19
  155. data/dist/ice/cpp/src/Ice/ConnectorF.h +4 -11
  156. data/dist/ice/cpp/src/{IceUtil → Ice}/ConsoleUtil.cpp +32 -53
  157. data/dist/ice/cpp/src/Ice/ConsoleUtil.h +79 -0
  158. data/dist/ice/cpp/src/Ice/CtrlCHandler.cpp +189 -0
  159. data/dist/ice/cpp/src/Ice/Current.cpp +29 -0
  160. data/dist/ice/cpp/src/Ice/DLLMain.cpp +25 -35
  161. data/dist/ice/cpp/src/Ice/DefaultSliceLoader.cpp +39 -0
  162. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +41 -119
  163. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.h +27 -41
  164. data/dist/ice/cpp/src/Ice/DefaultsAndOverridesF.h +4 -11
  165. data/dist/ice/cpp/src/Ice/Demangle.cpp +26 -0
  166. data/dist/ice/cpp/src/Ice/DisableWarnings.h +31 -0
  167. data/dist/ice/cpp/src/Ice/DynamicLibrary.cpp +44 -112
  168. data/dist/ice/cpp/src/Ice/DynamicLibrary.h +91 -0
  169. data/dist/ice/cpp/src/Ice/Endian.h +40 -0
  170. data/dist/ice/cpp/src/Ice/EndpointFactory.cpp +35 -59
  171. data/dist/ice/cpp/src/Ice/EndpointFactory.h +82 -103
  172. data/dist/ice/cpp/src/Ice/EndpointFactoryF.h +4 -11
  173. data/dist/ice/cpp/src/Ice/EndpointFactoryManager.cpp +54 -87
  174. data/dist/ice/cpp/src/Ice/EndpointFactoryManager.h +28 -33
  175. data/dist/ice/cpp/src/Ice/EndpointFactoryManagerF.h +4 -11
  176. data/dist/ice/cpp/src/Ice/EndpointI.cpp +53 -23
  177. data/dist/ice/cpp/src/Ice/EndpointI.h +132 -200
  178. data/dist/ice/cpp/src/Ice/EndpointIF.h +11 -39
  179. data/dist/ice/cpp/src/Ice/EventHandler.cpp +3 -26
  180. data/dist/ice/cpp/src/Ice/EventHandler.h +46 -56
  181. data/dist/ice/cpp/src/Ice/EventHandlerF.h +4 -14
  182. data/dist/ice/cpp/src/Ice/Exception.cpp +3 -816
  183. data/dist/ice/cpp/src/Ice/FileUtil.cpp +476 -0
  184. data/dist/ice/cpp/src/Ice/FileUtil.h +152 -0
  185. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +34 -0
  186. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +29 -0
  187. data/dist/ice/cpp/src/Ice/HashUtil.h +46 -32
  188. data/dist/ice/cpp/src/Ice/HttpParser.cpp +431 -431
  189. data/dist/ice/cpp/src/Ice/HttpParser.h +95 -100
  190. data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +207 -324
  191. data/dist/ice/cpp/src/Ice/IPEndpointI.h +80 -126
  192. data/dist/ice/cpp/src/Ice/IPEndpointIF.h +6 -17
  193. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +172 -0
  194. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +89 -0
  195. data/dist/ice/cpp/src/Ice/ImplicitContext.cpp +109 -0
  196. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +66 -0
  197. data/dist/ice/cpp/src/Ice/Initialize.cpp +48 -542
  198. data/dist/ice/cpp/src/Ice/InputStream.cpp +848 -1385
  199. data/dist/ice/cpp/src/Ice/Instance.cpp +816 -827
  200. data/dist/ice/cpp/src/Ice/Instance.h +202 -212
  201. data/dist/ice/cpp/src/Ice/InstrumentationI.cpp +526 -661
  202. data/dist/ice/cpp/src/Ice/InstrumentationI.h +171 -192
  203. data/dist/ice/cpp/src/Ice/LocalException.cpp +518 -0
  204. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +577 -0
  205. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +291 -329
  206. data/dist/ice/cpp/src/Ice/LocatorInfo.h +144 -157
  207. data/dist/ice/cpp/src/Ice/LocatorInfoF.h +8 -17
  208. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +561 -743
  209. data/dist/ice/cpp/src/Ice/LoggerAdminI.h +18 -28
  210. data/dist/ice/cpp/src/Ice/LoggerI.cpp +66 -91
  211. data/dist/ice/cpp/src/Ice/LoggerI.h +36 -41
  212. data/dist/ice/cpp/src/Ice/LoggerMiddleware.cpp +176 -0
  213. data/dist/ice/cpp/src/Ice/LoggerMiddleware.h +42 -0
  214. data/dist/ice/cpp/src/Ice/LoggerUtil.cpp +14 -38
  215. data/dist/ice/cpp/src/Ice/MarshaledResult.cpp +20 -0
  216. data/dist/ice/cpp/src/Ice/MetricsAdminI.cpp +194 -280
  217. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +600 -0
  218. data/dist/ice/cpp/src/Ice/MetricsFunctional.h +92 -0
  219. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +587 -0
  220. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +185 -0
  221. data/dist/ice/cpp/src/Ice/Network.cpp +595 -917
  222. data/dist/ice/cpp/src/Ice/Network.h +189 -213
  223. data/dist/ice/cpp/src/Ice/NetworkF.h +2 -10
  224. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +99 -104
  225. data/dist/ice/cpp/src/Ice/NetworkProxy.h +49 -54
  226. data/dist/ice/cpp/src/Ice/NetworkProxyF.h +4 -11
  227. data/dist/ice/cpp/src/Ice/OSLogLoggerI.cpp +16 -18
  228. data/dist/ice/cpp/src/Ice/OSLogLoggerI.h +22 -27
  229. data/dist/ice/cpp/src/Ice/Object.cpp +152 -338
  230. data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +170 -113
  231. data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.h +41 -41
  232. data/dist/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +4 -15
  233. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +580 -727
  234. data/dist/ice/cpp/src/Ice/ObjectAdapterI.h +149 -145
  235. data/dist/ice/cpp/src/Ice/ObserverHelper.cpp +36 -17
  236. data/dist/ice/cpp/src/Ice/ObserverMiddleware.cpp +96 -0
  237. data/dist/ice/cpp/src/Ice/ObserverMiddleware.h +25 -0
  238. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +147 -187
  239. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.h +56 -64
  240. data/dist/ice/cpp/src/{IceUtil → Ice}/Options.cpp +187 -258
  241. data/dist/ice/cpp/src/Ice/Options.h +119 -0
  242. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +516 -732
  243. data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +276 -0
  244. data/dist/ice/cpp/src/Ice/OutputStream.cpp +610 -543
  245. data/dist/ice/cpp/src/Ice/OutputUtil.cpp +344 -0
  246. data/dist/ice/cpp/src/Ice/OutputUtil.h +173 -0
  247. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +118 -277
  248. data/dist/ice/cpp/src/Ice/PluginManagerI.h +41 -48
  249. data/dist/ice/cpp/src/Ice/Properties.cpp +931 -0
  250. data/dist/ice/cpp/src/Ice/PropertyNames.cpp +519 -1341
  251. data/dist/ice/cpp/src/Ice/PropertyNames.h +49 -64
  252. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +103 -0
  253. data/dist/ice/cpp/src/Ice/PropertyUtil.h +31 -0
  254. data/dist/ice/cpp/src/Ice/Protocol.cpp +129 -94
  255. data/dist/ice/cpp/src/Ice/Protocol.h +116 -0
  256. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +117 -62
  257. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +63 -82
  258. data/dist/ice/cpp/src/Ice/ProtocolInstanceF.h +4 -11
  259. data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +10 -32
  260. data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.h +25 -54
  261. data/dist/ice/cpp/src/Ice/Proxy.cpp +294 -1357
  262. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +684 -0
  263. data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +90 -0
  264. data/dist/ice/cpp/src/Ice/PushDisableDeprecatedWarnings.h +15 -0
  265. data/dist/ice/cpp/src/Ice/Random.cpp +29 -0
  266. data/dist/ice/cpp/src/Ice/Random.h +23 -0
  267. data/dist/ice/cpp/src/Ice/Reference.cpp +635 -1097
  268. data/dist/ice/cpp/src/Ice/Reference.h +314 -298
  269. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +320 -378
  270. data/dist/ice/cpp/src/Ice/ReferenceFactory.h +48 -66
  271. data/dist/ice/cpp/src/Ice/ReferenceFactoryF.h +4 -9
  272. data/dist/ice/cpp/src/Ice/RequestHandler.cpp +15 -24
  273. data/dist/ice/cpp/src/Ice/RequestHandler.h +43 -68
  274. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +76 -0
  275. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +33 -0
  276. data/dist/ice/cpp/src/Ice/ResourceConfig.h +27 -0
  277. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +51 -57
  278. data/dist/ice/cpp/src/Ice/RetryQueue.h +39 -46
  279. data/dist/ice/cpp/src/Ice/RetryQueueF.h +4 -9
  280. data/dist/ice/cpp/src/Ice/RouterInfo.cpp +97 -201
  281. data/dist/ice/cpp/src/Ice/RouterInfo.h +61 -118
  282. data/dist/ice/cpp/src/Ice/RouterInfoF.h +6 -14
  283. data/dist/ice/cpp/src/Ice/SHA1.cpp +86 -60
  284. data/dist/ice/cpp/src/Ice/SHA1.h +35 -0
  285. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +89 -0
  286. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +87 -0
  287. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +521 -0
  288. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +40 -0
  289. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngineF.h +13 -0
  290. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +646 -0
  291. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +80 -0
  292. data/dist/ice/cpp/src/{IceSSL → Ice/SSL}/RFC2253.cpp +85 -88
  293. data/dist/ice/cpp/src/Ice/SSL/RFC2253.h +58 -0
  294. data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.cpp +124 -0
  295. data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.h +52 -0
  296. data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.cpp +92 -0
  297. data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.h +38 -0
  298. data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +377 -0
  299. data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.h +84 -0
  300. data/dist/ice/cpp/src/Ice/SSL/SSLEngine.cpp +115 -0
  301. data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +69 -0
  302. data/dist/ice/cpp/src/Ice/SSL/SSLEngineF.h +14 -0
  303. data/dist/ice/cpp/src/Ice/SSL/SSLException.cpp +18 -0
  304. data/dist/ice/cpp/src/Ice/SSL/SSLInstance.cpp +27 -0
  305. data/dist/ice/cpp/src/Ice/SSL/SSLInstance.h +26 -0
  306. data/dist/ice/cpp/src/Ice/SSL/SSLInstanceF.h +19 -0
  307. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +673 -0
  308. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.h +118 -0
  309. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +1449 -0
  310. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +58 -0
  311. data/dist/ice/cpp/src/Ice/SSL/SchannelEngineF.h +18 -0
  312. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +1088 -0
  313. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +118 -0
  314. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +825 -0
  315. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +44 -0
  316. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngineF.h +18 -0
  317. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +621 -0
  318. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.h +91 -0
  319. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +1048 -0
  320. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +40 -0
  321. data/dist/ice/cpp/src/Ice/SSL/TrustManager.cpp +233 -0
  322. data/dist/ice/cpp/src/Ice/SSL/TrustManager.h +42 -0
  323. data/dist/ice/cpp/src/Ice/SSL/TrustManagerF.h +14 -0
  324. data/dist/ice/cpp/src/Ice/ScannerConfig.h +35 -0
  325. data/dist/ice/cpp/src/Ice/Selector.cpp +341 -606
  326. data/dist/ice/cpp/src/Ice/Selector.h +167 -224
  327. data/dist/ice/cpp/src/Ice/ServantManager.cpp +195 -128
  328. data/dist/ice/cpp/src/Ice/ServantManager.h +52 -55
  329. data/dist/ice/cpp/src/Ice/ServantManagerF.h +14 -0
  330. data/dist/ice/cpp/src/Ice/Service.cpp +548 -641
  331. data/dist/ice/cpp/src/Ice/SharedContext.h +13 -26
  332. data/dist/ice/cpp/src/Ice/SliceLoader.cpp +53 -0
  333. data/dist/ice/cpp/src/Ice/SlicedData.cpp +17 -96
  334. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +104 -151
  335. data/dist/ice/cpp/src/Ice/StreamSocket.h +48 -60
  336. data/dist/ice/cpp/src/Ice/StringConverter.cpp +586 -0
  337. data/dist/ice/cpp/src/Ice/StringUtil.cpp +1137 -0
  338. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +41 -47
  339. data/dist/ice/cpp/src/Ice/SysLoggerI.h +24 -27
  340. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +16 -17
  341. data/dist/ice/cpp/src/Ice/SystemdJournalI.h +19 -25
  342. data/dist/ice/cpp/src/Ice/TargetCompare.h +96 -0
  343. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +67 -88
  344. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +34 -40
  345. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +42 -41
  346. data/dist/ice/cpp/src/Ice/TcpConnector.h +26 -35
  347. data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +172 -146
  348. data/dist/ice/cpp/src/Ice/TcpEndpointI.h +76 -80
  349. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +38 -26
  350. data/dist/ice/cpp/src/Ice/TcpTransceiver.h +40 -45
  351. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +333 -515
  352. data/dist/ice/cpp/src/Ice/ThreadPool.h +202 -290
  353. data/dist/ice/cpp/src/Ice/ThreadPoolF.h +14 -0
  354. data/dist/ice/cpp/src/Ice/TimeUtil.cpp +47 -0
  355. data/dist/ice/cpp/src/Ice/TimeUtil.h +21 -0
  356. data/dist/ice/cpp/src/Ice/Timer.cpp +73 -167
  357. data/dist/ice/cpp/src/Ice/Timer.h +212 -0
  358. data/dist/ice/cpp/src/Ice/TraceLevels.cpp +11 -29
  359. data/dist/ice/cpp/src/Ice/TraceLevels.h +22 -28
  360. data/dist/ice/cpp/src/Ice/TraceLevelsF.h +4 -11
  361. data/dist/ice/cpp/src/Ice/TraceUtil.cpp +136 -215
  362. data/dist/ice/cpp/src/Ice/TraceUtil.h +27 -16
  363. data/dist/ice/cpp/src/Ice/Transceiver.cpp +3 -7
  364. data/dist/ice/cpp/src/Ice/Transceiver.h +35 -32
  365. data/dist/ice/cpp/src/Ice/TransceiverF.h +10 -20
  366. data/dist/ice/cpp/src/Ice/UUID.cpp +79 -0
  367. data/dist/ice/cpp/src/Ice/UdpConnector.cpp +39 -39
  368. data/dist/ice/cpp/src/Ice/UdpConnector.h +27 -36
  369. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +178 -213
  370. data/dist/ice/cpp/src/Ice/UdpEndpointI.h +82 -85
  371. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +201 -221
  372. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +68 -74
  373. data/dist/ice/cpp/{include/IceUtil → src/Ice}/UndefSysMacros.h +12 -12
  374. data/dist/ice/cpp/src/Ice/UniqueRef.h +77 -0
  375. data/dist/ice/cpp/src/Ice/UserException.cpp +58 -0
  376. data/dist/ice/cpp/src/Ice/Value.cpp +107 -38
  377. data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +10 -15
  378. data/dist/ice/cpp/src/Ice/WSAcceptor.h +31 -37
  379. data/dist/ice/cpp/src/Ice/WSConnector.cpp +25 -40
  380. data/dist/ice/cpp/src/Ice/WSConnector.h +26 -33
  381. data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +164 -217
  382. data/dist/ice/cpp/src/Ice/WSEndpoint.h +72 -83
  383. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +469 -458
  384. data/dist/ice/cpp/src/Ice/WSTransceiver.h +117 -123
  385. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +20 -29
  386. data/dist/ice/cpp/src/Ice/generated/Context.cpp +40 -0
  387. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +20 -31
  388. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +24 -34
  389. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +454 -1744
  390. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +577 -0
  391. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +824 -1971
  392. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +56 -0
  393. data/dist/ice/cpp/src/Ice/generated/Process.cpp +190 -331
  394. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +289 -449
  395. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +40 -0
  396. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +547 -867
  397. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +70 -0
  398. data/dist/ice/cpp/src/Ice/generated/Router.cpp +406 -723
  399. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +19 -29
  400. data/dist/ice/cpp/src/Ice/generated/Version.cpp +28 -31
  401. data/dist/ice/cpp/src/IceDiscovery/LocatorI.cpp +76 -139
  402. data/dist/ice/cpp/src/IceDiscovery/LocatorI.h +55 -96
  403. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +190 -303
  404. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +126 -185
  405. data/dist/ice/cpp/src/IceDiscovery/PluginI.cpp +56 -77
  406. data/dist/ice/cpp/src/IceDiscovery/PluginI.h +20 -25
  407. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +638 -0
  408. data/dist/ice/cpp/src/IceLocatorDiscovery/Plugin.h +14 -37
  409. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +411 -649
  410. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +468 -0
  411. data/dist/ice/cpp/src/Slice/DeprecationReporter.cpp +172 -0
  412. data/dist/ice/cpp/src/Slice/DeprecationReporter.h +14 -0
  413. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +736 -0
  414. data/dist/ice/cpp/src/Slice/DocCommentParser.h +61 -0
  415. data/dist/ice/cpp/src/Slice/FileTracker.cpp +25 -75
  416. data/dist/ice/cpp/src/Slice/FileTracker.h +35 -56
  417. data/dist/ice/cpp/src/Slice/Grammar.cpp +2711 -3382
  418. data/dist/ice/cpp/src/Slice/Grammar.h +95 -75
  419. data/dist/ice/cpp/src/Slice/GrammarUtil.h +117 -217
  420. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +486 -0
  421. data/dist/ice/cpp/src/Slice/MetadataValidation.h +106 -0
  422. data/dist/ice/cpp/src/Slice/Parser.cpp +3068 -5223
  423. data/dist/ice/cpp/src/Slice/Parser.h +1086 -1065
  424. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +97 -599
  425. data/dist/ice/cpp/src/Slice/Preprocessor.h +26 -42
  426. data/dist/ice/cpp/src/Slice/Scanner.cpp +1562 -924
  427. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +517 -113
  428. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +254 -269
  429. data/dist/ice/cpp/src/Slice/Util.h +126 -35
  430. data/dist/ice/cpp/src/slice2rb/Main.cpp +13 -15
  431. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +250 -0
  432. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +1197 -0
  433. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +56 -0
  434. data/dist/ice/slice/Glacier2/Metrics.ice +34 -75
  435. data/dist/ice/slice/Glacier2/PermissionsVerifier.ice +42 -98
  436. data/dist/ice/slice/Glacier2/Router.ice +80 -173
  437. data/dist/ice/slice/Glacier2/SSLInfo.ice +23 -40
  438. data/dist/ice/slice/Glacier2/Session.ice +120 -261
  439. data/dist/ice/slice/Ice/BuiltinSequences.ice +33 -38
  440. data/dist/ice/slice/Ice/Context.ice +24 -0
  441. data/dist/ice/slice/Ice/EndpointTypes.ice +35 -33
  442. data/dist/ice/slice/Ice/Identity.ice +24 -63
  443. data/dist/ice/slice/Ice/Locator.ice +61 -226
  444. data/dist/ice/slice/Ice/LocatorRegistry.ice +77 -0
  445. data/dist/ice/slice/Ice/Metrics.ice +189 -424
  446. data/dist/ice/slice/Ice/OperationMode.ice +38 -0
  447. data/dist/ice/slice/Ice/Process.ice +16 -52
  448. data/dist/ice/slice/Ice/PropertiesAdmin.ice +25 -75
  449. data/dist/ice/slice/Ice/PropertyDict.ice +23 -0
  450. data/dist/ice/slice/Ice/RemoteLogger.ice +113 -213
  451. data/dist/ice/slice/Ice/ReplyStatus.ice +65 -0
  452. data/dist/ice/slice/Ice/Router.ice +42 -91
  453. data/dist/ice/slice/Ice/SliceChecksumDict.ice +7 -25
  454. data/dist/ice/slice/Ice/Version.ice +31 -39
  455. data/dist/ice/slice/IceBox/ServiceManager.ice +79 -0
  456. data/dist/ice/slice/IceGrid/Admin.ice +942 -1918
  457. data/dist/ice/slice/IceGrid/Descriptor.ice +476 -1051
  458. data/dist/ice/slice/IceGrid/Exception.ice +86 -384
  459. data/dist/ice/slice/IceGrid/FileParser.ice +23 -59
  460. data/dist/ice/slice/IceGrid/Registry.ice +117 -256
  461. data/dist/ice/slice/IceGrid/Session.ice +46 -110
  462. data/dist/ice/slice/IceGrid/UserAccountMapper.ice +22 -57
  463. data/dist/ice/slice/IceStorm/IceStorm.ice +173 -401
  464. data/dist/ice/slice/IceStorm/Metrics.ice +28 -70
  465. data/dist/lib/Glacier2/Metrics.rb +16 -31
  466. data/dist/lib/Glacier2/PermissionsVerifier.rb +18 -50
  467. data/dist/lib/Glacier2/Router.rb +20 -42
  468. data/dist/lib/Glacier2/SSLInfo.rb +14 -22
  469. data/dist/lib/Glacier2/Session.rb +53 -113
  470. data/dist/lib/Glacier2.rb +6 -6
  471. data/dist/lib/Ice/BuiltinSequences.rb +14 -26
  472. data/dist/lib/Ice/CompressBatch.rb +50 -0
  473. data/dist/lib/Ice/Context.rb +12 -0
  474. data/dist/lib/Ice/EndpointSelectionType.rb +49 -0
  475. data/dist/lib/Ice/EndpointTypes.rb +14 -55
  476. data/dist/lib/Ice/Exception.rb +20 -0
  477. data/dist/lib/Ice/Identity.rb +10 -26
  478. data/dist/lib/Ice/IdentitySpaceship.rb +16 -0
  479. data/dist/lib/Ice/InitializationData.rb +12 -0
  480. data/dist/lib/Ice/LocalExceptions.rb +168 -0
  481. data/dist/lib/Ice/Locator.rb +21 -134
  482. data/dist/lib/Ice/LocatorRegistry.rb +73 -0
  483. data/dist/lib/Ice/Metrics.rb +85 -132
  484. data/dist/lib/Ice/OperationMode.rb +58 -0
  485. data/dist/lib/Ice/Process.rb +12 -31
  486. data/dist/lib/Ice/PropertiesAdmin.rb +12 -36
  487. data/dist/lib/Ice/PropertyDict.rb +12 -0
  488. data/dist/lib/Ice/Proxy.rb +85 -0
  489. data/dist/lib/Ice/ProxyFunctions.rb +69 -0
  490. data/dist/lib/Ice/RemoteLogger.rb +29 -60
  491. data/dist/lib/Ice/ReplyStatus.rb +65 -0
  492. data/dist/lib/Ice/Router.rb +19 -47
  493. data/dist/lib/Ice/SliceChecksumDict.rb +5 -17
  494. data/dist/lib/Ice/SliceUtil.rb +41 -0
  495. data/dist/lib/Ice/Struct.rb +11 -0
  496. data/dist/lib/Ice/ToStringMode.rb +50 -0
  497. data/dist/lib/Ice/Value.rb +93 -0
  498. data/dist/lib/Ice/Version.rb +12 -24
  499. data/dist/lib/Ice.rb +29 -665
  500. data/dist/lib/IceBox/ServiceManager.rb +104 -0
  501. data/dist/lib/IceBox.rb +2 -4
  502. data/dist/lib/IceGrid/Admin.rb +303 -291
  503. data/dist/lib/IceGrid/Descriptor.rb +147 -192
  504. data/dist/lib/IceGrid/Exception.rb +26 -257
  505. data/dist/lib/IceGrid/FileParser.rb +12 -36
  506. data/dist/lib/IceGrid/Registry.rb +35 -76
  507. data/dist/lib/IceGrid/Session.rb +19 -34
  508. data/dist/lib/IceGrid/UserAccountMapper.rb +11 -34
  509. data/dist/lib/IceGrid.rb +3 -3
  510. data/dist/lib/IceStorm/IceStorm.rb +51 -132
  511. data/dist/lib/IceStorm/Metrics.rb +19 -37
  512. data/dist/lib/IceStorm.rb +3 -5
  513. data/extconf.rb +6 -8
  514. data/ice.gemspec +3 -3
  515. data/scripts/slice2rb +1 -3
  516. metadata +206 -386
  517. data/dist/IceRuby/ValueFactoryManager.cpp +0 -445
  518. data/dist/IceRuby/ValueFactoryManager.h +0 -95
  519. data/dist/ice/cpp/include/Ice/Application.h +0 -326
  520. data/dist/ice/cpp/include/Ice/AsyncResult.h +0 -155
  521. data/dist/ice/cpp/include/Ice/AsyncResultF.h +0 -23
  522. data/dist/ice/cpp/include/Ice/BatchRequestInterceptor.h +0 -75
  523. data/dist/ice/cpp/include/Ice/CommunicatorAsync.h +0 -154
  524. data/dist/ice/cpp/include/Ice/Comparable.h +0 -205
  525. data/dist/ice/cpp/include/Ice/ConnectionAsync.h +0 -302
  526. data/dist/ice/cpp/include/Ice/ConsoleUtil.h +0 -23
  527. data/dist/ice/cpp/include/Ice/DefaultValueFactory.h +0 -57
  528. data/dist/ice/cpp/include/Ice/DispatchInterceptor.h +0 -41
  529. data/dist/ice/cpp/include/Ice/Dispatcher.h +0 -67
  530. data/dist/ice/cpp/include/Ice/DynamicLibrary.h +0 -102
  531. data/dist/ice/cpp/include/Ice/DynamicLibraryF.h +0 -24
  532. data/dist/ice/cpp/include/Ice/ExceptionHelpers.h +0 -74
  533. data/dist/ice/cpp/include/Ice/FactoryTable.h +0 -73
  534. data/dist/ice/cpp/include/Ice/FactoryTableInit.h +0 -84
  535. data/dist/ice/cpp/include/Ice/Functional.h +0 -140
  536. data/dist/ice/cpp/include/Ice/GCObject.h +0 -76
  537. data/dist/ice/cpp/include/Ice/Handle.h +0 -182
  538. data/dist/ice/cpp/include/Ice/Incoming.h +0 -225
  539. data/dist/ice/cpp/include/Ice/IncomingAsync.h +0 -186
  540. data/dist/ice/cpp/include/Ice/IncomingAsyncF.h +0 -36
  541. data/dist/ice/cpp/include/Ice/InterfaceByValue.h +0 -57
  542. data/dist/ice/cpp/include/Ice/LocalObject.h +0 -35
  543. data/dist/ice/cpp/include/Ice/LocalObjectF.h +0 -21
  544. data/dist/ice/cpp/include/Ice/MetricsAdminI.h +0 -715
  545. data/dist/ice/cpp/include/Ice/MetricsFunctional.h +0 -159
  546. data/dist/ice/cpp/include/Ice/MetricsObserverI.h +0 -669
  547. data/dist/ice/cpp/include/Ice/Optional.h +0 -1114
  548. data/dist/ice/cpp/include/Ice/OutgoingAsyncF.h +0 -39
  549. data/dist/ice/cpp/include/Ice/Protocol.h +0 -274
  550. data/dist/ice/cpp/include/Ice/ProxyFactoryF.h +0 -21
  551. data/dist/ice/cpp/include/Ice/ProxyHandle.h +0 -318
  552. data/dist/ice/cpp/include/Ice/RegisterPlugins.h +0 -127
  553. data/dist/ice/cpp/include/Ice/ResponseHandlerF.h +0 -25
  554. data/dist/ice/cpp/include/Ice/SHA1.h +0 -40
  555. data/dist/ice/cpp/include/Ice/ServantManagerF.h +0 -21
  556. data/dist/ice/cpp/include/Ice/SliceChecksums.h +0 -33
  557. data/dist/ice/cpp/include/Ice/ThreadPoolF.h +0 -23
  558. data/dist/ice/cpp/include/Ice/UniquePtr.h +0 -95
  559. data/dist/ice/cpp/include/Ice/UniqueRef.h +0 -97
  560. data/dist/ice/cpp/include/IceSSL/Config.h +0 -21
  561. data/dist/ice/cpp/include/IceSSL/IceSSL.h +0 -24
  562. data/dist/ice/cpp/include/IceSSL/OpenSSL.h +0 -147
  563. data/dist/ice/cpp/include/IceSSL/Plugin.h +0 -712
  564. data/dist/ice/cpp/include/IceSSL/SChannel.h +0 -72
  565. data/dist/ice/cpp/include/IceSSL/SecureTransport.h +0 -72
  566. data/dist/ice/cpp/include/IceUtil/Atomic.h +0 -179
  567. data/dist/ice/cpp/include/IceUtil/Cond.h +0 -317
  568. data/dist/ice/cpp/include/IceUtil/Config.h +0 -392
  569. data/dist/ice/cpp/include/IceUtil/ConsoleUtil.h +0 -92
  570. data/dist/ice/cpp/include/IceUtil/CountDownLatch.h +0 -45
  571. data/dist/ice/cpp/include/IceUtil/CtrlCHandler.h +0 -96
  572. data/dist/ice/cpp/include/IceUtil/DisableWarnings.h +0 -44
  573. data/dist/ice/cpp/include/IceUtil/Exception.h +0 -394
  574. data/dist/ice/cpp/include/IceUtil/FileUtil.h +0 -140
  575. data/dist/ice/cpp/include/IceUtil/Functional.h +0 -389
  576. data/dist/ice/cpp/include/IceUtil/Handle.h +0 -261
  577. data/dist/ice/cpp/include/IceUtil/IceUtil.h +0 -40
  578. data/dist/ice/cpp/include/IceUtil/InputUtil.h +0 -42
  579. data/dist/ice/cpp/include/IceUtil/Iterator.h +0 -31
  580. data/dist/ice/cpp/include/IceUtil/Lock.h +0 -128
  581. data/dist/ice/cpp/include/IceUtil/Monitor.h +0 -243
  582. data/dist/ice/cpp/include/IceUtil/Mutex.h +0 -349
  583. data/dist/ice/cpp/include/IceUtil/MutexProtocol.h +0 -23
  584. data/dist/ice/cpp/include/IceUtil/MutexPtrLock.h +0 -78
  585. data/dist/ice/cpp/include/IceUtil/MutexPtrTryLock.h +0 -77
  586. data/dist/ice/cpp/include/IceUtil/Optional.h +0 -433
  587. data/dist/ice/cpp/include/IceUtil/Options.h +0 -135
  588. data/dist/ice/cpp/include/IceUtil/OutputUtil.h +0 -383
  589. data/dist/ice/cpp/include/IceUtil/PushDisableWarnings.h +0 -33
  590. data/dist/ice/cpp/include/IceUtil/Random.h +0 -55
  591. data/dist/ice/cpp/include/IceUtil/RecMutex.h +0 -107
  592. data/dist/ice/cpp/include/IceUtil/ResourceConfig.h +0 -37
  593. data/dist/ice/cpp/include/IceUtil/ScannerConfig.h +0 -40
  594. data/dist/ice/cpp/include/IceUtil/ScopedArray.h +0 -98
  595. data/dist/ice/cpp/include/IceUtil/Shared.h +0 -127
  596. data/dist/ice/cpp/include/IceUtil/StopWatch.h +0 -49
  597. data/dist/ice/cpp/include/IceUtil/StringConverter.h +0 -195
  598. data/dist/ice/cpp/include/IceUtil/StringUtil.h +0 -97
  599. data/dist/ice/cpp/include/IceUtil/Thread.h +0 -160
  600. data/dist/ice/cpp/include/IceUtil/ThreadException.h +0 -94
  601. data/dist/ice/cpp/include/IceUtil/Time.h +0 -205
  602. data/dist/ice/cpp/include/IceUtil/Timer.h +0 -153
  603. data/dist/ice/cpp/include/IceUtil/UUID.h +0 -21
  604. data/dist/ice/cpp/include/generated/Glacier2/Metrics.h +0 -475
  605. data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifier.h +0 -1430
  606. data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifierF.h +0 -147
  607. data/dist/ice/cpp/include/generated/Glacier2/Router.h +0 -3260
  608. data/dist/ice/cpp/include/generated/Glacier2/RouterF.h +0 -125
  609. data/dist/ice/cpp/include/generated/Glacier2/SSLInfo.h +0 -223
  610. data/dist/ice/cpp/include/generated/Glacier2/Session.h +0 -5894
  611. data/dist/ice/cpp/include/generated/Ice/Communicator.h +0 -1162
  612. data/dist/ice/cpp/include/generated/Ice/CommunicatorF.h +0 -101
  613. data/dist/ice/cpp/include/generated/Ice/Connection.h +0 -1703
  614. data/dist/ice/cpp/include/generated/Ice/ConnectionF.h +0 -119
  615. data/dist/ice/cpp/include/generated/Ice/Current.h +0 -322
  616. data/dist/ice/cpp/include/generated/Ice/Endpoint.h +0 -979
  617. data/dist/ice/cpp/include/generated/Ice/EndpointF.h +0 -166
  618. data/dist/ice/cpp/include/generated/Ice/FacetMap.h +0 -80
  619. data/dist/ice/cpp/include/generated/Ice/ImplicitContext.h +0 -284
  620. data/dist/ice/cpp/include/generated/Ice/ImplicitContextF.h +0 -101
  621. data/dist/ice/cpp/include/generated/Ice/Instrumentation.h +0 -1203
  622. data/dist/ice/cpp/include/generated/Ice/InstrumentationF.h +0 -128
  623. data/dist/ice/cpp/include/generated/Ice/LocalException.h +0 -7437
  624. data/dist/ice/cpp/include/generated/Ice/LocatorF.h +0 -147
  625. data/dist/ice/cpp/include/generated/Ice/Logger.h +0 -237
  626. data/dist/ice/cpp/include/generated/Ice/LoggerF.h +0 -101
  627. data/dist/ice/cpp/include/generated/Ice/ObjectAdapter.h +0 -1181
  628. data/dist/ice/cpp/include/generated/Ice/ObjectAdapterF.h +0 -101
  629. data/dist/ice/cpp/include/generated/Ice/ObjectFactory.h +0 -203
  630. data/dist/ice/cpp/include/generated/Ice/Plugin.h +0 -318
  631. data/dist/ice/cpp/include/generated/Ice/PluginF.h +0 -110
  632. data/dist/ice/cpp/include/generated/Ice/ProcessF.h +0 -125
  633. data/dist/ice/cpp/include/generated/Ice/Properties.h +0 -452
  634. data/dist/ice/cpp/include/generated/Ice/PropertiesF.h +0 -134
  635. data/dist/ice/cpp/include/generated/Ice/RouterF.h +0 -125
  636. data/dist/ice/cpp/include/generated/Ice/ServantLocator.h +0 -305
  637. data/dist/ice/cpp/include/generated/Ice/ServantLocatorF.h +0 -101
  638. data/dist/ice/cpp/include/generated/Ice/ValueFactory.h +0 -330
  639. data/dist/ice/cpp/include/generated/IceBox/IceBox.h +0 -3269
  640. data/dist/ice/cpp/include/generated/IceGrid/Admin.h +0 -33773
  641. data/dist/ice/cpp/include/generated/IceGrid/Descriptor.h +0 -5254
  642. data/dist/ice/cpp/include/generated/IceGrid/Exception.h +0 -2834
  643. data/dist/ice/cpp/include/generated/IceGrid/FileParser.h +0 -824
  644. data/dist/ice/cpp/include/generated/IceGrid/PluginFacade.h +0 -635
  645. data/dist/ice/cpp/include/generated/IceGrid/Registry.h +0 -5089
  646. data/dist/ice/cpp/include/generated/IceGrid/Session.h +0 -2240
  647. data/dist/ice/cpp/include/generated/IceGrid/UserAccountMapper.h +0 -800
  648. data/dist/ice/cpp/include/generated/IcePatch2/FileInfo.h +0 -325
  649. data/dist/ice/cpp/include/generated/IcePatch2/FileServer.h +0 -2891
  650. data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +0 -228
  651. data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +0 -101
  652. data/dist/ice/cpp/include/generated/IceSSL/EndpointInfo.h +0 -186
  653. data/dist/ice/cpp/include/generated/IceStorm/IceStorm.h +0 -6627
  654. data/dist/ice/cpp/include/generated/IceStorm/Metrics.h +0 -665
  655. data/dist/ice/cpp/src/Ice/ACM.cpp +0 -380
  656. data/dist/ice/cpp/src/Ice/ACM.h +0 -119
  657. data/dist/ice/cpp/src/Ice/ACMF.h +0 -30
  658. data/dist/ice/cpp/src/Ice/Acceptor.cpp +0 -16
  659. data/dist/ice/cpp/src/Ice/Application.cpp +0 -661
  660. data/dist/ice/cpp/src/Ice/AsyncResult.cpp +0 -70
  661. data/dist/ice/cpp/src/Ice/CommunicatorI.cpp +0 -586
  662. data/dist/ice/cpp/src/Ice/CommunicatorI.h +0 -167
  663. data/dist/ice/cpp/src/Ice/Cond.cpp +0 -381
  664. data/dist/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +0 -73
  665. data/dist/ice/cpp/src/Ice/ConnectionRequestHandler.h +0 -41
  666. data/dist/ice/cpp/src/Ice/Connector.cpp +0 -16
  667. data/dist/ice/cpp/src/Ice/CountDownLatch.cpp +0 -171
  668. data/dist/ice/cpp/src/Ice/DispatchInterceptor.cpp +0 -37
  669. data/dist/ice/cpp/src/Ice/FactoryTable.cpp +0 -162
  670. data/dist/ice/cpp/src/Ice/FactoryTableInit.cpp +0 -88
  671. data/dist/ice/cpp/src/Ice/GCObject.cpp +0 -442
  672. data/dist/ice/cpp/src/Ice/IconvStringConverter.cpp +0 -51
  673. data/dist/ice/cpp/src/Ice/ImplicitContextI.cpp +0 -655
  674. data/dist/ice/cpp/src/Ice/ImplicitContextI.h +0 -48
  675. data/dist/ice/cpp/src/Ice/Incoming.cpp +0 -795
  676. data/dist/ice/cpp/src/Ice/IncomingAsync.cpp +0 -230
  677. data/dist/ice/cpp/src/Ice/IncomingRequest.h +0 -33
  678. data/dist/ice/cpp/src/Ice/LocalObject.cpp +0 -23
  679. data/dist/ice/cpp/src/Ice/MetricsObserverI.cpp +0 -8
  680. data/dist/ice/cpp/src/Ice/PropertiesAdminI.cpp +0 -265
  681. data/dist/ice/cpp/src/Ice/PropertiesAdminI.h +0 -64
  682. data/dist/ice/cpp/src/Ice/PropertiesI.cpp +0 -739
  683. data/dist/ice/cpp/src/Ice/PropertiesI.h +0 -70
  684. data/dist/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +0 -21
  685. data/dist/ice/cpp/src/Ice/ProxyFactory.cpp +0 -300
  686. data/dist/ice/cpp/src/Ice/ProxyFactory.h +0 -57
  687. data/dist/ice/cpp/src/Ice/RegisterPluginsInit.cpp +0 -38
  688. data/dist/ice/cpp/src/Ice/RegisterPluginsInit.h +0 -20
  689. data/dist/ice/cpp/src/Ice/ReplyStatus.h +0 -24
  690. data/dist/ice/cpp/src/Ice/RequestHandlerFactory.cpp +0 -77
  691. data/dist/ice/cpp/src/Ice/RequestHandlerFactory.h +0 -37
  692. data/dist/ice/cpp/src/Ice/ResponseHandler.cpp +0 -12
  693. data/dist/ice/cpp/src/Ice/ResponseHandler.h +0 -43
  694. data/dist/ice/cpp/src/Ice/SliceChecksums.cpp +0 -75
  695. data/dist/ice/cpp/src/Ice/StringConverterPlugin.cpp +0 -192
  696. data/dist/ice/cpp/src/Ice/StringUtil.h +0 -30
  697. data/dist/ice/cpp/src/Ice/Thread.cpp +0 -569
  698. data/dist/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +0 -61
  699. data/dist/ice/cpp/src/Ice/ValueFactoryManagerI.h +0 -37
  700. data/dist/ice/cpp/src/Ice/VirtualShared.h +0 -38
  701. data/dist/ice/cpp/src/Ice/generated/Communicator.cpp +0 -79
  702. data/dist/ice/cpp/src/Ice/generated/CommunicatorF.cpp +0 -61
  703. data/dist/ice/cpp/src/Ice/generated/Connection.cpp +0 -155
  704. data/dist/ice/cpp/src/Ice/generated/ConnectionF.cpp +0 -61
  705. data/dist/ice/cpp/src/Ice/generated/Current.cpp +0 -62
  706. data/dist/ice/cpp/src/Ice/generated/Endpoint.cpp +0 -147
  707. data/dist/ice/cpp/src/Ice/generated/EndpointF.cpp +0 -61
  708. data/dist/ice/cpp/src/Ice/generated/FacetMap.cpp +0 -49
  709. data/dist/ice/cpp/src/Ice/generated/ImplicitContext.cpp +0 -75
  710. data/dist/ice/cpp/src/Ice/generated/ImplicitContextF.cpp +0 -61
  711. data/dist/ice/cpp/src/Ice/generated/Instrumentation.cpp +0 -188
  712. data/dist/ice/cpp/src/Ice/generated/InstrumentationF.cpp +0 -66
  713. data/dist/ice/cpp/src/Ice/generated/LocalException.cpp +0 -3262
  714. data/dist/ice/cpp/src/Ice/generated/LocatorF.cpp +0 -63
  715. data/dist/ice/cpp/src/Ice/generated/Logger.cpp +0 -73
  716. data/dist/ice/cpp/src/Ice/generated/LoggerF.cpp +0 -61
  717. data/dist/ice/cpp/src/Ice/generated/ObjectAdapter.cpp +0 -79
  718. data/dist/ice/cpp/src/Ice/generated/ObjectAdapterF.cpp +0 -61
  719. data/dist/ice/cpp/src/Ice/generated/ObjectFactory.cpp +0 -75
  720. data/dist/ice/cpp/src/Ice/generated/Plugin.cpp +0 -87
  721. data/dist/ice/cpp/src/Ice/generated/PluginF.cpp +0 -61
  722. data/dist/ice/cpp/src/Ice/generated/ProcessF.cpp +0 -63
  723. data/dist/ice/cpp/src/Ice/generated/Properties.cpp +0 -78
  724. data/dist/ice/cpp/src/Ice/generated/PropertiesF.cpp +0 -63
  725. data/dist/ice/cpp/src/Ice/generated/RouterF.cpp +0 -63
  726. data/dist/ice/cpp/src/Ice/generated/ServantLocator.cpp +0 -75
  727. data/dist/ice/cpp/src/Ice/generated/ServantLocatorF.cpp +0 -61
  728. data/dist/ice/cpp/src/Ice/generated/ValueFactory.cpp +0 -83
  729. data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.cpp +0 -154
  730. data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.h +0 -49
  731. data/dist/ice/cpp/src/Ice/ios/StreamConnector.cpp +0 -146
  732. data/dist/ice/cpp/src/Ice/ios/StreamConnector.h +0 -52
  733. data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.cpp +0 -477
  734. data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.h +0 -156
  735. data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.cpp +0 -570
  736. data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.h +0 -93
  737. data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery/IceDiscovery.h +0 -1889
  738. data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery.cpp +0 -915
  739. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery/IceLocatorDiscovery.h +0 -1197
  740. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery.cpp +0 -730
  741. data/dist/ice/cpp/src/IceSSL/AcceptorI.cpp +0 -105
  742. data/dist/ice/cpp/src/IceSSL/AcceptorI.h +0 -52
  743. data/dist/ice/cpp/src/IceSSL/CertificateI.cpp +0 -301
  744. data/dist/ice/cpp/src/IceSSL/CertificateI.h +0 -64
  745. data/dist/ice/cpp/src/IceSSL/ConnectorI.cpp +0 -102
  746. data/dist/ice/cpp/src/IceSSL/ConnectorI.h +0 -44
  747. data/dist/ice/cpp/src/IceSSL/EndpointI.cpp +0 -372
  748. data/dist/ice/cpp/src/IceSSL/EndpointI.h +0 -100
  749. data/dist/ice/cpp/src/IceSSL/Instance.cpp +0 -28
  750. data/dist/ice/cpp/src/IceSSL/Instance.h +0 -37
  751. data/dist/ice/cpp/src/IceSSL/InstanceF.h +0 -33
  752. data/dist/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +0 -688
  753. data/dist/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +0 -1147
  754. data/dist/ice/cpp/src/IceSSL/OpenSSLEngine.h +0 -59
  755. data/dist/ice/cpp/src/IceSSL/OpenSSLEngineF.h +0 -27
  756. data/dist/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +0 -127
  757. data/dist/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +0 -1092
  758. data/dist/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +0 -90
  759. data/dist/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +0 -288
  760. data/dist/ice/cpp/src/IceSSL/OpenSSLUtil.h +0 -58
  761. data/dist/ice/cpp/src/IceSSL/PluginI.cpp +0 -246
  762. data/dist/ice/cpp/src/IceSSL/PluginI.h +0 -67
  763. data/dist/ice/cpp/src/IceSSL/RFC2253.h +0 -62
  764. data/dist/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +0 -721
  765. data/dist/ice/cpp/src/IceSSL/SChannelEngine.cpp +0 -1283
  766. data/dist/ice/cpp/src/IceSSL/SChannelEngine.h +0 -123
  767. data/dist/ice/cpp/src/IceSSL/SChannelEngineF.h +0 -31
  768. data/dist/ice/cpp/src/IceSSL/SChannelPluginI.cpp +0 -73
  769. data/dist/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +0 -1174
  770. data/dist/ice/cpp/src/IceSSL/SChannelTransceiverI.h +0 -133
  771. data/dist/ice/cpp/src/IceSSL/SSLEngine.cpp +0 -313
  772. data/dist/ice/cpp/src/IceSSL/SSLEngine.h +0 -100
  773. data/dist/ice/cpp/src/IceSSL/SSLEngineF.h +0 -21
  774. data/dist/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +0 -999
  775. data/dist/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +0 -1308
  776. data/dist/ice/cpp/src/IceSSL/SecureTransportEngine.h +0 -59
  777. data/dist/ice/cpp/src/IceSSL/SecureTransportEngineF.h +0 -29
  778. data/dist/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +0 -75
  779. data/dist/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +0 -719
  780. data/dist/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +0 -92
  781. data/dist/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +0 -868
  782. data/dist/ice/cpp/src/IceSSL/SecureTransportUtil.h +0 -45
  783. data/dist/ice/cpp/src/IceSSL/TrustManager.cpp +0 -236
  784. data/dist/ice/cpp/src/IceSSL/TrustManager.h +0 -46
  785. data/dist/ice/cpp/src/IceSSL/TrustManagerF.h +0 -21
  786. data/dist/ice/cpp/src/IceSSL/Util.cpp +0 -192
  787. data/dist/ice/cpp/src/IceSSL/Util.h +0 -99
  788. data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfo.cpp +0 -75
  789. data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfoF.cpp +0 -61
  790. data/dist/ice/cpp/src/IceSSL/generated/EndpointInfo.cpp +0 -75
  791. data/dist/ice/cpp/src/IceUtil/ConvertUTF.cpp +0 -472
  792. data/dist/ice/cpp/src/IceUtil/ConvertUTF.h +0 -147
  793. data/dist/ice/cpp/src/IceUtil/CtrlCHandler.cpp +0 -259
  794. data/dist/ice/cpp/src/IceUtil/FileUtil.cpp +0 -471
  795. data/dist/ice/cpp/src/IceUtil/InputUtil.cpp +0 -36
  796. data/dist/ice/cpp/src/IceUtil/MutexProtocol.cpp +0 -19
  797. data/dist/ice/cpp/src/IceUtil/OutputUtil.cpp +0 -609
  798. data/dist/ice/cpp/src/IceUtil/Random.cpp +0 -180
  799. data/dist/ice/cpp/src/IceUtil/RecMutex.cpp +0 -238
  800. data/dist/ice/cpp/src/IceUtil/Shared.cpp +0 -71
  801. data/dist/ice/cpp/src/IceUtil/StringConverter.cpp +0 -690
  802. data/dist/ice/cpp/src/IceUtil/StringUtil.cpp +0 -1135
  803. data/dist/ice/cpp/src/IceUtil/ThreadException.cpp +0 -130
  804. data/dist/ice/cpp/src/IceUtil/Time.cpp +0 -307
  805. data/dist/ice/cpp/src/IceUtil/UUID.cpp +0 -165
  806. data/dist/ice/cpp/src/IceUtil/Unicode.cpp +0 -183
  807. data/dist/ice/cpp/src/IceUtil/Unicode.h +0 -43
  808. data/dist/ice/cpp/src/IceUtil/UtilException.cpp +0 -839
  809. data/dist/ice/cpp/src/Slice/CPlusPlusUtil.cpp +0 -1810
  810. data/dist/ice/cpp/src/Slice/CPlusPlusUtil.h +0 -72
  811. data/dist/ice/cpp/src/Slice/Checksum.cpp +0 -447
  812. data/dist/ice/cpp/src/Slice/Checksum.h +0 -21
  813. data/dist/ice/cpp/src/Slice/JavaUtil.cpp +0 -5183
  814. data/dist/ice/cpp/src/Slice/JavaUtil.h +0 -407
  815. data/dist/ice/cpp/src/Slice/MD5.cpp +0 -52
  816. data/dist/ice/cpp/src/Slice/MD5.h +0 -39
  817. data/dist/ice/cpp/src/Slice/MD5I.cpp +0 -393
  818. data/dist/ice/cpp/src/Slice/MD5I.h +0 -91
  819. data/dist/ice/cpp/src/Slice/PHPUtil.cpp +0 -157
  820. data/dist/ice/cpp/src/Slice/PHPUtil.h +0 -36
  821. data/dist/ice/cpp/src/Slice/Python.cpp +0 -830
  822. data/dist/ice/cpp/src/Slice/PythonUtil.cpp +0 -3439
  823. data/dist/ice/cpp/src/Slice/PythonUtil.h +0 -70
  824. data/dist/ice/cpp/src/Slice/Ruby.cpp +0 -350
  825. data/dist/ice/cpp/src/Slice/RubyUtil.cpp +0 -1571
  826. data/dist/ice/cpp/src/Slice/RubyUtil.h +0 -49
  827. data/dist/ice/slice/Glacier2/PermissionsVerifierF.ice +0 -30
  828. data/dist/ice/slice/Glacier2/RouterF.ice +0 -29
  829. data/dist/ice/slice/Ice/Communicator.ice +0 -676
  830. data/dist/ice/slice/Ice/CommunicatorF.ice +0 -31
  831. data/dist/ice/slice/Ice/Connection.ice +0 -516
  832. data/dist/ice/slice/Ice/ConnectionF.ice +0 -33
  833. data/dist/ice/slice/Ice/Current.ice +0 -170
  834. data/dist/ice/slice/Ice/Endpoint.ice +0 -291
  835. data/dist/ice/slice/Ice/EndpointF.ice +0 -43
  836. data/dist/ice/slice/Ice/FacetMap.ice +0 -36
  837. data/dist/ice/slice/Ice/ImplicitContext.ice +0 -119
  838. data/dist/ice/slice/Ice/ImplicitContextF.ice +0 -30
  839. data/dist/ice/slice/Ice/Instrumentation.ice +0 -509
  840. data/dist/ice/slice/Ice/InstrumentationF.ice +0 -38
  841. data/dist/ice/slice/Ice/LocalException.ice +0 -1040
  842. data/dist/ice/slice/Ice/LocatorF.ice +0 -32
  843. data/dist/ice/slice/Ice/Logger.ice +0 -99
  844. data/dist/ice/slice/Ice/LoggerF.ice +0 -31
  845. data/dist/ice/slice/Ice/ObjectAdapter.ice +0 -710
  846. data/dist/ice/slice/Ice/ObjectAdapterF.ice +0 -31
  847. data/dist/ice/slice/Ice/ObjectFactory.ice +0 -71
  848. data/dist/ice/slice/Ice/Plugin.ice +0 -131
  849. data/dist/ice/slice/Ice/PluginF.ice +0 -36
  850. data/dist/ice/slice/Ice/ProcessF.ice +0 -31
  851. data/dist/ice/slice/Ice/Properties.ice +0 -244
  852. data/dist/ice/slice/Ice/PropertiesF.ice +0 -32
  853. data/dist/ice/slice/Ice/RouterF.ice +0 -31
  854. data/dist/ice/slice/Ice/ServantLocator.ice +0 -136
  855. data/dist/ice/slice/Ice/ServantLocatorF.ice +0 -31
  856. data/dist/ice/slice/Ice/ValueFactory.ice +0 -133
  857. data/dist/ice/slice/IceBox/IceBox.ice +0 -216
  858. data/dist/ice/slice/IceGrid/PluginFacade.ice +0 -329
  859. data/dist/ice/slice/IcePatch2/FileInfo.ice +0 -85
  860. data/dist/ice/slice/IcePatch2/FileServer.ice +0 -191
  861. data/dist/lib/Glacier2/PermissionsVerifierF.rb +0 -30
  862. data/dist/lib/Glacier2/RouterF.rb +0 -25
  863. data/dist/lib/Ice/Communicator.rb +0 -87
  864. data/dist/lib/Ice/CommunicatorF.rb +0 -24
  865. data/dist/lib/Ice/Connection.rb +0 -413
  866. data/dist/lib/Ice/ConnectionF.rb +0 -32
  867. data/dist/lib/Ice/Current.rb +0 -141
  868. data/dist/lib/Ice/Endpoint.rb +0 -187
  869. data/dist/lib/Ice/EndpointF.rb +0 -48
  870. data/dist/lib/Ice/FacetMap.rb +0 -24
  871. data/dist/lib/Ice/ImplicitContext.rb +0 -26
  872. data/dist/lib/Ice/ImplicitContextF.rb +0 -24
  873. data/dist/lib/Ice/Instrumentation.rb +0 -169
  874. data/dist/lib/Ice/InstrumentationF.rb +0 -31
  875. data/dist/lib/Ice/LocalException.rb +0 -1031
  876. data/dist/lib/Ice/LocatorF.rb +0 -30
  877. data/dist/lib/Ice/Logger.rb +0 -24
  878. data/dist/lib/Ice/LoggerF.rb +0 -24
  879. data/dist/lib/Ice/ObjectAdapter.rb +0 -29
  880. data/dist/lib/Ice/ObjectAdapterF.rb +0 -24
  881. data/dist/lib/Ice/ObjectFactory.rb +0 -24
  882. data/dist/lib/Ice/Plugin.rb +0 -30
  883. data/dist/lib/Ice/PluginF.rb +0 -28
  884. data/dist/lib/Ice/ProcessF.rb +0 -25
  885. data/dist/lib/Ice/Properties.rb +0 -25
  886. data/dist/lib/Ice/PropertiesF.rb +0 -29
  887. data/dist/lib/Ice/RouterF.rb +0 -25
  888. data/dist/lib/Ice/ServantLocator.rb +0 -26
  889. data/dist/lib/Ice/ServantLocatorF.rb +0 -24
  890. data/dist/lib/Ice/ValueFactory.rb +0 -28
  891. data/dist/lib/IceBox/IceBox.rb +0 -164
  892. data/dist/lib/IceGrid/PluginFacade.rb +0 -35
  893. data/dist/lib/IcePatch2/FileInfo.rb +0 -115
  894. data/dist/lib/IcePatch2/FileServer.rb +0 -123
  895. data/dist/lib/IcePatch2.rb +0 -5
@@ -1,190 +1,163 @@
1
- //
2
- // Copyright (c) ZeroC, Inc. All rights reserved.
3
- //
4
-
5
- #include <IceUtil/DisableWarnings.h>
6
- #include <Ice/InputStream.h>
7
- #include <Ice/DefaultsAndOverrides.h>
8
- #include <Ice/Instance.h>
9
- #include <Ice/Object.h>
10
- #include <Ice/Proxy.h>
11
- #include <Ice/ProxyFactory.h>
12
- #include <Ice/ValueFactory.h>
13
- #include <Ice/UserExceptionFactory.h>
14
- #include <Ice/LocalException.h>
15
- #include <Ice/Protocol.h>
16
- #include <Ice/FactoryTableInit.h>
17
- #include <Ice/TraceUtil.h>
18
- #include <Ice/TraceLevels.h>
19
- #include <Ice/LoggerUtil.h>
20
- #include <Ice/SlicedData.h>
21
- #include <Ice/StringConverter.h>
22
- #include <iterator>
23
-
24
- #ifndef ICE_UNALIGNED
25
- # if defined(__i386) || defined(_M_IX86) || defined(__x86_64) || defined(_M_X64)
26
- # define ICE_UNALIGNED
27
- # endif
28
- #endif
1
+ // Copyright (c) ZeroC, Inc.
2
+
3
+ #include "Ice/InputStream.h"
4
+ #include "DefaultsAndOverrides.h"
5
+ #include "Endian.h"
6
+ #include "Ice/DefaultSliceLoader.h" // temporary
7
+ #include "Ice/LocalExceptions.h"
8
+ #include "Ice/SlicedData.h"
9
+ #include "Ice/StringConverter.h"
10
+ #include "Ice/UserExceptionFactory.h"
11
+ #include "Instance.h"
12
+ #include "ReferenceFactory.h"
13
+ #include "TraceLevels.h"
14
+ #include "TraceUtil.h"
15
+
16
+ #include "DisableWarnings.h"
29
17
 
30
18
  using namespace std;
31
19
  using namespace Ice;
32
20
  using namespace IceInternal;
33
21
 
34
- Ice::InputStream::InputStream()
35
- {
36
- initialize(currentEncoding);
37
- }
38
-
39
- Ice::InputStream::InputStream(const vector<Byte>& v) :
40
- Buffer(v)
41
- {
42
- initialize(currentEncoding);
43
- }
44
-
45
- Ice::InputStream::InputStream(const pair<const Byte*, const Byte*>& p) :
46
- Buffer(p.first, p.second)
47
- {
48
- initialize(currentEncoding);
49
- }
50
-
51
- Ice::InputStream::InputStream(Buffer& buf, bool adopt) :
52
- Buffer(buf, adopt)
53
- {
54
- initialize(currentEncoding);
55
- }
56
-
57
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator)
58
- {
59
- initialize(communicator);
60
- }
61
-
62
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const vector<Byte>& v) :
63
- Buffer(v)
64
- {
65
- initialize(communicator);
66
- }
67
-
68
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const pair<const Byte*, const Byte*>& p) :
69
- Buffer(p.first, p.second)
22
+ namespace
70
23
  {
71
- initialize(communicator);
24
+ const char* endOfBufferMessage = "attempting to unmarshal past the end of the buffer";
72
25
  }
73
26
 
74
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, Buffer& buf, bool adopt) :
75
- Buffer(buf, adopt)
27
+ void
28
+ IceInternal::Ex::throwUOE(const char* file, int line, const string& expectedType, const ValuePtr& v)
76
29
  {
77
- initialize(communicator);
78
- }
30
+ UnknownSlicedValuePtr usv = dynamic_pointer_cast<UnknownSlicedValue>(v);
31
+ if (usv)
32
+ {
33
+ throw MarshalException{
34
+ file,
35
+ line,
36
+ "the Slice loader did not find a class for type ID '" + string{usv->ice_id()} + "'"};
37
+ }
79
38
 
80
- Ice::InputStream::InputStream(const EncodingVersion& encoding)
81
- {
82
- initialize(encoding);
83
- }
39
+ string type = v->ice_id();
84
40
 
85
- Ice::InputStream::InputStream(const EncodingVersion& encoding, const vector<Byte>& v) :
86
- Buffer(v)
87
- {
88
- initialize(encoding);
41
+ throw MarshalException{
42
+ file,
43
+ line,
44
+ "failed to unmarshal class with type ID '" + expectedType +
45
+ "': the Slice loader returned a class with type ID '" + type + "'"};
89
46
  }
90
47
 
91
- Ice::InputStream::InputStream(const EncodingVersion& encoding, const pair<const Byte*, const Byte*>& p) :
92
- Buffer(p.first, p.second)
48
+ void
49
+ IceInternal::Ex::throwMemoryLimitException(const char* file, int line, size_t requested, int32_t maximum)
93
50
  {
94
- initialize(encoding);
51
+ throw MarshalException{
52
+ file,
53
+ line,
54
+ "cannot unmarshal Ice message: the message size of " + to_string(requested) +
55
+ " bytes exceeds the maximum allowed of " + to_string(maximum) + " bytes (see Ice.MessageSizeMax)."};
95
56
  }
96
57
 
97
- Ice::InputStream::InputStream(const EncodingVersion& encoding, Buffer& buf, bool adopt) :
98
- Buffer(buf, adopt)
58
+ void
59
+ IceInternal::Ex::throwMarshalException(const char* file, int line, string reason)
99
60
  {
100
- initialize(encoding);
61
+ throw Ice::MarshalException{file, line, std::move(reason)};
101
62
  }
102
63
 
103
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding)
64
+ Ice::InputStream::InputStream(Instance* instance, EncodingVersion encoding, SliceLoaderPtr sliceLoader)
65
+ : InputStream{instance, encoding, Buffer{}, std::move(sliceLoader)}
104
66
  {
105
- initialize(communicator, encoding);
106
67
  }
107
68
 
108
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding,
109
- const vector<Byte>& v) :
110
- Buffer(v)
69
+ Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const vector<byte>& v, SliceLoaderPtr sliceLoader)
70
+ : InputStream{
71
+ getInstance(communicator).get(),
72
+ getInstance(communicator)->defaultsAndOverrides()->defaultEncoding,
73
+ Buffer{v},
74
+ std::move(sliceLoader)}
111
75
  {
112
- initialize(communicator, encoding);
113
76
  }
114
77
 
115
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding,
116
- const pair<const Byte*, const Byte*>& p) :
117
- Buffer(p.first, p.second)
78
+ Ice::InputStream::InputStream(
79
+ const CommunicatorPtr& communicator,
80
+ pair<const byte*, const byte*> p,
81
+ SliceLoaderPtr sliceLoader)
82
+ : InputStream{
83
+ getInstance(communicator).get(),
84
+ getInstance(communicator)->defaultsAndOverrides()->defaultEncoding,
85
+ Buffer{p.first, p.second},
86
+ std::move(sliceLoader)}
118
87
  {
119
- initialize(communicator, encoding);
120
88
  }
121
89
 
122
- Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding,
123
- Buffer& buf, bool adopt) :
124
- Buffer(buf, adopt)
90
+ Ice::InputStream::InputStream(
91
+ const CommunicatorPtr& communicator,
92
+ EncodingVersion encoding,
93
+ const vector<byte>& v,
94
+ SliceLoaderPtr sliceLoader)
95
+ : InputStream{getInstance(communicator).get(), encoding, Buffer{v}, std::move(sliceLoader)}
125
96
  {
126
- initialize(communicator, encoding);
127
97
  }
128
98
 
129
- Ice::InputStream::InputStream(Instance* instance, const EncodingVersion& encoding)
99
+ Ice::InputStream::InputStream(
100
+ const CommunicatorPtr& communicator,
101
+ EncodingVersion encoding,
102
+ pair<const byte*, const byte*> p,
103
+ SliceLoaderPtr sliceLoader)
104
+ : InputStream{getInstance(communicator).get(), encoding, Buffer{p.first, p.second}, std::move(sliceLoader)}
130
105
  {
131
- initialize(instance, encoding);
132
106
  }
133
107
 
134
- Ice::InputStream::InputStream(Instance* instance, const EncodingVersion& encoding, Buffer& buf, bool adopt) :
135
- Buffer(buf, adopt)
108
+ Ice::InputStream::InputStream(
109
+ Instance* instance,
110
+ EncodingVersion encoding,
111
+ Buffer& buf,
112
+ bool adopt,
113
+ SliceLoaderPtr sliceLoader)
114
+ : InputStream{instance, encoding, Buffer{buf, adopt}, std::move(sliceLoader)}
136
115
  {
137
- initialize(instance, encoding);
138
116
  }
139
117
 
140
- void
141
- Ice::InputStream::initialize(const CommunicatorPtr& communicator)
118
+ Ice::InputStream::InputStream(InputStream&& other) noexcept
119
+ // only moves (and resets) the base class
120
+ : InputStream{other._instance, other._encoding, std::move(other), other._sliceLoader}
142
121
  {
143
- Instance* instance = getInstance(communicator).get();
144
- initialize(instance, instance->defaultsAndOverrides()->defaultEncoding);
145
- }
122
+ _closure = other._closure;
123
+ _startSeq = other._startSeq;
124
+ _minSeqSize = other._minSeqSize;
146
125
 
147
- void
148
- Ice::InputStream::initialize(const CommunicatorPtr& communicator, const EncodingVersion& encoding)
149
- {
150
- initialize(getInstance(communicator).get(), encoding);
126
+ // Reset other to its default state
127
+ other.resetEncapsulation();
128
+ other._closure = nullptr;
129
+ other._startSeq = -1;
130
+ other._minSeqSize = 0;
151
131
  }
152
132
 
153
- void
154
- Ice::InputStream::initialize(Instance* instance, const EncodingVersion& encoding)
133
+ InputStream&
134
+ Ice::InputStream::operator=(InputStream&& other) noexcept
155
135
  {
156
- initialize(encoding);
136
+ assert(_instance == other._instance);
157
137
 
158
- _instance = instance;
138
+ if (this != &other)
139
+ {
140
+ Buffer::operator=(std::move(other)); // only moves (and resets) the base class
159
141
 
160
- #ifndef ICE_CPP11_MAPPING
161
- _collectObjects = _instance->collectObjects();
162
- #endif
163
- _traceSlicing = _instance->traceLevels()->slicing > 0;
164
- _classGraphDepthMax = _instance->classGraphDepthMax();
165
- }
142
+ _encoding = other._encoding;
143
+ _closure = other._closure;
144
+ _startSeq = other._startSeq;
145
+ _minSeqSize = other._minSeqSize;
146
+ resetEncapsulation();
166
147
 
167
- void
168
- Ice::InputStream::initialize(const EncodingVersion& encoding)
169
- {
170
- _instance = 0;
171
- _encoding = encoding;
172
- _currentEncaps = 0;
173
- #ifndef ICE_CPP11_MAPPING
174
- _collectObjects = false;
175
- #endif
176
- _traceSlicing = false;
177
- _classGraphDepthMax = 0x7fffffff;
178
- _closure = 0;
179
- _sliceValues = true;
180
- _startSeq = -1;
181
- _minSeqSize = 0;
148
+ // Reset other to its default state.
149
+ other.resetEncapsulation();
150
+ other._closure = nullptr;
151
+ other._startSeq = -1;
152
+ other._minSeqSize = 0;
153
+ }
154
+ return *this;
182
155
  }
183
156
 
184
157
  void
185
158
  Ice::InputStream::clear()
186
159
  {
187
- while(_currentEncaps && _currentEncaps != &_preAllocatedEncaps)
160
+ while (_currentEncaps && _currentEncaps != &_preAllocatedEncaps)
188
161
  {
189
162
  Encaps* oldEncaps = _currentEncaps;
190
163
  _currentEncaps = _currentEncaps->previous;
@@ -192,62 +165,6 @@ Ice::InputStream::clear()
192
165
  }
193
166
 
194
167
  _startSeq = -1;
195
- _sliceValues = true;
196
- }
197
-
198
- void
199
- Ice::InputStream::setValueFactoryManager(const ValueFactoryManagerPtr& vfm)
200
- {
201
- _valueFactoryManager = vfm;
202
- }
203
-
204
- void
205
- Ice::InputStream::setLogger(const LoggerPtr& logger)
206
- {
207
- _logger = logger;
208
- }
209
-
210
- void
211
- #ifdef ICE_CPP11_MAPPING
212
- Ice::InputStream::setCompactIdResolver(std::function<std::string(int)> r)
213
- #else
214
- Ice::InputStream::setCompactIdResolver(const CompactIdResolverPtr& r)
215
- #endif
216
- {
217
- _compactIdResolver = r;
218
- }
219
-
220
- #ifndef ICE_CPP11_MAPPING
221
- void
222
- Ice::InputStream::setCollectObjects(bool on)
223
- {
224
- _collectObjects = on;
225
- }
226
- #endif
227
-
228
- void
229
- Ice::InputStream::setSliceValues(bool on)
230
- {
231
- _sliceValues = on;
232
- }
233
-
234
- void
235
- Ice::InputStream::setTraceSlicing(bool on)
236
- {
237
- _traceSlicing = on;
238
- }
239
-
240
- void
241
- Ice::InputStream::setClassGraphDepthMax(size_t classGraphDepthMax)
242
- {
243
- if(classGraphDepthMax < 1)
244
- {
245
- _classGraphDepthMax = 0x7fffffff;
246
- }
247
- else
248
- {
249
- _classGraphDepthMax = classGraphDepthMax;
250
- }
251
168
  }
252
169
 
253
170
  void*
@@ -265,19 +182,16 @@ Ice::InputStream::setClosure(void* p)
265
182
  }
266
183
 
267
184
  void
268
- Ice::InputStream::swap(InputStream& other)
185
+ Ice::InputStream::swap(InputStream& other) noexcept
269
186
  {
187
+ assert(_instance == other._instance);
188
+
270
189
  swapBuffer(other);
271
190
 
272
- std::swap(_instance, other._instance);
273
191
  std::swap(_encoding, other._encoding);
274
- #ifndef ICE_CPP11_MAPPING
275
- std::swap(_collectObjects, other._collectObjects);
276
- #endif
277
- std::swap(_traceSlicing, other._traceSlicing);
278
- std::swap(_classGraphDepthMax, other._classGraphDepthMax);
279
192
  std::swap(_closure, other._closure);
280
- std::swap(_sliceValues, other._sliceValues);
193
+ std::swap(_startSeq, other._startSeq);
194
+ std::swap(_minSeqSize, other._minSeqSize);
281
195
 
282
196
  //
283
197
  // Swap is never called for streams that have encapsulations being read. However,
@@ -286,19 +200,12 @@ Ice::InputStream::swap(InputStream& other)
286
200
  //
287
201
  resetEncapsulation();
288
202
  other.resetEncapsulation();
289
-
290
- std::swap(_startSeq, other._startSeq);
291
- std::swap(_minSeqSize, other._minSeqSize);
292
-
293
- std::swap(_valueFactoryManager, other._valueFactoryManager);
294
- std::swap(_logger, other._logger);
295
- std::swap(_compactIdResolver, other._compactIdResolver);
296
203
  }
297
204
 
298
205
  void
299
206
  Ice::InputStream::resetEncapsulation()
300
207
  {
301
- while(_currentEncaps && _currentEncaps != &_preAllocatedEncaps)
208
+ while (_currentEncaps && _currentEncaps != &_preAllocatedEncaps)
302
209
  {
303
210
  Encaps* oldEncaps = _currentEncaps;
304
211
  _currentEncaps = _currentEncaps->previous;
@@ -308,41 +215,178 @@ Ice::InputStream::resetEncapsulation()
308
215
  _preAllocatedEncaps.reset();
309
216
  }
310
217
 
311
- Int
218
+ const EncodingVersion&
219
+ Ice::InputStream::startEncapsulation()
220
+ {
221
+ Encaps* oldEncaps = _currentEncaps;
222
+ if (!oldEncaps) // First allocated encaps?
223
+ {
224
+ _currentEncaps = &_preAllocatedEncaps;
225
+ }
226
+ else
227
+ {
228
+ _currentEncaps = new Encaps();
229
+ _currentEncaps->previous = oldEncaps;
230
+ }
231
+ _currentEncaps->start = static_cast<size_t>(i - b.begin());
232
+
233
+ //
234
+ // I don't use readSize() and writeSize() for encapsulations,
235
+ // because when creating an encapsulation, I must know in advance
236
+ // how many bytes the size information will require in the data
237
+ // stream. If I use an Int, it is always 4 bytes. For
238
+ // readSize()/writeSize(), it could be 1 or 5 bytes.
239
+ //
240
+ std::int32_t sz;
241
+ read(sz);
242
+ if (sz < 6)
243
+ {
244
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
245
+ }
246
+ if (i - sizeof(std::int32_t) + sz > b.end())
247
+ {
248
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
249
+ }
250
+ _currentEncaps->sz = sz;
251
+
252
+ read(_currentEncaps->encoding);
253
+ IceInternal::checkSupportedEncoding(_currentEncaps->encoding); // Make sure the encoding is supported
254
+
255
+ return _currentEncaps->encoding;
256
+ }
257
+
258
+ void
259
+ Ice::InputStream::endEncapsulation()
260
+ {
261
+ assert(_currentEncaps);
262
+
263
+ if (_currentEncaps->encoding != Encoding_1_0)
264
+ {
265
+ skipOptionals();
266
+ if (i != b.begin() + _currentEncaps->start + _currentEncaps->sz)
267
+ {
268
+ throw MarshalException{__FILE__, __LINE__, "failed to unmarshal encapsulation"};
269
+ }
270
+ }
271
+ else if (i != b.begin() + _currentEncaps->start + _currentEncaps->sz)
272
+ {
273
+ if (i + 1 != b.begin() + _currentEncaps->start + _currentEncaps->sz)
274
+ {
275
+ throw MarshalException{__FILE__, __LINE__, "failed to unmarshal encapsulation"};
276
+ }
277
+
278
+ //
279
+ // Ice version < 3.3 had a bug where user exceptions with
280
+ // class members could be encoded with a trailing byte
281
+ // when dispatched with AMD. So we tolerate an extra byte
282
+ // in the encapsulation.
283
+ //
284
+ ++i;
285
+ }
286
+
287
+ Encaps* oldEncaps = _currentEncaps;
288
+ _currentEncaps = _currentEncaps->previous;
289
+ if (oldEncaps == &_preAllocatedEncaps)
290
+ {
291
+ oldEncaps->reset();
292
+ }
293
+ else
294
+ {
295
+ delete oldEncaps;
296
+ }
297
+ }
298
+
299
+ EncodingVersion
300
+ Ice::InputStream::skipEmptyEncapsulation()
301
+ {
302
+ std::int32_t sz;
303
+ read(sz);
304
+ if (sz < 6)
305
+ {
306
+ throw MarshalException{__FILE__, __LINE__, to_string(sz) + " is not a valid encapsulation size"};
307
+ }
308
+ if (i - sizeof(std::int32_t) + sz > b.end())
309
+ {
310
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
311
+ }
312
+ Ice::EncodingVersion encoding;
313
+ read(encoding);
314
+ IceInternal::checkSupportedEncoding(encoding); // Make sure the encoding is supported
315
+
316
+ if (encoding == Ice::Encoding_1_0)
317
+ {
318
+ if (sz != static_cast<std::int32_t>(sizeof(std::int32_t)) + 2)
319
+ {
320
+ throw MarshalException{
321
+ __FILE__,
322
+ __LINE__,
323
+ to_string(sz) + " is not a valid encapsulation size for a 1.0 empty encapsulation"};
324
+ }
325
+ }
326
+ else
327
+ {
328
+ // Skip the optional content of the encapsulation if we are expecting an
329
+ // empty encapsulation.
330
+ i += static_cast<size_t>(sz) - sizeof(std::int32_t) - 2;
331
+ }
332
+ return encoding;
333
+ }
334
+
335
+ EncodingVersion
336
+ Ice::InputStream::readEncapsulation(const std::byte*& v, std::int32_t& sz)
337
+ {
338
+ EncodingVersion encoding;
339
+ v = i;
340
+ read(sz);
341
+ if (sz < 6)
342
+ {
343
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
344
+ }
345
+ if (i - sizeof(std::int32_t) + sz > b.end())
346
+ {
347
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
348
+ }
349
+
350
+ read(encoding);
351
+ i += static_cast<size_t>(sz) - sizeof(std::int32_t) - 2;
352
+ return encoding;
353
+ }
354
+
355
+ int32_t
312
356
  Ice::InputStream::getEncapsulationSize()
313
357
  {
314
358
  assert(_currentEncaps);
315
- return _currentEncaps->sz - static_cast<Int>(sizeof(Int)) - 2;
359
+ return _currentEncaps->sz - static_cast<int32_t>(sizeof(int32_t)) - 2;
316
360
  }
317
361
 
318
362
  EncodingVersion
319
363
  Ice::InputStream::skipEncapsulation()
320
364
  {
321
- Int sz;
365
+ int32_t sz;
322
366
  read(sz);
323
- if(sz < 6)
367
+ if (sz < 6)
324
368
  {
325
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
369
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
326
370
  }
327
- if(i - sizeof(Int) + sz > b.end())
371
+ if (i - sizeof(int32_t) + sz > b.end())
328
372
  {
329
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
373
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
330
374
  }
331
375
  EncodingVersion encoding;
332
376
  read(encoding.major);
333
377
  read(encoding.minor);
334
- i += static_cast<size_t>(sz) - sizeof(Int) - 2;
378
+ i += static_cast<size_t>(sz) - sizeof(int32_t) - 2;
335
379
  return encoding;
336
380
  }
337
381
 
338
382
  void
339
383
  Ice::InputStream::readPendingValues()
340
384
  {
341
- if(_currentEncaps && _currentEncaps->decoder)
385
+ if (_currentEncaps && _currentEncaps->decoder)
342
386
  {
343
387
  _currentEncaps->decoder->readPendingValues();
344
388
  }
345
- else if(getEncoding() == Ice::Encoding_1_0)
389
+ else if (getEncoding() == Ice::Encoding_1_0)
346
390
  {
347
391
  //
348
392
  // If using the 1.0 encoding and no instances were read, we
@@ -357,12 +401,12 @@ Ice::InputStream::readPendingValues()
357
401
  }
358
402
  }
359
403
 
360
- Int
404
+ int32_t
361
405
  Ice::InputStream::readAndCheckSeqSize(int minSize)
362
406
  {
363
- Int sz = readSize();
407
+ int32_t sz = readSize();
364
408
 
365
- if(sz == 0)
409
+ if (sz == 0)
366
410
  {
367
411
  return sz;
368
412
  }
@@ -379,12 +423,12 @@ Ice::InputStream::readAndCheckSeqSize(int minSize)
379
423
  // _minSeqSize by the minimum size that this sequence will require on
380
424
  // the stream.
381
425
  //
382
- // The goal of this check is to ensure that when we start un-marshalling
426
+ // The goal of this check is to ensure that when we start un-marshaling
383
427
  // a new sequence, we check the minimal size of this new sequence against
384
428
  // the estimated remaining buffer size. This estimation is based on
385
429
  // the minimum size of the enclosing sequences, it's _minSeqSize.
386
430
  //
387
- if(_startSeq == -1 || i > (b.begin() + _startSeq + _minSeqSize))
431
+ if (_startSeq == -1 || i > (b.begin() + _startSeq + _minSeqSize))
388
432
  {
389
433
  _startSeq = static_cast<int>(i - b.begin());
390
434
  _minSeqSize = sz * minSize;
@@ -396,27 +440,27 @@ Ice::InputStream::readAndCheckSeqSize(int minSize)
396
440
 
397
441
  //
398
442
  // If there isn't enough data to read on the stream for the sequence (and
399
- // possibly enclosed sequences), something is wrong with the marshalled
443
+ // possibly enclosed sequences), something is wrong with the marshaled
400
444
  // data: it's claiming having more data that what is possible to read.
401
445
  //
402
- if(_startSeq + _minSeqSize > static_cast<int>(b.size()))
446
+ if (_startSeq + _minSeqSize > static_cast<int>(b.size()))
403
447
  {
404
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
448
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
405
449
  }
406
450
 
407
451
  return sz;
408
452
  }
409
453
 
410
454
  void
411
- Ice::InputStream::readBlob(vector<Byte>& v, Int sz)
455
+ Ice::InputStream::readBlob(vector<byte>& v, int32_t sz)
412
456
  {
413
- if(sz > 0)
457
+ if (sz > 0)
414
458
  {
415
- if(b.end() - i < sz)
459
+ if (b.end() - i < sz)
416
460
  {
417
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
461
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
418
462
  }
419
- vector<Byte>(i, i + sz).swap(v);
463
+ vector<byte>(i, i + sz).swap(v);
420
464
  i += sz;
421
465
  }
422
466
  else
@@ -426,11 +470,11 @@ Ice::InputStream::readBlob(vector<Byte>& v, Int sz)
426
470
  }
427
471
 
428
472
  void
429
- Ice::InputStream::read(std::vector<Ice::Byte>& v)
473
+ Ice::InputStream::read(std::vector<byte>& v)
430
474
  {
431
- std::pair<const Ice::Byte*, const Ice::Byte*> p;
475
+ std::pair<const byte*, const byte*> p;
432
476
  read(p);
433
- if(p.first != p.second)
477
+ if (p.first != p.second)
434
478
  {
435
479
  v.resize(static_cast<size_t>(p.second - p.first));
436
480
  copy(p.first, p.second, v.begin());
@@ -442,10 +486,10 @@ Ice::InputStream::read(std::vector<Ice::Byte>& v)
442
486
  }
443
487
 
444
488
  void
445
- Ice::InputStream::read(pair<const Byte*, const Byte*>& v)
489
+ Ice::InputStream::read(pair<const byte*, const byte*>& v)
446
490
  {
447
- Int sz = readAndCheckSeqSize(1);
448
- if(sz > 0)
491
+ int32_t sz = readAndCheckSeqSize(1);
492
+ if (sz > 0)
449
493
  {
450
494
  v.first = i;
451
495
  v.second = i + sz;
@@ -460,11 +504,11 @@ Ice::InputStream::read(pair<const Byte*, const Byte*>& v)
460
504
  void
461
505
  Ice::InputStream::read(vector<bool>& v)
462
506
  {
463
- Int sz = readAndCheckSeqSize(1);
464
- if(sz > 0)
507
+ int32_t sz = readAndCheckSeqSize(1);
508
+ if (sz > 0)
465
509
  {
466
510
  v.resize(static_cast<size_t>(sz));
467
- copy(i, i + sz, v.begin());
511
+ copy(reinterpret_cast<uint8_t*>(i), reinterpret_cast<uint8_t*>(i) + sz, v.begin());
468
512
  i += sz;
469
513
  }
470
514
  else
@@ -475,47 +519,42 @@ Ice::InputStream::read(vector<bool>& v)
475
519
 
476
520
  namespace
477
521
  {
478
-
479
- template<size_t boolSize>
480
- struct ReadBoolHelper
481
- {
482
- static bool* read(pair<const bool*, const bool*>& v, Int sz, InputStream::Container::iterator& i)
522
+ template<size_t boolSize> struct ReadBoolHelper
483
523
  {
484
- bool* array = new bool[static_cast<size_t>(sz)];
485
- for(int idx = 0; idx < sz; ++idx)
524
+ static bool* read(pair<const bool*, const bool*>& v, int32_t sz, InputStream::Container::iterator& i)
486
525
  {
487
- array[idx] = static_cast<bool>(*(i + idx));
526
+ bool* array = new bool[static_cast<size_t>(sz)];
527
+ for (int idx = 0; idx < sz; ++idx)
528
+ {
529
+ array[idx] = static_cast<bool>(*(i + idx));
530
+ }
531
+ v.first = array;
532
+ v.second = array + sz;
533
+ return array;
488
534
  }
489
- v.first = array;
490
- v.second = array + sz;
491
- return array;
492
- }
493
- };
535
+ };
494
536
 
495
- template<>
496
- struct ReadBoolHelper<1>
497
- {
498
- static bool* read(pair<const bool*, const bool*>& v, Int sz, InputStream::Container::iterator& i)
537
+ template<> struct ReadBoolHelper<1>
499
538
  {
500
- v.first = reinterpret_cast<bool*>(i);
501
- v.second = reinterpret_cast<bool*>(i) + sz;
502
- return 0;
503
- }
504
- };
505
-
539
+ static bool* read(pair<const bool*, const bool*>& v, int32_t sz, InputStream::Container::iterator& i)
540
+ {
541
+ v.first = reinterpret_cast<bool*>(i);
542
+ v.second = reinterpret_cast<bool*>(i) + sz;
543
+ return nullptr;
544
+ }
545
+ };
506
546
  }
507
547
 
508
- #ifdef ICE_CPP11_MAPPING
509
548
  void
510
549
  Ice::InputStream::read(pair<const bool*, const bool*>& v)
511
550
  {
512
- Int sz = readAndCheckSeqSize(1);
513
- if(sz > 0)
551
+ int32_t sz = readAndCheckSeqSize(1);
552
+ if (sz > 0)
514
553
  {
515
554
  auto boolArray = ReadBoolHelper<sizeof(bool)>::read(v, sz, i);
516
- if(boolArray)
555
+ if (boolArray)
517
556
  {
518
- _deleters.push_back([boolArray] { delete[] boolArray; });
557
+ _deleters.emplace_back([boolArray] { delete[] boolArray; });
519
558
  }
520
559
  i += sz;
521
560
  }
@@ -525,65 +564,53 @@ Ice::InputStream::read(pair<const bool*, const bool*>& v)
525
564
  }
526
565
  }
527
566
 
528
- #else
529
567
  void
530
- Ice::InputStream::read(pair<const bool*, const bool*>& v, IceUtil::ScopedArray<bool>& result)
568
+ Ice::InputStream::read(int16_t& v)
531
569
  {
532
- Int sz = readAndCheckSeqSize(1);
533
- if(sz > 0)
570
+ if (b.end() - i < static_cast<int>(sizeof(int16_t)))
534
571
  {
535
- result.reset(ReadBoolHelper<sizeof(bool)>::read(v, sz, i));
536
- i += sz;
572
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
537
573
  }
538
- else
574
+ const byte* src = &(*i);
575
+ i += sizeof(int16_t);
576
+ if constexpr (endian::native == endian::big)
539
577
  {
540
- result.reset();
541
- v.first = v.second = reinterpret_cast<bool*>(i);
578
+ byte* dest = reinterpret_cast<byte*>(&v) + sizeof(int16_t) - 1;
579
+ *dest-- = *src++;
580
+ *dest = *src;
542
581
  }
543
- }
544
- #endif
545
-
546
- void
547
- Ice::InputStream::read(Short& v)
548
- {
549
- if(b.end() - i < static_cast<int>(sizeof(Short)))
582
+ else
550
583
  {
551
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
584
+ byte* dest = reinterpret_cast<byte*>(&v);
585
+ *dest++ = *src++;
586
+ *dest = *src;
552
587
  }
553
- const Byte* src = &(*i);
554
- i += sizeof(Short);
555
- #ifdef ICE_BIG_ENDIAN
556
- Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Short) - 1;
557
- *dest-- = *src++;
558
- *dest = *src;
559
- #else
560
- Byte* dest = reinterpret_cast<Byte*>(&v);
561
- *dest++ = *src++;
562
- *dest = *src;
563
- #endif
564
588
  }
565
589
 
566
590
  void
567
- Ice::InputStream::read(vector<Short>& v)
591
+ Ice::InputStream::read(vector<int16_t>& v)
568
592
  {
569
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Short)));
570
- if(sz > 0)
593
+ int32_t sz = readAndCheckSeqSize(static_cast<int>(sizeof(int16_t)));
594
+ if (sz > 0)
571
595
  {
572
596
  Container::iterator begin = i;
573
- i += sz * static_cast<int>(sizeof(Short));
597
+ i += sz * static_cast<int>(sizeof(int16_t));
574
598
  v.resize(static_cast<size_t>(sz));
575
- #ifdef ICE_BIG_ENDIAN
576
- const Byte* src = &(*begin);
577
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Short) - 1;
578
- for(int j = 0 ; j < sz ; ++j)
599
+ if constexpr (endian::native == endian::big)
600
+ {
601
+ const byte* src = &(*begin);
602
+ byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int16_t) - 1;
603
+ for (int j = 0; j < sz; ++j)
604
+ {
605
+ *dest-- = *src++;
606
+ *dest-- = *src++;
607
+ dest += 2 * sizeof(int16_t);
608
+ }
609
+ }
610
+ else
579
611
  {
580
- *dest-- = *src++;
581
- *dest-- = *src++;
582
- dest += 2 * sizeof(Short);
612
+ copy(begin, i, reinterpret_cast<byte*>(&v[0]));
583
613
  }
584
- #else
585
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
586
- #endif
587
614
  }
588
615
  else
589
616
  {
@@ -591,81 +618,59 @@ Ice::InputStream::read(vector<Short>& v)
591
618
  }
592
619
  }
593
620
 
594
- #ifdef ICE_CPP11_MAPPING
595
621
  void
596
- Ice::InputStream::read(pair<const short*, const short*>& v)
597
- #else
598
- void
599
- Ice::InputStream::read(pair<const Short*, const Short*>& v, IceUtil::ScopedArray<Short>& result)
600
- #endif
601
- {
602
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Short)));
603
- if(sz > 0)
604
- {
605
- #ifdef ICE_UNALIGNED
606
- v.first = reinterpret_cast<Short*>(i);
607
- i += sz * static_cast<int>(sizeof(Short));
608
- v.second = reinterpret_cast<Short*>(i);
609
- #else
610
- # ifdef ICE_CPP11_MAPPING
611
- auto result = new short[static_cast<size_t>(sz)];
612
- _deleters.push_back([result] { delete[] result; });
613
- v.first = result;
614
- v.second = result + sz;
615
- # else
616
- result.reset(new Short[static_cast<size_t>(sz)]);
617
- v.first = result.get();
618
- v.second = result.get() + sz;
619
- # endif
620
-
621
- Container::iterator begin = i;
622
- i += sz * static_cast<int>(sizeof(Short));
623
- # ifdef ICE_BIG_ENDIAN
624
- const Byte* src = &(*begin);
625
- Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Short) - 1;
626
- for(int j = 0 ; j < sz ; ++j)
627
- {
628
- *dest-- = *src++;
629
- *dest-- = *src++;
630
- dest += 2 * sizeof(Short);
631
- }
632
- # else
633
- copy(begin, i, reinterpret_cast<Byte*>(&result[0]));
634
- # endif
635
- #endif
622
+ Ice::InputStream::read(int32_t& v)
623
+ {
624
+ if (b.end() - i < static_cast<int>(sizeof(int32_t)))
625
+ {
626
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
627
+ }
628
+ const byte* src = &(*i);
629
+ i += sizeof(int32_t);
630
+ if constexpr (endian::native == endian::big)
631
+ {
632
+ byte* dest = reinterpret_cast<byte*>(&v) + sizeof(int32_t) - 1;
633
+ *dest-- = *src++;
634
+ *dest-- = *src++;
635
+ *dest-- = *src++;
636
+ *dest = *src;
636
637
  }
637
638
  else
638
639
  {
639
- #ifndef ICE_CPP11_MAPPING
640
- result.reset();
641
- #endif
642
- v.first = v.second = 0;
640
+ byte* dest = reinterpret_cast<byte*>(&v);
641
+ *dest++ = *src++;
642
+ *dest++ = *src++;
643
+ *dest++ = *src++;
644
+ *dest = *src;
643
645
  }
644
646
  }
645
647
 
646
648
  void
647
- Ice::InputStream::read(vector<Int>& v)
649
+ Ice::InputStream::read(vector<int32_t>& v)
648
650
  {
649
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Int)));
650
- if(sz > 0)
651
+ int32_t sz = readAndCheckSeqSize(static_cast<int>(sizeof(int32_t)));
652
+ if (sz > 0)
651
653
  {
652
654
  Container::iterator begin = i;
653
- i += sz * static_cast<int>(sizeof(Int));
655
+ i += sz * static_cast<int>(sizeof(int32_t));
654
656
  v.resize(static_cast<size_t>(sz));
655
- #ifdef ICE_BIG_ENDIAN
656
- const Byte* src = &(*begin);
657
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Int) - 1;
658
- for(int j = 0 ; j < sz ; ++j)
657
+ if constexpr (endian::native == endian::big)
658
+ {
659
+ const byte* src = &(*begin);
660
+ byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int32_t) - 1;
661
+ for (int j = 0; j < sz; ++j)
662
+ {
663
+ *dest-- = *src++;
664
+ *dest-- = *src++;
665
+ *dest-- = *src++;
666
+ *dest-- = *src++;
667
+ dest += 2 * sizeof(int32_t);
668
+ }
669
+ }
670
+ else
659
671
  {
660
- *dest-- = *src++;
661
- *dest-- = *src++;
662
- *dest-- = *src++;
663
- *dest-- = *src++;
664
- dest += 2 * sizeof(Int);
672
+ copy(begin, i, reinterpret_cast<byte*>(&v[0]));
665
673
  }
666
- #else
667
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
668
- #endif
669
674
  }
670
675
  else
671
676
  {
@@ -673,120 +678,71 @@ Ice::InputStream::read(vector<Int>& v)
673
678
  }
674
679
  }
675
680
 
676
- #ifdef ICE_CPP11_MAPPING
677
- void
678
- Ice::InputStream::read(pair<const Int*, const Int*>& v)
679
- #else
680
681
  void
681
- Ice::InputStream::read(pair<const Int*, const Int*>& v, ::IceUtil::ScopedArray<Int>& result)
682
- #endif
683
- {
684
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Int)));
685
- if(sz > 0)
686
- {
687
- #ifdef ICE_UNALIGNED
688
- v.first = reinterpret_cast<Int*>(i);
689
- i += sz * static_cast<int>(sizeof(Int));
690
- v.second = reinterpret_cast<Int*>(i);
691
- #else
692
-
693
- # ifdef ICE_CPP11_MAPPING
694
- auto result = new int[static_cast<size_t>(sz)];
695
- _deleters.push_back([result] { delete[] result; });
696
- v.first = result;
697
- v.second = result + sz;
698
- # else
699
- result.reset(new Int[static_cast<size_t>(sz)]);
700
- v.first = result.get();
701
- v.second = result.get() + sz;
702
- # endif
703
-
704
- Container::iterator begin = i;
705
- i += sz * static_cast<int>(sizeof(Int));
706
- # ifdef ICE_BIG_ENDIAN
707
- const Byte* src = &(*begin);
708
- Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Int) - 1;
709
- for(int j = 0 ; j < sz ; ++j)
710
- {
711
- *dest-- = *src++;
712
- *dest-- = *src++;
713
- *dest-- = *src++;
714
- *dest-- = *src++;
715
- dest += 2 * sizeof(Int);
716
- }
717
- # else
718
- copy(begin, i, reinterpret_cast<Byte*>(&result[0]));
719
- # endif
720
- #endif
682
+ Ice::InputStream::read(int64_t& v)
683
+ {
684
+ if (b.end() - i < static_cast<int>(sizeof(int64_t)))
685
+ {
686
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
687
+ }
688
+ const byte* src = &(*i);
689
+ i += sizeof(int64_t);
690
+ if constexpr (endian::native == endian::big)
691
+ {
692
+ byte* dest = reinterpret_cast<byte*>(&v) + sizeof(int64_t) - 1;
693
+ *dest-- = *src++;
694
+ *dest-- = *src++;
695
+ *dest-- = *src++;
696
+ *dest-- = *src++;
697
+ *dest-- = *src++;
698
+ *dest-- = *src++;
699
+ *dest-- = *src++;
700
+ *dest = *src;
721
701
  }
722
702
  else
723
703
  {
724
- #ifndef ICE_CPP11_MAPPING
725
- result.reset();
726
- #endif
727
- v.first = v.second = 0;
704
+ byte* dest = reinterpret_cast<byte*>(&v);
705
+ *dest++ = *src++;
706
+ *dest++ = *src++;
707
+ *dest++ = *src++;
708
+ *dest++ = *src++;
709
+ *dest++ = *src++;
710
+ *dest++ = *src++;
711
+ *dest++ = *src++;
712
+ *dest = *src;
728
713
  }
729
714
  }
730
715
 
731
716
  void
732
- Ice::InputStream::read(Long& v)
733
- {
734
- if(b.end() - i < static_cast<int>(sizeof(Long)))
735
- {
736
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
737
- }
738
- const Byte* src = &(*i);
739
- i += sizeof(Long);
740
- #ifdef ICE_BIG_ENDIAN
741
- Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Long) - 1;
742
- *dest-- = *src++;
743
- *dest-- = *src++;
744
- *dest-- = *src++;
745
- *dest-- = *src++;
746
- *dest-- = *src++;
747
- *dest-- = *src++;
748
- *dest-- = *src++;
749
- *dest = *src;
750
- #else
751
- Byte* dest = reinterpret_cast<Byte*>(&v);
752
- *dest++ = *src++;
753
- *dest++ = *src++;
754
- *dest++ = *src++;
755
- *dest++ = *src++;
756
- *dest++ = *src++;
757
- *dest++ = *src++;
758
- *dest++ = *src++;
759
- *dest = *src;
760
- #endif
761
- }
762
-
763
- void
764
- Ice::InputStream::read(vector<Long>& v)
717
+ Ice::InputStream::read(vector<int64_t>& v)
765
718
  {
766
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Long)));
767
- if(sz > 0)
719
+ int32_t sz = readAndCheckSeqSize(static_cast<int>(sizeof(int64_t)));
720
+ if (sz > 0)
768
721
  {
769
722
  Container::iterator begin = i;
770
- i += sz * static_cast<int>(sizeof(Long));
723
+ i += sz * static_cast<int>(sizeof(int64_t));
771
724
  v.resize(static_cast<size_t>(sz));
772
- #ifdef ICE_BIG_ENDIAN
773
- const Byte* src = &(*begin);
774
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Long) - 1;
775
- for(int j = 0 ; j < sz ; ++j)
776
- {
777
- *dest-- = *src++;
778
- *dest-- = *src++;
779
- *dest-- = *src++;
780
- *dest-- = *src++;
781
- *dest-- = *src++;
782
- *dest-- = *src++;
783
- *dest-- = *src++;
784
- *dest-- = *src++;
785
- dest += 2 * sizeof(Long);
786
- }
787
- #else
788
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
789
- #endif
725
+ if constexpr (endian::native == endian::big)
726
+ {
727
+ const byte* src = &(*begin);
728
+ byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int64_t) - 1;
729
+ for (int j = 0; j < sz; ++j)
730
+ {
731
+ *dest-- = *src++;
732
+ *dest-- = *src++;
733
+ *dest-- = *src++;
734
+ *dest-- = *src++;
735
+ *dest-- = *src++;
736
+ *dest-- = *src++;
737
+ *dest-- = *src++;
738
+ *dest-- = *src++;
739
+ dest += 2 * sizeof(int64_t);
740
+ }
741
+ }
742
+ else
743
+ {
744
+ copy(begin, i, reinterpret_cast<byte*>(&v[0]));
745
+ }
790
746
  }
791
747
  else
792
748
  {
@@ -794,112 +750,59 @@ Ice::InputStream::read(vector<Long>& v)
794
750
  }
795
751
  }
796
752
 
797
- #ifdef ICE_CPP11_MAPPING
798
- void
799
- Ice::InputStream::read(pair<const Long*, const Long*>& v)
800
- #else
801
753
  void
802
- Ice::InputStream::read(pair<const Long*, const Long*>& v, IceUtil::ScopedArray<Long>& result)
803
- #endif
804
- {
805
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Long)));
806
- if(sz > 0)
807
- {
808
- #ifdef ICE_UNALIGNED
809
- v.first = reinterpret_cast<Long*>(i);
810
- i += sz * static_cast<int>(sizeof(Long));
811
- v.second = reinterpret_cast<Long*>(i);
812
- #else
813
-
814
- # ifdef ICE_CPP11_MAPPING
815
- auto result = new long long[static_cast<size_t>(sz)];
816
- _deleters.push_back([result] { delete[] result; });
817
- v.first = result;
818
- v.second = result + sz;
819
- # else
820
- result.reset(new Long[static_cast<size_t>(sz)]);
821
- v.first = result.get();
822
- v.second = result.get() + sz;
823
- # endif
824
-
825
- Container::iterator begin = i;
826
- i += sz * static_cast<int>(sizeof(Long));
827
- # ifdef ICE_BIG_ENDIAN
828
- const Byte* src = &(*begin);
829
- Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Long) - 1;
830
- for(int j = 0 ; j < sz ; ++j)
831
- {
832
- *dest-- = *src++;
833
- *dest-- = *src++;
834
- *dest-- = *src++;
835
- *dest-- = *src++;
836
- *dest-- = *src++;
837
- *dest-- = *src++;
838
- *dest-- = *src++;
839
- *dest-- = *src++;
840
- dest += 2 * sizeof(Long);
841
- }
842
- # else
843
- copy(begin, i, reinterpret_cast<Byte*>(&result[0]));
844
- # endif
845
- #endif
754
+ Ice::InputStream::read(float& v)
755
+ {
756
+ if (b.end() - i < static_cast<int>(sizeof(float)))
757
+ {
758
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
846
759
  }
847
- else
760
+ const byte* src = &(*i);
761
+ i += sizeof(float);
762
+ if constexpr (endian::native == endian::big)
848
763
  {
849
- #ifndef ICE_CPP11_MAPPING
850
- result.reset();
851
- #endif
852
- v.first = v.second = 0;
764
+ byte* dest = reinterpret_cast<byte*>(&v) + sizeof(float) - 1;
765
+ *dest-- = *src++;
766
+ *dest-- = *src++;
767
+ *dest-- = *src++;
768
+ *dest = *src;
853
769
  }
854
- }
855
-
856
- void
857
- Ice::InputStream::read(Float& v)
858
- {
859
- if(b.end() - i < static_cast<int>(sizeof(Float)))
770
+ else
860
771
  {
861
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
772
+ byte* dest = reinterpret_cast<byte*>(&v);
773
+ *dest++ = *src++;
774
+ *dest++ = *src++;
775
+ *dest++ = *src++;
776
+ *dest = *src;
862
777
  }
863
- const Byte* src = &(*i);
864
- i += sizeof(Float);
865
- #ifdef ICE_BIG_ENDIAN
866
- Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Float) - 1;
867
- *dest-- = *src++;
868
- *dest-- = *src++;
869
- *dest-- = *src++;
870
- *dest = *src;
871
- #else
872
- Byte* dest = reinterpret_cast<Byte*>(&v);
873
- *dest++ = *src++;
874
- *dest++ = *src++;
875
- *dest++ = *src++;
876
- *dest = *src;
877
- #endif
878
778
  }
879
779
 
880
780
  void
881
- Ice::InputStream::read(vector<Float>& v)
781
+ Ice::InputStream::read(vector<float>& v)
882
782
  {
883
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Float)));
884
- if(sz > 0)
783
+ int32_t sz = readAndCheckSeqSize(static_cast<int>(sizeof(float)));
784
+ if (sz > 0)
885
785
  {
886
786
  Container::iterator begin = i;
887
- i += sz * static_cast<int>(sizeof(Float));
787
+ i += sz * static_cast<int>(sizeof(float));
888
788
  v.resize(static_cast<size_t>(sz));
889
- #ifdef ICE_BIG_ENDIAN
890
- const Byte* src = &(*begin);
891
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Float) - 1;
892
- for(int j = 0 ; j < sz ; ++j)
789
+ if constexpr (endian::native == endian::big)
893
790
  {
894
- *dest-- = *src++;
895
- *dest-- = *src++;
896
- *dest-- = *src++;
897
- *dest-- = *src++;
898
- dest += 2 * sizeof(Float);
791
+ const byte* src = &(*begin);
792
+ byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(float) - 1;
793
+ for (int j = 0; j < sz; ++j)
794
+ {
795
+ *dest-- = *src++;
796
+ *dest-- = *src++;
797
+ *dest-- = *src++;
798
+ *dest-- = *src++;
799
+ dest += 2 * sizeof(float);
800
+ }
801
+ }
802
+ else
803
+ {
804
+ copy(begin, i, reinterpret_cast<byte*>(&v[0]));
899
805
  }
900
- #else
901
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
902
- #endif
903
806
  }
904
807
  else
905
808
  {
@@ -907,120 +810,71 @@ Ice::InputStream::read(vector<Float>& v)
907
810
  }
908
811
  }
909
812
 
910
- #ifdef ICE_CPP11_MAPPING
911
813
  void
912
- Ice::InputStream::read(pair<const Float*, const Float*>& v)
913
- #else
914
- void
915
- Ice::InputStream::read(pair<const Float*, const Float*>& v, IceUtil::ScopedArray<Float>& result)
916
- #endif
917
- {
918
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Float)));
919
- if(sz > 0)
920
- {
921
- #ifdef ICE_UNALIGNED
922
- v.first = reinterpret_cast<Float*>(i);
923
- i += sz * static_cast<int>(sizeof(Float));
924
- v.second = reinterpret_cast<Float*>(i);
925
- #else
926
-
927
- # ifdef ICE_CPP11_MAPPING
928
- auto result = new float[static_cast<size_t>(sz)];
929
- _deleters.push_back([result] { delete[] result; });
930
- v.first = result;
931
- v.second = result + sz;
932
- # else
933
- result.reset(new Float[static_cast<size_t>(sz)]);
934
- v.first = result.get();
935
- v.second = result.get() + sz;
936
- # endif
937
-
938
- Container::iterator begin = i;
939
- i += sz * static_cast<int>(sizeof(Float));
940
- # ifdef ICE_BIG_ENDIAN
941
- const Byte* src = &(*begin);
942
- Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Float) - 1;
943
- for(int j = 0 ; j < sz ; ++j)
944
- {
945
- *dest-- = *src++;
946
- *dest-- = *src++;
947
- *dest-- = *src++;
948
- *dest-- = *src++;
949
- dest += 2 * sizeof(Float);
950
- }
951
- # else
952
- copy(begin, i, reinterpret_cast<Byte*>(&result[0]));
953
- # endif
954
- #endif
814
+ Ice::InputStream::read(double& v)
815
+ {
816
+ if (b.end() - i < static_cast<int>(sizeof(double)))
817
+ {
818
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
819
+ }
820
+ const byte* src = &(*i);
821
+ i += sizeof(double);
822
+ if constexpr (endian::native == endian::big)
823
+ {
824
+ byte* dest = reinterpret_cast<byte*>(&v) + sizeof(double) - 1;
825
+ *dest-- = *src++;
826
+ *dest-- = *src++;
827
+ *dest-- = *src++;
828
+ *dest-- = *src++;
829
+ *dest-- = *src++;
830
+ *dest-- = *src++;
831
+ *dest-- = *src++;
832
+ *dest = *src;
955
833
  }
956
834
  else
957
835
  {
958
- #ifndef ICE_CPP11_MAPPING
959
- result.reset();
960
- #endif
961
- v.first = v.second = 0;
836
+ byte* dest = reinterpret_cast<byte*>(&v);
837
+ *dest++ = *src++;
838
+ *dest++ = *src++;
839
+ *dest++ = *src++;
840
+ *dest++ = *src++;
841
+ *dest++ = *src++;
842
+ *dest++ = *src++;
843
+ *dest++ = *src++;
844
+ *dest = *src;
962
845
  }
963
846
  }
964
847
 
965
848
  void
966
- Ice::InputStream::read(Double& v)
967
- {
968
- if(b.end() - i < static_cast<int>(sizeof(Double)))
969
- {
970
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
971
- }
972
- const Byte* src = &(*i);
973
- i += sizeof(Double);
974
- #ifdef ICE_BIG_ENDIAN
975
- Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Double) - 1;
976
- *dest-- = *src++;
977
- *dest-- = *src++;
978
- *dest-- = *src++;
979
- *dest-- = *src++;
980
- *dest-- = *src++;
981
- *dest-- = *src++;
982
- *dest-- = *src++;
983
- *dest = *src;
984
- #else
985
- Byte* dest = reinterpret_cast<Byte*>(&v);
986
- *dest++ = *src++;
987
- *dest++ = *src++;
988
- *dest++ = *src++;
989
- *dest++ = *src++;
990
- *dest++ = *src++;
991
- *dest++ = *src++;
992
- *dest++ = *src++;
993
- *dest = *src;
994
- #endif
995
- }
996
-
997
- void
998
- Ice::InputStream::read(vector<Double>& v)
849
+ Ice::InputStream::read(vector<double>& v)
999
850
  {
1000
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Double)));
1001
- if(sz > 0)
851
+ int32_t sz = readAndCheckSeqSize(static_cast<int>(sizeof(double)));
852
+ if (sz > 0)
1002
853
  {
1003
854
  Container::iterator begin = i;
1004
- i += sz * static_cast<int>(sizeof(Double));
855
+ i += sz * static_cast<int>(sizeof(double));
1005
856
  v.resize(static_cast<size_t>(sz));
1006
- #ifdef ICE_BIG_ENDIAN
1007
- const Byte* src = &(*begin);
1008
- Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Double) - 1;
1009
- for(int j = 0 ; j < sz ; ++j)
1010
- {
1011
- *dest-- = *src++;
1012
- *dest-- = *src++;
1013
- *dest-- = *src++;
1014
- *dest-- = *src++;
1015
- *dest-- = *src++;
1016
- *dest-- = *src++;
1017
- *dest-- = *src++;
1018
- *dest-- = *src++;
1019
- dest += 2 * sizeof(Double);
1020
- }
1021
- #else
1022
- copy(begin, i, reinterpret_cast<Byte*>(&v[0]));
1023
- #endif
857
+ if constexpr (endian::native == endian::big)
858
+ {
859
+ const byte* src = &(*begin);
860
+ byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(double) - 1;
861
+ for (int j = 0; j < sz; ++j)
862
+ {
863
+ *dest-- = *src++;
864
+ *dest-- = *src++;
865
+ *dest-- = *src++;
866
+ *dest-- = *src++;
867
+ *dest-- = *src++;
868
+ *dest-- = *src++;
869
+ *dest-- = *src++;
870
+ *dest-- = *src++;
871
+ dest += 2 * sizeof(double);
872
+ }
873
+ }
874
+ else
875
+ {
876
+ copy(begin, i, reinterpret_cast<byte*>(&v[0]));
877
+ }
1024
878
  }
1025
879
  else
1026
880
  {
@@ -1028,77 +882,18 @@ Ice::InputStream::read(vector<Double>& v)
1028
882
  }
1029
883
  }
1030
884
 
1031
- #ifdef ICE_CPP11_MAPPING
1032
- void
1033
- Ice::InputStream::read(pair<const Double*, const Double*>& v)
1034
- #else
1035
- void
1036
- Ice::InputStream::read(pair<const Double*, const Double*>& v, IceUtil::ScopedArray<Double>& result)
1037
- #endif
1038
- {
1039
- Int sz = readAndCheckSeqSize(static_cast<int>(sizeof(Double)));
1040
- if(sz > 0)
1041
- {
1042
- #ifdef ICE_UNALIGNED
1043
- v.first = reinterpret_cast<Double*>(i);
1044
- i += sz * static_cast<int>(sizeof(Double));
1045
- v.second = reinterpret_cast<Double*>(i);
1046
- #else
1047
-
1048
- # ifdef ICE_CPP11_MAPPING
1049
- auto result = new double[static_cast<size_t>(sz)];
1050
- _deleters.push_back([result] { delete[] result; });
1051
- v.first = result;
1052
- v.second = result + sz;
1053
- # else
1054
- result.reset(new Double[static_cast<size_t>(sz)]);
1055
- v.first = result.get();
1056
- v.second = result.get() + sz;
1057
- # endif
1058
-
1059
- Container::iterator begin = i;
1060
- i += sz * static_cast<int>(sizeof(Double));
1061
- # ifdef ICE_BIG_ENDIAN
1062
- const Byte* src = &(*begin);
1063
- Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Double) - 1;
1064
- for(int j = 0 ; j < sz ; ++j)
1065
- {
1066
- *dest-- = *src++;
1067
- *dest-- = *src++;
1068
- *dest-- = *src++;
1069
- *dest-- = *src++;
1070
- *dest-- = *src++;
1071
- *dest-- = *src++;
1072
- *dest-- = *src++;
1073
- *dest-- = *src++;
1074
- dest += 2 * sizeof(Double);
1075
- }
1076
- # else
1077
- copy(begin, i, reinterpret_cast<Byte*>(&result[0]));
1078
- # endif
1079
- #endif
1080
- }
1081
- else
1082
- {
1083
- #ifndef ICE_CPP11_MAPPING
1084
- result.reset();
1085
- #endif
1086
- v.first = v.second = 0;
1087
- }
1088
- }
1089
-
1090
885
  void
1091
886
  Ice::InputStream::read(std::string& v, bool convert)
1092
887
  {
1093
- Int sz = readSize();
1094
- if(sz > 0)
888
+ int32_t sz = readSize();
889
+ if (sz > 0)
1095
890
  {
1096
- if(b.end() - i < sz)
891
+ if (b.end() - i < sz)
1097
892
  {
1098
893
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1099
894
  }
1100
895
 
1101
- if(!convert || !readConverted(v, sz))
896
+ if (!convert || !readConverted(v, sz))
1102
897
  {
1103
898
  string(reinterpret_cast<const char*>(&*i), reinterpret_cast<const char*>(&*i) + sz).swap(v);
1104
899
  }
@@ -1110,19 +905,18 @@ Ice::InputStream::read(std::string& v, bool convert)
1110
905
  }
1111
906
  }
1112
907
 
1113
- #ifdef ICE_CPP11_MAPPING
1114
908
  void
1115
909
  Ice::InputStream::read(const char*& vdata, size_t& vsize, bool convert)
1116
910
  {
1117
911
  int sz = readSize();
1118
- if(sz > 0)
912
+ if (sz > 0)
1119
913
  {
1120
- if(b.end() - i < sz)
914
+ if (b.end() - i < sz)
1121
915
  {
1122
916
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1123
917
  }
1124
918
 
1125
- if(convert == false)
919
+ if (convert == false)
1126
920
  {
1127
921
  vdata = reinterpret_cast<const char*>(&*i);
1128
922
  vsize = static_cast<size_t>(sz);
@@ -1131,9 +925,9 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize, bool convert)
1131
925
  else
1132
926
  {
1133
927
  string converted;
1134
- if(readConverted(converted, sz))
928
+ if (readConverted(converted, sz))
1135
929
  {
1136
- if(converted.size() <= static_cast<size_t>(sz))
930
+ if (converted.size() <= static_cast<size_t>(sz))
1137
931
  {
1138
932
  //
1139
933
  // Write converted string directly into buffer
@@ -1145,7 +939,7 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize, bool convert)
1145
939
  else
1146
940
  {
1147
941
  auto holder = new string(std::move(converted));
1148
- _deleters.push_back([holder] { delete holder; });
942
+ _deleters.emplace_back([holder] { delete holder; });
1149
943
  vdata = holder->data();
1150
944
  vsize = holder->size();
1151
945
  }
@@ -1160,153 +954,70 @@ Ice::InputStream::read(const char*& vdata, size_t& vsize, bool convert)
1160
954
  }
1161
955
  else
1162
956
  {
1163
- vdata = 0;
957
+ vdata = nullptr;
1164
958
  vsize = 0;
1165
959
  }
1166
960
  }
1167
961
 
1168
- #else
1169
-
1170
- void
1171
- Ice::InputStream::read(const char*& vdata, size_t& vsize)
1172
- {
1173
- Int sz = readSize();
1174
- if(sz > 0)
1175
- {
1176
- if(b.end() - i < sz)
1177
- {
1178
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1179
- }
1180
-
1181
- vdata = reinterpret_cast<const char*>(&*i);
1182
- vsize = static_cast<size_t>(sz);
1183
- i += sz;
1184
- }
1185
- else
1186
- {
1187
- vdata = 0;
1188
- vsize = 0;
1189
- }
1190
- }
1191
-
1192
- void
1193
- Ice::InputStream::read(const char*& vdata, size_t& vsize, string& holder)
1194
- {
1195
- Int sz = readSize();
1196
- if(sz > 0)
1197
- {
1198
- if(b.end() - i < sz)
1199
- {
1200
- throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1201
- }
1202
-
1203
- if(readConverted(holder, sz))
1204
- {
1205
- vdata = holder.data();
1206
- vsize = holder.size();
1207
- }
1208
- else
1209
- {
1210
- vdata = reinterpret_cast<const char*>(&*i);
1211
- vsize = static_cast<size_t>(sz);
1212
- }
1213
- i += sz;
1214
- }
1215
- else
1216
- {
1217
- holder.clear();
1218
- vdata = 0;
1219
- vsize = 0;
1220
- }
1221
- }
1222
- #endif
1223
-
1224
962
  bool
1225
963
  Ice::InputStream::readConverted(string& v, int sz)
1226
964
  {
1227
965
  try
1228
966
  {
1229
967
  bool converted = false;
1230
-
1231
- //
1232
- // NOTE: When using an _instance, we get a const& on the string reference to
1233
- // not have to increment unecessarily its reference count.
1234
- //
1235
-
1236
- if(_instance)
968
+ const StringConverterPtr& stringConverter = _instance->getStringConverter();
969
+ if (stringConverter)
1237
970
  {
1238
- const StringConverterPtr& stringConverter = _instance->getStringConverter();
1239
- if(stringConverter)
1240
- {
1241
- stringConverter->fromUTF8(i, i + sz, v);
1242
- converted = true;
1243
- }
1244
- }
1245
- else
1246
- {
1247
- StringConverterPtr stringConverter = getProcessStringConverter();
1248
- if(stringConverter)
1249
- {
1250
- stringConverter->fromUTF8(i, i + sz, v);
1251
- converted = true;
1252
- }
971
+ stringConverter->fromUTF8(i, i + sz, v);
972
+ converted = true;
1253
973
  }
1254
974
 
1255
975
  return converted;
1256
976
  }
1257
- catch(const IllegalConversionException& ex)
977
+ catch (const IllegalConversionException& ex)
1258
978
  {
1259
- throw StringConversionException(__FILE__, __LINE__, ex.reason());
979
+ throw MarshalException{__FILE__, __LINE__, string{"failed to unmarshal a string:\n"} + ex.what()};
1260
980
  }
1261
981
  }
1262
982
 
1263
983
  void
1264
984
  Ice::InputStream::read(vector<string>& v, bool convert)
1265
985
  {
1266
- Int sz = readAndCheckSeqSize(1);
1267
- if(sz > 0)
986
+ int32_t sz = readAndCheckSeqSize(1);
987
+ if (sz > 0)
1268
988
  {
1269
989
  v.resize(static_cast<size_t>(sz));
1270
- for(size_t j = 0; j < static_cast<size_t>(sz); ++j)
990
+ for (size_t j = 0; j < static_cast<size_t>(sz); ++j)
1271
991
  {
1272
992
  read(v[j], convert);
1273
993
  }
1274
994
  }
1275
995
  else
1276
996
  {
1277
- v.clear();
997
+ v.clear();
1278
998
  }
1279
999
  }
1280
1000
 
1281
1001
  void
1282
1002
  Ice::InputStream::read(wstring& v)
1283
1003
  {
1284
- Int sz = readSize();
1285
- if(sz > 0)
1004
+ int32_t sz = readSize();
1005
+ if (sz > 0)
1286
1006
  {
1287
- if(b.end() - i < sz)
1007
+ if (b.end() - i < sz)
1288
1008
  {
1289
1009
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1290
1010
  }
1291
1011
 
1292
1012
  try
1293
1013
  {
1294
- if(_instance)
1295
- {
1296
- const WstringConverterPtr& wstringConverter = _instance->getWstringConverter();
1297
- wstringConverter->fromUTF8(i, i + sz, v);
1298
- }
1299
- else
1300
- {
1301
- WstringConverterPtr wstringConverter = getProcessWstringConverter();
1302
- wstringConverter->fromUTF8(i, i + sz, v);
1303
- }
1304
-
1014
+ const WstringConverterPtr& wstringConverter = _instance->getWstringConverter();
1015
+ wstringConverter->fromUTF8(i, i + sz, v);
1305
1016
  i += sz;
1306
1017
  }
1307
- catch(const IllegalConversionException& ex)
1018
+ catch (const IllegalConversionException& ex)
1308
1019
  {
1309
- throw StringConversionException(__FILE__, __LINE__, ex.reason());
1020
+ throw MarshalException{__FILE__, __LINE__, string{"failed to unmarshal a string:\n"} + ex.what()};
1310
1021
  }
1311
1022
  }
1312
1023
  else
@@ -1318,65 +1029,77 @@ Ice::InputStream::read(wstring& v)
1318
1029
  void
1319
1030
  Ice::InputStream::read(vector<wstring>& v)
1320
1031
  {
1321
- size_t sz = static_cast<size_t>(readAndCheckSeqSize(1));
1322
- if(sz > 0)
1032
+ auto sz = static_cast<size_t>(readAndCheckSeqSize(1));
1033
+ if (sz > 0)
1323
1034
  {
1324
1035
  v.resize(sz);
1325
- for(size_t j = 0; j < sz; ++j)
1036
+ for (size_t j = 0; j < sz; ++j)
1326
1037
  {
1327
1038
  read(v[j]);
1328
1039
  }
1329
1040
  }
1330
1041
  else
1331
1042
  {
1332
- v.clear();
1043
+ v.clear();
1333
1044
  }
1334
1045
  }
1335
1046
 
1336
- #ifdef ICE_CPP11_MAPPING
1337
- shared_ptr<ObjectPrx>
1338
- Ice::InputStream::readProxy()
1047
+ namespace
1339
1048
  {
1340
- if(!_instance)
1049
+ inline Ice::SliceLoaderPtr getSliceLoader(SliceLoaderPtr sliceLoader, Instance* instance)
1341
1050
  {
1342
- throw MarshalException(__FILE__, __LINE__, "cannot unmarshal a proxy without a communicator");
1051
+ if (!sliceLoader)
1052
+ {
1053
+ sliceLoader = instance->sliceLoader();
1054
+ }
1055
+ return sliceLoader;
1343
1056
  }
1057
+ }
1344
1058
 
1345
- return _instance->proxyFactory()->streamToProxy(this);
1059
+ Ice::InputStream::InputStream(Instance* instance, EncodingVersion encoding, Buffer&& buf, SliceLoaderPtr sliceLoader)
1060
+ : Buffer(std::move(buf)),
1061
+ _instance(instance),
1062
+ _encoding(encoding),
1063
+ _classGraphDepthMax(instance->classGraphDepthMax()),
1064
+ _sliceLoader{getSliceLoader(std::move(sliceLoader), instance)}
1065
+ {
1346
1066
  }
1347
- #else
1348
- void
1349
- Ice::InputStream::read(ObjectPrx& v)
1067
+
1068
+ ReferencePtr
1069
+ Ice::InputStream::readReference()
1350
1070
  {
1351
- if(!_instance)
1071
+ Identity ident;
1072
+ read(ident);
1073
+ if (ident.name.empty())
1352
1074
  {
1353
- throw MarshalException(__FILE__, __LINE__, "cannot unmarshal a proxy without a communicator");
1075
+ return nullptr;
1076
+ }
1077
+ else
1078
+ {
1079
+ return _instance->referenceFactory()->create(std::move(ident), this);
1354
1080
  }
1355
-
1356
- v = _instance->proxyFactory()->streamToProxy(this);
1357
1081
  }
1358
- #endif
1359
1082
 
1360
- Int
1361
- Ice::InputStream::readEnum(Int maxValue)
1083
+ int32_t
1084
+ Ice::InputStream::readEnum(int32_t maxValue)
1362
1085
  {
1363
- if(getEncoding() == Encoding_1_0)
1086
+ if (getEncoding() == Encoding_1_0)
1364
1087
  {
1365
- if(maxValue < 127)
1088
+ if (maxValue < 127)
1366
1089
  {
1367
- Byte value;
1090
+ uint8_t value;
1368
1091
  read(value);
1369
1092
  return value;
1370
1093
  }
1371
- else if(maxValue < 32767)
1094
+ else if (maxValue < 32767)
1372
1095
  {
1373
- Short value;
1096
+ int16_t value;
1374
1097
  read(value);
1375
1098
  return value;
1376
1099
  }
1377
1100
  else
1378
1101
  {
1379
- Int value;
1102
+ int32_t value;
1380
1103
  read(value);
1381
1104
  return value;
1382
1105
  }
@@ -1388,57 +1111,57 @@ Ice::InputStream::readEnum(Int maxValue)
1388
1111
  }
1389
1112
 
1390
1113
  void
1391
- Ice::InputStream::throwException(ICE_IN(ICE_DELEGATE(UserExceptionFactory)) factory)
1114
+ Ice::InputStream::throwException(UserExceptionFactory factory)
1392
1115
  {
1393
1116
  initEncaps();
1394
- _currentEncaps->decoder->throwException(factory);
1117
+ _currentEncaps->decoder->throwException(std::move(factory));
1395
1118
  }
1396
1119
 
1397
1120
  bool
1398
- Ice::InputStream::readOptImpl(Int readTag, OptionalFormat expectedFormat)
1121
+ Ice::InputStream::readOptImpl(int32_t readTag, OptionalFormat expectedFormat)
1399
1122
  {
1400
- if(getEncoding() == Encoding_1_0)
1123
+ if (getEncoding() == Encoding_1_0)
1401
1124
  {
1402
1125
  return false; // Optional members aren't supported with the 1.0 encoding.
1403
1126
  }
1404
1127
 
1405
- while(true)
1128
+ while (true)
1406
1129
  {
1407
- if(i >= b.begin() + _currentEncaps->start + _currentEncaps->sz)
1130
+ if (i >= b.begin() + _currentEncaps->start + _currentEncaps->sz)
1408
1131
  {
1409
1132
  return false; // End of encapsulation also indicates end of optionals.
1410
1133
  }
1411
1134
 
1412
- Byte v;
1135
+ uint8_t v;
1413
1136
  read(v);
1414
- if(v == OPTIONAL_END_MARKER)
1137
+ if (v == OPTIONAL_END_MARKER)
1415
1138
  {
1416
1139
  --i; // Rewind
1417
1140
  return false;
1418
1141
  }
1419
1142
 
1420
- OptionalFormat format = static_cast<OptionalFormat>(v & 0x07); // First 3 bits.
1421
- Int tag = static_cast<Int>(v >> 3);
1422
- if(tag == 30)
1143
+ auto format = static_cast<OptionalFormat>(v & 0x07); // First 3 bits.
1144
+ auto tag = static_cast<int32_t>(v >> 3);
1145
+ if (tag == 30)
1423
1146
  {
1424
1147
  tag = readSize();
1425
1148
  }
1426
1149
 
1427
- if(tag > readTag)
1150
+ if (tag > readTag)
1428
1151
  {
1429
1152
  i -= tag < 30 ? 1 : (tag < 255 ? 2 : 6); // Rewind
1430
- return false; // No optional data members with the requested tag.
1153
+ return false; // No optional data members with the requested tag.
1431
1154
  }
1432
- else if(tag < readTag)
1155
+ else if (tag < readTag)
1433
1156
  {
1434
1157
  skipOptional(format); // Skip optional data members
1435
1158
  }
1436
1159
  else
1437
1160
  {
1438
- if(format != expectedFormat)
1161
+ if (format != expectedFormat)
1439
1162
  {
1440
1163
  ostringstream os;
1441
- os << "invalid optional data member `" << tag << "': unexpected format";
1164
+ os << "invalid optional data member '" << tag << "': unexpected format";
1442
1165
  throw MarshalException(__FILE__, __LINE__, os.str());
1443
1166
  }
1444
1167
  return true;
@@ -1450,53 +1173,52 @@ Ice::InputStream::readOptImpl(Int readTag, OptionalFormat expectedFormat)
1450
1173
  void
1451
1174
  Ice::InputStream::skipOptional(OptionalFormat type)
1452
1175
  {
1453
- switch(type)
1176
+ switch (type)
1454
1177
  {
1455
- case ICE_SCOPED_ENUM(OptionalFormat, F1):
1178
+ case OptionalFormat::F1:
1456
1179
  {
1457
1180
  skip(1);
1458
1181
  break;
1459
1182
  }
1460
- case ICE_SCOPED_ENUM(OptionalFormat, F2):
1183
+ case OptionalFormat::F2:
1461
1184
  {
1462
1185
  skip(2);
1463
1186
  break;
1464
1187
  }
1465
- case ICE_SCOPED_ENUM(OptionalFormat, F4):
1188
+ case OptionalFormat::F4:
1466
1189
  {
1467
1190
  skip(4);
1468
1191
  break;
1469
1192
  }
1470
- case ICE_SCOPED_ENUM(OptionalFormat, F8):
1193
+ case OptionalFormat::F8:
1471
1194
  {
1472
1195
  skip(8);
1473
1196
  break;
1474
1197
  }
1475
- case ICE_SCOPED_ENUM(OptionalFormat, Size):
1198
+ case OptionalFormat::Size:
1476
1199
  {
1477
1200
  skipSize();
1478
1201
  break;
1479
1202
  }
1480
- case ICE_SCOPED_ENUM(OptionalFormat, VSize):
1203
+ case OptionalFormat::VSize:
1481
1204
  {
1482
1205
  skip(static_cast<size_t>(readSize()));
1483
1206
  break;
1484
1207
  }
1485
- case ICE_SCOPED_ENUM(OptionalFormat, FSize):
1208
+ case OptionalFormat::FSize:
1486
1209
  {
1487
- Int sz;
1210
+ int32_t sz;
1488
1211
  read(sz);
1489
- if(sz < 0)
1212
+ if (sz < 0)
1490
1213
  {
1491
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
1214
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
1492
1215
  }
1493
1216
  skip(static_cast<size_t>(sz));
1494
1217
  break;
1495
1218
  }
1496
- case ICE_SCOPED_ENUM(OptionalFormat, Class):
1219
+ case OptionalFormat::Class:
1497
1220
  {
1498
- read(0, 0);
1499
- break;
1221
+ throw MarshalException{__FILE__, __LINE__, "cannot skip optional class"};
1500
1222
  }
1501
1223
  }
1502
1224
  }
@@ -1507,22 +1229,22 @@ Ice::InputStream::skipOptionals()
1507
1229
  //
1508
1230
  // Skip remaining un-read optional members.
1509
1231
  //
1510
- while(true)
1232
+ while (true)
1511
1233
  {
1512
- if(i >= b.begin() + _currentEncaps->start + _currentEncaps->sz)
1234
+ if (i >= b.begin() + _currentEncaps->start + _currentEncaps->sz)
1513
1235
  {
1514
1236
  return; // End of encapsulation also indicates end of optionals.
1515
1237
  }
1516
1238
 
1517
- Byte v;
1239
+ uint8_t v;
1518
1240
  read(v);
1519
- if(v == OPTIONAL_END_MARKER)
1241
+ if (v == OPTIONAL_END_MARKER)
1520
1242
  {
1521
1243
  return;
1522
1244
  }
1523
1245
 
1524
- OptionalFormat format = static_cast<OptionalFormat>(v & 0x07); // Read first 3 bits.
1525
- if(static_cast<Int>(v >> 3) == 30)
1246
+ auto format = static_cast<OptionalFormat>(v & 0x07); // Read first 3 bits.
1247
+ if (static_cast<int32_t>(v >> 3) == 30)
1526
1248
  {
1527
1249
  skipSize();
1528
1250
  }
@@ -1533,204 +1255,59 @@ Ice::InputStream::skipOptionals()
1533
1255
  void
1534
1256
  Ice::InputStream::throwUnmarshalOutOfBoundsException(const char* file, int line)
1535
1257
  {
1536
- throw UnmarshalOutOfBoundsException(file, line);
1258
+ throw MarshalException{file, line, endOfBufferMessage};
1537
1259
  }
1538
1260
 
1539
1261
  void
1540
- Ice::InputStream::throwEncapsulationException(const char* file, int line)
1262
+ Ice::InputStream::traceSkipSlice(string_view typeId, SliceType sliceType) const
1541
1263
  {
1542
- throw EncapsulationException(file, line);
1543
- }
1544
-
1545
- string
1546
- Ice::InputStream::resolveCompactId(int id) const
1547
- {
1548
- string type;
1549
-
1550
- #ifdef ICE_CPP11_MAPPING
1551
- function<string(int)> resolver = compactIdResolver();
1552
- #else
1553
- CompactIdResolverPtr resolver = compactIdResolver();
1554
- #endif
1555
-
1556
- if(resolver)
1264
+ assert(_instance->initializationData().logger); // not null once the communicator is initialized
1265
+ if (_instance->traceLevels()->slicing > 0)
1557
1266
  {
1558
- try
1559
- {
1560
- #ifdef ICE_CPP11_MAPPING
1561
- type = resolver(id);
1562
- #else
1563
- type = resolver->resolve(id);
1564
- #endif
1565
- }
1566
- catch(const LocalException&)
1567
- {
1568
- throw;
1569
- }
1570
- catch(const std::exception& ex)
1571
- {
1572
- ostringstream ostr;
1573
- ostr << "exception in CompactIdResolver for ID " << id;
1574
- string msg = ostr.str();
1575
- string what = ex.what();
1576
- if(!what.empty())
1577
- {
1578
- msg += ":\n" + what;
1579
- }
1580
- throw MarshalException(__FILE__, __LINE__, msg);
1581
- }
1582
- catch(...)
1583
- {
1584
- ostringstream ostr;
1585
- ostr << "unknown exception in CompactIdResolver for ID " << id;
1586
- throw MarshalException(__FILE__, __LINE__, ostr.str());
1587
- }
1588
- }
1589
-
1590
- return type;
1591
- }
1592
-
1593
- void
1594
- Ice::InputStream::postUnmarshal(const ValuePtr& v) const
1595
- {
1596
- try
1597
- {
1598
- #ifndef ICE_CPP11_MAPPING
1599
- if(_collectObjects)
1600
- {
1601
- v->ice_collectable(true);
1602
- }
1603
- #endif
1604
- v->ice_postUnmarshal();
1605
- }
1606
- catch(const std::exception& ex)
1607
- {
1608
- if(logger())
1609
- {
1610
- Warning out(logger());
1611
- out << "std::exception raised by ice_postUnmarshal:\n" << ex;
1612
- }
1613
- }
1614
- catch(...)
1615
- {
1616
- if(logger())
1617
- {
1618
- Warning out(logger());
1619
- out << "unknown exception raised by ice_postUnmarshal";
1620
- }
1267
+ traceSlicing(
1268
+ sliceType == ExceptionSlice ? "exception" : "object",
1269
+ typeId,
1270
+ "Slicing",
1271
+ _instance->initializationData().logger);
1621
1272
  }
1622
1273
  }
1623
1274
 
1624
- void
1625
- Ice::InputStream::traceSkipSlice(const string& typeId, SliceType sliceType) const
1626
- {
1627
- if(_traceSlicing && logger())
1628
- {
1629
- traceSlicing(sliceType == ExceptionSlice ? "exception" : "object", typeId, "Slicing", logger());
1630
- }
1631
- }
1632
-
1633
- ValueFactoryManagerPtr
1634
- Ice::InputStream::valueFactoryManager() const
1635
- {
1636
- if(_valueFactoryManager)
1637
- {
1638
- return _valueFactoryManager;
1639
- }
1640
- else if(_instance)
1641
- {
1642
- return _instance->initializationData().valueFactoryManager;
1643
- }
1644
-
1645
- return 0;
1646
- }
1647
-
1648
- LoggerPtr
1649
- Ice::InputStream::logger() const
1650
- {
1651
- if(_logger)
1652
- {
1653
- return _logger;
1654
- }
1655
- else if(_instance)
1656
- {
1657
- return _instance->initializationData().logger;
1658
- }
1659
-
1660
- return 0;
1661
- }
1662
-
1663
- #ifdef ICE_CPP11_MAPPING
1664
- function<string(int)>
1665
- Ice::InputStream::compactIdResolver() const
1666
- {
1667
- if(_compactIdResolver)
1668
- {
1669
- return _compactIdResolver;
1670
- }
1671
- else if(_instance)
1672
- {
1673
- return _instance->initializationData().compactIdResolver;
1674
- }
1675
-
1676
- return nullptr;
1677
- }
1678
- #else
1679
- CompactIdResolverPtr
1680
- Ice::InputStream::compactIdResolver() const
1681
- {
1682
- if(_compactIdResolver)
1683
- {
1684
- return _compactIdResolver;
1685
- }
1686
- else if(_instance)
1687
- {
1688
- return _instance->initializationData().compactIdResolver;
1689
- }
1690
-
1691
- return 0;
1692
- }
1693
- #endif
1694
-
1695
1275
  void
1696
1276
  Ice::InputStream::initEncaps()
1697
1277
  {
1698
- if(!_currentEncaps) // Lazy initialization.
1278
+ if (!_currentEncaps) // Lazy initialization.
1699
1279
  {
1700
1280
  _currentEncaps = &_preAllocatedEncaps;
1701
1281
  _currentEncaps->encoding = _encoding;
1702
- _currentEncaps->sz = static_cast<Ice::Int>(b.size());
1282
+ _currentEncaps->sz = static_cast<int32_t>(b.size());
1703
1283
  }
1704
1284
 
1705
- if(!_currentEncaps->decoder) // Lazy initialization.
1285
+ if (!_currentEncaps->decoder) // Lazy initialization.
1706
1286
  {
1707
- ValueFactoryManagerPtr vfm = valueFactoryManager();
1708
- if(_currentEncaps->encoding == Encoding_1_0)
1287
+ if (_currentEncaps->encoding == Encoding_1_0)
1709
1288
  {
1710
- _currentEncaps->decoder = new EncapsDecoder10(this, _currentEncaps, _sliceValues, _classGraphDepthMax, vfm);
1289
+ _currentEncaps->decoder = new EncapsDecoder10(this, _currentEncaps, _classGraphDepthMax);
1711
1290
  }
1712
1291
  else
1713
1292
  {
1714
- _currentEncaps->decoder = new EncapsDecoder11(this, _currentEncaps, _sliceValues, _classGraphDepthMax, vfm);
1293
+ _currentEncaps->decoder = new EncapsDecoder11(this, _currentEncaps, _classGraphDepthMax);
1715
1294
  }
1716
1295
  }
1717
1296
  }
1718
1297
 
1719
- Ice::InputStream::EncapsDecoder::~EncapsDecoder()
1720
- {
1721
- // Out of line to avoid weak vtable
1722
- }
1298
+ // Out of line to avoid weak vtable
1299
+ Ice::InputStream::EncapsDecoder::~EncapsDecoder() = default;
1723
1300
 
1724
1301
  string
1725
1302
  Ice::InputStream::EncapsDecoder::readTypeId(bool isIndex)
1726
1303
  {
1727
- if(isIndex)
1304
+ if (isIndex)
1728
1305
  {
1729
- Int index = _stream->readSize();
1730
- TypeIdMap::const_iterator k = _typeIdMap.find(index);
1731
- if(k == _typeIdMap.end())
1306
+ int32_t index = _stream->readSize();
1307
+ auto k = _typeIdMap.find(index);
1308
+ if (k == _typeIdMap.end())
1732
1309
  {
1733
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
1310
+ throw MarshalException{__FILE__, __LINE__, endOfBufferMessage};
1734
1311
  }
1735
1312
  return k->second;
1736
1313
  }
@@ -1743,94 +1320,31 @@ Ice::InputStream::EncapsDecoder::readTypeId(bool isIndex)
1743
1320
  }
1744
1321
  }
1745
1322
 
1746
- Ice::ValuePtr
1747
- Ice::InputStream::EncapsDecoder::newInstance(const string& typeId)
1323
+ ValuePtr
1324
+ Ice::InputStream::EncapsDecoder::newInstance(string_view typeId)
1748
1325
  {
1749
- Ice::ValuePtr v;
1750
-
1751
- //
1752
- // Try to find a factory registered for the specific type.
1753
- //
1754
- #ifdef ICE_CPP11_MAPPING
1755
- function<ValuePtr(const string&)> userFactory;
1756
- if(_valueFactoryManager)
1757
- {
1758
- userFactory = _valueFactoryManager->find(typeId);
1759
- if(userFactory)
1760
- {
1761
- v = userFactory(typeId);
1762
- }
1763
- }
1764
- #else
1765
- ValueFactoryPtr userFactory;
1766
- if(_valueFactoryManager)
1767
- {
1768
- userFactory = _valueFactoryManager->find(typeId);
1769
- if(userFactory)
1770
- {
1771
- v = userFactory->create(typeId);
1772
- }
1773
- }
1774
- #endif
1775
- //
1776
- // If that fails, invoke the default factory if one has been registered.
1777
- //
1778
- if(!v && _valueFactoryManager)
1779
- {
1780
- userFactory = _valueFactoryManager->find("");
1781
- if(userFactory)
1782
- {
1783
- #ifdef ICE_CPP11_MAPPING
1784
- v = userFactory(typeId);
1785
- #else
1786
- v = userFactory->create(typeId);
1787
- #endif
1788
- }
1789
- }
1790
-
1791
- //
1792
- // Last chance: check the table of static factories (i.e.,
1793
- // automatically generated factories for concrete classes).
1794
- //
1795
- if(!v)
1796
- {
1797
- #ifdef ICE_CPP11_MAPPING
1798
- function<ValuePtr(const string&)> of = IceInternal::factoryTable->getValueFactory(typeId);
1799
- if(of)
1800
- {
1801
- v = of(typeId);
1802
- assert(v);
1803
- }
1804
- #else
1805
- ValueFactoryPtr of = IceInternal::factoryTable->getValueFactory(typeId);
1806
- if(of)
1807
- {
1808
- v = of->create(typeId);
1809
- assert(v);
1810
- }
1811
- #endif
1812
- }
1813
- return v;
1326
+ return _stream->_sliceLoader->newClassInstance(typeId);
1814
1327
  }
1815
1328
 
1816
1329
  void
1817
- Ice::InputStream::EncapsDecoder::addPatchEntry(Int index, PatchFunc patchFunc, void* patchAddr)
1330
+ Ice::InputStream::EncapsDecoder::addPatchEntry(int32_t index, const PatchFunc& patchFunc, void* patchAddr)
1818
1331
  {
1819
1332
  assert(index > 0);
1820
1333
 
1821
1334
  //
1822
- // Check if we already unmarshaled the object. If that's the case, just patch the object smart pointer
1823
- // and we're done. A null value indicates we've encountered a cycle and Ice.AllowClassCycles is false.
1335
+ // Check if we already unmarshaled the object. If that's the case, just patch the object smart
1336
+ // pointer and we're done. A null value indicates we've encountered a cycle and Ice.AllowClassCycles
1337
+ // is false.
1824
1338
  //
1825
- IndexToPtrMap::iterator p = _unmarshaledMap.find(index);
1826
- if(p != _unmarshaledMap.end())
1339
+ auto p = _unmarshaledMap.find(index);
1340
+ if (p != _unmarshaledMap.end())
1827
1341
  {
1828
- if (p->second == ICE_NULLPTR)
1342
+ if (p->second == nullptr)
1829
1343
  {
1830
1344
  assert(!_stream->_instance->acceptClassCycles());
1831
1345
  throw MarshalException(__FILE__, __LINE__, "cycle detected during Value unmarshaling");
1832
1346
  }
1833
- (*patchFunc)(patchAddr, p->second);
1347
+ patchFunc(patchAddr, p->second);
1834
1348
  return;
1835
1349
  }
1836
1350
 
@@ -1840,8 +1354,8 @@ Ice::InputStream::EncapsDecoder::addPatchEntry(Int index, PatchFunc patchFunc, v
1840
1354
  // unmarshaled.
1841
1355
  //
1842
1356
 
1843
- PatchMap::iterator q = _patchMap.find(index);
1844
- if(q == _patchMap.end())
1357
+ auto q = _patchMap.find(index);
1358
+ if (q == _patchMap.end())
1845
1359
  {
1846
1360
  //
1847
1361
  // We have no outstanding instances to be patched for this
@@ -1861,7 +1375,7 @@ Ice::InputStream::EncapsDecoder::addPatchEntry(Int index, PatchFunc patchFunc, v
1861
1375
  }
1862
1376
 
1863
1377
  void
1864
- Ice::InputStream::EncapsDecoder::unmarshal(Int index, const Ice::ValuePtr& v)
1378
+ Ice::InputStream::EncapsDecoder::unmarshal(int32_t index, const ValuePtr& v)
1865
1379
  {
1866
1380
  //
1867
1381
  // Add the object to the map of unmarshaled instances, this must
@@ -1870,7 +1384,7 @@ Ice::InputStream::EncapsDecoder::unmarshal(Int index, const Ice::ValuePtr& v)
1870
1384
  // If circular references are not allowed we insert null (for cycle detection) and add
1871
1385
  // the object to the map once it has been fully unmarshaled.
1872
1386
  //
1873
- _unmarshaledMap.insert(make_pair(index, _stream->_instance->acceptClassCycles() ? v : Ice::ValuePtr()));
1387
+ _unmarshaledMap.insert(make_pair(index, _stream->_instance->acceptClassCycles() ? v : nullptr));
1874
1388
 
1875
1389
  //
1876
1390
  // Read the object.
@@ -1880,17 +1394,17 @@ Ice::InputStream::EncapsDecoder::unmarshal(Int index, const Ice::ValuePtr& v)
1880
1394
  //
1881
1395
  // Patch all instances now that the object is unmarshaled.
1882
1396
  //
1883
- PatchMap::iterator patchPos = _patchMap.find(index);
1884
- if(patchPos != _patchMap.end())
1397
+ auto patchPos = _patchMap.find(index);
1398
+ if (patchPos != _patchMap.end())
1885
1399
  {
1886
1400
  assert(patchPos->second.size() > 0);
1887
1401
 
1888
1402
  //
1889
1403
  // Patch all pointers that refer to the instance.
1890
1404
  //
1891
- for(PatchList::iterator k = patchPos->second.begin(); k != patchPos->second.end(); ++k)
1405
+ for (const auto& k : patchPos->second)
1892
1406
  {
1893
- (*k->patchFunc)(k->patchAddr, v);
1407
+ k.patchFunc(k.patchAddr, v);
1894
1408
  }
1895
1409
 
1896
1410
  //
@@ -1900,31 +1414,29 @@ Ice::InputStream::EncapsDecoder::unmarshal(Int index, const Ice::ValuePtr& v)
1900
1414
  _patchMap.erase(patchPos);
1901
1415
  }
1902
1416
 
1903
- if(_valueList.empty() && _patchMap.empty())
1417
+ if (_valueList.empty() && _patchMap.empty())
1904
1418
  {
1905
- _stream->postUnmarshal(v);
1419
+ v->ice_postUnmarshal();
1906
1420
  }
1907
1421
  else
1908
1422
  {
1909
1423
  _valueList.push_back(v);
1910
1424
 
1911
- if(_patchMap.empty())
1425
+ if (_patchMap.empty())
1912
1426
  {
1913
- //
1914
1427
  // Iterate over the value list and invoke ice_postUnmarshal on
1915
1428
  // each value. We must do this after all values have been
1916
1429
  // unmarshaled in order to ensure that any value data members
1917
1430
  // have been properly patched.
1918
- //
1919
- for(ValueList::iterator p = _valueList.begin(); p != _valueList.end(); ++p)
1431
+ for (const auto& value : _valueList)
1920
1432
  {
1921
- _stream->postUnmarshal(*p);
1433
+ value->ice_postUnmarshal();
1922
1434
  }
1923
1435
  _valueList.clear();
1924
1436
  }
1925
1437
  }
1926
1438
 
1927
- if(!_stream->_instance->acceptClassCycles())
1439
+ if (!_stream->_instance->acceptClassCycles())
1928
1440
  {
1929
1441
  // This class has been fully unmarshaled without creating any cycles
1930
1442
  // It can be added to the map now.
@@ -1940,22 +1452,21 @@ Ice::InputStream::EncapsDecoder10::read(PatchFunc patchFunc, void* patchAddr)
1940
1452
  //
1941
1453
  // Object references are encoded as a negative integer in 1.0.
1942
1454
  //
1943
- Int index;
1455
+ int32_t index;
1944
1456
  _stream->read(index);
1945
- if(index > 0)
1457
+ if (index > 0)
1946
1458
  {
1947
1459
  throw MarshalException(__FILE__, __LINE__, "invalid object id");
1948
1460
  }
1949
1461
  index = -index;
1950
1462
 
1951
- if(index == 0)
1463
+ if (index == 0)
1952
1464
  {
1953
1465
  //
1954
1466
  // Calling the patch function for null instances is necessary for correct functioning of Ice for
1955
1467
  // Python and Ruby.
1956
1468
  //
1957
- ValuePtr nil;
1958
- patchFunc(patchAddr, nil);
1469
+ patchFunc(patchAddr, nullptr);
1959
1470
  }
1960
1471
  else
1961
1472
  {
@@ -1964,7 +1475,7 @@ Ice::InputStream::EncapsDecoder10::read(PatchFunc patchFunc, void* patchAddr)
1964
1475
  }
1965
1476
 
1966
1477
  void
1967
- Ice::InputStream::EncapsDecoder10::throwException(ICE_IN(ICE_DELEGATE(UserExceptionFactory)) factory)
1478
+ Ice::InputStream::EncapsDecoder10::throwException(UserExceptionFactory exceptionFactory)
1968
1479
  {
1969
1480
  assert(_sliceType == NoSlice);
1970
1481
 
@@ -1986,21 +1497,26 @@ Ice::InputStream::EncapsDecoder10::throwException(ICE_IN(ICE_DELEGATE(UserExcept
1986
1497
  //
1987
1498
  startSlice();
1988
1499
  const string mostDerivedId = _typeId;
1989
- ICE_DELEGATE(UserExceptionFactory) exceptionFactory = factory;
1990
- while(true)
1500
+ while (true)
1991
1501
  {
1992
1502
  //
1993
1503
  // Look for a statically-generated factory for this ID.
1994
1504
  //
1995
- if(!exceptionFactory)
1505
+ if (!exceptionFactory)
1996
1506
  {
1997
- exceptionFactory = factoryTable->getExceptionFactory(_typeId);
1507
+ std::exception_ptr exceptionPtr = _stream->_sliceLoader->newExceptionInstance(_typeId);
1508
+
1509
+ if (exceptionPtr)
1510
+ {
1511
+ exceptionFactory = [exceptionPtr](string_view) { std::rethrow_exception(exceptionPtr); };
1512
+ }
1998
1513
  }
1999
1514
 
2000
1515
  //
2001
1516
  // We found a factory, we get out of this loop.
1517
+ // A factory that doesn't throw is equivalent to a null factory.
2002
1518
  //
2003
- if(exceptionFactory)
1519
+ if (exceptionFactory)
2004
1520
  {
2005
1521
  //
2006
1522
  // Got factory -- ask the factory to instantiate the
@@ -2009,22 +1525,16 @@ Ice::InputStream::EncapsDecoder10::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2009
1525
  //
2010
1526
  try
2011
1527
  {
2012
- #ifdef ICE_CPP11_MAPPING
2013
1528
  exceptionFactory(_typeId);
2014
- #else
2015
- exceptionFactory->createAndThrow(_typeId);
2016
- #endif
2017
1529
  }
2018
- catch(UserException& ex)
1530
+ catch (UserException& ex)
2019
1531
  {
2020
1532
  ex._read(_stream);
2021
- if(usesClasses)
1533
+ if (usesClasses)
2022
1534
  {
2023
1535
  readPendingValues();
2024
1536
  }
2025
1537
  throw;
2026
-
2027
- // Never reached.
2028
1538
  }
2029
1539
  }
2030
1540
 
@@ -2036,64 +1546,56 @@ Ice::InputStream::EncapsDecoder10::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2036
1546
  {
2037
1547
  startSlice();
2038
1548
  }
2039
- catch(UnmarshalOutOfBoundsException& ex)
1549
+ catch (const MarshalException&)
2040
1550
  {
2041
1551
  //
2042
1552
  // An oversight in the 1.0 encoding means there is no marker to indicate
2043
1553
  // the last slice of an exception. As a result, we just try to read the
2044
- // next type ID, which raises UnmarshalOutOfBoundsException when the
1554
+ // next type ID, which raises MarshalException when the
2045
1555
  // input buffer underflows.
2046
- //
2047
- // Set the reason member to a more helpful message.
2048
- //
2049
- ex.reason = "unknown exception type `" + mostDerivedId + "'";
2050
- throw;
1556
+ throw MarshalException{__FILE__, __LINE__, "unknown exception type '" + mostDerivedId + "'"};
2051
1557
  }
2052
1558
  }
2053
1559
  }
2054
1560
 
2055
1561
  void
2056
- #ifndef NDEBUG
2057
- Ice::InputStream::EncapsDecoder10::startInstance(SliceType sliceType)
2058
- #else
2059
- Ice::InputStream::EncapsDecoder10::startInstance(SliceType)
2060
- #endif
1562
+ Ice::InputStream::EncapsDecoder10::startInstance([[maybe_unused]] SliceType sliceType)
2061
1563
  {
2062
1564
  assert(_sliceType == sliceType);
2063
1565
  _skipFirstSlice = true;
2064
1566
  }
2065
1567
 
2066
1568
  SlicedDataPtr
2067
- Ice::InputStream::EncapsDecoder10::endInstance(bool)
1569
+ Ice::InputStream::EncapsDecoder10::endInstance()
2068
1570
  {
2069
1571
  //
2070
1572
  // Read the Ice::Value slice.
2071
1573
  //
2072
- if(_sliceType == ValueSlice)
1574
+ if (_sliceType == ValueSlice)
2073
1575
  {
2074
1576
  startSlice();
2075
- Int sz = _stream->readSize(); // For compatibility with the old AFM.
2076
- if(sz != 0)
1577
+ int32_t sz = _stream->readSize(); // For compatibility with the old AFM.
1578
+ if (sz != 0)
2077
1579
  {
2078
1580
  throw MarshalException(__FILE__, __LINE__, "invalid Object slice");
2079
1581
  }
2080
1582
  endSlice();
2081
1583
  }
2082
1584
  _sliceType = NoSlice;
2083
- return 0;
1585
+ return nullptr;
2084
1586
  }
2085
1587
 
2086
- const std::string&
1588
+ void
2087
1589
  Ice::InputStream::EncapsDecoder10::startSlice()
2088
1590
  {
2089
1591
  //
2090
1592
  // If first slice, don't read the header, it was already read in
2091
1593
  // readInstance or throwException to find the factory.
2092
1594
  //
2093
- if(_skipFirstSlice)
1595
+ if (_skipFirstSlice)
2094
1596
  {
2095
1597
  _skipFirstSlice = false;
2096
- return _typeId;
1598
+ return;
2097
1599
  }
2098
1600
 
2099
1601
  //
@@ -2102,7 +1604,7 @@ Ice::InputStream::EncapsDecoder10::startSlice()
2102
1604
  // index. For exceptions, the type ID is always encoded as a
2103
1605
  // string.
2104
1606
  //
2105
- if(_sliceType == ValueSlice)
1607
+ if (_sliceType == ValueSlice)
2106
1608
  {
2107
1609
  bool isIndex;
2108
1610
  _stream->read(isIndex);
@@ -2114,11 +1616,10 @@ Ice::InputStream::EncapsDecoder10::startSlice()
2114
1616
  }
2115
1617
 
2116
1618
  _stream->read(_sliceSize);
2117
- if(_sliceSize < 4)
1619
+ if (_sliceSize < 4)
2118
1620
  {
2119
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
1621
+ throw MarshalException{__FILE__, __LINE__, endOfBufferMessage};
2120
1622
  }
2121
- return _typeId;
2122
1623
  }
2123
1624
 
2124
1625
  void
@@ -2131,28 +1632,27 @@ Ice::InputStream::EncapsDecoder10::skipSlice()
2131
1632
  {
2132
1633
  _stream->traceSkipSlice(_typeId, _sliceType);
2133
1634
  assert(_sliceSize >= 4);
2134
- _stream->skip(static_cast<size_t>(_sliceSize) - sizeof(Int));
1635
+ _stream->skip(static_cast<size_t>(_sliceSize) - sizeof(int32_t));
2135
1636
  }
2136
1637
 
2137
1638
  void
2138
1639
  Ice::InputStream::EncapsDecoder10::readPendingValues()
2139
1640
  {
2140
- Int num;
1641
+ int32_t num;
2141
1642
  do
2142
1643
  {
2143
1644
  num = _stream->readSize();
2144
- for(Int k = num; k > 0; --k)
1645
+ for (int32_t k = num; k > 0; --k)
2145
1646
  {
2146
1647
  readInstance();
2147
1648
  }
2148
- }
2149
- while(num);
1649
+ } while (num);
2150
1650
 
2151
- if(!_patchMap.empty())
1651
+ if (!_patchMap.empty())
2152
1652
  {
2153
1653
  //
2154
- // If any entries remain in the patch map, the sender has sent an index for an object, but failed
2155
- // to supply the object.
1654
+ // If any entries remain in the patch map, the sender has sent an index for an object, but
1655
+ // failed to supply the object.
2156
1656
  //
2157
1657
  throw MarshalException(__FILE__, __LINE__, "index for class received, but no instance");
2158
1658
  }
@@ -2161,10 +1661,10 @@ Ice::InputStream::EncapsDecoder10::readPendingValues()
2161
1661
  void
2162
1662
  Ice::InputStream::EncapsDecoder10::readInstance()
2163
1663
  {
2164
- Int index;
1664
+ int32_t index;
2165
1665
  _stream->read(index);
2166
1666
 
2167
- if(index <= 0)
1667
+ if (index <= 0)
2168
1668
  {
2169
1669
  throw MarshalException(__FILE__, __LINE__, "invalid object id");
2170
1670
  }
@@ -2177,16 +1677,16 @@ Ice::InputStream::EncapsDecoder10::readInstance()
2177
1677
  //
2178
1678
  startSlice();
2179
1679
  const string mostDerivedId = _typeId;
2180
- ValuePtr v;
2181
- while(true)
1680
+ shared_ptr<Value> v;
1681
+ while (true)
2182
1682
  {
2183
- //
2184
- // For the 1.0 encoding, the type ID for the base Object class
2185
- // marks the last slice.
2186
- //
2187
- if(_typeId == Object::ice_staticId())
1683
+ // For the 1.0 encoding, the type ID for the base Object class marks the last slice.
1684
+ if (_typeId == Value::ice_staticId())
2188
1685
  {
2189
- throw NoValueFactoryException(__FILE__, __LINE__, "", mostDerivedId);
1686
+ throw MarshalException{
1687
+ __FILE__,
1688
+ __LINE__,
1689
+ "the Slice loader did not find a class for type ID '" + mostDerivedId + "'"};
2190
1690
  }
2191
1691
 
2192
1692
  v = newInstance(_typeId);
@@ -2194,20 +1694,11 @@ Ice::InputStream::EncapsDecoder10::readInstance()
2194
1694
  //
2195
1695
  // We found a factory, we get out of this loop.
2196
1696
  //
2197
- if(v)
1697
+ if (v)
2198
1698
  {
2199
1699
  break;
2200
1700
  }
2201
1701
 
2202
- //
2203
- // If value slicing is disabled, stop unmarshaling.
2204
- //
2205
- if(!_sliceValues)
2206
- {
2207
- throw NoValueFactoryException(__FILE__, __LINE__, "no value factory found and value slicing is disabled",
2208
- _typeId);
2209
- }
2210
-
2211
1702
  //
2212
1703
  // Slice off what we don't understand.
2213
1704
  //
@@ -2221,20 +1712,20 @@ Ice::InputStream::EncapsDecoder10::readInstance()
2221
1712
  // keep the biggest one.
2222
1713
  //
2223
1714
  _classGraphDepth = 0;
2224
- PatchMap::iterator patchPos = _patchMap.find(index);
2225
- if(patchPos != _patchMap.end())
1715
+ auto patchPos = _patchMap.find(index);
1716
+ if (patchPos != _patchMap.end())
2226
1717
  {
2227
1718
  assert(patchPos->second.size() > 0);
2228
- for(PatchList::iterator k = patchPos->second.begin(); k != patchPos->second.end(); ++k)
1719
+ for (const auto& k : patchPos->second)
2229
1720
  {
2230
- if(k->classGraphDepth > _classGraphDepth)
1721
+ if (k.classGraphDepth > _classGraphDepth)
2231
1722
  {
2232
- _classGraphDepth = k->classGraphDepth;
1723
+ _classGraphDepth = k.classGraphDepth;
2233
1724
  }
2234
1725
  }
2235
1726
  }
2236
1727
 
2237
- if(++_classGraphDepth > _classGraphDepthMax)
1728
+ if (++_classGraphDepth > _classGraphDepthMax)
2238
1729
  {
2239
1730
  throw MarshalException(__FILE__, __LINE__, "maximum class graph depth reached");
2240
1731
  }
@@ -2248,24 +1739,22 @@ Ice::InputStream::EncapsDecoder10::readInstance()
2248
1739
  void
2249
1740
  Ice::InputStream::EncapsDecoder11::read(PatchFunc patchFunc, void* patchAddr)
2250
1741
  {
2251
- Int index = _stream->readSize();
2252
- if(index < 0)
1742
+ assert(patchFunc && patchAddr); // we used to support null for optional classes
1743
+
1744
+ int32_t index = _stream->readSize();
1745
+ if (index < 0)
2253
1746
  {
2254
1747
  throw MarshalException(__FILE__, __LINE__, "invalid object id");
2255
1748
  }
2256
- else if(index == 0)
1749
+ else if (index == 0)
2257
1750
  {
2258
1751
  //
2259
1752
  // Calling the patch function for null instances is necessary for correct functioning of Ice for
2260
1753
  // Python and Ruby.
2261
1754
  //
2262
- if(patchFunc)
2263
- {
2264
- ValuePtr nil;
2265
- patchFunc(patchAddr, nil);
2266
- }
1755
+ patchFunc(patchAddr, nullptr);
2267
1756
  }
2268
- else if(_current && _current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
1757
+ else if (_current && _current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
2269
1758
  {
2270
1759
  //
2271
1760
  // When reading an object within a slice and there's an
@@ -2278,14 +1767,11 @@ Ice::InputStream::EncapsDecoder11::read(PatchFunc patchFunc, void* patchAddr)
2278
1767
  // derive an index into the indirection table that we'll read
2279
1768
  // at the end of the slice.
2280
1769
  //
2281
- if(patchFunc)
2282
- {
2283
- IndirectPatchEntry e;
2284
- e.index = index - 1;
2285
- e.patchFunc = patchFunc;
2286
- e.patchAddr = patchAddr;
2287
- _current->indirectPatchList.push_back(e);
2288
- }
1770
+ IndirectPatchEntry e;
1771
+ e.index = index - 1;
1772
+ e.patchFunc = patchFunc;
1773
+ e.patchAddr = patchAddr;
1774
+ _current->indirectPatchList.push_back(e);
2289
1775
  }
2290
1776
  else
2291
1777
  {
@@ -2294,7 +1780,7 @@ Ice::InputStream::EncapsDecoder11::read(PatchFunc patchFunc, void* patchAddr)
2294
1780
  }
2295
1781
 
2296
1782
  void
2297
- Ice::InputStream::EncapsDecoder11::throwException(ICE_IN(ICE_DELEGATE(UserExceptionFactory)) factory)
1783
+ Ice::InputStream::EncapsDecoder11::throwException(UserExceptionFactory exceptionFactory)
2298
1784
  {
2299
1785
  assert(!_current);
2300
1786
 
@@ -2305,21 +1791,26 @@ Ice::InputStream::EncapsDecoder11::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2305
1791
  //
2306
1792
  startSlice();
2307
1793
  const string mostDerivedId = _current->typeId;
2308
- ICE_DELEGATE(UserExceptionFactory) exceptionFactory = factory;
2309
- while(true)
1794
+ while (true)
2310
1795
  {
2311
1796
  //
2312
1797
  // Look for a statically-generated factory for this ID.
2313
1798
  //
2314
- if(!exceptionFactory)
1799
+ if (!exceptionFactory)
2315
1800
  {
2316
- exceptionFactory = factoryTable->getExceptionFactory(_current->typeId);
1801
+ std::exception_ptr exceptionPtr = _stream->_sliceLoader->newExceptionInstance(_current->typeId);
1802
+
1803
+ if (exceptionPtr)
1804
+ {
1805
+ exceptionFactory = [exceptionPtr](string_view) { std::rethrow_exception(exceptionPtr); };
1806
+ }
2317
1807
  }
2318
1808
 
2319
1809
  //
2320
1810
  // We found a factory, we get out of this loop.
1811
+ // A factory that doesn't throw is equivalent to a null factory.
2321
1812
  //
2322
- if(exceptionFactory)
1813
+ if (exceptionFactory)
2323
1814
  {
2324
1815
  //
2325
1816
  // Got factory -- ask the factory to instantiate the
@@ -2328,18 +1819,12 @@ Ice::InputStream::EncapsDecoder11::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2328
1819
  //
2329
1820
  try
2330
1821
  {
2331
- #ifdef ICE_CPP11_MAPPING
2332
1822
  exceptionFactory(_current->typeId);
2333
- #else
2334
- exceptionFactory->createAndThrow(_current->typeId);
2335
- #endif
2336
1823
  }
2337
- catch(UserException& ex)
1824
+ catch (UserException& ex)
2338
1825
  {
2339
1826
  ex._read(_stream);
2340
1827
  throw;
2341
-
2342
- // Never reached.
2343
1828
  }
2344
1829
  }
2345
1830
 
@@ -2349,11 +1834,14 @@ Ice::InputStream::EncapsDecoder11::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2349
1834
  skipSlice();
2350
1835
 
2351
1836
  //
2352
- // If this is the last slice, raise an exception and stop un-marshalling.
1837
+ // If this is the last slice, raise an exception and stop un-marshaling.
2353
1838
  //
2354
- if(_current->sliceFlags & FLAG_IS_LAST_SLICE)
1839
+ if (_current->sliceFlags & FLAG_IS_LAST_SLICE)
2355
1840
  {
2356
- throw UnknownUserException(__FILE__, __LINE__, mostDerivedId);
1841
+ throw MarshalException{
1842
+ __FILE__,
1843
+ __LINE__,
1844
+ "cannot unmarshal exception with type ID '" + mostDerivedId + "'"};
2357
1845
  }
2358
1846
 
2359
1847
  startSlice();
@@ -2361,41 +1849,33 @@ Ice::InputStream::EncapsDecoder11::throwException(ICE_IN(ICE_DELEGATE(UserExcept
2361
1849
  }
2362
1850
 
2363
1851
  void
2364
- #ifndef NDEBUG
2365
- Ice::InputStream::EncapsDecoder11::startInstance(SliceType sliceType)
2366
- #else
2367
- Ice::InputStream::EncapsDecoder11::startInstance(SliceType)
2368
- #endif
1852
+ Ice::InputStream::EncapsDecoder11::startInstance([[maybe_unused]] SliceType sliceType)
2369
1853
  {
2370
1854
  assert(_current->sliceType == sliceType);
2371
1855
  _current->skipFirstSlice = true;
2372
1856
  }
2373
1857
 
2374
1858
  SlicedDataPtr
2375
- Ice::InputStream::EncapsDecoder11::endInstance(bool preserve)
1859
+ Ice::InputStream::EncapsDecoder11::endInstance()
2376
1860
  {
2377
- SlicedDataPtr slicedData;
2378
- if(preserve)
2379
- {
2380
- slicedData = readSlicedData();
2381
- }
2382
- _current->slices.clear();
1861
+ SlicedDataPtr slicedData = readSlicedData();
2383
1862
  _current->indirectionTables.clear();
1863
+ _current->slices.clear();
2384
1864
  _current = _current->previous;
2385
1865
  return slicedData;
2386
1866
  }
2387
1867
 
2388
- const std::string&
1868
+ void
2389
1869
  Ice::InputStream::EncapsDecoder11::startSlice()
2390
1870
  {
2391
1871
  //
2392
1872
  // If first slice, don't read the header, it was already read in
2393
1873
  // readInstance or throwException to find the factory.
2394
1874
  //
2395
- if(_current->skipFirstSlice)
1875
+ if (_current->skipFirstSlice)
2396
1876
  {
2397
1877
  _current->skipFirstSlice = false;
2398
- return _current->typeId;
1878
+ return;
2399
1879
  }
2400
1880
 
2401
1881
  _stream->read(_current->sliceFlags);
@@ -2405,14 +1885,14 @@ Ice::InputStream::EncapsDecoder11::startSlice()
2405
1885
  // string or as an index, for exceptions it's always encoded as a
2406
1886
  // string.
2407
1887
  //
2408
- if(_current->sliceType == ValueSlice)
1888
+ if (_current->sliceType == ValueSlice)
2409
1889
  {
2410
- if((_current->sliceFlags & FLAG_HAS_TYPE_ID_COMPACT) == FLAG_HAS_TYPE_ID_COMPACT) // Must be checked first!
1890
+ if ((_current->sliceFlags & FLAG_HAS_TYPE_ID_COMPACT) == FLAG_HAS_TYPE_ID_COMPACT) // Must be checked first!
2411
1891
  {
2412
- _current->typeId.clear();
2413
1892
  _current->compactId = _stream->readSize();
1893
+ _current->typeId = std::to_string(_current->compactId);
2414
1894
  }
2415
- else if(_current->sliceFlags & (FLAG_HAS_TYPE_ID_STRING | FLAG_HAS_TYPE_ID_INDEX))
1895
+ else if (_current->sliceFlags & (FLAG_HAS_TYPE_ID_STRING | FLAG_HAS_TYPE_ID_INDEX))
2416
1896
  {
2417
1897
  _current->typeId = readTypeId(_current->sliceFlags & FLAG_HAS_TYPE_ID_INDEX);
2418
1898
  _current->compactId = -1;
@@ -2427,31 +1907,30 @@ Ice::InputStream::EncapsDecoder11::startSlice()
2427
1907
  else
2428
1908
  {
2429
1909
  _stream->read(_current->typeId, false);
1910
+ _current->compactId = -1;
2430
1911
  }
2431
1912
 
2432
1913
  //
2433
1914
  // Read the slice size if necessary.
2434
1915
  //
2435
- if(_current->sliceFlags & FLAG_HAS_SLICE_SIZE)
1916
+ if (_current->sliceFlags & FLAG_HAS_SLICE_SIZE)
2436
1917
  {
2437
1918
  _stream->read(_current->sliceSize);
2438
- if(_current->sliceSize < 4)
1919
+ if (_current->sliceSize < 4)
2439
1920
  {
2440
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
1921
+ throw MarshalException{__FILE__, __LINE__, endOfBufferMessage};
2441
1922
  }
2442
1923
  }
2443
1924
  else
2444
1925
  {
2445
1926
  _current->sliceSize = 0;
2446
1927
  }
2447
-
2448
- return _current->typeId;
2449
1928
  }
2450
1929
 
2451
1930
  void
2452
1931
  Ice::InputStream::EncapsDecoder11::endSlice()
2453
1932
  {
2454
- if(_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS)
1933
+ if (_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS)
2455
1934
  {
2456
1935
  _stream->skipOptionals();
2457
1936
  }
@@ -2459,12 +1938,12 @@ Ice::InputStream::EncapsDecoder11::endSlice()
2459
1938
  //
2460
1939
  // Read the indirect object table if one is present.
2461
1940
  //
2462
- if(_current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
1941
+ if (_current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
2463
1942
  {
2464
1943
  IndexList indirectionTable(static_cast<size_t>(_stream->readAndCheckSeqSize(1)));
2465
- for(IndexList::iterator p = indirectionTable.begin(); p != indirectionTable.end(); ++p)
1944
+ for (auto& p : indirectionTable)
2466
1945
  {
2467
- *p = readInstance(_stream->readSize(), 0, 0);
1946
+ p = readInstance(_stream->readSize(), nullptr, nullptr);
2468
1947
  }
2469
1948
 
2470
1949
  //
@@ -2472,11 +1951,11 @@ Ice::InputStream::EncapsDecoder11::endSlice()
2472
1951
  // that not all object references were read if they are from
2473
1952
  // unknown optional data members.
2474
1953
  //
2475
- if(indirectionTable.empty())
1954
+ if (indirectionTable.empty())
2476
1955
  {
2477
1956
  throw MarshalException(__FILE__, __LINE__, "empty indirection table");
2478
1957
  }
2479
- if(_current->indirectPatchList.empty() && !(_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS))
1958
+ if (_current->indirectPatchList.empty() && !(_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS))
2480
1959
  {
2481
1960
  throw MarshalException(__FILE__, __LINE__, "no references to indirection table");
2482
1961
  }
@@ -2485,10 +1964,10 @@ Ice::InputStream::EncapsDecoder11::endSlice()
2485
1964
  // Convert indirect references into direct references.
2486
1965
  //
2487
1966
  IndirectPatchList::iterator p;
2488
- for(p = _current->indirectPatchList.begin(); p != _current->indirectPatchList.end(); ++p)
1967
+ for (p = _current->indirectPatchList.begin(); p != _current->indirectPatchList.end(); ++p)
2489
1968
  {
2490
1969
  assert(p->index >= 0);
2491
- if(p->index >= static_cast<Int>(indirectionTable.size()))
1970
+ if (p->index >= static_cast<int32_t>(indirectionTable.size()))
2492
1971
  {
2493
1972
  throw MarshalException(__FILE__, __LINE__, "indirection out of range");
2494
1973
  }
@@ -2505,92 +1984,101 @@ Ice::InputStream::EncapsDecoder11::skipSlice()
2505
1984
 
2506
1985
  Container::iterator start = _stream->i;
2507
1986
 
2508
- if(_current->sliceFlags & FLAG_HAS_SLICE_SIZE)
1987
+ if (_current->sliceFlags & FLAG_HAS_SLICE_SIZE)
2509
1988
  {
2510
1989
  assert(_current->sliceSize >= 4);
2511
- _stream->skip(static_cast<size_t>(_current->sliceSize) - sizeof(Int));
1990
+ _stream->skip(static_cast<size_t>(_current->sliceSize) - sizeof(int32_t));
2512
1991
  }
2513
1992
  else
2514
1993
  {
2515
- if(_current->sliceType == ValueSlice)
1994
+ if (_current->sliceType == ValueSlice)
2516
1995
  {
2517
- throw NoValueFactoryException(__FILE__, __LINE__,
2518
- "no value factory found and compact format prevents "
2519
- "slicing (the sender should use the sliced format instead)",
2520
- _current->typeId);
1996
+ throw MarshalException{
1997
+ __FILE__,
1998
+ __LINE__,
1999
+ "the Slice loader did not find a class for type ID '" + _current->typeId +
2000
+ "' and compact format prevents slicing"};
2521
2001
  }
2522
2002
  else
2523
2003
  {
2524
- throw UnknownUserException(__FILE__, __LINE__, _current->typeId);
2004
+ throw MarshalException{
2005
+ __FILE__,
2006
+ __LINE__,
2007
+ "the Slice loader did not find a user exception class for type ID '" + _current->typeId +
2008
+ "' and compact format prevents slicing"};
2525
2009
  }
2526
2010
  }
2527
2011
 
2528
2012
  //
2529
- // Preserve this slice.
2013
+ // Preserve this slice if unmarshaling a value in Slice format. Exception slices are not preserved.
2530
2014
  //
2531
- SliceInfoPtr info = ICE_MAKE_SHARED(SliceInfo);
2532
- info->typeId = _current->typeId;
2533
- info->compactId = _current->compactId;
2534
- info->hasOptionalMembers = _current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS;
2535
- info->isLastSlice = _current->sliceFlags & FLAG_IS_LAST_SLICE;
2536
- if(info->hasOptionalMembers)
2537
- {
2538
- //
2539
- // Don't include the optional member end marker. It will be re-written by
2540
- // endSlice when the sliced data is re-written.
2541
- //
2542
- vector<Byte>(start, _stream->i - 1).swap(info->bytes);
2543
- }
2544
- else
2015
+ if (_current->sliceType == ValueSlice)
2545
2016
  {
2546
- vector<Byte>(start, _stream->i).swap(info->bytes);
2017
+ bool hasOptionalMembers = _current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS;
2018
+ vector<byte> bytes;
2019
+ if (hasOptionalMembers)
2020
+ {
2021
+ //
2022
+ // Don't include the optional member end marker. It will be re-written by
2023
+ // endSlice when the sliced data is re-written.
2024
+ //
2025
+ bytes = vector<byte>(start, _stream->i - 1);
2026
+ }
2027
+ else
2028
+ {
2029
+ bytes = vector<byte>(start, _stream->i);
2030
+ }
2031
+
2032
+ SliceInfoPtr info = make_shared<SliceInfo>(
2033
+ _current->compactId == -1 ? _current->typeId : "",
2034
+ _current->compactId,
2035
+ std::move(bytes),
2036
+ hasOptionalMembers,
2037
+ _current->sliceFlags & FLAG_IS_LAST_SLICE);
2038
+
2039
+ _current->slices.push_back(info);
2547
2040
  }
2548
2041
 
2549
- _current->indirectionTables.push_back(IndexList());
2042
+ _current->indirectionTables.emplace_back();
2550
2043
 
2551
2044
  //
2552
2045
  // Read the indirect object table. We read the instances or their
2553
- // IDs if the instance is a reference to an already un-marhsaled
2046
+ // IDs if the instance is a reference to an already un-marshaled
2554
2047
  // object.
2555
2048
  //
2556
- // The SliceInfo object sequence is initialized only if
2557
- // readSlicedData is called.
2558
- //
2559
- if(_current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
2049
+ if (_current->sliceFlags & FLAG_HAS_INDIRECTION_TABLE)
2560
2050
  {
2561
2051
  IndexList& table = _current->indirectionTables.back();
2562
2052
  table.resize(static_cast<size_t>(_stream->readAndCheckSeqSize(1)));
2563
- for(IndexList::iterator p = table.begin(); p != table.end(); ++p)
2053
+ for (auto& entry : table)
2564
2054
  {
2565
- *p = readInstance(_stream->readSize(), 0, 0);
2055
+ entry = readInstance(_stream->readSize(), nullptr, nullptr);
2566
2056
  }
2567
2057
  }
2568
-
2569
- _current->slices.push_back(info);
2570
2058
  }
2571
2059
 
2572
2060
  bool
2573
- Ice::InputStream::EncapsDecoder11::readOptional(Ice::Int readTag, Ice::OptionalFormat expectedFormat)
2061
+ Ice::InputStream::EncapsDecoder11::readOptional(int32_t readTag, Ice::OptionalFormat expectedFormat)
2574
2062
  {
2575
- if(!_current)
2063
+ if (!_current)
2576
2064
  {
2577
2065
  return _stream->readOptImpl(readTag, expectedFormat);
2578
2066
  }
2579
- else if(_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS)
2067
+ else if (_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS)
2580
2068
  {
2581
2069
  return _stream->readOptImpl(readTag, expectedFormat);
2582
2070
  }
2583
2071
  return false;
2584
2072
  }
2585
2073
 
2586
- Int
2587
- Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc, void* patchAddr)
2074
+ int32_t
2075
+ Ice::InputStream::EncapsDecoder11::readInstance(int32_t index, const PatchFunc& patchFunc, void* patchAddr)
2588
2076
  {
2589
2077
  assert(index > 0);
2590
2078
 
2591
- if(index > 1)
2079
+ if (index > 1)
2592
2080
  {
2593
- if(patchFunc)
2081
+ if (patchFunc)
2594
2082
  {
2595
2083
  addPatchEntry(index, patchFunc, patchAddr);
2596
2084
  }
@@ -2611,43 +2099,22 @@ Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc,
2611
2099
  //
2612
2100
  startSlice();
2613
2101
  const string mostDerivedId = _current->typeId;
2614
- Ice::ValuePtr v;
2615
- while(true)
2102
+ shared_ptr<Value> v;
2103
+ while (true)
2616
2104
  {
2617
- if(_current->compactId >= 0)
2618
- {
2619
- //
2620
- // Translate a compact (numeric) type ID into a string type ID.
2621
- //
2622
- _current->typeId = _stream->resolveCompactId(_current->compactId);
2623
- if(_current->typeId.empty())
2624
- {
2625
- _current->typeId = IceInternal::factoryTable->getTypeId(_current->compactId);
2626
- }
2627
- }
2628
-
2629
- if(!_current->typeId.empty())
2105
+ if (!_current->typeId.empty())
2630
2106
  {
2631
2107
  v = newInstance(_current->typeId);
2632
2108
 
2633
2109
  //
2634
2110
  // We found a factory, we get out of this loop.
2635
2111
  //
2636
- if(v)
2112
+ if (v)
2637
2113
  {
2638
2114
  break;
2639
2115
  }
2640
2116
  }
2641
2117
 
2642
- //
2643
- // If value slicing is disabled, stop unmarshaling.
2644
- //
2645
- if(!_sliceValues)
2646
- {
2647
- throw NoValueFactoryException(__FILE__, __LINE__, "no value factory found and value slicing is disabled",
2648
- _current->typeId);
2649
- }
2650
-
2651
2118
  //
2652
2119
  // Slice off what we don't understand.
2653
2120
  //
@@ -2656,17 +2123,17 @@ Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc,
2656
2123
  //
2657
2124
  // If this is the last slice, keep the object as an opaque UnknownSlicedValue.
2658
2125
  //
2659
- if(_current->sliceFlags & FLAG_IS_LAST_SLICE)
2126
+ if (_current->sliceFlags & FLAG_IS_LAST_SLICE)
2660
2127
  {
2661
2128
  //
2662
2129
  // Provide a factory with an opportunity to supply the object.
2663
2130
  // We pass the "::Ice::Object" ID to indicate that this is the
2664
2131
  // last chance to preserve the object.
2665
2132
  //
2666
- v = newInstance(Object::ice_staticId());
2667
- if(!v)
2133
+ v = newInstance(Value::ice_staticId());
2134
+ if (!v)
2668
2135
  {
2669
- v = ICE_MAKE_SHARED(UnknownSlicedValue, mostDerivedId);
2136
+ v = make_shared<UnknownSlicedValue>(mostDerivedId);
2670
2137
  }
2671
2138
 
2672
2139
  break;
@@ -2675,7 +2142,7 @@ Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc,
2675
2142
  startSlice(); // Read next Slice header for next iteration.
2676
2143
  }
2677
2144
 
2678
- if(++_classGraphDepth > _classGraphDepthMax)
2145
+ if (++_classGraphDepth > _classGraphDepthMax)
2679
2146
  {
2680
2147
  throw MarshalException(__FILE__, __LINE__, "maximum class graph depth reached");
2681
2148
  }
@@ -2687,16 +2154,16 @@ Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc,
2687
2154
 
2688
2155
  --_classGraphDepth;
2689
2156
 
2690
- if(!_current && !_patchMap.empty())
2157
+ if (!_current && !_patchMap.empty())
2691
2158
  {
2692
2159
  //
2693
- // If any entries remain in the patch map, the sender has sent an index for an object, but failed
2694
- // to supply the object.
2160
+ // If any entries remain in the patch map, the sender has sent an index for an object, but
2161
+ // failed to supply the object.
2695
2162
  //
2696
2163
  throw MarshalException(__FILE__, __LINE__, "index for class received, but no instance");
2697
2164
  }
2698
2165
 
2699
- if(patchFunc)
2166
+ if (patchFunc)
2700
2167
  {
2701
2168
  patchFunc(patchAddr, v);
2702
2169
  }
@@ -2706,9 +2173,9 @@ Ice::InputStream::EncapsDecoder11::readInstance(Int index, PatchFunc patchFunc,
2706
2173
  SlicedDataPtr
2707
2174
  Ice::InputStream::EncapsDecoder11::readSlicedData()
2708
2175
  {
2709
- if(_current->slices.empty()) // No preserved slices.
2176
+ if (_current->slices.empty()) // No preserved slices.
2710
2177
  {
2711
- return 0;
2178
+ return nullptr;
2712
2179
  }
2713
2180
 
2714
2181
  //
@@ -2716,7 +2183,7 @@ Ice::InputStream::EncapsDecoder11::readSlicedData()
2716
2183
  // each slice in slices.
2717
2184
  //
2718
2185
  assert(_current->slices.size() == _current->indirectionTables.size());
2719
- for(SliceInfoSeq::size_type n = 0; n < _current->slices.size(); ++n)
2186
+ for (SliceInfoSeq::size_type n = 0; n < _current->slices.size(); ++n)
2720
2187
  {
2721
2188
  //
2722
2189
  // We use the "instances" list in SliceInfo to hold references
@@ -2725,17 +2192,13 @@ Ice::InputStream::EncapsDecoder11::readSlicedData()
2725
2192
  // enclosing instance.
2726
2193
  //
2727
2194
  const IndexList& table = _current->indirectionTables[n];
2728
- vector<ValuePtr>& instances = _current->slices[n]->instances;
2195
+ vector<shared_ptr<Value>>& instances = _current->slices[n]->instances;
2729
2196
  instances.resize(table.size());
2730
2197
  IndexList::size_type j = 0;
2731
- for(IndexList::const_iterator p = table.begin(); p != table.end(); ++p)
2198
+ for (const auto& p : table)
2732
2199
  {
2733
- #ifdef ICE_CPP11_MAPPING
2734
- addPatchEntry(*p, &patchHandle<Value>, &instances[j++]);
2735
- #else
2736
- addPatchEntry(*p, &patchHandle<Object>, &instances[j++]);
2737
- #endif
2200
+ addPatchEntry(p, patchValue<Value>, &instances[j++]);
2738
2201
  }
2739
2202
  }
2740
- return ICE_MAKE_SHARED(SlicedData, _current->slices);
2203
+ return make_shared<SlicedData>(_current->slices);
2741
2204
  }