zeroc-ice 3.6.5 → 3.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (777) hide show
  1. checksums.yaml +5 -5
  2. data/ICE_LICENSE +17 -17
  3. data/LICENSE +12 -12
  4. data/bin/slice2rb +1 -6
  5. data/ext/Communicator.cpp +223 -61
  6. data/ext/Communicator.h +1 -6
  7. data/ext/Config.h +23 -7
  8. data/ext/Connection.cpp +108 -76
  9. data/ext/Connection.h +4 -6
  10. data/ext/Endpoint.cpp +16 -54
  11. data/ext/Endpoint.h +1 -6
  12. data/ext/ImplicitContext.cpp +1 -10
  13. data/ext/ImplicitContext.h +1 -6
  14. data/ext/Init.cpp +4 -6
  15. data/ext/Logger.cpp +1 -6
  16. data/ext/Logger.h +1 -6
  17. data/ext/Operation.cpp +38 -54
  18. data/ext/Operation.h +1 -6
  19. data/ext/Properties.cpp +3 -8
  20. data/ext/Properties.h +1 -6
  21. data/ext/Proxy.cpp +111 -70
  22. data/ext/Proxy.h +1 -6
  23. data/ext/Slice.cpp +5 -20
  24. data/ext/Slice.h +1 -6
  25. data/ext/Types.cpp +313 -224
  26. data/ext/Types.h +118 -71
  27. data/ext/Util.cpp +69 -36
  28. data/ext/Util.h +117 -42
  29. data/ext/ValueFactoryManager.cpp +440 -0
  30. data/ext/ValueFactoryManager.h +95 -0
  31. data/ext/extconf.rb +52 -48
  32. data/ext/ice/cpp/include/Ice/Application.h +275 -105
  33. data/ext/ice/cpp/include/Ice/AsyncResult.h +124 -337
  34. data/ext/ice/cpp/include/Ice/AsyncResultF.h +4 -7
  35. data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +39 -16
  36. data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +1 -6
  37. data/ext/ice/cpp/include/Ice/Buffer.h +10 -15
  38. data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +56 -17
  39. data/ext/ice/cpp/include/Ice/Comparable.h +205 -0
  40. data/ext/ice/cpp/include/Ice/Config.h +16 -39
  41. data/ext/ice/cpp/include/Ice/ConnectionAsync.h +203 -16
  42. data/ext/ice/cpp/include/Ice/ConnectionIF.h +7 -6
  43. data/ext/ice/cpp/include/Ice/ConsoleUtil.h +23 -0
  44. data/ext/ice/cpp/include/Ice/DefaultValueFactory.h +57 -0
  45. data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +20 -12
  46. data/ext/ice/cpp/include/Ice/Dispatcher.h +35 -19
  47. data/ext/ice/cpp/include/Ice/DynamicLibrary.h +7 -10
  48. data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +1 -6
  49. data/ext/ice/cpp/include/Ice/Exception.h +110 -63
  50. data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +74 -0
  51. data/ext/ice/cpp/include/Ice/FactoryTable.h +22 -18
  52. data/ext/ice/cpp/include/Ice/FactoryTableInit.h +28 -31
  53. data/ext/ice/cpp/include/Ice/Format.h +17 -18
  54. data/ext/ice/cpp/include/Ice/Functional.h +38 -38
  55. data/ext/ice/cpp/include/Ice/GCObject.h +9 -10
  56. data/ext/ice/cpp/include/Ice/Handle.h +6 -16
  57. data/ext/ice/cpp/include/Ice/Ice.h +9 -10
  58. data/ext/ice/cpp/include/Ice/IconvStringConverter.h +377 -0
  59. data/ext/ice/cpp/include/Ice/Incoming.h +132 -38
  60. data/ext/ice/cpp/include/Ice/IncomingAsync.h +109 -31
  61. data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +7 -6
  62. data/ext/ice/cpp/include/Ice/Initialize.h +872 -60
  63. data/ext/ice/cpp/include/Ice/InputStream.h +1514 -0
  64. data/ext/ice/cpp/include/Ice/InstanceF.h +1 -7
  65. data/ext/ice/cpp/include/Ice/InterfaceByValue.h +57 -0
  66. data/ext/ice/cpp/include/Ice/LocalObject.h +13 -14
  67. data/ext/ice/cpp/include/Ice/LocalObjectF.h +1 -6
  68. data/ext/ice/cpp/include/Ice/LoggerUtil.h +56 -24
  69. data/ext/ice/cpp/include/Ice/MetricsAdminI.h +124 -71
  70. data/ext/ice/cpp/include/Ice/MetricsFunctional.h +25 -10
  71. data/ext/ice/cpp/include/Ice/MetricsObserverI.h +116 -32
  72. data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +61 -30
  73. data/ext/ice/cpp/include/Ice/Object.h +413 -78
  74. data/ext/ice/cpp/include/Ice/ObjectF.h +12 -8
  75. data/ext/ice/cpp/include/Ice/ObserverHelper.h +18 -13
  76. data/ext/ice/cpp/include/Ice/Optional.h +1114 -0
  77. data/ext/ice/cpp/include/Ice/OutgoingAsync.h +684 -89
  78. data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +12 -11
  79. data/ext/ice/cpp/include/Ice/OutputStream.h +1092 -0
  80. data/ext/ice/cpp/include/Ice/Protocol.h +49 -17
  81. data/ext/ice/cpp/include/Ice/Proxy.h +3438 -745
  82. data/ext/ice/cpp/include/Ice/ProxyF.h +13 -38
  83. data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +1 -6
  84. data/ext/ice/cpp/include/Ice/ProxyHandle.h +43 -55
  85. data/ext/ice/cpp/include/Ice/ReferenceF.h +1 -6
  86. data/ext/ice/cpp/include/Ice/RegisterPlugins.h +84 -12
  87. data/ext/ice/cpp/include/Ice/RequestHandlerF.h +10 -9
  88. data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +6 -6
  89. data/ext/ice/cpp/include/Ice/SHA1.h +42 -0
  90. data/ext/ice/cpp/include/Ice/ServantManagerF.h +1 -6
  91. data/ext/ice/cpp/include/Ice/Service.h +273 -154
  92. data/ext/ice/cpp/include/Ice/SliceChecksums.h +5 -6
  93. data/ext/ice/cpp/include/Ice/SlicedData.h +121 -53
  94. data/ext/ice/cpp/include/Ice/SlicedDataF.h +17 -11
  95. data/ext/ice/cpp/include/Ice/StreamHelpers.h +453 -140
  96. data/ext/ice/cpp/include/Ice/StringConverter.h +78 -0
  97. data/ext/ice/cpp/include/Ice/ThreadPoolF.h +1 -6
  98. data/ext/ice/cpp/include/Ice/UUID.h +19 -0
  99. data/ext/ice/cpp/include/{IceUtil → Ice}/UniquePtr.h +22 -28
  100. data/ext/ice/cpp/include/Ice/UniqueRef.h +97 -0
  101. data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +45 -13
  102. data/ext/ice/cpp/include/Ice/Value.h +139 -0
  103. data/ext/ice/cpp/include/Ice/ValueF.h +21 -0
  104. data/ext/ice/cpp/include/IceSSL/Config.h +8 -28
  105. data/ext/ice/cpp/include/IceSSL/IceSSL.h +17 -11
  106. data/ext/ice/cpp/include/IceSSL/OpenSSL.h +147 -0
  107. data/ext/ice/cpp/include/IceSSL/Plugin.h +461 -448
  108. data/ext/ice/cpp/include/IceSSL/SChannel.h +72 -0
  109. data/ext/ice/cpp/include/IceSSL/SecureTransport.h +72 -0
  110. data/ext/ice/cpp/include/IceSSL/UWP.h +62 -0
  111. data/ext/ice/cpp/include/IceUtil/Atomic.h +7 -14
  112. data/ext/ice/cpp/include/IceUtil/Cond.h +17 -23
  113. data/ext/ice/cpp/include/IceUtil/Config.h +166 -46
  114. data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +92 -0
  115. data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +5 -10
  116. data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +63 -41
  117. data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +5 -13
  118. data/ext/ice/cpp/include/IceUtil/Exception.h +284 -75
  119. data/ext/ice/cpp/include/IceUtil/FileUtil.h +143 -0
  120. data/ext/ice/cpp/include/IceUtil/Functional.h +4 -6
  121. data/ext/ice/cpp/include/IceUtil/Handle.h +11 -16
  122. data/ext/ice/cpp/include/IceUtil/IceUtil.h +4 -15
  123. data/ext/ice/cpp/include/IceUtil/InputUtil.h +3 -8
  124. data/ext/ice/cpp/include/IceUtil/Iterator.h +2 -7
  125. data/ext/ice/cpp/include/IceUtil/Lock.h +8 -15
  126. data/ext/ice/cpp/include/IceUtil/Monitor.h +1 -7
  127. data/ext/ice/cpp/include/IceUtil/Mutex.h +19 -23
  128. data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +2 -7
  129. data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +4 -9
  130. data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +4 -9
  131. data/ext/ice/cpp/include/IceUtil/Optional.h +134 -23
  132. data/ext/ice/cpp/include/IceUtil/Options.h +17 -23
  133. data/ext/ice/cpp/include/IceUtil/OutputUtil.h +61 -37
  134. data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +6 -11
  135. data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +18 -15
  136. data/ext/ice/cpp/include/IceUtil/Random.h +39 -8
  137. data/ext/ice/cpp/include/IceUtil/RecMutex.h +7 -13
  138. data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +53 -0
  139. data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +10 -15
  140. data/ext/ice/cpp/include/IceUtil/ScopedArray.h +8 -7
  141. data/ext/ice/cpp/include/IceUtil/Shared.h +5 -12
  142. data/ext/ice/cpp/{src → include}/IceUtil/StopWatch.h +2 -7
  143. data/ext/ice/cpp/include/IceUtil/StringConverter.h +146 -126
  144. data/ext/ice/cpp/include/IceUtil/StringUtil.h +32 -26
  145. data/ext/ice/cpp/include/IceUtil/Thread.h +10 -17
  146. data/ext/ice/cpp/include/IceUtil/ThreadException.h +33 -47
  147. data/ext/ice/cpp/include/IceUtil/Time.h +3 -8
  148. data/ext/ice/cpp/include/IceUtil/Timer.h +18 -18
  149. data/ext/ice/cpp/include/IceUtil/UUID.h +6 -7
  150. data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +1 -6
  151. data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +170 -0
  152. data/ext/ice/cpp/include/generated/Ice/Communicator.h +1156 -0
  153. data/ext/ice/cpp/include/{Ice → generated/Ice}/CommunicatorF.h +51 -16
  154. data/ext/ice/cpp/include/generated/Ice/Connection.h +1660 -0
  155. data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +119 -0
  156. data/ext/ice/cpp/include/generated/Ice/Current.h +322 -0
  157. data/ext/ice/cpp/include/generated/Ice/Endpoint.h +943 -0
  158. data/ext/ice/cpp/include/generated/Ice/EndpointF.h +166 -0
  159. data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +118 -0
  160. data/ext/ice/cpp/include/{Ice → generated/Ice}/FacetMap.h +31 -15
  161. data/ext/ice/cpp/include/generated/Ice/Identity.h +264 -0
  162. data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +278 -0
  163. data/ext/ice/cpp/include/{Ice → generated/Ice}/ImplicitContextF.h +51 -16
  164. data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +1143 -0
  165. data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +128 -0
  166. data/ext/ice/cpp/include/generated/Ice/LocalException.h +7041 -0
  167. data/ext/ice/cpp/include/generated/Ice/Locator.h +3850 -0
  168. data/ext/ice/cpp/include/generated/Ice/LocatorF.h +147 -0
  169. data/ext/ice/cpp/include/generated/Ice/Logger.h +231 -0
  170. data/ext/ice/cpp/include/{Ice → generated/Ice}/LoggerF.h +51 -16
  171. data/ext/ice/cpp/include/generated/Ice/Metrics.h +4717 -0
  172. data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +1175 -0
  173. data/ext/ice/cpp/include/{Ice → generated/Ice}/ObjectAdapterF.h +51 -16
  174. data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +197 -0
  175. data/ext/ice/cpp/include/generated/Ice/Plugin.h +306 -0
  176. data/ext/ice/cpp/include/generated/Ice/PluginF.h +110 -0
  177. data/ext/ice/cpp/include/generated/Ice/Process.h +971 -0
  178. data/ext/ice/cpp/include/generated/Ice/ProcessF.h +125 -0
  179. data/ext/ice/cpp/include/generated/Ice/Properties.h +446 -0
  180. data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +1360 -0
  181. data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +134 -0
  182. data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +2689 -0
  183. data/ext/ice/cpp/include/generated/Ice/Router.h +1838 -0
  184. data/ext/ice/cpp/include/generated/Ice/RouterF.h +125 -0
  185. data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +299 -0
  186. data/ext/ice/cpp/include/{Ice → generated/Ice}/ServantLocatorF.h +51 -16
  187. data/ext/ice/cpp/include/{Ice → generated/Ice}/SliceChecksumDict.h +34 -14
  188. data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +318 -0
  189. data/ext/ice/cpp/include/generated/Ice/Version.h +357 -0
  190. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +223 -0
  191. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +101 -0
  192. data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +181 -0
  193. data/ext/ice/cpp/src/Ice/ACM.cpp +38 -27
  194. data/ext/ice/cpp/src/Ice/ACM.h +9 -7
  195. data/ext/ice/cpp/src/Ice/ACMF.h +30 -0
  196. data/ext/ice/cpp/src/Ice/Acceptor.cpp +6 -6
  197. data/ext/ice/cpp/src/Ice/Acceptor.h +4 -8
  198. data/ext/ice/cpp/src/Ice/AcceptorF.h +1 -6
  199. data/ext/ice/cpp/src/Ice/ArgVector.cpp +59 -0
  200. data/ext/ice/cpp/src/Ice/ArgVector.h +36 -0
  201. data/ext/ice/cpp/src/Ice/AsyncResult.cpp +15 -544
  202. data/ext/ice/cpp/src/Ice/Base64.cpp +22 -28
  203. data/ext/ice/cpp/src/Ice/Base64.h +1 -6
  204. data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +41 -18
  205. data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +15 -15
  206. data/ext/ice/cpp/src/Ice/Buffer.cpp +75 -18
  207. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +21 -12
  208. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +86 -197
  209. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +17 -23
  210. data/ext/ice/cpp/src/Ice/Communicator.cpp +43 -15
  211. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +28 -11
  212. data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +318 -117
  213. data/ext/ice/cpp/src/Ice/CommunicatorI.h +95 -40
  214. data/ext/ice/cpp/src/{IceUtil → Ice}/Cond.cpp +3 -8
  215. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +55 -122
  216. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +15 -31
  217. data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +6 -7
  218. data/ext/ice/cpp/src/Ice/Connection.cpp +111 -20
  219. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +28 -11
  220. data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +300 -107
  221. data/ext/ice/cpp/src/Ice/ConnectionFactory.h +44 -28
  222. data/ext/ice/cpp/src/Ice/ConnectionFactoryF.h +30 -0
  223. data/ext/ice/cpp/src/Ice/ConnectionI.cpp +785 -713
  224. data/ext/ice/cpp/src/Ice/ConnectionI.h +105 -80
  225. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +2 -20
  226. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +5 -9
  227. data/ext/ice/cpp/src/Ice/Connector.cpp +6 -6
  228. data/ext/ice/cpp/src/Ice/Connector.h +4 -8
  229. data/ext/ice/cpp/src/Ice/ConnectorF.h +1 -6
  230. data/ext/ice/cpp/src/{IceUtil → Ice}/CountDownLatch.cpp +4 -9
  231. data/ext/ice/cpp/src/Ice/Current.cpp +30 -12
  232. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -16
  233. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +1 -6
  234. data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +1 -6
  235. data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +13 -25
  236. data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +34 -28
  237. data/ext/ice/cpp/src/Ice/Endpoint.cpp +107 -19
  238. data/ext/ice/cpp/src/Ice/EndpointF.cpp +28 -11
  239. data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +152 -6
  240. data/ext/ice/cpp/src/Ice/EndpointFactory.h +72 -11
  241. data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +1 -6
  242. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +41 -36
  243. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +10 -9
  244. data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +1 -6
  245. data/ext/ice/cpp/src/Ice/EndpointI.cpp +18 -7
  246. data/ext/ice/cpp/src/Ice/EndpointI.h +39 -18
  247. data/ext/ice/cpp/src/Ice/EndpointIF.h +18 -10
  248. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +19 -12
  249. data/ext/ice/cpp/src/Ice/EventHandler.cpp +6 -9
  250. data/ext/ice/cpp/src/Ice/EventHandler.h +13 -13
  251. data/ext/ice/cpp/src/Ice/EventHandlerF.h +5 -7
  252. data/ext/ice/cpp/src/Ice/Exception.cpp +102 -98
  253. data/ext/ice/cpp/src/Ice/FacetMap.cpp +21 -12
  254. data/ext/ice/cpp/src/Ice/FactoryTable.cpp +37 -33
  255. data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +2 -9
  256. data/ext/ice/cpp/src/Ice/GCObject.cpp +29 -31
  257. data/ext/ice/cpp/src/Ice/HashUtil.h +3 -9
  258. data/ext/ice/cpp/src/Ice/HttpParser.cpp +1 -7
  259. data/ext/ice/cpp/src/Ice/HttpParser.h +1 -6
  260. data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +128 -111
  261. data/ext/ice/cpp/src/Ice/IPEndpointI.h +23 -19
  262. data/ext/ice/cpp/src/Ice/IPEndpointIF.h +6 -7
  263. data/ext/ice/cpp/src/Ice/IconvStringConverter.cpp +51 -0
  264. data/ext/ice/cpp/src/Ice/Identity.cpp +25 -16
  265. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +41 -13
  266. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +28 -11
  267. data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +11 -28
  268. data/ext/ice/cpp/src/Ice/ImplicitContextI.h +7 -10
  269. data/ext/ice/cpp/src/Ice/Incoming.cpp +284 -255
  270. data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +104 -214
  271. data/ext/ice/cpp/src/Ice/IncomingRequest.h +5 -9
  272. data/ext/ice/cpp/src/Ice/Initialize.cpp +309 -193
  273. data/ext/ice/cpp/src/Ice/InputStream.cpp +2726 -0
  274. data/ext/ice/cpp/src/Ice/Instance.cpp +243 -262
  275. data/ext/ice/cpp/src/Ice/Instance.h +30 -23
  276. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +137 -23
  277. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +28 -11
  278. data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +118 -105
  279. data/ext/ice/cpp/src/Ice/InstrumentationI.h +30 -36
  280. data/ext/ice/cpp/src/Ice/LocalException.cpp +1191 -422
  281. data/ext/ice/cpp/src/Ice/LocalObject.cpp +1 -7
  282. data/ext/ice/cpp/src/Ice/Locator.cpp +1282 -1222
  283. data/ext/ice/cpp/src/Ice/LocatorF.cpp +30 -12
  284. data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +150 -186
  285. data/ext/ice/cpp/src/Ice/LocatorInfo.h +31 -36
  286. data/ext/ice/cpp/src/Ice/LocatorInfoF.h +1 -6
  287. data/ext/ice/cpp/src/Ice/Logger.cpp +39 -12
  288. data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +182 -88
  289. data/ext/ice/cpp/src/Ice/LoggerAdminI.h +4 -9
  290. data/ext/ice/cpp/src/Ice/LoggerF.cpp +28 -11
  291. data/ext/ice/cpp/src/Ice/LoggerI.cpp +26 -55
  292. data/ext/ice/cpp/src/Ice/LoggerI.h +7 -18
  293. data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +10 -17
  294. data/ext/ice/cpp/src/Ice/Metrics.cpp +1280 -1107
  295. data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +58 -33
  296. data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +1 -7
  297. data/ext/ice/cpp/src/Ice/Network.cpp +753 -408
  298. data/ext/ice/cpp/src/Ice/Network.h +99 -36
  299. data/ext/ice/cpp/src/Ice/NetworkF.h +2 -7
  300. data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +20 -19
  301. data/ext/ice/cpp/src/Ice/NetworkProxy.h +5 -7
  302. data/ext/ice/cpp/src/Ice/NetworkProxyF.h +1 -6
  303. data/ext/ice/cpp/src/Ice/OSLogLoggerI.cpp +57 -0
  304. data/ext/ice/cpp/src/Ice/OSLogLoggerI.h +40 -0
  305. data/ext/ice/cpp/src/Ice/Object.cpp +227 -232
  306. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +45 -13
  307. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +28 -11
  308. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +83 -33
  309. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +13 -12
  310. data/ext/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +25 -0
  311. data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +298 -191
  312. data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +44 -39
  313. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +41 -13
  314. data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +9 -37
  315. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +67 -67
  316. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +15 -11
  317. data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +801 -366
  318. data/ext/ice/cpp/src/Ice/OutputStream.cpp +1367 -0
  319. data/ext/ice/cpp/src/Ice/Plugin.cpp +52 -14
  320. data/ext/ice/cpp/src/Ice/PluginF.cpp +28 -11
  321. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +27 -51
  322. data/ext/ice/cpp/src/Ice/PluginManagerI.h +7 -13
  323. data/ext/ice/cpp/src/Ice/Process.cpp +294 -128
  324. data/ext/ice/cpp/src/Ice/ProcessF.cpp +30 -12
  325. data/ext/ice/cpp/src/Ice/Properties.cpp +42 -15
  326. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +382 -340
  327. data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +83 -24
  328. data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +29 -10
  329. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +30 -12
  330. data/ext/ice/cpp/src/Ice/PropertiesI.cpp +46 -57
  331. data/ext/ice/cpp/src/Ice/PropertiesI.h +18 -26
  332. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +112 -19
  333. data/ext/ice/cpp/src/Ice/PropertyNames.h +4 -7
  334. data/ext/ice/cpp/src/Ice/Protocol.cpp +6 -19
  335. data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +37 -7
  336. data/ext/ice/cpp/src/Ice/ProtocolInstance.h +9 -25
  337. data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +1 -6
  338. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +6 -6
  339. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +3 -6
  340. data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +1 -6
  341. data/ext/ice/cpp/src/Ice/Proxy.cpp +729 -957
  342. data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +33 -38
  343. data/ext/ice/cpp/src/Ice/ProxyFactory.h +16 -16
  344. data/ext/ice/cpp/src/Ice/Reference.cpp +190 -106
  345. data/ext/ice/cpp/src/Ice/Reference.h +39 -28
  346. data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +69 -118
  347. data/ext/ice/cpp/src/Ice/ReferenceFactory.h +12 -17
  348. data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +1 -6
  349. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.cpp +19 -9
  350. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.h +1 -6
  351. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +766 -565
  352. data/ext/ice/cpp/src/Ice/ReplyStatus.h +1 -6
  353. data/ext/ice/cpp/src/Ice/RequestHandler.cpp +5 -8
  354. data/ext/ice/cpp/src/Ice/RequestHandler.h +10 -18
  355. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +10 -11
  356. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +2 -7
  357. data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +3 -11
  358. data/ext/ice/cpp/src/Ice/ResponseHandler.h +16 -12
  359. data/ext/ice/cpp/src/Ice/RetryQueue.cpp +12 -20
  360. data/ext/ice/cpp/src/Ice/RetryQueue.h +7 -11
  361. data/ext/ice/cpp/src/Ice/RetryQueueF.h +1 -6
  362. data/ext/ice/cpp/src/Ice/Router.cpp +614 -492
  363. data/ext/ice/cpp/src/Ice/RouterF.cpp +30 -12
  364. data/ext/ice/cpp/src/Ice/RouterInfo.cpp +93 -99
  365. data/ext/ice/cpp/src/Ice/RouterInfo.h +42 -38
  366. data/ext/ice/cpp/src/Ice/RouterInfoF.h +1 -6
  367. data/ext/ice/cpp/src/{IceUtil → Ice}/SHA1.cpp +23 -28
  368. data/ext/ice/cpp/src/Ice/Selector.cpp +948 -855
  369. data/ext/ice/cpp/src/Ice/Selector.h +100 -152
  370. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +41 -13
  371. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +28 -11
  372. data/ext/ice/cpp/src/Ice/ServantManager.cpp +24 -45
  373. data/ext/ice/cpp/src/Ice/ServantManager.h +1 -6
  374. data/ext/ice/cpp/src/Ice/SharedContext.h +2 -7
  375. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +21 -12
  376. data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +2 -7
  377. data/ext/ice/cpp/src/Ice/SlicedData.cpp +72 -25
  378. data/ext/ice/cpp/src/Ice/StreamSocket.cpp +208 -76
  379. data/ext/ice/cpp/src/Ice/StreamSocket.h +13 -9
  380. data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +57 -22
  381. data/ext/ice/cpp/src/Ice/StringUtil.h +30 -0
  382. data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +6 -7
  383. data/ext/ice/cpp/src/Ice/SysLoggerI.h +2 -8
  384. data/ext/ice/cpp/src/Ice/SystemdJournalI.cpp +66 -0
  385. data/ext/ice/cpp/src/Ice/SystemdJournalI.h +39 -0
  386. data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +169 -49
  387. data/ext/ice/cpp/src/Ice/TcpAcceptor.h +12 -10
  388. data/ext/ice/cpp/src/Ice/TcpConnector.cpp +6 -12
  389. data/ext/ice/cpp/src/Ice/TcpConnector.h +1 -7
  390. data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +51 -46
  391. data/ext/ice/cpp/src/Ice/TcpEndpointI.h +12 -14
  392. data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +17 -32
  393. data/ext/ice/cpp/src/Ice/TcpTransceiver.h +7 -15
  394. data/ext/ice/cpp/src/{IceUtil → Ice}/Thread.cpp +41 -54
  395. data/ext/ice/cpp/src/Ice/ThreadPool.cpp +242 -274
  396. data/ext/ice/cpp/src/Ice/ThreadPool.h +46 -48
  397. data/ext/ice/cpp/src/{IceUtil → Ice}/Timer.cpp +38 -26
  398. data/ext/ice/cpp/src/Ice/TraceLevels.cpp +2 -7
  399. data/ext/ice/cpp/src/Ice/TraceLevels.h +1 -6
  400. data/ext/ice/cpp/src/Ice/TraceLevelsF.h +2 -7
  401. data/ext/ice/cpp/src/Ice/TraceUtil.cpp +53 -36
  402. data/ext/ice/cpp/src/Ice/TraceUtil.h +13 -11
  403. data/ext/ice/cpp/src/Ice/Transceiver.cpp +1 -7
  404. data/ext/ice/cpp/src/Ice/Transceiver.h +8 -12
  405. data/ext/ice/cpp/src/Ice/TransceiverF.h +3 -8
  406. data/ext/ice/cpp/src/Ice/UdpConnector.cpp +5 -13
  407. data/ext/ice/cpp/src/Ice/UdpConnector.h +1 -7
  408. data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +118 -60
  409. data/ext/ice/cpp/src/Ice/UdpEndpointI.h +13 -10
  410. data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +177 -236
  411. data/ext/ice/cpp/src/Ice/UdpTransceiver.h +15 -22
  412. data/ext/ice/cpp/src/Ice/Value.cpp +76 -0
  413. data/ext/ice/cpp/src/Ice/ValueFactory.cpp +83 -0
  414. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +61 -0
  415. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.h +37 -0
  416. data/ext/ice/cpp/src/Ice/Version.cpp +25 -20
  417. data/ext/ice/cpp/src/Ice/VirtualShared.h +38 -0
  418. data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +3 -14
  419. data/ext/ice/cpp/src/Ice/WSAcceptor.h +3 -12
  420. data/ext/ice/cpp/src/Ice/WSConnector.cpp +5 -16
  421. data/ext/ice/cpp/src/Ice/WSConnector.h +3 -11
  422. data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +188 -89
  423. data/ext/ice/cpp/src/Ice/WSEndpoint.h +22 -37
  424. data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +65 -66
  425. data/ext/ice/cpp/src/Ice/WSTransceiver.h +7 -27
  426. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +596 -281
  427. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +1383 -543
  428. data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +89 -32
  429. data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +59 -28
  430. data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +315 -66
  431. data/ext/ice/cpp/src/IceDiscovery/LookupI.h +83 -41
  432. data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +57 -64
  433. data/ext/ice/cpp/src/IceDiscovery/PluginI.h +3 -8
  434. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +450 -172
  435. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +863 -406
  436. data/ext/ice/cpp/src/IceLocatorDiscovery/Plugin.h +47 -0
  437. data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +636 -144
  438. data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +20 -173
  439. data/ext/ice/cpp/src/IceSSL/AcceptorI.h +8 -22
  440. data/ext/ice/cpp/src/IceSSL/CertificateI.cpp +279 -0
  441. data/ext/ice/cpp/src/IceSSL/CertificateI.h +64 -0
  442. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +42 -17
  443. data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +61 -0
  444. data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +15 -64
  445. data/ext/ice/cpp/src/IceSSL/ConnectorI.h +6 -18
  446. data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +207 -204
  447. data/ext/ice/cpp/src/IceSSL/EndpointI.h +43 -40
  448. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +42 -16
  449. data/ext/ice/cpp/src/IceSSL/Instance.cpp +1 -11
  450. data/ext/ice/cpp/src/IceSSL/Instance.h +7 -12
  451. data/ext/ice/cpp/src/IceSSL/InstanceF.h +11 -12
  452. data/ext/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +583 -0
  453. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +134 -115
  454. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.h +59 -0
  455. data/ext/ice/cpp/src/IceSSL/OpenSSLEngineF.h +27 -0
  456. data/ext/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +127 -0
  457. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +477 -182
  458. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +32 -26
  459. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +286 -0
  460. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.h +58 -0
  461. data/ext/ice/cpp/src/IceSSL/PluginI.cpp +71 -46
  462. data/ext/ice/cpp/src/IceSSL/PluginI.h +13 -23
  463. data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +9 -60
  464. data/ext/ice/cpp/src/IceSSL/RFC2253.h +7 -12
  465. data/ext/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +580 -0
  466. data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +523 -74
  467. data/ext/ice/cpp/src/IceSSL/SChannelEngine.h +123 -0
  468. data/ext/ice/cpp/src/IceSSL/SChannelEngineF.h +31 -0
  469. data/ext/ice/cpp/src/IceSSL/SChannelPluginI.cpp +73 -0
  470. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +187 -221
  471. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +24 -26
  472. data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +97 -94
  473. data/ext/ice/cpp/src/IceSSL/SSLEngine.h +26 -192
  474. data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +4 -24
  475. data/ext/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +868 -0
  476. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +69 -201
  477. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.h +59 -0
  478. data/ext/ice/cpp/src/IceSSL/SecureTransportEngineF.h +29 -0
  479. data/ext/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +75 -0
  480. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +174 -161
  481. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +29 -33
  482. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +864 -0
  483. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.h +45 -0
  484. data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +12 -22
  485. data/ext/ice/cpp/src/IceSSL/TrustManager.h +4 -9
  486. data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +3 -8
  487. data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +266 -0
  488. data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +338 -0
  489. data/ext/ice/cpp/src/IceSSL/UWPEngine.h +41 -0
  490. data/ext/ice/cpp/src/IceSSL/UWPEngineF.h +26 -0
  491. data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +89 -0
  492. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +383 -0
  493. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +71 -0
  494. data/ext/ice/cpp/src/IceSSL/Util.cpp +71 -1260
  495. data/ext/ice/cpp/src/IceSSL/Util.h +48 -142
  496. data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +157 -0
  497. data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +22 -27
  498. data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +34 -31
  499. data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +22 -36
  500. data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +30 -126
  501. data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +1 -6
  502. data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +1 -6
  503. data/ext/ice/cpp/src/IceUtil/Options.cpp +20 -33
  504. data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +47 -21
  505. data/ext/ice/cpp/src/IceUtil/Random.cpp +15 -20
  506. data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +4 -19
  507. data/ext/ice/cpp/src/IceUtil/Shared.cpp +8 -8
  508. data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +501 -269
  509. data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +582 -244
  510. data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +37 -79
  511. data/ext/ice/cpp/src/IceUtil/Time.cpp +6 -11
  512. data/ext/ice/cpp/src/IceUtil/UUID.cpp +17 -22
  513. data/ext/ice/cpp/src/IceUtil/Unicode.cpp +97 -101
  514. data/ext/ice/cpp/src/IceUtil/Unicode.h +21 -40
  515. data/ext/ice/cpp/src/IceUtil/UtilException.cpp +839 -0
  516. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +894 -234
  517. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.h +72 -0
  518. data/ext/ice/cpp/src/Slice/Checksum.cpp +2 -7
  519. data/ext/ice/cpp/src/Slice/Checksum.h +21 -0
  520. data/ext/ice/cpp/src/Slice/FileTracker.cpp +25 -83
  521. data/ext/ice/cpp/{include → src}/Slice/FileTracker.h +9 -14
  522. data/ext/ice/cpp/src/Slice/Grammar.cpp +1981 -1944
  523. data/ext/ice/cpp/src/Slice/Grammar.h +39 -19
  524. data/ext/ice/cpp/src/Slice/GrammarUtil.h +14 -20
  525. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +2752 -1948
  526. data/ext/ice/cpp/src/Slice/JavaUtil.h +398 -0
  527. data/ext/ice/cpp/src/Slice/MD5.cpp +1 -6
  528. data/ext/ice/cpp/src/Slice/MD5.h +1 -6
  529. data/ext/ice/cpp/src/Slice/MD5I.cpp +8 -1
  530. data/ext/ice/cpp/src/Slice/MD5I.h +1 -1
  531. data/ext/ice/cpp/src/Slice/PHPUtil.cpp +17 -20
  532. data/ext/ice/cpp/src/Slice/PHPUtil.h +36 -0
  533. data/ext/ice/cpp/src/Slice/Parser.cpp +1190 -426
  534. data/ext/ice/cpp/{include → src}/Slice/Parser.h +143 -91
  535. data/ext/ice/cpp/src/Slice/Preprocessor.cpp +67 -36
  536. data/ext/ice/cpp/{include → src}/Slice/Preprocessor.h +8 -18
  537. data/ext/ice/cpp/src/Slice/Python.cpp +218 -111
  538. data/ext/ice/cpp/src/Slice/PythonUtil.cpp +787 -699
  539. data/ext/ice/cpp/src/Slice/PythonUtil.h +70 -0
  540. data/ext/ice/cpp/src/Slice/Ruby.cpp +42 -43
  541. data/ext/ice/cpp/src/Slice/RubyUtil.cpp +175 -445
  542. data/ext/ice/cpp/{include → src}/Slice/RubyUtil.h +6 -11
  543. data/ext/ice/cpp/src/Slice/Scanner.cpp +390 -399
  544. data/ext/ice/cpp/src/Slice/{Util.cpp → SliceUtil.cpp} +36 -69
  545. data/ext/ice/cpp/src/Slice/StringLiteralUtil.cpp +456 -0
  546. data/ext/ice/cpp/src/Slice/Util.h +50 -0
  547. data/ice.gemspec +2 -9
  548. data/lib/Glacier2.rb +1 -6
  549. data/lib/Glacier2/Metrics.rb +6 -50
  550. data/lib/Glacier2/PermissionsVerifier.rb +23 -99
  551. data/lib/Glacier2/PermissionsVerifierF.rb +2 -7
  552. data/lib/Glacier2/Router.rb +31 -78
  553. data/lib/Glacier2/RouterF.rb +2 -7
  554. data/lib/Glacier2/SSLInfo.rb +3 -11
  555. data/lib/Glacier2/Session.rb +87 -311
  556. data/lib/Ice.rb +84 -58
  557. data/lib/Ice/BuiltinSequences.rb +3 -8
  558. data/lib/Ice/Communicator.rb +54 -61
  559. data/lib/Ice/CommunicatorF.rb +2 -7
  560. data/lib/Ice/Connection.rb +152 -166
  561. data/lib/Ice/ConnectionF.rb +2 -7
  562. data/lib/Ice/Current.rb +3 -15
  563. data/lib/Ice/Endpoint.rb +56 -137
  564. data/lib/Ice/EndpointF.rb +2 -7
  565. data/lib/Ice/EndpointTypes.rb +2 -11
  566. data/lib/Ice/FacetMap.rb +3 -8
  567. data/lib/Ice/Identity.rb +4 -12
  568. data/lib/Ice/ImplicitContext.rb +4 -38
  569. data/lib/Ice/ImplicitContextF.rb +2 -7
  570. data/lib/Ice/Instrumentation.rb +22 -279
  571. data/lib/Ice/InstrumentationF.rb +2 -7
  572. data/lib/Ice/LocalException.rb +94 -145
  573. data/lib/Ice/Locator.rb +50 -169
  574. data/lib/Ice/LocatorF.rb +2 -7
  575. data/lib/Ice/Logger.rb +4 -38
  576. data/lib/Ice/LoggerF.rb +2 -7
  577. data/lib/Ice/Metrics.rb +60 -420
  578. data/lib/Ice/ObjectAdapter.rb +29 -0
  579. data/lib/Ice/ObjectAdapterF.rb +2 -7
  580. data/lib/Ice/ObjectFactory.rb +4 -34
  581. data/lib/Ice/Plugin.rb +6 -64
  582. data/lib/Ice/PluginF.rb +2 -7
  583. data/lib/Ice/Process.rb +15 -56
  584. data/lib/Ice/ProcessF.rb +2 -7
  585. data/lib/Ice/Properties.rb +4 -45
  586. data/lib/Ice/PropertiesAdmin.rb +18 -60
  587. data/lib/Ice/PropertiesF.rb +2 -7
  588. data/lib/Ice/RemoteLogger.rb +33 -119
  589. data/lib/Ice/Router.rb +28 -105
  590. data/lib/Ice/RouterF.rb +2 -7
  591. data/lib/Ice/ServantLocator.rb +26 -0
  592. data/lib/Ice/ServantLocatorF.rb +24 -0
  593. data/lib/Ice/SliceChecksumDict.rb +2 -7
  594. data/lib/Ice/ValueFactory.rb +28 -0
  595. data/lib/Ice/Version.rb +4 -15
  596. data/lib/IceBox.rb +1 -6
  597. data/lib/IceBox/IceBox.rb +43 -152
  598. data/lib/IceGrid.rb +1 -9
  599. data/lib/IceGrid/Admin.rb +550 -431
  600. data/lib/IceGrid/Descriptor.rb +61 -533
  601. data/lib/IceGrid/Exception.rb +23 -49
  602. data/lib/IceGrid/FileParser.rb +13 -54
  603. data/lib/IceGrid/PluginFacade.rb +35 -0
  604. data/lib/IceGrid/Registry.rb +150 -62
  605. data/lib/IceGrid/Session.rb +24 -68
  606. data/lib/IceGrid/UserAccountMapper.rb +13 -54
  607. data/lib/IcePatch2.rb +1 -6
  608. data/lib/IcePatch2/FileInfo.rb +4 -15
  609. data/lib/IcePatch2/FileServer.rb +32 -80
  610. data/lib/IceStorm.rb +1 -6
  611. data/lib/IceStorm/IceStorm.rb +78 -210
  612. data/lib/IceStorm/Metrics.rb +10 -93
  613. data/slice/Glacier2/Metrics.ice +20 -10
  614. data/slice/Glacier2/PermissionsVerifier.ice +19 -12
  615. data/slice/Glacier2/PermissionsVerifierF.ice +16 -9
  616. data/slice/Glacier2/Router.ice +19 -13
  617. data/slice/Glacier2/RouterF.ice +16 -9
  618. data/slice/Glacier2/SSLInfo.ice +17 -10
  619. data/slice/Glacier2/Session.ice +24 -18
  620. data/slice/Ice/BuiltinSequences.ice +18 -9
  621. data/slice/Ice/Communicator.ice +180 -64
  622. data/slice/Ice/CommunicatorF.ice +18 -9
  623. data/slice/Ice/Connection.ice +208 -75
  624. data/slice/Ice/ConnectionF.ice +18 -9
  625. data/slice/Ice/Current.ice +37 -28
  626. data/slice/Ice/Endpoint.ice +73 -21
  627. data/slice/Ice/EndpointF.ice +19 -10
  628. data/slice/Ice/EndpointTypes.ice +21 -13
  629. data/slice/Ice/FacetMap.ice +19 -10
  630. data/slice/Ice/Identity.ice +24 -10
  631. data/slice/Ice/ImplicitContext.ice +41 -33
  632. data/slice/Ice/ImplicitContextF.ice +17 -9
  633. data/slice/Ice/Instrumentation.ice +37 -30
  634. data/slice/Ice/InstrumentationF.ice +19 -10
  635. data/slice/Ice/LocalException.ice +118 -112
  636. data/slice/Ice/Locator.ice +28 -21
  637. data/slice/Ice/LocatorF.ice +18 -9
  638. data/slice/Ice/Logger.ice +26 -18
  639. data/slice/Ice/LoggerF.ice +18 -9
  640. data/slice/Ice/Metrics.ice +42 -30
  641. data/slice/Ice/ObjectAdapter.ice +88 -53
  642. data/slice/Ice/ObjectAdapterF.ice +18 -9
  643. data/slice/Ice/ObjectFactory.ice +28 -17
  644. data/slice/Ice/Plugin.ice +25 -13
  645. data/slice/Ice/PluginF.ice +22 -9
  646. data/slice/Ice/Process.ice +20 -11
  647. data/slice/Ice/ProcessF.ice +18 -9
  648. data/slice/Ice/Properties.ice +42 -28
  649. data/slice/Ice/PropertiesAdmin.ice +20 -10
  650. data/slice/Ice/PropertiesF.ice +18 -9
  651. data/slice/Ice/RemoteLogger.ice +23 -19
  652. data/slice/Ice/Router.ice +28 -13
  653. data/slice/Ice/RouterF.ice +18 -9
  654. data/slice/Ice/ServantLocator.ice +40 -29
  655. data/slice/Ice/ServantLocatorF.ice +18 -9
  656. data/slice/Ice/SliceChecksumDict.ice +18 -9
  657. data/slice/Ice/ValueFactory.ice +132 -0
  658. data/slice/Ice/Version.ice +20 -10
  659. data/slice/IceBT/ConnectionInfo.ice +58 -0
  660. data/slice/IceBT/EndpointInfo.ice +56 -0
  661. data/slice/IceBT/Types.ice +44 -0
  662. data/slice/IceBox/IceBox.ice +45 -27
  663. data/slice/IceDiscovery/IceDiscovery.ice +75 -10
  664. data/slice/IceGrid/Admin.ice +410 -44
  665. data/slice/IceGrid/Descriptor.ice +47 -34
  666. data/slice/IceGrid/Exception.ice +43 -32
  667. data/slice/IceGrid/FileParser.ice +21 -12
  668. data/slice/IceGrid/PluginFacade.ice +26 -18
  669. data/slice/IceGrid/Registry.ice +150 -21
  670. data/slice/IceGrid/Session.ice +25 -17
  671. data/slice/IceGrid/UserAccountMapper.ice +23 -14
  672. data/slice/IceIAP/ConnectionInfo.ice +73 -0
  673. data/slice/IceIAP/EndpointInfo.ice +67 -0
  674. data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +19 -12
  675. data/slice/IcePatch2/FileInfo.ice +19 -13
  676. data/slice/IcePatch2/FileServer.ice +27 -18
  677. data/slice/IceSSL/ConnectionInfo.ice +27 -23
  678. data/slice/IceSSL/ConnectionInfoF.ice +30 -0
  679. data/slice/IceSSL/EndpointInfo.ice +21 -36
  680. data/slice/IceStorm/IceStorm.ice +33 -24
  681. data/slice/IceStorm/Metrics.ice +19 -11
  682. metadata +148 -120
  683. data/ext/ObjectFactory.cpp +0 -140
  684. data/ext/ObjectFactory.h +0 -50
  685. data/ext/ice/cpp/include/Ice/ACMF.h +0 -30
  686. data/ext/ice/cpp/include/Ice/BasicStream.h +0 -1335
  687. data/ext/ice/cpp/include/Ice/BuiltinSequences.h +0 -82
  688. data/ext/ice/cpp/include/Ice/Communicator.h +0 -200
  689. data/ext/ice/cpp/include/Ice/Connection.h +0 -497
  690. data/ext/ice/cpp/include/Ice/ConnectionF.h +0 -74
  691. data/ext/ice/cpp/include/Ice/ConnectionFactoryF.h +0 -30
  692. data/ext/ice/cpp/include/Ice/Current.h +0 -102
  693. data/ext/ice/cpp/include/Ice/DefaultObjectFactory.h +0 -48
  694. data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +0 -62
  695. data/ext/ice/cpp/include/Ice/Endpoint.h +0 -341
  696. data/ext/ice/cpp/include/Ice/EndpointF.h +0 -93
  697. data/ext/ice/cpp/include/Ice/EndpointTypes.h +0 -82
  698. data/ext/ice/cpp/include/Ice/Identity.h +0 -168
  699. data/ext/ice/cpp/include/Ice/ImplicitContext.h +0 -102
  700. data/ext/ice/cpp/include/Ice/Instrumentation.h +0 -365
  701. data/ext/ice/cpp/include/Ice/InstrumentationF.h +0 -75
  702. data/ext/ice/cpp/include/Ice/LocalException.h +0 -1030
  703. data/ext/ice/cpp/include/Ice/Locator.h +0 -2193
  704. data/ext/ice/cpp/include/Ice/LocatorF.h +0 -93
  705. data/ext/ice/cpp/include/Ice/Logger.h +0 -100
  706. data/ext/ice/cpp/include/Ice/Metrics.h +0 -2974
  707. data/ext/ice/cpp/include/Ice/ObjectAdapter.h +0 -168
  708. data/ext/ice/cpp/include/Ice/ObjectAdapterFactoryF.h +0 -26
  709. data/ext/ice/cpp/include/Ice/ObjectFactory.h +0 -92
  710. data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +0 -66
  711. data/ext/ice/cpp/include/Ice/ObjectFactoryManagerF.h +0 -26
  712. data/ext/ice/cpp/include/Ice/Outgoing.h +0 -225
  713. data/ext/ice/cpp/include/Ice/Plugin.h +0 -125
  714. data/ext/ice/cpp/include/Ice/PluginF.h +0 -70
  715. data/ext/ice/cpp/include/Ice/Process.h +0 -574
  716. data/ext/ice/cpp/include/Ice/ProcessF.h +0 -83
  717. data/ext/ice/cpp/include/Ice/Properties.h +0 -136
  718. data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +0 -830
  719. data/ext/ice/cpp/include/Ice/PropertiesF.h +0 -87
  720. data/ext/ice/cpp/include/Ice/RemoteLogger.h +0 -1500
  721. data/ext/ice/cpp/include/Ice/Router.h +0 -1159
  722. data/ext/ice/cpp/include/Ice/RouterF.h +0 -83
  723. data/ext/ice/cpp/include/Ice/ServantLocator.h +0 -96
  724. data/ext/ice/cpp/include/Ice/Stream.h +0 -447
  725. data/ext/ice/cpp/include/Ice/StreamF.h +0 -30
  726. data/ext/ice/cpp/include/Ice/Version.h +0 -262
  727. data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +0 -158
  728. data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +0 -142
  729. data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +0 -119
  730. data/ext/ice/cpp/include/IceUtil/Cache.h +0 -362
  731. data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +0 -302
  732. data/ext/ice/cpp/include/IceUtil/SHA1.h +0 -47
  733. data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +0 -65
  734. data/ext/ice/cpp/include/Slice/Checksum.h +0 -26
  735. data/ext/ice/cpp/include/Slice/CsUtil.h +0 -92
  736. data/ext/ice/cpp/include/Slice/DotNetNames.h +0 -34
  737. data/ext/ice/cpp/include/Slice/JavaUtil.h +0 -279
  738. data/ext/ice/cpp/include/Slice/ObjCUtil.h +0 -127
  739. data/ext/ice/cpp/include/Slice/PHPUtil.h +0 -50
  740. data/ext/ice/cpp/include/Slice/PythonUtil.h +0 -64
  741. data/ext/ice/cpp/include/Slice/Util.h +0 -56
  742. data/ext/ice/cpp/src/Ice/BasicStream.cpp +0 -3428
  743. data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +0 -62
  744. data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +0 -44
  745. data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +0 -139
  746. data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +0 -43
  747. data/ext/ice/cpp/src/Ice/Outgoing.cpp +0 -694
  748. data/ext/ice/cpp/src/Ice/Stream.cpp +0 -53
  749. data/ext/ice/cpp/src/Ice/StreamI.cpp +0 -832
  750. data/ext/ice/cpp/src/Ice/StreamI.h +0 -198
  751. data/ext/ice/cpp/src/IceSSL/Certificate.cpp +0 -1336
  752. data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +0 -64
  753. data/ext/ice/cpp/src/IceUtil/ArgVector.h +0 -41
  754. data/ext/ice/cpp/src/IceUtil/Exception.cpp +0 -792
  755. data/ext/ice/cpp/src/IceUtil/FileUtil.h +0 -185
  756. data/ext/ice/cpp/src/Slice/CsUtil.cpp +0 -2660
  757. data/ext/ice/cpp/src/Slice/DotNetNames.cpp +0 -146
  758. data/ext/ice/cpp/src/Slice/ObjCUtil.cpp +0 -1310
  759. data/lib/Ice/ObjectFactoryF.rb +0 -29
  760. data/lib/IceGrid/Locator.rb +0 -106
  761. data/lib/IceGrid/Observer.rb +0 -572
  762. data/lib/IceGrid/Query.rb +0 -169
  763. data/slice/Freeze/BackgroundSaveEvictor.ice +0 -111
  764. data/slice/Freeze/CatalogData.ice +0 -49
  765. data/slice/Freeze/Connection.ice +0 -121
  766. data/slice/Freeze/ConnectionF.ice +0 -20
  767. data/slice/Freeze/DB.ice +0 -37
  768. data/slice/Freeze/Evictor.ice +0 -346
  769. data/slice/Freeze/EvictorF.ice +0 -22
  770. data/slice/Freeze/EvictorStorage.ice +0 -72
  771. data/slice/Freeze/Exception.ice +0 -100
  772. data/slice/Freeze/Transaction.ice +0 -58
  773. data/slice/Freeze/TransactionalEvictor.ice +0 -50
  774. data/slice/Ice/ObjectFactoryF.ice +0 -21
  775. data/slice/IceGrid/Locator.ice +0 -57
  776. data/slice/IceGrid/Observer.ice +0 -395
  777. data/slice/IceGrid/Query.ice +0 -131
@@ -1,14 +1,11 @@
1
- // **********************************************************************
2
1
  //
3
- // Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
2
+ // Copyright (c) ZeroC, Inc. All rights reserved.
4
3
  //
5
- // This copy of Ice is licensed to you under the terms described in the
6
- // ICE_LICENSE file included in this distribution.
7
- //
8
- // **********************************************************************
9
4
 
10
5
  #include <Slice/PHPUtil.h>
11
6
  #include <functional>
7
+ #include <algorithm>
8
+ #include <vector>
12
9
 
13
10
  using namespace std;
14
11
  using namespace Slice;
@@ -17,7 +14,12 @@ static string
17
14
  lowerCase(const string& s)
18
15
  {
19
16
  string result(s);
17
+ #ifdef ICE_CPP11_COMPILER
18
+ transform(result.begin(), result.end(), result.begin(),
19
+ [](char c){ return static_cast<char>(::tolower(static_cast<unsigned char>(c))); });
20
+ #else
20
21
  transform(result.begin(), result.end(), result.begin(), ::tolower);
22
+ #endif
21
23
  return result;
22
24
  }
23
25
 
@@ -29,14 +31,15 @@ lookupKwd(const string& name)
29
31
  //
30
32
  // Keyword list. *Must* be kept in alphabetical order.
31
33
  //
32
- static const string keywordList[] =
33
- {
34
- "abstract", "and", "array", "as", "break", "case", "catch", "class", "clone", "const", "continue", "declare",
35
- "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif",
36
- "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "if",
37
- "implements", "include", "include_once", "interface", "isset", "list", "new", "or", "print", "private",
38
- "protected", "public", "require", "require_once", "return", "static", "switch", "this", "throw", "try",
39
- "unset", "use", "var", "while", "xor"
34
+ static const string keywordList[] =
35
+ {
36
+ "_halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone",
37
+ "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare",
38
+ "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "finally",
39
+ "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof",
40
+ "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public",
41
+ "require", "require_once", "return", "static", "switch", "this", "throw", "trait", "try", "unset", "use", "var",
42
+ "while", "xor", "yield"
40
43
  };
41
44
  bool found = binary_search(&keywordList[0],
42
45
  &keywordList[sizeof(keywordList) / sizeof(*keywordList)],
@@ -134,12 +137,6 @@ Slice::PHP::fixIdent(const string& ident)
134
137
  return result.str();
135
138
  }
136
139
 
137
- string
138
- Slice::PHP::getAbsolute(const ContainedPtr& cont, bool ns, const string& prefix, const string& suffix)
139
- {
140
- return scopedToName(cont->scope() + prefix + cont->name() + suffix, ns);
141
- }
142
-
143
140
  string
144
141
  Slice::PHP::escapeName(const string& name)
145
142
  {
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright (c) ZeroC, Inc. All rights reserved.
3
+ //
4
+
5
+ #ifndef SLICE_PHP_UTIL_H
6
+ #define SLICE_PHP_UTIL_H
7
+
8
+ #include <IceUtil/Config.h>
9
+ #include <string>
10
+
11
+ namespace Slice
12
+ {
13
+ namespace PHP
14
+ {
15
+
16
+ //
17
+ // Convert a scoped name into a PHP name.
18
+ //
19
+ std::string scopedToName(const std::string&, bool);
20
+
21
+ //
22
+ // Check the given identifier against PHP's list of reserved words. If it matches
23
+ // a reserved word, then an escaped version is returned with a leading underscore.
24
+ //
25
+ std::string fixIdent(const std::string&);
26
+
27
+ //
28
+ // Since PHP uses the backslash character as the namespace separator, we have
29
+ // to escape backslash characters when they appear in a string literal.
30
+ //
31
+ std::string escapeName(const std::string&);
32
+
33
+ }
34
+ }
35
+
36
+ #endif
@@ -1,11 +1,6 @@
1
- // **********************************************************************
2
1
  //
3
- // Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
2
+ // Copyright (c) ZeroC, Inc. All rights reserved.
4
3
  //
5
- // This copy of Ice is licensed to you under the terms described in the
6
- // ICE_LICENSE file included in this distribution.
7
- //
8
- // **********************************************************************
9
4
 
10
5
  #include <IceUtil/Functional.h>
11
6
  #include <IceUtil/InputUtil.h>
@@ -16,16 +11,64 @@
16
11
  #include <cstring>
17
12
  #include <iterator>
18
13
 
19
- #ifdef _WIN32
20
- # include <io.h>
14
+ // TODO: fix this warning once we no longer support VS2013 and earlier
15
+ #if defined(_MSC_VER) && (_MSC_VER >= 1900)
16
+ # pragma warning(disable:4589) // Constructor of abstract class 'Slice::Type' ignores initializer...
21
17
  #endif
22
18
 
23
19
  using namespace std;
24
20
  using namespace Slice;
25
21
 
22
+ Slice::CompilerException::CompilerException(const char* file, int line, const string& r) :
23
+ IceUtil::Exception(file, line),
24
+ _reason(r)
25
+ {
26
+ }
27
+
28
+ #ifndef ICE_CPP11_COMPILER
29
+ Slice::CompilerException::~CompilerException() throw()
30
+ {
31
+ }
32
+ #endif
33
+
34
+ string
35
+ Slice::CompilerException::ice_id() const
36
+ {
37
+ return "::Slice::CompilerException";
38
+ }
39
+
40
+ void
41
+ Slice::CompilerException::ice_print(ostream& out) const
42
+ {
43
+ IceUtil::Exception::ice_print(out);
44
+ out << ": " << _reason;
45
+ }
46
+
47
+ #ifndef ICE_CPP11_MAPPING
48
+ Slice::CompilerException*
49
+ Slice::CompilerException::ice_clone() const
50
+ {
51
+ return new CompilerException(*this);
52
+ }
53
+ #endif
54
+
55
+ void
56
+ Slice::CompilerException::ice_throw() const
57
+ {
58
+ throw *this;
59
+ }
60
+
61
+ string
62
+ Slice::CompilerException::reason() const
63
+ {
64
+ return _reason;
65
+ }
66
+
26
67
  extern FILE* slice_in;
27
68
  extern int slice_debug;
28
69
 
70
+ int slice_parse();
71
+
29
72
  //
30
73
  // Operation attributes
31
74
  //
@@ -63,6 +106,72 @@ filterOrderedOptionalDataMembers(const DataMemberList& members)
63
106
  return result;
64
107
  }
65
108
 
109
+ void
110
+ sortOptionalParameters(ParamDeclList& params)
111
+ {
112
+ //
113
+ // Sort optional parameters by tag.
114
+ //
115
+ class SortFn
116
+ {
117
+ public:
118
+ static bool compare(const ParamDeclPtr& lhs, const ParamDeclPtr& rhs)
119
+ {
120
+ return lhs->tag() < rhs->tag();
121
+ }
122
+ };
123
+ params.sort(SortFn::compare);
124
+ }
125
+
126
+ bool
127
+ isMutableAfterReturnType(const TypePtr& type)
128
+ {
129
+ //
130
+ // Returns true if the type contains data types which can be referenced by user code
131
+ // and mutated after a dispatch returns.
132
+ //
133
+
134
+ if(ClassDeclPtr::dynamicCast(type))
135
+ {
136
+ return true;
137
+ }
138
+
139
+ BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
140
+ if(builtin && (builtin->kind() == Builtin::KindObject || builtin->kind() == Builtin::KindValue))
141
+ {
142
+ return true;
143
+ }
144
+
145
+ if(SequencePtr::dynamicCast(type) || DictionaryPtr::dynamicCast(type))
146
+ {
147
+ return true;
148
+ }
149
+
150
+ StructPtr s = StructPtr::dynamicCast(type);
151
+ if(s)
152
+ {
153
+ return true;
154
+ }
155
+
156
+ return false;
157
+ }
158
+
159
+ void
160
+ checkDeprecatedType(const UnitPtr& unt, const TypePtr& type)
161
+ {
162
+ ClassDeclPtr decl = ClassDeclPtr::dynamicCast(type);
163
+ if(decl && !decl->isLocal() && decl->isInterface())
164
+ {
165
+ unt->warning(Deprecated, "interface by value is deprecated");
166
+ }
167
+
168
+ ProxyPtr proxy = ProxyPtr::dynamicCast(type);
169
+ if(proxy && !proxy->_class()->isInterface())
170
+ {
171
+ unt->warning(Deprecated, "proxy for a class is deprecated");
172
+ }
173
+ }
174
+
66
175
  }
67
176
 
68
177
  namespace Slice
@@ -79,6 +188,7 @@ Unit* unit;
79
188
  Slice::DefinitionContext::DefinitionContext(int includeLevel, const StringList& metaData) :
80
189
  _includeLevel(includeLevel), _metaData(metaData), _seenDefinition(false)
81
190
  {
191
+ initSuppressedWarnings();
82
192
  }
83
193
 
84
194
  string
@@ -121,6 +231,7 @@ void
121
231
  Slice::DefinitionContext::setMetaData(const StringList& metaData)
122
232
  {
123
233
  _metaData = metaData;
234
+ initSuppressedWarnings();
124
235
  }
125
236
 
126
237
  string
@@ -143,6 +254,144 @@ Slice::DefinitionContext::getMetaData() const
143
254
  return _metaData;
144
255
  }
145
256
 
257
+ void
258
+ Slice::DefinitionContext::warning(WarningCategory category, const string& file, int line, const string& msg) const
259
+ {
260
+ if(!suppressWarning(category))
261
+ {
262
+ emitWarning(file, line, msg);
263
+ }
264
+ }
265
+
266
+ void
267
+ Slice::DefinitionContext::warning(WarningCategory category, const string& file, const string& line, const string& msg) const
268
+ {
269
+ if(!suppressWarning(category))
270
+ {
271
+ emitWarning(file, line, msg);
272
+ }
273
+ }
274
+
275
+ void
276
+ Slice::DefinitionContext::error(const string& file, int line, const string& msg) const
277
+ {
278
+ emitError(file, line, msg);
279
+ throw CompilerException(__FILE__, __LINE__, msg);
280
+ }
281
+
282
+ void
283
+ Slice::DefinitionContext::error(const string& file, const string& line, const string& msg) const
284
+ {
285
+ emitError(file, line, msg);
286
+ throw CompilerException(__FILE__, __LINE__, msg);
287
+ }
288
+
289
+ bool
290
+ Slice::DefinitionContext::suppressWarning(WarningCategory category) const
291
+ {
292
+ return _suppressedWarnings.find(category) != _suppressedWarnings.end() ||
293
+ _suppressedWarnings.find(All) != _suppressedWarnings.end();
294
+ }
295
+
296
+ void
297
+ Slice::DefinitionContext::initSuppressedWarnings()
298
+ {
299
+ _suppressedWarnings.clear();
300
+ const string prefix = "suppress-warning";
301
+ string value = findMetaData(prefix);
302
+ if(value == prefix)
303
+ {
304
+ _suppressedWarnings.insert(All);
305
+ }
306
+ else if(!value.empty())
307
+ {
308
+ assert(value.length() > prefix.length());
309
+ if(value[prefix.length()] == ':')
310
+ {
311
+ value = value.substr(prefix.length() + 1);
312
+ vector<string> result;
313
+ IceUtilInternal::splitString(value, ",", result);
314
+ for(vector<string>::iterator p = result.begin(); p != result.end(); ++p)
315
+ {
316
+ string s = IceUtilInternal::trim(*p);
317
+ if(s == "all")
318
+ {
319
+ _suppressedWarnings.insert(All);
320
+ }
321
+ else if(s == "deprecated")
322
+ {
323
+ _suppressedWarnings.insert(Deprecated);
324
+ }
325
+ else if(s == "invalid-metadata")
326
+ {
327
+ _suppressedWarnings.insert(InvalidMetaData);
328
+ }
329
+ else
330
+ {
331
+ warning(InvalidMetaData, "", "", string("invalid category `") + s +
332
+ "' in global metadata suppress-warning");
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+
339
+ // ----------------------------------------------------------------------
340
+ // Comment
341
+ // ----------------------------------------------------------------------
342
+
343
+ bool
344
+ Slice::Comment::isDeprecated() const
345
+ {
346
+ return _isDeprecated;
347
+ }
348
+
349
+ StringList
350
+ Slice::Comment::deprecated() const
351
+ {
352
+ return _deprecated;
353
+ }
354
+
355
+ StringList
356
+ Slice::Comment::overview() const
357
+ {
358
+ return _overview;
359
+ }
360
+
361
+ StringList
362
+ Slice::Comment::misc() const
363
+ {
364
+ return _misc;
365
+ }
366
+
367
+ StringList
368
+ Slice::Comment::seeAlso() const
369
+ {
370
+ return _seeAlso;
371
+ }
372
+
373
+ StringList
374
+ Slice::Comment::returns() const
375
+ {
376
+ return _returns;
377
+ }
378
+
379
+ map<string, StringList>
380
+ Slice::Comment::parameters() const
381
+ {
382
+ return _parameters;
383
+ }
384
+
385
+ map<string, StringList>
386
+ Slice::Comment::exceptions() const
387
+ {
388
+ return _exceptions;
389
+ }
390
+
391
+ Slice::Comment::Comment()
392
+ {
393
+ }
394
+
146
395
  // ----------------------------------------------------------------------
147
396
  // SyntaxTreeBase
148
397
  // ----------------------------------------------------------------------
@@ -170,12 +419,13 @@ Slice::SyntaxTreeBase::visit(ParserVisitor*, bool)
170
419
  {
171
420
  }
172
421
 
173
- Slice::SyntaxTreeBase::SyntaxTreeBase(const UnitPtr& unit) :
174
- _unit(unit)
422
+ Slice::SyntaxTreeBase::SyntaxTreeBase(const UnitPtr& unt, const DefinitionContextPtr& definitionContext) :
423
+ _unit(unt),
424
+ _definitionContext(definitionContext)
175
425
  {
176
- if(_unit)
426
+ if(!_definitionContext && _unit)
177
427
  {
178
- _definitionContext = unit->currentDefinitionContext();
428
+ _definitionContext = unt->currentDefinitionContext();
179
429
  }
180
430
  }
181
431
 
@@ -183,8 +433,8 @@ Slice::SyntaxTreeBase::SyntaxTreeBase(const UnitPtr& unit) :
183
433
  // Type
184
434
  // ----------------------------------------------------------------------
185
435
 
186
- Slice::Type::Type(const UnitPtr& unit) :
187
- SyntaxTreeBase(unit)
436
+ Slice::Type::Type(const UnitPtr& unt) :
437
+ SyntaxTreeBase(unt)
188
438
  {
189
439
  }
190
440
 
@@ -258,6 +508,11 @@ Slice::Builtin::typeId() const
258
508
  return "::Ice::LocalObject";
259
509
  break;
260
510
  }
511
+ case KindValue:
512
+ {
513
+ return "::Ice::Value";
514
+ break;
515
+ }
261
516
  }
262
517
  assert(false);
263
518
  return ""; // Keep the compiler happy.
@@ -266,7 +521,7 @@ Slice::Builtin::typeId() const
266
521
  bool
267
522
  Slice::Builtin::usesClasses() const
268
523
  {
269
- return _kind == KindObject;
524
+ return _kind == KindObject || _kind == KindValue;
270
525
  }
271
526
 
272
527
  size_t
@@ -283,7 +538,9 @@ Slice::Builtin::minWireSize() const
283
538
  8, // KindDouble
284
539
  1, // KindString: at least one byte for an empty string.
285
540
  1, // KindObject: at least one byte (to marshal an index instead of an instance).
286
- 2 // KindObjectProxy: at least an empty identity for a nil proxy, that is, 2 bytes.
541
+ 2, // KindObjectProxy: at least an empty identity for a nil proxy, that is, 2 bytes.
542
+ 0, // KindLocalObject: unused
543
+ 1 // KindValue: at least one byte (to marshal an index instead of an instance).
287
544
  };
288
545
 
289
546
  assert(_kind != KindLocalObject);
@@ -293,7 +550,7 @@ Slice::Builtin::minWireSize() const
293
550
  bool
294
551
  Slice::Builtin::isVariableLength() const
295
552
  {
296
- return _kind == KindString || _kind == KindObject || _kind == KindObjectProxy;
553
+ return _kind == KindString || _kind == KindObject || _kind == KindObjectProxy || _kind == KindValue;
297
554
  }
298
555
 
299
556
  Builtin::Kind
@@ -320,12 +577,13 @@ const char* Slice::Builtin::builtinTable[] =
320
577
  "string",
321
578
  "Object",
322
579
  "Object*",
323
- "LocalObject"
580
+ "LocalObject",
581
+ "Value"
324
582
  };
325
583
 
326
- Slice::Builtin::Builtin(const UnitPtr& unit, Kind kind) :
327
- SyntaxTreeBase(unit),
328
- Type(unit),
584
+ Slice::Builtin::Builtin(const UnitPtr& ut, Kind kind) :
585
+ SyntaxTreeBase(ut),
586
+ Type(ut),
329
587
  _kind(kind)
330
588
  {
331
589
  //
@@ -368,12 +626,13 @@ string
368
626
  Slice::Contained::flattenedScope() const
369
627
  {
370
628
  string s = scope();
371
- string flattenedScope;
372
- for(string::const_iterator r = s.begin(); r != s.end(); ++r)
629
+ string::size_type pos = 0;
630
+ while((pos = s.find("::", pos)) != string::npos)
373
631
  {
374
- flattenedScope += ((*r) == ':') ? '_' : *r;
632
+ s.replace(pos, 2, "_");
633
+
375
634
  }
376
- return flattenedScope;
635
+ return s;
377
636
  }
378
637
 
379
638
  string
@@ -394,6 +653,330 @@ Slice::Contained::comment() const
394
653
  return _comment;
395
654
  }
396
655
 
656
+ namespace
657
+ {
658
+
659
+ void
660
+ trimLines(StringList& l)
661
+ {
662
+ //
663
+ // Remove empty trailing lines.
664
+ //
665
+ while(!l.empty() && l.back().empty())
666
+ {
667
+ l.pop_back();
668
+ }
669
+ }
670
+
671
+ StringList
672
+ splitComment(const string& c, bool stripMarkup)
673
+ {
674
+ string comment = c;
675
+
676
+ if(stripMarkup)
677
+ {
678
+ //
679
+ // Strip HTML markup and javadoc links.
680
+ //
681
+ string::size_type pos = 0;
682
+ do
683
+ {
684
+ pos = comment.find('<', pos);
685
+ if(pos != string::npos)
686
+ {
687
+ string::size_type endpos = comment.find('>', pos);
688
+ if(endpos == string::npos)
689
+ {
690
+ break;
691
+ }
692
+ comment.erase(pos, endpos - pos + 1);
693
+ }
694
+ }
695
+ while(pos != string::npos);
696
+
697
+ const string link = "{@link";
698
+ pos = 0;
699
+ do
700
+ {
701
+ pos = comment.find(link, pos);
702
+ if(pos != string::npos)
703
+ {
704
+ comment.erase(pos, link.size() + 1); // Erase trailing white space too.
705
+ string::size_type endpos = comment.find('}', pos);
706
+ if(endpos != string::npos)
707
+ {
708
+ string ident = comment.substr(pos, endpos - pos);
709
+ comment.erase(pos, endpos - pos + 1);
710
+
711
+ //
712
+ // Replace links of the form {@link Type#member} with "Type.member".
713
+ //
714
+ string::size_type hash = ident.find('#');
715
+ string rest;
716
+ if(hash != string::npos)
717
+ {
718
+ rest = ident.substr(hash + 1);
719
+ ident = ident.substr(0, hash);
720
+ if(!ident.empty())
721
+ {
722
+ if(!rest.empty())
723
+ {
724
+ ident += "." + rest;
725
+ }
726
+ }
727
+ else if(!rest.empty())
728
+ {
729
+ ident = rest;
730
+ }
731
+ }
732
+
733
+ comment.insert(pos, ident);
734
+ }
735
+ }
736
+ }
737
+ while(pos != string::npos);
738
+ }
739
+
740
+ StringList result;
741
+
742
+ string::size_type pos = 0;
743
+ string::size_type nextPos;
744
+ while((nextPos = comment.find_first_of('\n', pos)) != string::npos)
745
+ {
746
+ result.push_back(IceUtilInternal::trim(string(comment, pos, nextPos - pos)));
747
+ pos = nextPos + 1;
748
+ }
749
+ string lastLine = IceUtilInternal::trim(string(comment, pos));
750
+ if(!lastLine.empty())
751
+ {
752
+ result.push_back(lastLine);
753
+ }
754
+
755
+ trimLines(result);
756
+
757
+ return result;
758
+ }
759
+
760
+ bool
761
+ parseCommentLine(const string& l, const string& tag, bool namedTag, string& name, string& doc)
762
+ {
763
+ doc.clear();
764
+
765
+ if(l.find(tag) == 0)
766
+ {
767
+ const string ws = " \t";
768
+
769
+ if(namedTag)
770
+ {
771
+ string::size_type n = l.find_first_not_of(ws, tag.size());
772
+ if(n == string::npos)
773
+ {
774
+ return false; // Malformed line, ignore it.
775
+ }
776
+ string::size_type end = l.find_first_of(ws, n);
777
+ if(end == string::npos)
778
+ {
779
+ return false; // Malformed line, ignore it.
780
+ }
781
+ name = l.substr(n, end - n);
782
+ n = l.find_first_not_of(ws, end);
783
+ if(n != string::npos)
784
+ {
785
+ doc = l.substr(n);
786
+ }
787
+ }
788
+ else
789
+ {
790
+ name.clear();
791
+
792
+ string::size_type n = l.find_first_not_of(ws, tag.size());
793
+ if(n == string::npos)
794
+ {
795
+ return false; // Malformed line, ignore it.
796
+ }
797
+ doc = l.substr(n);
798
+ }
799
+
800
+ return true;
801
+ }
802
+
803
+ return false;
804
+ }
805
+
806
+ }
807
+
808
+ CommentPtr
809
+ Slice::Contained::parseComment(bool stripMarkup) const
810
+ {
811
+ CommentPtr comment = new Comment;
812
+
813
+ comment->_isDeprecated = false;
814
+
815
+ //
816
+ // First check metadata for a deprecated tag.
817
+ //
818
+ string deprecateMetadata;
819
+ if(findMetaData("deprecate", deprecateMetadata))
820
+ {
821
+ comment->_isDeprecated = true;
822
+ if(deprecateMetadata.find("deprecate:") == 0 && deprecateMetadata.size() > 10)
823
+ {
824
+ comment->_deprecated.push_back(IceUtilInternal::trim(deprecateMetadata.substr(10)));
825
+ }
826
+ }
827
+
828
+ if(!comment->_isDeprecated && _comment.empty())
829
+ {
830
+ return 0;
831
+ }
832
+
833
+ //
834
+ // Split up the comment into lines.
835
+ //
836
+ StringList lines = splitComment(_comment, stripMarkup);
837
+
838
+ StringList::const_iterator i;
839
+ for(i = lines.begin(); i != lines.end(); ++i)
840
+ {
841
+ const string l = *i;
842
+ if(l[0] == '@')
843
+ {
844
+ break;
845
+ }
846
+ comment->_overview.push_back(l);
847
+ }
848
+
849
+ enum State { StateMisc, StateParam, StateThrows, StateReturn, StateDeprecated };
850
+ State state = StateMisc;
851
+ string name;
852
+ const string ws = " \t";
853
+ const string paramTag = "@param";
854
+ const string throwsTag = "@throws";
855
+ const string exceptionTag = "@exception";
856
+ const string returnTag = "@return";
857
+ const string deprecatedTag = "@deprecated";
858
+ const string seeTag = "@see";
859
+ for(; i != lines.end(); ++i)
860
+ {
861
+ const string l = IceUtilInternal::trim(*i);
862
+ string line;
863
+ if(parseCommentLine(l, paramTag, true, name, line))
864
+ {
865
+ if(!line.empty())
866
+ {
867
+ state = StateParam;
868
+ StringList sl;
869
+ sl.push_back(line); // The first line of the description.
870
+ comment->_parameters[name] = sl;
871
+ }
872
+ }
873
+ else if(parseCommentLine(l, throwsTag, true, name, line))
874
+ {
875
+ if(!line.empty())
876
+ {
877
+ state = StateThrows;
878
+ StringList sl;
879
+ sl.push_back(line); // The first line of the description.
880
+ comment->_exceptions[name] = sl;
881
+ }
882
+ }
883
+ else if(parseCommentLine(l, exceptionTag, true, name, line))
884
+ {
885
+ if(!line.empty())
886
+ {
887
+ state = StateThrows;
888
+ StringList sl;
889
+ sl.push_back(line); // The first line of the description.
890
+ comment->_exceptions[name] = sl;
891
+ }
892
+ }
893
+ else if(parseCommentLine(l, seeTag, false, name, line))
894
+ {
895
+ if(!line.empty())
896
+ {
897
+ comment->_seeAlso.push_back(line);
898
+ }
899
+ }
900
+ else if(parseCommentLine(l, returnTag, false, name, line))
901
+ {
902
+ if(!line.empty())
903
+ {
904
+ state = StateReturn;
905
+ comment->_returns.push_back(line); // The first line of the description.
906
+ }
907
+ }
908
+ else if(parseCommentLine(l, deprecatedTag, false, name, line))
909
+ {
910
+ comment->_isDeprecated = true;
911
+ if(!line.empty())
912
+ {
913
+ state = StateDeprecated;
914
+ comment->_deprecated.push_back(line); // The first line of the description.
915
+ }
916
+ }
917
+ else if(!l.empty())
918
+ {
919
+ if(l[0] == '@')
920
+ {
921
+ //
922
+ // Treat all other tags as miscellaneous comments.
923
+ //
924
+ state = StateMisc;
925
+ }
926
+
927
+ switch(state)
928
+ {
929
+ case StateMisc:
930
+ {
931
+ comment->_misc.push_back(l);
932
+ break;
933
+ }
934
+ case StateParam:
935
+ {
936
+ assert(!name.empty());
937
+ StringList sl;
938
+ if(comment->_parameters.find(name) != comment->_parameters.end())
939
+ {
940
+ sl = comment->_parameters[name];
941
+ }
942
+ sl.push_back(l);
943
+ comment->_parameters[name] = sl;
944
+ break;
945
+ }
946
+ case StateThrows:
947
+ {
948
+ assert(!name.empty());
949
+ StringList sl;
950
+ if(comment->_exceptions.find(name) != comment->_exceptions.end())
951
+ {
952
+ sl = comment->_exceptions[name];
953
+ }
954
+ sl.push_back(l);
955
+ comment->_exceptions[name] = sl;
956
+ break;
957
+ }
958
+ case StateReturn:
959
+ {
960
+ comment->_returns.push_back(l);
961
+ break;
962
+ }
963
+ case StateDeprecated:
964
+ {
965
+ comment->_deprecated.push_back(l);
966
+ break;
967
+ }
968
+ }
969
+ }
970
+ }
971
+
972
+ trimLines(comment->_overview);
973
+ trimLines(comment->_deprecated);
974
+ trimLines(comment->_misc);
975
+ trimLines(comment->_returns);
976
+
977
+ return comment;
978
+ }
979
+
397
980
  int
398
981
  Slice::Contained::includeLevel() const
399
982
  {
@@ -496,12 +1079,6 @@ Slice::Contained::operator==(const Contained& rhs) const
496
1079
  return _scoped == rhs._scoped;
497
1080
  }
498
1081
 
499
- bool
500
- Slice::Contained::operator!=(const Contained& rhs) const
501
- {
502
- return _scoped != rhs._scoped;
503
- }
504
-
505
1082
  Slice::Contained::Contained(const ContainerPtr& container, const string& name) :
506
1083
  SyntaxTreeBase(container->unit()),
507
1084
  _container(container),
@@ -539,7 +1116,6 @@ Slice::Container::destroy()
539
1116
  ModulePtr
540
1117
  Slice::Container::createModule(const string& name)
541
1118
  {
542
- checkIdentifier(name);
543
1119
  ContainedList matches = _unit->findContents(thisScope() + name);
544
1120
  matches.sort(); // Modules can occur many times...
545
1121
  matches.unique(); // ... but we only want one instance of each.
@@ -592,8 +1168,6 @@ Slice::Container::createModule(const string& name)
592
1168
  ClassDefPtr
593
1169
  Slice::Container::createClassDef(const string& name, int id, bool intf, const ClassList& bases, bool local)
594
1170
  {
595
- checkIdentifier(name);
596
-
597
1171
  ContainedList matches = _unit->findContents(thisScope() + name);
598
1172
  for(ContainedList::const_iterator p = matches.begin(); p != matches.end(); ++p)
599
1173
  {
@@ -674,20 +1248,15 @@ Slice::Container::createClassDef(const string& name, int id, bool intf, const Cl
674
1248
  // definition. This way the code generator can rely on always
675
1249
  // having a class declaration available for lookup.
676
1250
  //
677
- ClassDeclPtr decl = createClassDecl(name, intf, local, false);
1251
+ ClassDeclPtr decl = createClassDecl(name, intf, local);
678
1252
  def->_declaration = decl;
679
1253
 
680
1254
  return def;
681
1255
  }
682
1256
 
683
1257
  ClassDeclPtr
684
- Slice::Container::createClassDecl(const string& name, bool intf, bool local, bool checkName)
1258
+ Slice::Container::createClassDecl(const string& name, bool intf, bool local)
685
1259
  {
686
- if (checkName)
687
- {
688
- checkIdentifier(name);
689
- }
690
-
691
1260
  ClassDefPtr def;
692
1261
 
693
1262
  ContainedList matches = _unit->findContents(thisScope() + name);
@@ -777,8 +1346,6 @@ Slice::Container::createClassDecl(const string& name, bool intf, bool local, boo
777
1346
  ExceptionPtr
778
1347
  Slice::Container::createException(const string& name, const ExceptionPtr& base, bool local, NodeType nt)
779
1348
  {
780
- checkIdentifier(name);
781
-
782
1349
  ContainedList matches = _unit->findContents(thisScope() + name);
783
1350
  if(!matches.empty())
784
1351
  {
@@ -829,8 +1396,6 @@ Slice::Container::createException(const string& name, const ExceptionPtr& base,
829
1396
  StructPtr
830
1397
  Slice::Container::createStruct(const string& name, bool local, NodeType nt)
831
1398
  {
832
- checkIdentifier(name);
833
-
834
1399
  ContainedList matches = _unit->findContents(thisScope() + name);
835
1400
  if(!matches.empty())
836
1401
  {
@@ -874,19 +1439,6 @@ SequencePtr
874
1439
  Slice::Container::createSequence(const string& name, const TypePtr& type, const StringList& metaData, bool local,
875
1440
  NodeType nt)
876
1441
  {
877
- checkIdentifier(name);
878
-
879
- if(_unit->profile() == IceE && !local)
880
- {
881
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
882
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(type))
883
- {
884
- string msg = "Sequence `" + name + "' cannot contain object values.";
885
- _unit->error(msg);
886
- return 0;
887
- }
888
- }
889
-
890
1442
  ContainedList matches = _unit->findContents(thisScope() + name);
891
1443
  if(!matches.empty())
892
1444
  {
@@ -930,6 +1482,8 @@ Slice::Container::createSequence(const string& name, const TypePtr& type, const
930
1482
  _unit->error(msg);
931
1483
  }
932
1484
 
1485
+ checkDeprecatedType(_unit, type);
1486
+
933
1487
  SequencePtr p = new Sequence(this, name, type, metaData, local);
934
1488
  _contents.push_back(p);
935
1489
  return p;
@@ -940,19 +1494,6 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c
940
1494
  const TypePtr& valueType, const StringList& valueMetaData, bool local,
941
1495
  NodeType nt)
942
1496
  {
943
- checkIdentifier(name);
944
-
945
- if(_unit->profile() == IceE && !local)
946
- {
947
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(valueType);
948
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(valueType))
949
- {
950
- string msg = "Dictionary `" + name + "' cannot contain object values.";
951
- _unit->error(msg);
952
- return 0;
953
- }
954
- }
955
-
956
1497
  ContainedList matches = _unit->findContents(thisScope() + name);
957
1498
  if(!matches.empty())
958
1499
  {
@@ -997,7 +1538,7 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c
997
1538
  }
998
1539
  if(containsSequence)
999
1540
  {
1000
- _unit->warning("use of sequences in dictionary keys has been deprecated");
1541
+ _unit->warning(Deprecated, "use of sequences in dictionary keys has been deprecated");
1001
1542
  }
1002
1543
  }
1003
1544
 
@@ -1015,6 +1556,8 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c
1015
1556
  }
1016
1557
  }
1017
1558
 
1559
+ checkDeprecatedType(_unit, valueType);
1560
+
1018
1561
  DictionaryPtr p = new Dictionary(this, name, keyType, keyMetaData, valueType, valueMetaData, local);
1019
1562
  _contents.push_back(p);
1020
1563
  return p;
@@ -1023,8 +1566,6 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c
1023
1566
  EnumPtr
1024
1567
  Slice::Container::createEnum(const string& name, bool local, NodeType nt)
1025
1568
  {
1026
- checkIdentifier(name);
1027
-
1028
1569
  ContainedList matches = _unit->findContents(thisScope() + name);
1029
1570
  if(!matches.empty())
1030
1571
  {
@@ -1068,13 +1609,11 @@ EnumeratorPtr
1068
1609
  Slice::Container::createEnumerator(const string& name)
1069
1610
  {
1070
1611
  EnumeratorPtr p = validateEnumerator(name);
1071
- if(p)
1612
+ if(!p)
1072
1613
  {
1073
- return p;
1614
+ p = new Enumerator(this, name);
1615
+ _contents.push_back(p);
1074
1616
  }
1075
-
1076
- p = new Enumerator(this, name);
1077
- _contents.push_back(p);
1078
1617
  return p;
1079
1618
  }
1080
1619
 
@@ -1082,13 +1621,11 @@ EnumeratorPtr
1082
1621
  Slice::Container::createEnumerator(const string& name, int value)
1083
1622
  {
1084
1623
  EnumeratorPtr p = validateEnumerator(name);
1085
- if(p)
1624
+ if(!p)
1086
1625
  {
1087
- return p;
1626
+ p = new Enumerator(this, name, value);
1627
+ _contents.push_back(p);
1088
1628
  }
1089
-
1090
- p = new Enumerator(this, name, value);
1091
- _contents.push_back(p);
1092
1629
  return p;
1093
1630
  }
1094
1631
 
@@ -1097,8 +1634,6 @@ Slice::Container::createConst(const string name, const TypePtr& constType, const
1097
1634
  const SyntaxTreeBasePtr& valueType, const string& value, const string& literal,
1098
1635
  NodeType nt)
1099
1636
  {
1100
- checkIdentifier(name);
1101
-
1102
1637
  ContainedList matches = _unit->findContents(thisScope() + name);
1103
1638
  if(!matches.empty())
1104
1639
  {
@@ -1133,15 +1668,17 @@ Slice::Container::createConst(const string name, const TypePtr& constType, const
1133
1668
  checkForGlobalDef(name, "constant"); // Don't return here -- we create the constant anyway.
1134
1669
  }
1135
1670
 
1671
+ SyntaxTreeBasePtr resolvedValueType = valueType;
1672
+
1136
1673
  //
1137
- // Validate the constant and its value.
1674
+ // Validate the constant and its value; for enums, find enumerator
1138
1675
  //
1139
- if(nt == Real && !validateConstant(name, constType, valueType, value, true))
1676
+ if(nt == Real && !validateConstant(name, constType, resolvedValueType, value, true))
1140
1677
  {
1141
1678
  return 0;
1142
1679
  }
1143
1680
 
1144
- ConstPtr p = new Const(this, name, constType, metaData, valueType, value, literal);
1681
+ ConstPtr p = new Const(this, name, constType, metaData, resolvedValueType, value, literal);
1145
1682
  _contents.push_back(p);
1146
1683
  return p;
1147
1684
  }
@@ -1174,20 +1711,12 @@ Slice::Container::lookupType(const string& scoped, bool printError)
1174
1711
 
1175
1712
  //
1176
1713
  // Not a builtin type, try to look up a constructed type.
1177
- //
1178
- return lookupTypeNoBuiltin(scoped, printError);
1179
- }
1180
-
1181
- //
1182
- // TODO: Hack to keep binary compatibility with Ice 3.6.0, fix properly in Ice 3.7
1183
- //
1184
- namespace
1185
- {
1186
- bool ignoreUndefined = false;
1714
+ //
1715
+ return lookupTypeNoBuiltin(scoped, printError);
1187
1716
  }
1188
1717
 
1189
1718
  TypeList
1190
- Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError)
1719
+ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError, bool ignoreUndefined)
1191
1720
  {
1192
1721
  //
1193
1722
  // Remove whitespace.
@@ -1304,12 +1833,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError)
1304
1833
  ContainedPtr contained = ContainedPtr::dynamicCast(this);
1305
1834
  if(contained)
1306
1835
  {
1307
- if(typeError)
1308
- {
1309
- ignoreUndefined = true;
1310
- }
1311
- results = contained->container()->lookupTypeNoBuiltin(sc, printError);
1312
- ignoreUndefined = false;
1836
+ results = contained->container()->lookupTypeNoBuiltin(sc, printError, typeError || ignoreUndefined);
1313
1837
  }
1314
1838
  else if(!typeError)
1315
1839
  {
@@ -1433,7 +1957,6 @@ Slice::Container::unit() const
1433
1957
  return SyntaxTreeBase::unit();
1434
1958
  }
1435
1959
 
1436
-
1437
1960
  ModuleList
1438
1961
  Slice::Container::modules() const
1439
1962
  {
@@ -1539,6 +2062,86 @@ Slice::Container::enums() const
1539
2062
  return result;
1540
2063
  }
1541
2064
 
2065
+ EnumeratorList
2066
+ Slice::Container::enumerators() const
2067
+ {
2068
+ EnumeratorList result;
2069
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2070
+ {
2071
+ EnumeratorPtr q = EnumeratorPtr::dynamicCast(*p);
2072
+ if(q)
2073
+ {
2074
+ result.push_back(q);
2075
+ }
2076
+ }
2077
+ return result;
2078
+ }
2079
+
2080
+ //
2081
+ // Find enumerators using the old unscoped enumerators lookup
2082
+ //
2083
+ EnumeratorList
2084
+ Slice::Container::enumerators(const string& scoped) const
2085
+ {
2086
+ EnumeratorList result;
2087
+ string::size_type lastColon = scoped.rfind(':');
2088
+
2089
+ if(lastColon == string::npos)
2090
+ {
2091
+ // check all enclosing scopes
2092
+ ContainerPtr container = const_cast<Container*>(this);
2093
+ do
2094
+ {
2095
+ EnumList enums = container->enums();
2096
+ for(EnumList::iterator p = enums.begin(); p != enums.end(); ++p)
2097
+ {
2098
+ ContainedList cl = (*p)->lookupContained(scoped, false);
2099
+ if(!cl.empty())
2100
+ {
2101
+ result.push_back(EnumeratorPtr::dynamicCast(cl.front()));
2102
+ }
2103
+ }
2104
+
2105
+ ContainedPtr contained = ContainedPtr::dynamicCast(container);
2106
+ if(contained)
2107
+ {
2108
+ container = contained->container();
2109
+ }
2110
+ else
2111
+ {
2112
+ container = 0;
2113
+ }
2114
+ }
2115
+ while(result.empty() && container);
2116
+ }
2117
+ else
2118
+ {
2119
+ // Find the referenced scope
2120
+ ContainerPtr container = const_cast<Container*>(this);
2121
+ string scope = scoped.substr(0, scoped.rfind("::"));
2122
+ ContainedList cl = container->lookupContained(scope, false);
2123
+ if(!cl.empty())
2124
+ {
2125
+ container = ContainerPtr::dynamicCast(cl.front());
2126
+ if(container)
2127
+ {
2128
+ EnumList enums = container->enums();
2129
+ string name = scoped.substr(lastColon + 1);
2130
+ for(EnumList::iterator p = enums.begin(); p != enums.end(); ++p)
2131
+ {
2132
+ ContainedList cl2 = (*p)->lookupContained(name, false);
2133
+ if(!cl2.empty())
2134
+ {
2135
+ result.push_back(EnumeratorPtr::dynamicCast(cl2.front()));
2136
+ }
2137
+ }
2138
+ }
2139
+ }
2140
+ }
2141
+
2142
+ return result;
2143
+ }
2144
+
1542
2145
  ConstList
1543
2146
  Slice::Container::consts() const
1544
2147
  {
@@ -1610,7 +2213,7 @@ Slice::Container::hasLocalClassDefsWithAsync() const
1610
2213
  ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
1611
2214
  if(cl && cl->isLocal())
1612
2215
  {
1613
- if(cl->hasMetaData("async"))
2216
+ if(cl->hasMetaData("async-oneway"))
1614
2217
  {
1615
2218
  return true;
1616
2219
  }
@@ -1618,7 +2221,7 @@ Slice::Container::hasLocalClassDefsWithAsync() const
1618
2221
  OperationList ol = cl->operations();
1619
2222
  for(OperationList::const_iterator q = ol.begin(); q != ol.end(); ++q)
1620
2223
  {
1621
- if((*q)->hasMetaData("async"))
2224
+ if((*q)->hasMetaData("async-oneway"))
1622
2225
  {
1623
2226
  return true;
1624
2227
  }
@@ -1677,7 +2280,47 @@ Slice::Container::hasNonLocalExceptions() const
1677
2280
  return false;
1678
2281
  }
1679
2282
 
2283
+ bool
2284
+ Slice::Container::hasStructs() const
2285
+ {
2286
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2287
+ {
2288
+ StructPtr q = StructPtr::dynamicCast(*p);
2289
+ if(q)
2290
+ {
2291
+ return true;
2292
+ }
2293
+
2294
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2295
+ if(container && container->hasStructs())
2296
+ {
2297
+ return true;
2298
+ }
2299
+ }
2300
+
2301
+ return false;
2302
+ }
2303
+
2304
+ bool
2305
+ Slice::Container::hasExceptions() const
2306
+ {
2307
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2308
+ {
2309
+ ExceptionPtr q = ExceptionPtr::dynamicCast(*p);
2310
+ if(q)
2311
+ {
2312
+ return true;
2313
+ }
2314
+
2315
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2316
+ if(container && container->hasExceptions())
2317
+ {
2318
+ return true;
2319
+ }
2320
+ }
1680
2321
 
2322
+ return false;
2323
+ }
1681
2324
 
1682
2325
  bool
1683
2326
  Slice::Container::hasClassDecls() const
@@ -1774,6 +2417,66 @@ Slice::Container::hasClassDefs() const
1774
2417
  return false;
1775
2418
  }
1776
2419
 
2420
+ bool
2421
+ Slice::Container::hasLocalClassDefs() const
2422
+ {
2423
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2424
+ {
2425
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
2426
+ if(cl && cl->isLocal())
2427
+ {
2428
+ return true;
2429
+ }
2430
+
2431
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2432
+ if(container && container->hasLocalClassDefs())
2433
+ {
2434
+ return true;
2435
+ }
2436
+ }
2437
+ return false;
2438
+ }
2439
+
2440
+ bool
2441
+ Slice::Container::hasNonLocalInterfaceDefs() const
2442
+ {
2443
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2444
+ {
2445
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
2446
+ if(cl && !cl->isLocal() && (cl->isInterface() || !cl->allOperations().empty()))
2447
+ {
2448
+ return true;
2449
+ }
2450
+
2451
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2452
+ if(container && container->hasNonLocalInterfaceDefs())
2453
+ {
2454
+ return true;
2455
+ }
2456
+ }
2457
+ return false;
2458
+ }
2459
+
2460
+ bool
2461
+ Slice::Container::hasValueDefs() const
2462
+ {
2463
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2464
+ {
2465
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
2466
+ if(cl && !cl->isLocal() && !cl->isInterface())
2467
+ {
2468
+ return true;
2469
+ }
2470
+
2471
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2472
+ if(container && container->hasValueDefs())
2473
+ {
2474
+ return true;
2475
+ }
2476
+ }
2477
+ return false;
2478
+ }
2479
+
1777
2480
  bool
1778
2481
  Slice::Container::hasOnlyClassDecls() const
1779
2482
  {
@@ -1797,18 +2500,39 @@ Slice::Container::hasOnlyClassDecls() const
1797
2500
  }
1798
2501
 
1799
2502
  bool
1800
- Slice::Container::hasAbstractClassDefs() const
2503
+ Slice::Container::hasOperations() const
2504
+ {
2505
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
2506
+ {
2507
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
2508
+ if(cl && cl->hasOperations())
2509
+ {
2510
+ return true;
2511
+ }
2512
+
2513
+ ContainerPtr container = ContainerPtr::dynamicCast(*p);
2514
+ if(container && container->hasOperations())
2515
+ {
2516
+ return true;
2517
+ }
2518
+ }
2519
+
2520
+ return false;
2521
+ }
2522
+
2523
+ bool
2524
+ Slice::Container::hasNonLocalAbstractClassDefs() const
1801
2525
  {
1802
2526
  for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
1803
2527
  {
1804
2528
  ClassDefPtr cl = ClassDefPtr::dynamicCast(*p);
1805
- if(cl && cl->isAbstract())
2529
+ if(cl && cl->isAbstract() && !cl->isLocal())
1806
2530
  {
1807
2531
  return true;
1808
2532
  }
1809
2533
 
1810
2534
  ContainerPtr container = ContainerPtr::dynamicCast(*p);
1811
- if(container && container->hasAbstractClassDefs())
2535
+ if(container && container->hasNonLocalAbstractClassDefs())
1812
2536
  {
1813
2537
  return true;
1814
2538
  }
@@ -2001,7 +2725,7 @@ Slice::Container::mergeModules()
2001
2725
  metaData2.unique();
2002
2726
  if(!checkGlobalMetaData(metaData1, metaData2))
2003
2727
  {
2004
- unit()->warning("global metadata mismatch for module `" + mod1->name() + "' in files " +
2728
+ unit()->warning(All, "global metadata mismatch for module `" + mod1->name() + "' in files " +
2005
2729
  dc1->filename() + " and " + dc2->filename());
2006
2730
  }
2007
2731
 
@@ -2275,63 +2999,6 @@ Slice::Container::Container(const UnitPtr& unit) :
2275
2999
  {
2276
3000
  }
2277
3001
 
2278
- void
2279
- Slice::Container::checkIdentifier(const string& name) const
2280
- {
2281
- //
2282
- // Weed out identifiers with reserved suffixes.
2283
- //
2284
- static const string suffixBlacklist[] = { "Helper", "Holder", "Prx", "Ptr" };
2285
- for(size_t i = 0; i < sizeof(suffixBlacklist) / sizeof(*suffixBlacklist); ++i)
2286
- {
2287
- if(name.find(suffixBlacklist[i], name.size() - suffixBlacklist[i].size()) != string::npos)
2288
- {
2289
- _unit->error("illegal identifier `" + name + "': `" + suffixBlacklist[i] + "' suffix is reserved");
2290
- }
2291
- }
2292
-
2293
- //
2294
- // Check for illegal underscores.
2295
- //
2296
- if(name.find('_') == 0)
2297
- {
2298
- _unit->error("illegal leading underscore in identifier `" + name + "'");
2299
- }
2300
- else if(name.rfind('_') == name.size() - 1)
2301
- {
2302
- _unit->error("illegal trailing underscore in identifier `" + name + "'");
2303
- }
2304
- else if(name.find("__") != string::npos)
2305
- {
2306
- _unit->error("illegal double underscore in identifier `" + name + "'");
2307
- }
2308
- else if(_unit->currentIncludeLevel() == 0 && !_unit->allowUnderscore() && name.find('_') != string::npos)
2309
- {
2310
- //
2311
- // For rules controlled by a translator option, we don't complain about included files.
2312
- //
2313
- _unit->error("illegal underscore in identifier `" + name + "'");
2314
- }
2315
-
2316
- if(_unit->currentIncludeLevel() == 0 && !_unit->allowIcePrefix())
2317
- {
2318
- //
2319
- // For rules controlled by a translator option, we don't complain about included files.
2320
- //
2321
- if(name.size() >= 3)
2322
- {
2323
- string prefix3;
2324
- prefix3 += ::tolower(static_cast<unsigned char>(name[0]));
2325
- prefix3 += ::tolower(static_cast<unsigned char>(name[1]));
2326
- prefix3 += ::tolower(static_cast<unsigned char>(name[2]));
2327
- if(prefix3 == "ice")
2328
- {
2329
- _unit->error("illegal identifier `" + name + "': `" + name.substr(0, 3) + "' prefix is reserved");
2330
- }
2331
- }
2332
- }
2333
- }
2334
-
2335
3002
  bool
2336
3003
  Slice::Container::checkInterfaceAndLocal(const string& name, bool defined,
2337
3004
  bool intf, bool intfOther,
@@ -2429,7 +3096,7 @@ Slice::Container::checkGlobalMetaData(const StringList& m1, const StringList& m2
2429
3096
  }
2430
3097
 
2431
3098
  bool
2432
- Slice::Container::validateConstant(const string& name, const TypePtr& type, const SyntaxTreeBasePtr& valueType,
3099
+ Slice::Container::validateConstant(const string& name, const TypePtr& type, SyntaxTreeBasePtr& valueType,
2433
3100
  const string& value, bool isConstant)
2434
3101
  {
2435
3102
  //
@@ -2575,6 +3242,7 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons
2575
3242
  case Builtin::KindObject:
2576
3243
  case Builtin::KindObjectProxy:
2577
3244
  case Builtin::KindLocalObject:
3245
+ case Builtin::KindValue:
2578
3246
  {
2579
3247
  assert(false);
2580
3248
  break;
@@ -2657,20 +3325,57 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons
2657
3325
  }
2658
3326
  else
2659
3327
  {
2660
- EnumeratorPtr lte = EnumeratorPtr::dynamicCast(valueType);
2661
-
2662
- if(!lte)
3328
+ if(valueType)
2663
3329
  {
2664
- string msg = "type of initializer is incompatible with the type of " + desc + " `" + name + "'";
2665
- _unit->error(msg);
2666
- return false;
3330
+ EnumeratorPtr lte = EnumeratorPtr::dynamicCast(valueType);
3331
+
3332
+ if(!lte)
3333
+ {
3334
+ string msg = "type of initializer is incompatible with the type of " + desc + " `" + name + "'";
3335
+ _unit->error(msg);
3336
+ return false;
3337
+ }
3338
+ EnumeratorList elist = e->enumerators();
3339
+ if(find(elist.begin(), elist.end(), lte) == elist.end())
3340
+ {
3341
+ string msg = "enumerator `" + value + "' is not defined in enumeration `" + e->scoped() + "'";
3342
+ _unit->error(msg);
3343
+ return false;
3344
+ }
2667
3345
  }
2668
- EnumeratorList elist = e->getEnumerators();
2669
- if(find(elist.begin(), elist.end(), lte) == elist.end())
3346
+ else
2670
3347
  {
2671
- string msg = "enumerator `" + value + "' is not defined in enumeration `" + e->scoped() + "'";
2672
- _unit->error(msg);
2673
- return false;
3348
+ // Check if value designates an enumerator of e
3349
+ string newVal = value;
3350
+ string::size_type lastColon = value.rfind(':');
3351
+ if(lastColon != string::npos && lastColon + 1 < value.length())
3352
+ {
3353
+ newVal = value.substr(0, lastColon + 1) + e->name() + "::" + value.substr(lastColon + 1);
3354
+ }
3355
+
3356
+ ContainedList clist = e->lookupContained(newVal, false);
3357
+ if(clist.empty())
3358
+ {
3359
+ string msg = "`" + value + "' does not designate an enumerator of `" + e->scoped() + "'";
3360
+ _unit->error(msg);
3361
+ return false;
3362
+ }
3363
+ EnumeratorPtr lte = EnumeratorPtr::dynamicCast(clist.front());
3364
+ if(lte)
3365
+ {
3366
+ valueType = lte;
3367
+ if(lastColon != string::npos)
3368
+ {
3369
+ _unit->warning(Deprecated, string("referencing enumerator `") + lte->name() +
3370
+ "' in its enumeration's enclosing scope is deprecated");
3371
+ }
3372
+ }
3373
+ else
3374
+ {
3375
+ string msg = "type of initializer is incompatible with the type of " + desc + " `" + name + "'";
3376
+ _unit->error(msg);
3377
+ return false;
3378
+ }
2674
3379
  }
2675
3380
  }
2676
3381
  }
@@ -2681,8 +3386,6 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons
2681
3386
  EnumeratorPtr
2682
3387
  Slice::Container::validateEnumerator(const string& name)
2683
3388
  {
2684
- checkIdentifier(name);
2685
-
2686
3389
  ContainedList matches = _unit->findContents(thisScope() + name);
2687
3390
  if(!matches.empty())
2688
3391
  {
@@ -2697,20 +3400,17 @@ Slice::Container::validateEnumerator(const string& name)
2697
3400
  }
2698
3401
  if(matches.front()->name() == name)
2699
3402
  {
2700
- string msg = "redefinition of " + matches.front()->kindOf() + " `" + matches.front()->name();
2701
- msg += "' as enumerator";
2702
- _unit->error(msg);
3403
+ _unit->error(string("redefinition of enumerator `") + name + "'");
2703
3404
  }
2704
3405
  else
2705
3406
  {
2706
3407
  string msg = "enumerator `" + name + "' differs only in capitalization from ";
2707
- msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'";
3408
+ msg += "`" + matches.front()->name() + "'";
2708
3409
  _unit->error(msg);
2709
3410
  }
2710
3411
  }
2711
3412
 
2712
- nameIsLegal(name, "enumerator"); // Don't return here -- we create the enumerator anyway.
2713
-
3413
+ nameIsLegal(name, "enumerator"); // Ignore return value.
2714
3414
  return 0;
2715
3415
  }
2716
3416
 
@@ -2884,7 +3584,7 @@ Slice::ClassDecl::recDependencies(set& dependencies)
2884
3584
 
2885
3585
  void
2886
3586
  Slice::ClassDecl::checkBasesAreLegal(const string& name, bool intf, bool local, const ClassList& bases,
2887
- const UnitPtr& unit)
3587
+ const UnitPtr& ut)
2888
3588
  {
2889
3589
  //
2890
3590
  // Local definitions cannot have non-local bases, and vice versa.
@@ -2897,7 +3597,7 @@ Slice::ClassDecl::checkBasesAreLegal(const string& name, bool intf, bool local,
2897
3597
  msg << (local ? "local" : "non-local") << " " << (intf ? "interface" : "class") << " `"
2898
3598
  << name << "' cannot have " << ((*p)->isLocal() ? "local" : "non-local") << " base "
2899
3599
  << ((*p)->isInterface() ? "interface" : "class") << " `" << (*p)->name() << "'";
2900
- unit->error(msg.str());
3600
+ ut->error(msg.str());
2901
3601
  }
2902
3602
  }
2903
3603
 
@@ -2934,7 +3634,7 @@ Slice::ClassDecl::checkBasesAreLegal(const string& name, bool intf, bool local,
2934
3634
  // name (that is, if the union of the intersections of all possible pairs
2935
3635
  // of partitions is empty).
2936
3636
  //
2937
- checkPairIntersections(spl, name, unit);
3637
+ checkPairIntersections(spl, name, ut);
2938
3638
  }
2939
3639
  }
2940
3640
 
@@ -3036,7 +3736,7 @@ Slice::ClassDecl::toStringPartitionList(const GraphPartitionList& gpl)
3036
3736
  // in the other and, if so, complain.
3037
3737
  //
3038
3738
  void
3039
- Slice::ClassDecl::checkPairIntersections(const StringPartitionList& l, const string& name, const UnitPtr& unit)
3739
+ Slice::ClassDecl::checkPairIntersections(const StringPartitionList& l, const string& name, const UnitPtr& ut)
3040
3740
  {
3041
3741
  set<string> reported;
3042
3742
  for(StringPartitionList::const_iterator i = l.begin(); i != l.end(); ++i)
@@ -3053,7 +3753,7 @@ Slice::ClassDecl::checkPairIntersections(const StringPartitionList& l, const str
3053
3753
  {
3054
3754
  string msg = "ambiguous multiple inheritance: `" + name;
3055
3755
  msg += "' inherits operation `" + *s1 + "' from two or more unrelated base interfaces";
3056
- unit->error(msg);
3756
+ ut->error(msg);
3057
3757
  reported.insert(*s1);
3058
3758
  }
3059
3759
  else if(!CICompare()(*s1, *s2) && !CICompare()(*s2, *s1) &&
@@ -3062,7 +3762,7 @@ Slice::ClassDecl::checkPairIntersections(const StringPartitionList& l, const str
3062
3762
  string msg = "ambiguous multiple inheritance: `" + name;
3063
3763
  msg += "' inherits operations `" + *s1 + "' and `" + *s2;
3064
3764
  msg += "', which differ only in capitalization, from unrelated base interfaces";
3065
- unit->error(msg);
3765
+ ut->error(msg);
3066
3766
  reported.insert(*s1);
3067
3767
  reported.insert(*s2);
3068
3768
  }
@@ -3080,7 +3780,7 @@ void
3080
3780
  Slice::ClassDef::destroy()
3081
3781
  {
3082
3782
  _declaration = 0;
3083
- _bases.empty();
3783
+ _bases.clear();
3084
3784
  Container::destroy();
3085
3785
  }
3086
3786
 
@@ -3091,8 +3791,6 @@ Slice::ClassDef::createOperation(const string& name,
3091
3791
  int tag,
3092
3792
  Operation::Mode mode)
3093
3793
  {
3094
- checkIdentifier(name);
3095
-
3096
3794
  ContainedList matches = _unit->findContents(thisScope() + name);
3097
3795
  if(!matches.empty())
3098
3796
  {
@@ -3166,8 +3864,8 @@ Slice::ClassDef::createOperation(const string& name,
3166
3864
  }
3167
3865
 
3168
3866
  string baseName = IceUtilInternal::toLower((*q)->name());
3169
- string newName = IceUtilInternal::toLower(name);
3170
- if(baseName == newName)
3867
+ string newName2 = IceUtilInternal::toLower(name);
3868
+ if(baseName == newName2)
3171
3869
  {
3172
3870
  string msg = "operation `" + name + "' differs only in capitalization from " + (*q)->kindOf();
3173
3871
  msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
@@ -3186,6 +3884,12 @@ Slice::ClassDef::createOperation(const string& name,
3186
3884
  _unit->error(msg);
3187
3885
  }
3188
3886
 
3887
+ if(!isInterface() && !isLocal() && !_hasOperations)
3888
+ {
3889
+ // Only warn for the first operation
3890
+ _unit->warning(Deprecated, "classes with operations are deprecated");
3891
+ }
3892
+
3189
3893
  _hasOperations = true;
3190
3894
  OperationPtr op = new Operation(this, name, returnType, optional, tag, mode);
3191
3895
  _contents.push_back(op);
@@ -3197,30 +3901,6 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool
3197
3901
  const SyntaxTreeBasePtr& defaultValueType, const string& defaultValue,
3198
3902
  const string& defaultLiteral)
3199
3903
  {
3200
- checkIdentifier(name);
3201
-
3202
- if(_unit->profile() == IceE)
3203
- {
3204
- if(!isLocal())
3205
- {
3206
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
3207
- if((builtin && builtin->kind() == Builtin::KindObject))
3208
- {
3209
- string msg = "Class data member `" + name + "' cannot be a value object.";
3210
- _unit->error(msg);
3211
- return 0;
3212
- }
3213
-
3214
- ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type);
3215
- if(classDecl != 0 && !classDecl->isLocal())
3216
- {
3217
- string msg = "Class data member `" + name + "' cannot be a value object.";
3218
- _unit->error(msg);
3219
- return 0;
3220
- }
3221
- }
3222
- }
3223
-
3224
3904
  assert(!isInterface());
3225
3905
  ContainedList matches = _unit->findContents(thisScope() + name);
3226
3906
  if(!matches.empty())
@@ -3280,8 +3960,8 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool
3280
3960
  }
3281
3961
 
3282
3962
  string baseName = IceUtilInternal::toLower((*q)->name());
3283
- string newName = IceUtilInternal::toLower(name);
3284
- if(baseName == newName)
3963
+ string newName2 = IceUtilInternal::toLower(name);
3964
+ if(baseName == newName2)
3285
3965
  {
3286
3966
  string msg = "data member `" + name + "' differs only in capitalization from " + (*q)->kindOf();
3287
3967
  msg += " `" + (*q)->name() + "', which is defined in a base interface or class";
@@ -3303,7 +3983,7 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool
3303
3983
  string dv = defaultValue;
3304
3984
  string dl = defaultLiteral;
3305
3985
 
3306
- if(dlt)
3986
+ if(dlt || (EnumPtr::dynamicCast(type) && !dv.empty()))
3307
3987
  {
3308
3988
  //
3309
3989
  // Validate the default value.
@@ -3336,6 +4016,8 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool
3336
4016
  }
3337
4017
  }
3338
4018
 
4019
+ checkDeprecatedType(_unit, type);
4020
+
3339
4021
  _hasDataMembers = true;
3340
4022
  DataMemberPtr member = new DataMember(this, name, type, optional, tag, dlt, dv, dl);
3341
4023
  _contents.push_back(member);
@@ -3387,14 +4069,26 @@ Slice::ClassDef::operations() const
3387
4069
  OperationList
3388
4070
  Slice::ClassDef::allOperations() const
3389
4071
  {
3390
- OperationList result = operations();
3391
- result.sort();
3392
- result.unique();
4072
+ OperationList result;
3393
4073
  for(ClassList::const_iterator p = _bases.begin(); p != _bases.end(); ++p)
3394
4074
  {
3395
4075
  OperationList li = (*p)->allOperations();
3396
- result.merge(li);
3397
- result.unique();
4076
+ for(OperationList::const_iterator q = li.begin(); q != li.end(); ++q)
4077
+ {
4078
+ if(find(result.begin(), result.end(), *q) == result.end())
4079
+ {
4080
+ result.push_back(*q);
4081
+ }
4082
+ }
4083
+ }
4084
+
4085
+ OperationList li = operations();
4086
+ for(OperationList::const_iterator q = li.begin(); q != li.end(); ++q)
4087
+ {
4088
+ if(find(result.begin(), result.end(), *q) == result.end())
4089
+ {
4090
+ result.push_back(*q);
4091
+ }
3398
4092
  }
3399
4093
  return result;
3400
4094
  }
@@ -3456,7 +4150,9 @@ Slice::ClassDef::classDataMembers() const
3456
4150
  if(q)
3457
4151
  {
3458
4152
  BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type());
3459
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type()))
4153
+ if((builtin && builtin->kind() == Builtin::KindObject) ||
4154
+ (builtin && builtin->kind() == Builtin::KindValue) ||
4155
+ ClassDeclPtr::dynamicCast(q->type()))
3460
4156
  {
3461
4157
  result.push_back(q);
3462
4158
  }
@@ -3603,6 +4299,17 @@ Slice::ClassDef::inheritsMetaData(const string& meta) const
3603
4299
  return false;
3604
4300
  }
3605
4301
 
4302
+ bool
4303
+ Slice::ClassDef::hasBaseDataMembers() const
4304
+ {
4305
+ if(!_bases.empty() && !_bases.front()->isInterface())
4306
+ {
4307
+ return !_bases.front()->allDataMembers().empty();
4308
+ }
4309
+
4310
+ return false;
4311
+ }
4312
+
3606
4313
  Contained::ContainedType
3607
4314
  Slice::ClassDef::containedType() const
3608
4315
  {
@@ -3645,6 +4352,12 @@ Slice::ClassDef::compactId() const
3645
4352
  return _compactId;
3646
4353
  }
3647
4354
 
4355
+ bool
4356
+ Slice::ClassDef::isDelegate() const
4357
+ {
4358
+ return isLocal() && isInterface() && hasMetaData("delegate") && allOperations().size() == 1;
4359
+ }
4360
+
3648
4361
  Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, int id, bool intf, const ClassList& bases,
3649
4362
  bool local) :
3650
4363
  SyntaxTreeBase(container->unit()),
@@ -3657,6 +4370,17 @@ Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, int
3657
4370
  _local(local),
3658
4371
  _compactId(id)
3659
4372
  {
4373
+ if(!local && !intf)
4374
+ {
4375
+ for(ClassList::const_iterator p = _bases.begin(); p != _bases.end(); ++p)
4376
+ {
4377
+ if((*p)->isInterface())
4378
+ {
4379
+ _unit->warning(Deprecated, "classes implementing interfaces are deprecated");
4380
+ break;
4381
+ }
4382
+ }
4383
+ }
3660
4384
  //
3661
4385
  // First element of bases may be a class, all others must be
3662
4386
  // interfaces.
@@ -3681,13 +4405,13 @@ Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, int
3681
4405
  bool
3682
4406
  Slice::Proxy::isLocal() const
3683
4407
  {
3684
- return __class->isLocal();
4408
+ return _classDecl->isLocal();
3685
4409
  }
3686
4410
 
3687
4411
  string
3688
4412
  Slice::Proxy::typeId() const
3689
4413
  {
3690
- return __class->scoped();
4414
+ return _classDecl->scoped();
3691
4415
  }
3692
4416
 
3693
4417
  bool
@@ -3711,13 +4435,13 @@ Slice::Proxy::isVariableLength() const
3711
4435
  ClassDeclPtr
3712
4436
  Slice::Proxy::_class() const
3713
4437
  {
3714
- return __class;
4438
+ return _classDecl;
3715
4439
  }
3716
4440
 
3717
4441
  Slice::Proxy::Proxy(const ClassDeclPtr& cl) :
3718
- SyntaxTreeBase(cl->unit()),
3719
- Type(cl->unit()),
3720
- __class(cl)
4442
+ SyntaxTreeBase(cl->unit(), cl->definitionContext()),
4443
+ Type(cl->unit()),
4444
+ _classDecl(cl)
3721
4445
  {
3722
4446
  }
3723
4447
 
@@ -3737,30 +4461,6 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool
3737
4461
  const SyntaxTreeBasePtr& defaultValueType, const string& defaultValue,
3738
4462
  const string& defaultLiteral)
3739
4463
  {
3740
- checkIdentifier(name);
3741
-
3742
- if(_unit->profile() == IceE)
3743
- {
3744
- if(!isLocal())
3745
- {
3746
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
3747
- if((builtin && builtin->kind() == Builtin::KindObject))
3748
- {
3749
- string msg = "Exception data member `" + name + "' cannot be a value object.";
3750
- _unit->error(msg);
3751
- return 0;
3752
- }
3753
-
3754
- ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type);
3755
- if(classDecl != 0 && !classDecl->isLocal())
3756
- {
3757
- string msg = "Exception data member `" + name + "' cannot be a value object.";
3758
- _unit->error(msg);
3759
- return 0;
3760
- }
3761
- }
3762
- }
3763
-
3764
4464
  ContainedList matches = _unit->findContents(thisScope() + name);
3765
4465
  if(!matches.empty())
3766
4466
  {
@@ -3807,8 +4507,8 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool
3807
4507
  }
3808
4508
 
3809
4509
  string baseName = IceUtilInternal::toLower((*r)->name());
3810
- string newName = IceUtilInternal::toLower(name);
3811
- if(baseName == newName)
4510
+ string newName2 = IceUtilInternal::toLower(name);
4511
+ if(baseName == newName2)
3812
4512
  {
3813
4513
  string msg = "exception member `" + name + "' differs only in capitalization from exception member `";
3814
4514
  msg += (*r)->name() + "', which is defined in a base exception";
@@ -3830,7 +4530,7 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool
3830
4530
  string dv = defaultValue;
3831
4531
  string dl = defaultLiteral;
3832
4532
 
3833
- if(dlt)
4533
+ if(dlt || (EnumPtr::dynamicCast(type) && !dv.empty()))
3834
4534
  {
3835
4535
  //
3836
4536
  // Validate the default value.
@@ -3863,6 +4563,8 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool
3863
4563
  }
3864
4564
  }
3865
4565
 
4566
+ checkDeprecatedType(_unit, type);
4567
+
3866
4568
  DataMemberPtr p = new DataMember(this, name, type, optional, tag, dlt, dv, dl);
3867
4569
  _contents.push_back(p);
3868
4570
  return p;
@@ -3925,7 +4627,9 @@ Slice::Exception::classDataMembers() const
3925
4627
  if(q)
3926
4628
  {
3927
4629
  BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type());
3928
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type()))
4630
+ if((builtin && builtin->kind() == Builtin::KindObject) ||
4631
+ (builtin && builtin->kind() == Builtin::KindValue) ||
4632
+ ClassDeclPtr::dynamicCast(q->type()))
3929
4633
  {
3930
4634
  result.push_back(q);
3931
4635
  }
@@ -4059,6 +4763,12 @@ Slice::Exception::inheritsMetaData(const string& meta) const
4059
4763
  return false;
4060
4764
  }
4061
4765
 
4766
+ bool
4767
+ Slice::Exception::hasBaseDataMembers() const
4768
+ {
4769
+ return _base && !_base->allDataMembers().empty();
4770
+ }
4771
+
4062
4772
  string
4063
4773
  Slice::Exception::kindOf() const
4064
4774
  {
@@ -4093,29 +4803,6 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op
4093
4803
  const SyntaxTreeBasePtr& defaultValueType, const string& defaultValue,
4094
4804
  const string& defaultLiteral)
4095
4805
  {
4096
- checkIdentifier(name);
4097
-
4098
- if(_unit->profile() == IceE)
4099
- {
4100
- if(!isLocal())
4101
- {
4102
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
4103
- if((builtin && builtin->kind() == Builtin::KindObject))
4104
- {
4105
- string msg = "Struct data member `" + name + "' cannot be a value object.";
4106
- _unit->error(msg);
4107
- return 0;
4108
- }
4109
- ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type);
4110
- if(classDecl != 0 && !classDecl->isLocal())
4111
- {
4112
- string msg = "Struct data member `" + name + "' cannot be a value object.";
4113
- _unit->error(msg);
4114
- return 0;
4115
- }
4116
- }
4117
- }
4118
-
4119
4806
  ContainedList matches = _unit->findContents(thisScope() + name);
4120
4807
  if(!matches.empty())
4121
4808
  {
@@ -4167,7 +4854,7 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op
4167
4854
  string dv = defaultValue;
4168
4855
  string dl = defaultLiteral;
4169
4856
 
4170
- if(dlt)
4857
+ if(dlt || (EnumPtr::dynamicCast(type) && !dv.empty()))
4171
4858
  {
4172
4859
  //
4173
4860
  // Validate the default value.
@@ -4200,6 +4887,8 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op
4200
4887
  }
4201
4888
  }
4202
4889
 
4890
+ checkDeprecatedType(_unit, type);
4891
+
4203
4892
  DataMemberPtr p = new DataMember(this, name, type, optional, tag, dlt, dv, dl);
4204
4893
  _contents.push_back(p);
4205
4894
  return p;
@@ -4230,7 +4919,9 @@ Slice::Struct::classDataMembers() const
4230
4919
  if(q)
4231
4920
  {
4232
4921
  BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type());
4233
- if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type()))
4922
+ if((builtin && builtin->kind() == Builtin::KindObject) ||
4923
+ (builtin && builtin->kind() == Builtin::KindValue) ||
4924
+ ClassDeclPtr::dynamicCast(q->type()))
4234
4925
  {
4235
4926
  result.push_back(q);
4236
4927
  }
@@ -4569,6 +5260,7 @@ Slice::Dictionary::legalKeyType(const TypePtr& type, bool& containsSequence)
4569
5260
  case Builtin::KindObject:
4570
5261
  case Builtin::KindObjectProxy:
4571
5262
  case Builtin::KindLocalObject:
5263
+ case Builtin::KindValue:
4572
5264
  {
4573
5265
  return false;
4574
5266
  break;
@@ -4630,71 +5322,9 @@ Slice::Dictionary::Dictionary(const ContainerPtr& container, const string& name,
4630
5322
  void
4631
5323
  Slice::Enum::destroy()
4632
5324
  {
4633
- _enumerators.clear();
4634
5325
  SyntaxTreeBase::destroy();
4635
5326
  }
4636
5327
 
4637
- EnumeratorList
4638
- Slice::Enum::getEnumerators()
4639
- {
4640
- return _enumerators;
4641
- }
4642
-
4643
- void
4644
- Slice::Enum::setEnumerators(const EnumeratorList& ens)
4645
- {
4646
- _enumerators = ens;
4647
- int lastValue = -1;
4648
- set<int> values;
4649
- for(EnumeratorList::iterator p = _enumerators.begin(); p != _enumerators.end(); ++p)
4650
- {
4651
- (*p)->_type = this;
4652
-
4653
- if((*p)->_explicitValue)
4654
- {
4655
- _explicitValue = true;
4656
-
4657
- if((*p)->_value < 0)
4658
- {
4659
- string msg = "value for enumerator `" + (*p)->name() + "' is out of range";
4660
- _unit->error(msg);
4661
- }
4662
- }
4663
- else
4664
- {
4665
- if(lastValue == Int32Max)
4666
- {
4667
- string msg = "value for enumerator `" + (*p)->name() + "' is out of range";
4668
- _unit->error(msg);
4669
- }
4670
-
4671
- //
4672
- // If the enumerator was not assigned an explicit value, we automatically assign
4673
- // it one more than the previous enumerator.
4674
- //
4675
- (*p)->_value = lastValue + 1;
4676
- }
4677
-
4678
- if(values.count((*p)->_value) != 0)
4679
- {
4680
- string msg = "enumerator `" + (*p)->name() + "' has a duplicate value";
4681
- _unit->error(msg);
4682
- }
4683
- values.insert((*p)->_value);
4684
-
4685
- lastValue = (*p)->_value;
4686
-
4687
- if(lastValue > _maxValue)
4688
- {
4689
- _maxValue = lastValue;
4690
- }
4691
- if(lastValue < _minValue)
4692
- {
4693
- _minValue = lastValue;
4694
- }
4695
- }
4696
- }
4697
-
4698
5328
  bool
4699
5329
  Slice::Enum::explicitValue() const
4700
5330
  {
@@ -4763,13 +5393,75 @@ Slice::Enum::recDependencies(set&)
4763
5393
 
4764
5394
  Slice::Enum::Enum(const ContainerPtr& container, const string& name, bool local) :
4765
5395
  SyntaxTreeBase(container->unit()),
5396
+ Container(container->unit()),
4766
5397
  Type(container->unit()),
4767
5398
  Contained(container, name),
4768
5399
  Constructed(container, name, local),
4769
5400
  _explicitValue(false),
4770
5401
  _minValue(Int32Max),
4771
- _maxValue(0)
5402
+ _maxValue(0),
5403
+ _lastValue(-1)
5404
+ {
5405
+ }
5406
+
5407
+ int
5408
+ Slice::Enum::newEnumerator(const EnumeratorPtr& p)
4772
5409
  {
5410
+ if(p->explicitValue())
5411
+ {
5412
+ _explicitValue = true;
5413
+ _lastValue = p->value();
5414
+
5415
+ if(_lastValue < 0)
5416
+ {
5417
+ string msg = "value for enumerator `" + p->name() + "' is out of range";
5418
+ _unit->error(msg);
5419
+ }
5420
+ }
5421
+ else
5422
+ {
5423
+ if(_lastValue == Int32Max)
5424
+ {
5425
+ string msg = "value for enumerator `" + p->name() + "' is out of range";
5426
+ _unit->error(msg);
5427
+ }
5428
+ else
5429
+ {
5430
+ //
5431
+ // If the enumerator was not assigned an explicit value, we automatically assign
5432
+ // it one more than the previous enumerator.
5433
+ //
5434
+ ++_lastValue;
5435
+ }
5436
+ }
5437
+
5438
+ bool checkForDuplicates = true;
5439
+ if(_lastValue > _maxValue)
5440
+ {
5441
+ _maxValue = _lastValue;
5442
+ checkForDuplicates = false;
5443
+ }
5444
+ if(_lastValue < _minValue)
5445
+ {
5446
+ _minValue = _lastValue;
5447
+ checkForDuplicates = false;
5448
+ }
5449
+
5450
+ if(checkForDuplicates)
5451
+ {
5452
+ EnumeratorList enl = enumerators();
5453
+ for(EnumeratorList::iterator q = enl.begin(); q != enl.end(); ++q)
5454
+ {
5455
+ EnumeratorPtr& r = *q;
5456
+ if(r != p && r->value() == _lastValue)
5457
+ {
5458
+ _unit->error(string("enumerator `") + p->name() + "' has the same value as enumerator `" +
5459
+ r->name() + "'");
5460
+ }
5461
+ }
5462
+ }
5463
+
5464
+ return _lastValue;
4773
5465
  }
4774
5466
 
4775
5467
  // ----------------------------------------------------------------------
@@ -4779,7 +5471,7 @@ Slice::Enum::Enum(const ContainerPtr& container, const string& name, bool local)
4779
5471
  EnumPtr
4780
5472
  Slice::Enumerator::type() const
4781
5473
  {
4782
- return _type;
5474
+ return EnumPtr::dynamicCast(container());
4783
5475
  }
4784
5476
 
4785
5477
  Contained::ContainedType
@@ -4818,6 +5510,7 @@ Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name)
4818
5510
  _explicitValue(false),
4819
5511
  _value(-1)
4820
5512
  {
5513
+ _value = EnumPtr::dynamicCast(container)->newEnumerator(this);
4821
5514
  }
4822
5515
 
4823
5516
  Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name, int value) :
@@ -4826,6 +5519,7 @@ Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name,
4826
5519
  _explicitValue(true),
4827
5520
  _value(value)
4828
5521
  {
5522
+ EnumPtr::dynamicCast(container)->newEnumerator(this);
4829
5523
  }
4830
5524
 
4831
5525
  // ----------------------------------------------------------------------
@@ -4898,6 +5592,11 @@ Slice::Const::Const(const ContainerPtr& container, const string& name, const Typ
4898
5592
  _value(value),
4899
5593
  _literal(literal)
4900
5594
  {
5595
+ if(valueType == 0)
5596
+ {
5597
+ cerr << "const " << name << " created with null valueType" << endl;
5598
+ }
5599
+
4901
5600
  }
4902
5601
 
4903
5602
  // ----------------------------------------------------------------------
@@ -4941,34 +5640,32 @@ Slice::Operation::sendMode() const
4941
5640
  }
4942
5641
  }
4943
5642
 
4944
- ParamDeclPtr
4945
- Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool isOutParam, bool optional, int tag)
5643
+ bool
5644
+ Slice::Operation::hasMarshaledResult() const
4946
5645
  {
4947
- checkIdentifier(name);
4948
-
4949
- if(_unit->profile() == IceE)
5646
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(container());
5647
+ assert(cl);
5648
+ if(cl->hasMetaData("marshaled-result") || hasMetaData("marshaled-result"))
4950
5649
  {
4951
- ClassDefPtr cl = ClassDefPtr::dynamicCast(this->container());
4952
- assert(cl);
4953
- if(!cl->isLocal())
5650
+ if(returnType() && isMutableAfterReturnType(returnType()))
4954
5651
  {
4955
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
4956
- if((builtin && builtin->kind() == Builtin::KindObject))
4957
- {
4958
- string msg = "Object `" + name + "' cannot be passed by value.";
4959
- _unit->error(msg);
4960
- return 0;
4961
- }
4962
- ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type);
4963
- if(classDecl != 0 && !classDecl->isLocal())
5652
+ return true;
5653
+ }
5654
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
5655
+ {
5656
+ ParamDeclPtr q = ParamDeclPtr::dynamicCast(*p);
5657
+ if(q->isOutParam() && isMutableAfterReturnType(q->type()))
4964
5658
  {
4965
- string msg = "Object `" + name + "' cannot be passed by value.";
4966
- _unit->error(msg);
4967
- return 0;
5659
+ return true;
4968
5660
  }
4969
5661
  }
4970
5662
  }
5663
+ return false;
5664
+ }
4971
5665
 
5666
+ ParamDeclPtr
5667
+ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool isOutParam, bool optional, int tag)
5668
+ {
4972
5669
  ContainedList matches = _unit->findContents(thisScope() + name);
4973
5670
  if(!matches.empty())
4974
5671
  {
@@ -5023,6 +5720,11 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool
5023
5720
  _unit->error(msg);
5024
5721
  }
5025
5722
 
5723
+ //
5724
+ // Issue a warning for a deprecated parameter type.
5725
+ //
5726
+ checkDeprecatedType(_unit, type);
5727
+
5026
5728
  if(optional)
5027
5729
  {
5028
5730
  //
@@ -5067,6 +5769,74 @@ Slice::Operation::parameters() const
5067
5769
  return result;
5068
5770
  }
5069
5771
 
5772
+ ParamDeclList
5773
+ Slice::Operation::inParameters() const
5774
+ {
5775
+ ParamDeclList result;
5776
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
5777
+ {
5778
+ ParamDeclPtr q = ParamDeclPtr::dynamicCast(*p);
5779
+ if(q && !q->isOutParam())
5780
+ {
5781
+ result.push_back(q);
5782
+ }
5783
+ }
5784
+ return result;
5785
+ }
5786
+
5787
+ void
5788
+ Slice::Operation::inParameters(ParamDeclList& required, ParamDeclList& optional) const
5789
+ {
5790
+ const ParamDeclList params = inParameters();
5791
+ for(ParamDeclList::const_iterator pli = params.begin(); pli != params.end(); ++pli)
5792
+ {
5793
+ if((*pli)->optional())
5794
+ {
5795
+ optional.push_back(*pli);
5796
+ }
5797
+ else
5798
+ {
5799
+ required.push_back(*pli);
5800
+ }
5801
+ }
5802
+
5803
+ sortOptionalParameters(optional);
5804
+ }
5805
+
5806
+ ParamDeclList
5807
+ Slice::Operation::outParameters() const
5808
+ {
5809
+ ParamDeclList result;
5810
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
5811
+ {
5812
+ ParamDeclPtr q = ParamDeclPtr::dynamicCast(*p);
5813
+ if(q && q->isOutParam())
5814
+ {
5815
+ result.push_back(q);
5816
+ }
5817
+ }
5818
+ return result;
5819
+ }
5820
+
5821
+ void
5822
+ Slice::Operation::outParameters(ParamDeclList& required, ParamDeclList& optional) const
5823
+ {
5824
+ const ParamDeclList params = outParameters();
5825
+ for(ParamDeclList::const_iterator pli = params.begin(); pli != params.end(); ++pli)
5826
+ {
5827
+ if((*pli)->optional())
5828
+ {
5829
+ optional.push_back(*pli);
5830
+ }
5831
+ else
5832
+ {
5833
+ required.push_back(*pli);
5834
+ }
5835
+ }
5836
+
5837
+ sortOptionalParameters(optional);
5838
+ }
5839
+
5070
5840
  ExceptionList
5071
5841
  Slice::Operation::throws() const
5072
5842
  {
@@ -5218,13 +5988,26 @@ Slice::Operation::returnsData() const
5218
5988
  return false;
5219
5989
  }
5220
5990
 
5991
+ bool
5992
+ Slice::Operation::returnsMultipleValues() const
5993
+ {
5994
+ size_t count = outParameters().size();
5995
+
5996
+ if(returnType())
5997
+ {
5998
+ ++count;
5999
+ }
6000
+
6001
+ return count > 1;
6002
+ }
6003
+
5221
6004
  bool
5222
6005
  Slice::Operation::sendsOptionals() const
5223
6006
  {
5224
- ParamDeclList pdl = parameters();
6007
+ ParamDeclList pdl = inParameters();
5225
6008
  for(ParamDeclList::const_iterator i = pdl.begin(); i != pdl.end(); ++i)
5226
6009
  {
5227
- if(!(*i)->isOutParam() && (*i)->optional())
6010
+ if((*i)->optional())
5228
6011
  {
5229
6012
  return true;
5230
6013
  }
@@ -5263,7 +6046,7 @@ Slice::Operation::attributes() const
5263
6046
  }
5264
6047
  if(i == 2)
5265
6048
  {
5266
- emitWarning(definitionContext()->filename(), line(), "invalid freeze metadata for operation");
6049
+ _unit->warning(InvalidMetaData, "invalid freeze metadata for operation");
5267
6050
  }
5268
6051
  else
5269
6052
  {
@@ -5277,14 +6060,14 @@ Slice::Operation::attributes() const
5277
6060
  //
5278
6061
  freezeMD = freezeMD.substr(1);
5279
6062
 
5280
- int i = 0;
6063
+ i = 0;
5281
6064
  while(i < 4)
5282
6065
  {
5283
6066
  if(freezeMD.find(txAttribute[i]) == 0)
5284
6067
  {
5285
6068
  if(result != 0 && (i == int(Supports) || i == int(Never)))
5286
6069
  {
5287
- emitWarning(definitionContext()->filename(), line(), "invalid freeze metadata for operation");
6070
+ _unit->warning(InvalidMetaData, "invalid freeze metadata for operation");
5288
6071
  }
5289
6072
  else
5290
6073
  {
@@ -5298,7 +6081,7 @@ Slice::Operation::attributes() const
5298
6081
 
5299
6082
  if(i == 4)
5300
6083
  {
5301
- emitWarning(definitionContext()->filename(), line(), "invalid freeze metadata for operation");
6084
+ _unit->warning(InvalidMetaData, "invalid freeze metadata for operation");
5302
6085
 
5303
6086
  //
5304
6087
  // Set default
@@ -5356,25 +6139,9 @@ Slice::Operation::Operation(const ContainerPtr& container,
5356
6139
  _returnTag(returnTag),
5357
6140
  _mode(mode)
5358
6141
  {
5359
- if(_unit->profile() == IceE)
6142
+ if(returnType)
5360
6143
  {
5361
- ClassDefPtr cl = ClassDefPtr::dynamicCast(this->container());
5362
- assert(cl);
5363
- if(!cl->isLocal())
5364
- {
5365
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(returnType);
5366
- if((builtin && builtin->kind() == Builtin::KindObject))
5367
- {
5368
- string msg = "Method `" + name + "' cannot return an object by value.";
5369
- _unit->error(msg);
5370
- }
5371
- ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(returnType);
5372
- if(classDecl != 0 && !classDecl->isLocal())
5373
- {
5374
- string msg = "Method `" + name + "' cannot return an object by value.";
5375
- _unit->error(msg);
5376
- }
5377
- }
6144
+ checkDeprecatedType(_unit, returnType);
5378
6145
  }
5379
6146
  }
5380
6147
 
@@ -5800,13 +6567,6 @@ Slice::Unit::setSeenDefinition()
5800
6567
  dc->setSeenDefinition();
5801
6568
  }
5802
6569
 
5803
- void
5804
- Slice::Unit::error(const char* s)
5805
- {
5806
- emitError(currentFile(), _currentLine, s);
5807
- _errors++;
5808
- }
5809
-
5810
6570
  void
5811
6571
  Slice::Unit::error(const string& s)
5812
6572
  {
@@ -5815,15 +6575,16 @@ Slice::Unit::error(const string& s)
5815
6575
  }
5816
6576
 
5817
6577
  void
5818
- Slice::Unit::warning(const char* s) const
5819
- {
5820
- emitWarning(currentFile(), _currentLine, s);
5821
- }
5822
-
5823
- void
5824
- Slice::Unit::warning(const string& s) const
6578
+ Slice::Unit::warning(WarningCategory category, const string& msg) const
5825
6579
  {
5826
- emitWarning(currentFile(), _currentLine, s);
6580
+ if(_definitionContextStack.empty())
6581
+ {
6582
+ emitWarning(currentFile(), _currentLine, msg);
6583
+ }
6584
+ else
6585
+ {
6586
+ _definitionContextStack.top()->warning(category, currentFile(), _currentLine, msg);
6587
+ }
5827
6588
  }
5828
6589
 
5829
6590
  ContainerPtr
@@ -5997,7 +6758,7 @@ Slice::Unit::addTypeId(int compactId, const std::string& typeId)
5997
6758
  }
5998
6759
 
5999
6760
  std::string
6000
- Slice::Unit::getTypeId(int compactId)
6761
+ Slice::Unit::getTypeId(int compactId) const
6001
6762
  {
6002
6763
  map<int, string>::const_iterator p = _typeIds.find(compactId);
6003
6764
  if(p != _typeIds.end())
@@ -6007,6 +6768,12 @@ Slice::Unit::getTypeId(int compactId)
6007
6768
  return string();
6008
6769
  }
6009
6770
 
6771
+ bool
6772
+ Slice::Unit::hasCompactTypeId() const
6773
+ {
6774
+ return _typeIds.size() > 0;
6775
+ }
6776
+
6010
6777
  bool
6011
6778
  Slice::Unit::usesNonLocals() const
6012
6779
  {
@@ -6038,6 +6805,11 @@ Slice::Unit::usesNonLocals() const
6038
6805
  return true;
6039
6806
  }
6040
6807
 
6808
+ if(_builtins.find(Builtin::KindValue) != _builtins.end())
6809
+ {
6810
+ return true;
6811
+ }
6812
+
6041
6813
  return false;
6042
6814
  }
6043
6815
 
@@ -6059,12 +6831,6 @@ Slice::Unit::usesConsts() const
6059
6831
  return false;
6060
6832
  }
6061
6833
 
6062
- FeatureProfile
6063
- Slice::Unit::profile() const
6064
- {
6065
- return _featureProfile;
6066
- }
6067
-
6068
6834
  StringList
6069
6835
  Slice::Unit::includeFiles() const
6070
6836
  {
@@ -6084,7 +6850,7 @@ Slice::Unit::allFiles() const
6084
6850
  }
6085
6851
 
6086
6852
  int
6087
- Slice::Unit::parse(const string& filename, FILE* file, bool debug, Slice::FeatureProfile profile)
6853
+ Slice::Unit::parse(const string& filename, FILE* file, bool debug)
6088
6854
  {
6089
6855
  slice_debug = debug ? 1 : 0;
6090
6856
 
@@ -6094,7 +6860,6 @@ Slice::Unit::parse(const string& filename, FILE* file, bool debug, Slice::Featur
6094
6860
  _currentComment = "";
6095
6861
  _currentLine = 1;
6096
6862
  _currentIncludeLevel = 0;
6097
- _featureProfile = profile;
6098
6863
  _topLevelFile = fullPath(filename);
6099
6864
  pushContainer(this);
6100
6865
  pushDefinitionContext();
@@ -6270,7 +7035,6 @@ Slice::cICompare(const std::string& s1, const std::string& s2)
6270
7035
  }
6271
7036
  #endif
6272
7037
 
6273
-
6274
7038
  // ----------------------------------------------------------------------
6275
7039
  // DerivedToBaseCompare
6276
7040
  // ----------------------------------------------------------------------