zeroc-ice 3.7.10 → 3.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (936) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Connection.cpp +536 -0
  3. data/dist/IceRuby/Endpoint.cpp +344 -0
  4. data/dist/IceRuby/ImplicitContext.cpp +148 -0
  5. data/dist/IceRuby/Logger.cpp +151 -0
  6. data/dist/IceRuby/Operation.cpp +665 -0
  7. data/dist/IceRuby/Properties.cpp +369 -0
  8. data/dist/IceRuby/Types.cpp +3336 -0
  9. data/dist/IceRuby/Types.h +604 -0
  10. data/dist/IceRuby/ValueFactoryManager.cpp +445 -0
  11. data/dist/ice/cpp/include/Ice/ExceptionHelpers.h +74 -0
  12. data/dist/ice/cpp/include/Ice/Initialize.h +957 -0
  13. data/dist/ice/cpp/include/Ice/MetricsObserverI.h +669 -0
  14. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +868 -0
  15. data/dist/ice/cpp/include/Ice/Proxy.h +5171 -0
  16. data/dist/ice/cpp/include/Ice/UserExceptionFactory.h +90 -0
  17. data/dist/ice/cpp/include/IceDiscovery/IceDiscovery.h +1889 -0
  18. data/dist/ice/cpp/include/IceLocatorDiscovery/IceLocatorDiscovery.h +1197 -0
  19. data/dist/ice/cpp/include/IceUtil/Cond.h +317 -0
  20. data/dist/ice/cpp/include/IceUtil/Config.h +392 -0
  21. data/dist/ice/cpp/include/IceUtil/CtrlCHandler.h +96 -0
  22. data/dist/ice/cpp/include/IceUtil/InputUtil.h +42 -0
  23. data/dist/ice/cpp/include/IceUtil/ResourceConfig.h +37 -0
  24. data/dist/ice/cpp/include/IceUtil/Timer.h +153 -0
  25. data/dist/ice/cpp/include/generated/Glacier2/Metrics.h +475 -0
  26. data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifier.h +1430 -0
  27. data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifierF.h +147 -0
  28. data/dist/ice/cpp/include/generated/Glacier2/Router.h +3260 -0
  29. data/dist/ice/cpp/include/generated/Glacier2/RouterF.h +125 -0
  30. data/dist/ice/cpp/include/generated/Glacier2/SSLInfo.h +223 -0
  31. data/dist/ice/cpp/include/generated/Glacier2/Session.h +5894 -0
  32. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +170 -0
  33. data/dist/ice/cpp/include/generated/Ice/Communicator.h +1162 -0
  34. data/dist/ice/cpp/include/generated/Ice/CommunicatorF.h +101 -0
  35. data/dist/ice/cpp/include/generated/Ice/Connection.h +1703 -0
  36. data/dist/ice/cpp/include/generated/Ice/ConnectionF.h +119 -0
  37. data/dist/ice/cpp/include/generated/Ice/Current.h +322 -0
  38. data/dist/ice/cpp/include/generated/Ice/Endpoint.h +979 -0
  39. data/dist/ice/cpp/include/generated/Ice/EndpointF.h +166 -0
  40. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +118 -0
  41. data/dist/ice/cpp/include/generated/Ice/FacetMap.h +80 -0
  42. data/dist/ice/cpp/include/generated/Ice/Identity.h +264 -0
  43. data/dist/ice/cpp/include/generated/Ice/ImplicitContext.h +284 -0
  44. data/dist/ice/cpp/include/generated/Ice/ImplicitContextF.h +101 -0
  45. data/dist/ice/cpp/include/generated/Ice/Instrumentation.h +1203 -0
  46. data/dist/ice/cpp/include/generated/Ice/InstrumentationF.h +128 -0
  47. data/dist/ice/cpp/include/generated/Ice/LocalException.h +7437 -0
  48. data/dist/ice/cpp/include/generated/Ice/Locator.h +3898 -0
  49. data/dist/ice/cpp/include/generated/Ice/LocatorF.h +147 -0
  50. data/dist/ice/cpp/include/generated/Ice/Logger.h +237 -0
  51. data/dist/ice/cpp/include/generated/Ice/LoggerF.h +101 -0
  52. data/dist/ice/cpp/include/generated/Ice/Metrics.h +4769 -0
  53. data/dist/ice/cpp/include/generated/Ice/ObjectAdapter.h +1181 -0
  54. data/dist/ice/cpp/include/generated/Ice/ObjectAdapterF.h +101 -0
  55. data/dist/ice/cpp/include/generated/Ice/ObjectFactory.h +203 -0
  56. data/dist/ice/cpp/include/generated/Ice/Plugin.h +318 -0
  57. data/dist/ice/cpp/include/generated/Ice/PluginF.h +110 -0
  58. data/dist/ice/cpp/include/generated/Ice/Process.h +977 -0
  59. data/dist/ice/cpp/include/generated/Ice/ProcessF.h +125 -0
  60. data/dist/ice/cpp/include/generated/Ice/Properties.h +452 -0
  61. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +1366 -0
  62. data/dist/ice/cpp/include/generated/Ice/PropertiesF.h +134 -0
  63. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +2707 -0
  64. data/dist/ice/cpp/include/generated/Ice/Router.h +1850 -0
  65. data/dist/ice/cpp/include/generated/Ice/RouterF.h +125 -0
  66. data/dist/ice/cpp/include/generated/Ice/ServantLocator.h +305 -0
  67. data/dist/ice/cpp/include/generated/Ice/ServantLocatorF.h +101 -0
  68. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +84 -0
  69. data/dist/ice/cpp/include/generated/Ice/ValueFactory.h +330 -0
  70. data/dist/ice/cpp/include/generated/Ice/Version.h +357 -0
  71. data/dist/ice/cpp/include/generated/IceBox/IceBox.h +3269 -0
  72. data/dist/ice/cpp/include/generated/IceGrid/Admin.h +33773 -0
  73. data/dist/ice/cpp/include/generated/IceGrid/Descriptor.h +5254 -0
  74. data/dist/ice/cpp/include/generated/IceGrid/Exception.h +2834 -0
  75. data/dist/ice/cpp/include/generated/IceGrid/FileParser.h +824 -0
  76. data/dist/ice/cpp/include/generated/IceGrid/PluginFacade.h +635 -0
  77. data/dist/ice/cpp/include/generated/IceGrid/Registry.h +5089 -0
  78. data/dist/ice/cpp/include/generated/IceGrid/Session.h +2240 -0
  79. data/dist/ice/cpp/include/generated/IceGrid/UserAccountMapper.h +800 -0
  80. data/dist/ice/cpp/include/generated/IcePatch2/FileInfo.h +325 -0
  81. data/dist/ice/cpp/include/generated/IcePatch2/FileServer.h +2891 -0
  82. data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +228 -0
  83. data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +101 -0
  84. data/dist/ice/cpp/include/generated/IceSSL/EndpointInfo.h +186 -0
  85. data/dist/ice/cpp/include/generated/IceStorm/IceStorm.h +6627 -0
  86. data/dist/ice/cpp/include/generated/IceStorm/Metrics.h +665 -0
  87. data/dist/ice/cpp/src/Ice/Application.cpp +661 -0
  88. data/dist/ice/cpp/src/Ice/CountDownLatch.cpp +171 -0
  89. data/dist/ice/cpp/src/Ice/DLLMain.cpp +50 -0
  90. data/dist/ice/cpp/src/Ice/EndpointFactory.cpp +189 -0
  91. data/dist/ice/cpp/src/Ice/EndpointI.cpp +98 -0
  92. data/dist/ice/cpp/src/Ice/InputStream.cpp +2741 -0
  93. data/dist/ice/cpp/src/Ice/MetricsAdminI.cpp +694 -0
  94. data/dist/ice/cpp/src/Ice/Network.cpp +2249 -0
  95. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +1530 -0
  96. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1322 -0
  97. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +503 -0
  98. data/dist/ice/cpp/src/Ice/PropertyNames.cpp +1428 -0
  99. data/dist/ice/cpp/src/Ice/PropertyNames.h +78 -0
  100. data/dist/ice/cpp/src/Ice/Proxy.cpp +1604 -0
  101. data/dist/ice/cpp/src/Ice/Selector.cpp +1535 -0
  102. data/dist/ice/cpp/src/Ice/Service.cpp +1883 -0
  103. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +1292 -0
  104. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +49 -0
  105. data/dist/ice/cpp/src/Ice/generated/Communicator.cpp +79 -0
  106. data/dist/ice/cpp/src/Ice/generated/CommunicatorF.cpp +61 -0
  107. data/dist/ice/cpp/src/Ice/generated/Connection.cpp +155 -0
  108. data/dist/ice/cpp/src/Ice/generated/ConnectionF.cpp +61 -0
  109. data/dist/ice/cpp/src/Ice/generated/Current.cpp +62 -0
  110. data/dist/ice/cpp/src/Ice/generated/Endpoint.cpp +147 -0
  111. data/dist/ice/cpp/src/Ice/generated/EndpointF.cpp +61 -0
  112. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +51 -0
  113. data/dist/ice/cpp/src/Ice/generated/FacetMap.cpp +49 -0
  114. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +57 -0
  115. data/dist/ice/cpp/src/Ice/generated/ImplicitContext.cpp +75 -0
  116. data/dist/ice/cpp/src/Ice/generated/ImplicitContextF.cpp +61 -0
  117. data/dist/ice/cpp/src/Ice/generated/Instrumentation.cpp +188 -0
  118. data/dist/ice/cpp/src/Ice/generated/InstrumentationF.cpp +66 -0
  119. data/dist/ice/cpp/src/Ice/generated/LocalException.cpp +3262 -0
  120. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2042 -0
  121. data/dist/ice/cpp/src/Ice/generated/LocatorF.cpp +63 -0
  122. data/dist/ice/cpp/src/Ice/generated/Logger.cpp +73 -0
  123. data/dist/ice/cpp/src/Ice/generated/LoggerF.cpp +61 -0
  124. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2352 -0
  125. data/dist/ice/cpp/src/Ice/generated/ObjectAdapter.cpp +79 -0
  126. data/dist/ice/cpp/src/Ice/generated/ObjectAdapterF.cpp +61 -0
  127. data/dist/ice/cpp/src/Ice/generated/ObjectFactory.cpp +75 -0
  128. data/dist/ice/cpp/src/Ice/generated/Plugin.cpp +87 -0
  129. data/dist/ice/cpp/src/Ice/generated/PluginF.cpp +61 -0
  130. data/dist/ice/cpp/src/Ice/generated/Process.cpp +471 -0
  131. data/dist/ice/cpp/src/Ice/generated/ProcessF.cpp +63 -0
  132. data/dist/ice/cpp/src/Ice/generated/Properties.cpp +78 -0
  133. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +603 -0
  134. data/dist/ice/cpp/src/Ice/generated/PropertiesF.cpp +63 -0
  135. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +1171 -0
  136. data/dist/ice/cpp/src/Ice/generated/Router.cpp +977 -0
  137. data/dist/ice/cpp/src/Ice/generated/RouterF.cpp +63 -0
  138. data/dist/ice/cpp/src/Ice/generated/ServantLocator.cpp +75 -0
  139. data/dist/ice/cpp/src/Ice/generated/ServantLocatorF.cpp +61 -0
  140. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +49 -0
  141. data/dist/ice/cpp/src/Ice/generated/ValueFactory.cpp +83 -0
  142. data/dist/ice/cpp/src/Ice/generated/Version.cpp +57 -0
  143. data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.cpp +154 -0
  144. data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.h +49 -0
  145. data/dist/ice/cpp/src/Ice/ios/StreamConnector.cpp +146 -0
  146. data/dist/ice/cpp/src/Ice/ios/StreamConnector.h +52 -0
  147. data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.cpp +477 -0
  148. data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.h +156 -0
  149. data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.cpp +570 -0
  150. data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.h +93 -0
  151. data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery/IceDiscovery.h +1889 -0
  152. data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery.cpp +915 -0
  153. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery/IceLocatorDiscovery.h +1197 -0
  154. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery.cpp +730 -0
  155. data/dist/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +1092 -0
  156. data/dist/ice/cpp/src/IceSSL/PluginI.cpp +246 -0
  157. data/dist/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +719 -0
  158. data/dist/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +868 -0
  159. data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfo.cpp +75 -0
  160. data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfoF.cpp +61 -0
  161. data/dist/ice/cpp/src/IceSSL/generated/EndpointInfo.cpp +75 -0
  162. data/dist/ice/cpp/src/IceUtil/StringConverter.cpp +690 -0
  163. data/dist/ice/cpp/src/Slice/JavaUtil.cpp +5183 -0
  164. data/dist/ice/cpp/src/slice2rb/Main.cpp +35 -0
  165. data/dist/ice/mcpp/directive.c +1407 -0
  166. data/dist/ice/mcpp/internal.H +530 -0
  167. data/dist/ice/mcpp/mcpp_main.c +792 -0
  168. data/dist/ice/mcpp/support.c +1985 -0
  169. data/dist/ice/mcpp/system.c +2741 -0
  170. data/dist/ice/slice/Ice/Connection.ice +516 -0
  171. data/dist/ice/slice/Ice/Locator.ice +239 -0
  172. data/dist/ice/slice/Ice/Metrics.ice +436 -0
  173. data/dist/ice/slice/Ice/ObjectAdapter.ice +710 -0
  174. data/dist/ice/slice/Ice/Router.ice +103 -0
  175. data/dist/ice/slice/IceGrid/PluginFacade.ice +329 -0
  176. data/dist/ice/slice/IceStorm/IceStorm.ice +414 -0
  177. data/dist/lib/Glacier2/Metrics.rb +56 -0
  178. data/dist/lib/Glacier2/PermissionsVerifier.rb +93 -0
  179. data/dist/lib/Glacier2/PermissionsVerifierF.rb +30 -0
  180. data/dist/lib/Glacier2/Router.rb +95 -0
  181. data/dist/lib/Glacier2/RouterF.rb +25 -0
  182. data/dist/lib/Glacier2/SSLInfo.rb +72 -0
  183. data/dist/lib/Glacier2/Session.rb +247 -0
  184. data/dist/lib/Ice/BuiltinSequences.rb +60 -0
  185. data/dist/lib/Ice/Communicator.rb +87 -0
  186. data/dist/lib/Ice/CommunicatorF.rb +24 -0
  187. data/dist/lib/Ice/Connection.rb +413 -0
  188. data/dist/lib/Ice/ConnectionF.rb +32 -0
  189. data/dist/lib/Ice/Current.rb +141 -0
  190. data/dist/lib/Ice/Endpoint.rb +187 -0
  191. data/dist/lib/Ice/EndpointF.rb +48 -0
  192. data/dist/lib/Ice/EndpointTypes.rb +69 -0
  193. data/dist/lib/Ice/FacetMap.rb +24 -0
  194. data/dist/lib/Ice/Identity.rb +63 -0
  195. data/dist/lib/Ice/ImplicitContext.rb +26 -0
  196. data/dist/lib/Ice/ImplicitContextF.rb +24 -0
  197. data/dist/lib/Ice/Instrumentation.rb +169 -0
  198. data/dist/lib/Ice/InstrumentationF.rb +31 -0
  199. data/dist/lib/Ice/LocalException.rb +1031 -0
  200. data/dist/lib/Ice/Locator.rb +196 -0
  201. data/dist/lib/Ice/LocatorF.rb +30 -0
  202. data/dist/lib/Ice/Logger.rb +24 -0
  203. data/dist/lib/Ice/LoggerF.rb +24 -0
  204. data/dist/lib/Ice/Metrics.rb +337 -0
  205. data/dist/lib/Ice/ObjectAdapter.rb +29 -0
  206. data/dist/lib/Ice/ObjectAdapterF.rb +24 -0
  207. data/dist/lib/Ice/ObjectFactory.rb +24 -0
  208. data/dist/lib/Ice/Plugin.rb +30 -0
  209. data/dist/lib/Ice/PluginF.rb +28 -0
  210. data/dist/lib/Ice/Process.rb +53 -0
  211. data/dist/lib/Ice/ProcessF.rb +25 -0
  212. data/dist/lib/Ice/Properties.rb +25 -0
  213. data/dist/lib/Ice/PropertiesAdmin.rb +63 -0
  214. data/dist/lib/Ice/PropertiesF.rb +29 -0
  215. data/dist/lib/Ice/RemoteLogger.rb +207 -0
  216. data/dist/lib/Ice/Router.rb +87 -0
  217. data/dist/lib/Ice/RouterF.rb +25 -0
  218. data/dist/lib/Ice/ServantLocator.rb +26 -0
  219. data/dist/lib/Ice/ServantLocatorF.rb +24 -0
  220. data/dist/lib/Ice/SliceChecksumDict.rb +24 -0
  221. data/dist/lib/Ice/ValueFactory.rb +28 -0
  222. data/dist/lib/Ice/Version.rb +90 -0
  223. data/dist/lib/IceBox/IceBox.rb +164 -0
  224. data/dist/lib/IceGrid/Admin.rb +1196 -0
  225. data/dist/lib/IceGrid/Descriptor.rb +1034 -0
  226. data/dist/lib/IceGrid/Exception.rb +376 -0
  227. data/dist/lib/IceGrid/FileParser.rb +65 -0
  228. data/dist/lib/IceGrid/PluginFacade.rb +35 -0
  229. data/dist/lib/IceGrid/Registry.rb +209 -0
  230. data/dist/lib/IceGrid/Session.rb +71 -0
  231. data/dist/lib/IceGrid/UserAccountMapper.rb +61 -0
  232. data/dist/lib/IcePatch2/FileInfo.rb +115 -0
  233. data/dist/lib/IcePatch2/FileServer.rb +123 -0
  234. data/dist/lib/IceStorm/IceStorm.rb +332 -0
  235. data/dist/lib/IceStorm/Metrics.rb +73 -0
  236. data/extconf.rb +91 -0
  237. data/ice.gemspec +21 -16
  238. metadata +715 -711
  239. data/ICE_LICENSE +0 -48
  240. data/LICENSE +0 -340
  241. data/MCPP_LICENSE +0 -29
  242. data/ext/Connection.cpp +0 -532
  243. data/ext/Endpoint.cpp +0 -340
  244. data/ext/ImplicitContext.cpp +0 -144
  245. data/ext/Logger.cpp +0 -147
  246. data/ext/Operation.cpp +0 -661
  247. data/ext/Properties.cpp +0 -365
  248. data/ext/Types.cpp +0 -3325
  249. data/ext/Types.h +0 -595
  250. data/ext/ValueFactoryManager.cpp +0 -441
  251. data/ext/extconf.rb +0 -97
  252. data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +0 -74
  253. data/ext/ice/cpp/include/Ice/Initialize.h +0 -957
  254. data/ext/ice/cpp/include/Ice/MetricsObserverI.h +0 -669
  255. data/ext/ice/cpp/include/Ice/OutgoingAsync.h +0 -856
  256. data/ext/ice/cpp/include/Ice/Proxy.h +0 -5154
  257. data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +0 -88
  258. data/ext/ice/cpp/include/IceSSL/UWP.h +0 -62
  259. data/ext/ice/cpp/include/IceUtil/Cond.h +0 -317
  260. data/ext/ice/cpp/include/IceUtil/Config.h +0 -392
  261. data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +0 -92
  262. data/ext/ice/cpp/include/IceUtil/InputUtil.h +0 -42
  263. data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +0 -37
  264. data/ext/ice/cpp/include/IceUtil/Timer.h +0 -144
  265. data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +0 -170
  266. data/ext/ice/cpp/include/generated/Ice/Communicator.h +0 -1162
  267. data/ext/ice/cpp/include/generated/Ice/CommunicatorF.h +0 -101
  268. data/ext/ice/cpp/include/generated/Ice/Connection.h +0 -1703
  269. data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +0 -119
  270. data/ext/ice/cpp/include/generated/Ice/Current.h +0 -322
  271. data/ext/ice/cpp/include/generated/Ice/Endpoint.h +0 -979
  272. data/ext/ice/cpp/include/generated/Ice/EndpointF.h +0 -166
  273. data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +0 -118
  274. data/ext/ice/cpp/include/generated/Ice/FacetMap.h +0 -80
  275. data/ext/ice/cpp/include/generated/Ice/Identity.h +0 -264
  276. data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +0 -284
  277. data/ext/ice/cpp/include/generated/Ice/ImplicitContextF.h +0 -101
  278. data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +0 -1203
  279. data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +0 -128
  280. data/ext/ice/cpp/include/generated/Ice/LocalException.h +0 -7437
  281. data/ext/ice/cpp/include/generated/Ice/Locator.h +0 -3898
  282. data/ext/ice/cpp/include/generated/Ice/LocatorF.h +0 -147
  283. data/ext/ice/cpp/include/generated/Ice/Logger.h +0 -237
  284. data/ext/ice/cpp/include/generated/Ice/LoggerF.h +0 -101
  285. data/ext/ice/cpp/include/generated/Ice/Metrics.h +0 -4769
  286. data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +0 -1181
  287. data/ext/ice/cpp/include/generated/Ice/ObjectAdapterF.h +0 -101
  288. data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +0 -203
  289. data/ext/ice/cpp/include/generated/Ice/Plugin.h +0 -318
  290. data/ext/ice/cpp/include/generated/Ice/PluginF.h +0 -110
  291. data/ext/ice/cpp/include/generated/Ice/Process.h +0 -977
  292. data/ext/ice/cpp/include/generated/Ice/ProcessF.h +0 -125
  293. data/ext/ice/cpp/include/generated/Ice/Properties.h +0 -452
  294. data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +0 -1366
  295. data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +0 -134
  296. data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +0 -2707
  297. data/ext/ice/cpp/include/generated/Ice/Router.h +0 -1850
  298. data/ext/ice/cpp/include/generated/Ice/RouterF.h +0 -125
  299. data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +0 -305
  300. data/ext/ice/cpp/include/generated/Ice/ServantLocatorF.h +0 -101
  301. data/ext/ice/cpp/include/generated/Ice/SliceChecksumDict.h +0 -84
  302. data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +0 -330
  303. data/ext/ice/cpp/include/generated/Ice/Version.h +0 -357
  304. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +0 -228
  305. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +0 -101
  306. data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +0 -186
  307. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +0 -49
  308. data/ext/ice/cpp/src/Ice/Communicator.cpp +0 -79
  309. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +0 -61
  310. data/ext/ice/cpp/src/Ice/Connection.cpp +0 -155
  311. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +0 -61
  312. data/ext/ice/cpp/src/Ice/CountDownLatch.cpp +0 -171
  313. data/ext/ice/cpp/src/Ice/Current.cpp +0 -62
  314. data/ext/ice/cpp/src/Ice/Endpoint.cpp +0 -147
  315. data/ext/ice/cpp/src/Ice/EndpointF.cpp +0 -61
  316. data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +0 -189
  317. data/ext/ice/cpp/src/Ice/EndpointI.cpp +0 -98
  318. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +0 -51
  319. data/ext/ice/cpp/src/Ice/FacetMap.cpp +0 -49
  320. data/ext/ice/cpp/src/Ice/Identity.cpp +0 -57
  321. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +0 -75
  322. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +0 -61
  323. data/ext/ice/cpp/src/Ice/InputStream.cpp +0 -2741
  324. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +0 -188
  325. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +0 -66
  326. data/ext/ice/cpp/src/Ice/LocalException.cpp +0 -3262
  327. data/ext/ice/cpp/src/Ice/Locator.cpp +0 -2042
  328. data/ext/ice/cpp/src/Ice/LocatorF.cpp +0 -63
  329. data/ext/ice/cpp/src/Ice/Logger.cpp +0 -73
  330. data/ext/ice/cpp/src/Ice/LoggerF.cpp +0 -61
  331. data/ext/ice/cpp/src/Ice/Metrics.cpp +0 -2352
  332. data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +0 -694
  333. data/ext/ice/cpp/src/Ice/Network.cpp +0 -2249
  334. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +0 -79
  335. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +0 -61
  336. data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +0 -1530
  337. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +0 -75
  338. data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +0 -1322
  339. data/ext/ice/cpp/src/Ice/Plugin.cpp +0 -87
  340. data/ext/ice/cpp/src/Ice/PluginF.cpp +0 -61
  341. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +0 -503
  342. data/ext/ice/cpp/src/Ice/Process.cpp +0 -471
  343. data/ext/ice/cpp/src/Ice/ProcessF.cpp +0 -63
  344. data/ext/ice/cpp/src/Ice/Properties.cpp +0 -78
  345. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +0 -603
  346. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +0 -63
  347. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +0 -1429
  348. data/ext/ice/cpp/src/Ice/PropertyNames.h +0 -78
  349. data/ext/ice/cpp/src/Ice/Proxy.cpp +0 -1601
  350. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +0 -1171
  351. data/ext/ice/cpp/src/Ice/Router.cpp +0 -977
  352. data/ext/ice/cpp/src/Ice/RouterF.cpp +0 -63
  353. data/ext/ice/cpp/src/Ice/Selector.cpp +0 -1525
  354. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +0 -75
  355. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +0 -61
  356. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +0 -49
  357. data/ext/ice/cpp/src/Ice/ThreadPool.cpp +0 -1292
  358. data/ext/ice/cpp/src/Ice/ValueFactory.cpp +0 -83
  359. data/ext/ice/cpp/src/Ice/Version.cpp +0 -57
  360. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +0 -915
  361. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +0 -1889
  362. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +0 -730
  363. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +0 -1197
  364. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +0 -75
  365. data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +0 -61
  366. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +0 -75
  367. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +0 -1092
  368. data/ext/ice/cpp/src/IceSSL/PluginI.cpp +0 -246
  369. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +0 -719
  370. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +0 -868
  371. data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +0 -266
  372. data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +0 -338
  373. data/ext/ice/cpp/src/IceSSL/UWPEngine.h +0 -41
  374. data/ext/ice/cpp/src/IceSSL/UWPEngineF.h +0 -26
  375. data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +0 -89
  376. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +0 -383
  377. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +0 -71
  378. data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +0 -690
  379. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +0 -5176
  380. data/ext/ice/mcpp/CMakeLists.txt +0 -80
  381. data/ext/ice/mcpp/LICENSE +0 -29
  382. data/ext/ice/mcpp/Makefile +0 -63
  383. data/ext/ice/mcpp/README.md +0 -32
  384. data/ext/ice/mcpp/directive.c +0 -1404
  385. data/ext/ice/mcpp/internal.H +0 -530
  386. data/ext/ice/mcpp/main.c +0 -792
  387. data/ext/ice/mcpp/mcpp.gyp +0 -88
  388. data/ext/ice/mcpp/support.c +0 -1985
  389. data/ext/ice/mcpp/system.c +0 -2737
  390. data/lib/Glacier2/Metrics.rb +0 -56
  391. data/lib/Glacier2/PermissionsVerifier.rb +0 -93
  392. data/lib/Glacier2/PermissionsVerifierF.rb +0 -30
  393. data/lib/Glacier2/Router.rb +0 -95
  394. data/lib/Glacier2/RouterF.rb +0 -25
  395. data/lib/Glacier2/SSLInfo.rb +0 -72
  396. data/lib/Glacier2/Session.rb +0 -247
  397. data/lib/Ice/BuiltinSequences.rb +0 -60
  398. data/lib/Ice/Communicator.rb +0 -87
  399. data/lib/Ice/CommunicatorF.rb +0 -24
  400. data/lib/Ice/Connection.rb +0 -413
  401. data/lib/Ice/ConnectionF.rb +0 -32
  402. data/lib/Ice/Current.rb +0 -141
  403. data/lib/Ice/Endpoint.rb +0 -187
  404. data/lib/Ice/EndpointF.rb +0 -48
  405. data/lib/Ice/EndpointTypes.rb +0 -69
  406. data/lib/Ice/FacetMap.rb +0 -24
  407. data/lib/Ice/Identity.rb +0 -63
  408. data/lib/Ice/ImplicitContext.rb +0 -26
  409. data/lib/Ice/ImplicitContextF.rb +0 -24
  410. data/lib/Ice/Instrumentation.rb +0 -169
  411. data/lib/Ice/InstrumentationF.rb +0 -31
  412. data/lib/Ice/LocalException.rb +0 -1031
  413. data/lib/Ice/Locator.rb +0 -196
  414. data/lib/Ice/LocatorF.rb +0 -30
  415. data/lib/Ice/Logger.rb +0 -24
  416. data/lib/Ice/LoggerF.rb +0 -24
  417. data/lib/Ice/Metrics.rb +0 -337
  418. data/lib/Ice/ObjectAdapter.rb +0 -29
  419. data/lib/Ice/ObjectAdapterF.rb +0 -24
  420. data/lib/Ice/ObjectFactory.rb +0 -24
  421. data/lib/Ice/Plugin.rb +0 -30
  422. data/lib/Ice/PluginF.rb +0 -28
  423. data/lib/Ice/Process.rb +0 -53
  424. data/lib/Ice/ProcessF.rb +0 -25
  425. data/lib/Ice/Properties.rb +0 -25
  426. data/lib/Ice/PropertiesAdmin.rb +0 -63
  427. data/lib/Ice/PropertiesF.rb +0 -29
  428. data/lib/Ice/RemoteLogger.rb +0 -207
  429. data/lib/Ice/Router.rb +0 -87
  430. data/lib/Ice/RouterF.rb +0 -25
  431. data/lib/Ice/ServantLocator.rb +0 -26
  432. data/lib/Ice/ServantLocatorF.rb +0 -24
  433. data/lib/Ice/SliceChecksumDict.rb +0 -24
  434. data/lib/Ice/ValueFactory.rb +0 -28
  435. data/lib/Ice/Version.rb +0 -90
  436. data/lib/IceBox/IceBox.rb +0 -164
  437. data/lib/IceGrid/Admin.rb +0 -1196
  438. data/lib/IceGrid/Descriptor.rb +0 -1034
  439. data/lib/IceGrid/Exception.rb +0 -376
  440. data/lib/IceGrid/FileParser.rb +0 -65
  441. data/lib/IceGrid/PluginFacade.rb +0 -35
  442. data/lib/IceGrid/Registry.rb +0 -209
  443. data/lib/IceGrid/Session.rb +0 -71
  444. data/lib/IceGrid/UserAccountMapper.rb +0 -61
  445. data/lib/IcePatch2/FileInfo.rb +0 -115
  446. data/lib/IcePatch2/FileServer.rb +0 -123
  447. data/lib/IceStorm/IceStorm.rb +0 -332
  448. data/lib/IceStorm/Metrics.rb +0 -73
  449. data/slice/Ice/Connection.ice +0 -516
  450. data/slice/Ice/Locator.ice +0 -239
  451. data/slice/Ice/Metrics.ice +0 -436
  452. data/slice/Ice/ObjectAdapter.ice +0 -710
  453. data/slice/Ice/Router.ice +0 -103
  454. data/slice/IceBT/ConnectionInfo.ice +0 -59
  455. data/slice/IceBT/EndpointInfo.ice +0 -57
  456. data/slice/IceBT/Types.ice +0 -45
  457. data/slice/IceDiscovery/IceDiscovery.ice +0 -98
  458. data/slice/IceGrid/PluginFacade.ice +0 -329
  459. data/slice/IceIAP/ConnectionInfo.ice +0 -74
  460. data/slice/IceIAP/EndpointInfo.ice +0 -68
  461. data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +0 -83
  462. data/slice/IceSSL/ConnectionInfo.ice +0 -54
  463. data/slice/IceSSL/ConnectionInfoF.ice +0 -31
  464. data/slice/IceSSL/EndpointInfo.ice +0 -45
  465. data/slice/IceStorm/IceStorm.ice +0 -414
  466. /data/{ext → dist/IceRuby}/Communicator.cpp +0 -0
  467. /data/{ext → dist/IceRuby}/Communicator.h +0 -0
  468. /data/{ext → dist/IceRuby}/Config.h +0 -0
  469. /data/{ext → dist/IceRuby}/Connection.h +0 -0
  470. /data/{ext → dist/IceRuby}/Endpoint.h +0 -0
  471. /data/{ext → dist/IceRuby}/ImplicitContext.h +0 -0
  472. /data/{ext → dist/IceRuby}/Init.cpp +0 -0
  473. /data/{ext → dist/IceRuby}/Logger.h +0 -0
  474. /data/{ext → dist/IceRuby}/Operation.h +0 -0
  475. /data/{ext → dist/IceRuby}/Properties.h +0 -0
  476. /data/{ext → dist/IceRuby}/Proxy.cpp +0 -0
  477. /data/{ext → dist/IceRuby}/Proxy.h +0 -0
  478. /data/{ext → dist/IceRuby}/Slice.cpp +0 -0
  479. /data/{ext → dist/IceRuby}/Slice.h +0 -0
  480. /data/{ext → dist/IceRuby}/Util.cpp +0 -0
  481. /data/{ext → dist/IceRuby}/Util.h +0 -0
  482. /data/{ext → dist/IceRuby}/ValueFactoryManager.h +0 -0
  483. /data/{ext → dist}/ice/cpp/include/Ice/Application.h +0 -0
  484. /data/{ext → dist}/ice/cpp/include/Ice/AsyncResult.h +0 -0
  485. /data/{ext → dist}/ice/cpp/include/Ice/AsyncResultF.h +0 -0
  486. /data/{ext → dist}/ice/cpp/include/Ice/BatchRequestInterceptor.h +0 -0
  487. /data/{ext → dist}/ice/cpp/include/Ice/BatchRequestQueueF.h +0 -0
  488. /data/{ext → dist}/ice/cpp/include/Ice/Buffer.h +0 -0
  489. /data/{ext → dist}/ice/cpp/include/Ice/CommunicatorAsync.h +0 -0
  490. /data/{ext → dist}/ice/cpp/include/Ice/Comparable.h +0 -0
  491. /data/{ext → dist}/ice/cpp/include/Ice/Config.h +0 -0
  492. /data/{ext → dist}/ice/cpp/include/Ice/ConnectionAsync.h +0 -0
  493. /data/{ext → dist}/ice/cpp/include/Ice/ConnectionIF.h +0 -0
  494. /data/{ext → dist}/ice/cpp/include/Ice/ConsoleUtil.h +0 -0
  495. /data/{ext → dist}/ice/cpp/include/Ice/DefaultValueFactory.h +0 -0
  496. /data/{ext → dist}/ice/cpp/include/Ice/DispatchInterceptor.h +0 -0
  497. /data/{ext → dist}/ice/cpp/include/Ice/Dispatcher.h +0 -0
  498. /data/{ext → dist}/ice/cpp/include/Ice/DynamicLibrary.h +0 -0
  499. /data/{ext → dist}/ice/cpp/include/Ice/DynamicLibraryF.h +0 -0
  500. /data/{ext → dist}/ice/cpp/include/Ice/Exception.h +0 -0
  501. /data/{ext → dist}/ice/cpp/include/Ice/FactoryTable.h +0 -0
  502. /data/{ext → dist}/ice/cpp/include/Ice/FactoryTableInit.h +0 -0
  503. /data/{ext → dist}/ice/cpp/include/Ice/Format.h +0 -0
  504. /data/{ext → dist}/ice/cpp/include/Ice/Functional.h +0 -0
  505. /data/{ext → dist}/ice/cpp/include/Ice/GCObject.h +0 -0
  506. /data/{ext → dist}/ice/cpp/include/Ice/Handle.h +0 -0
  507. /data/{ext → dist}/ice/cpp/include/Ice/Ice.h +0 -0
  508. /data/{ext → dist}/ice/cpp/include/Ice/IconvStringConverter.h +0 -0
  509. /data/{ext → dist}/ice/cpp/include/Ice/Incoming.h +0 -0
  510. /data/{ext → dist}/ice/cpp/include/Ice/IncomingAsync.h +0 -0
  511. /data/{ext → dist}/ice/cpp/include/Ice/IncomingAsyncF.h +0 -0
  512. /data/{ext → dist}/ice/cpp/include/Ice/InputStream.h +0 -0
  513. /data/{ext → dist}/ice/cpp/include/Ice/InstanceF.h +0 -0
  514. /data/{ext → dist}/ice/cpp/include/Ice/InterfaceByValue.h +0 -0
  515. /data/{ext → dist}/ice/cpp/include/Ice/LocalObject.h +0 -0
  516. /data/{ext → dist}/ice/cpp/include/Ice/LocalObjectF.h +0 -0
  517. /data/{ext → dist}/ice/cpp/include/Ice/LoggerUtil.h +0 -0
  518. /data/{ext → dist}/ice/cpp/include/Ice/MetricsAdminI.h +0 -0
  519. /data/{ext → dist}/ice/cpp/include/Ice/MetricsFunctional.h +0 -0
  520. /data/{ext → dist}/ice/cpp/include/Ice/NativePropertiesAdmin.h +0 -0
  521. /data/{ext → dist}/ice/cpp/include/Ice/Object.h +0 -0
  522. /data/{ext → dist}/ice/cpp/include/Ice/ObjectF.h +0 -0
  523. /data/{ext → dist}/ice/cpp/include/Ice/ObserverHelper.h +0 -0
  524. /data/{ext → dist}/ice/cpp/include/Ice/Optional.h +0 -0
  525. /data/{ext → dist}/ice/cpp/include/Ice/OutgoingAsyncF.h +0 -0
  526. /data/{ext → dist}/ice/cpp/include/Ice/OutputStream.h +0 -0
  527. /data/{ext → dist}/ice/cpp/include/Ice/Protocol.h +0 -0
  528. /data/{ext → dist}/ice/cpp/include/Ice/ProxyF.h +0 -0
  529. /data/{ext → dist}/ice/cpp/include/Ice/ProxyFactoryF.h +0 -0
  530. /data/{ext → dist}/ice/cpp/include/Ice/ProxyHandle.h +0 -0
  531. /data/{ext → dist}/ice/cpp/include/Ice/ReferenceF.h +0 -0
  532. /data/{ext → dist}/ice/cpp/include/Ice/RegisterPlugins.h +0 -0
  533. /data/{ext → dist}/ice/cpp/include/Ice/RequestHandlerF.h +0 -0
  534. /data/{ext → dist}/ice/cpp/include/Ice/ResponseHandlerF.h +0 -0
  535. /data/{ext → dist}/ice/cpp/include/Ice/SHA1.h +0 -0
  536. /data/{ext → dist}/ice/cpp/include/Ice/ServantManagerF.h +0 -0
  537. /data/{ext → dist}/ice/cpp/include/Ice/Service.h +0 -0
  538. /data/{ext → dist}/ice/cpp/include/Ice/SliceChecksums.h +0 -0
  539. /data/{ext → dist}/ice/cpp/include/Ice/SlicedData.h +0 -0
  540. /data/{ext → dist}/ice/cpp/include/Ice/SlicedDataF.h +0 -0
  541. /data/{ext → dist}/ice/cpp/include/Ice/StreamHelpers.h +0 -0
  542. /data/{ext → dist}/ice/cpp/include/Ice/StringConverter.h +0 -0
  543. /data/{ext → dist}/ice/cpp/include/Ice/ThreadPoolF.h +0 -0
  544. /data/{ext → dist}/ice/cpp/include/Ice/UUID.h +0 -0
  545. /data/{ext → dist}/ice/cpp/include/Ice/UniquePtr.h +0 -0
  546. /data/{ext → dist}/ice/cpp/include/Ice/UniqueRef.h +0 -0
  547. /data/{ext → dist}/ice/cpp/include/Ice/Value.h +0 -0
  548. /data/{ext → dist}/ice/cpp/include/Ice/ValueF.h +0 -0
  549. /data/{ext → dist}/ice/cpp/include/IceSSL/Config.h +0 -0
  550. /data/{ext → dist}/ice/cpp/include/IceSSL/IceSSL.h +0 -0
  551. /data/{ext → dist}/ice/cpp/include/IceSSL/OpenSSL.h +0 -0
  552. /data/{ext → dist}/ice/cpp/include/IceSSL/Plugin.h +0 -0
  553. /data/{ext → dist}/ice/cpp/include/IceSSL/SChannel.h +0 -0
  554. /data/{ext → dist}/ice/cpp/include/IceSSL/SecureTransport.h +0 -0
  555. /data/{ext → dist}/ice/cpp/include/IceUtil/Atomic.h +0 -0
  556. /data/{ext → dist}/ice/cpp/include/IceUtil/ConsoleUtil.h +0 -0
  557. /data/{ext → dist}/ice/cpp/include/IceUtil/CountDownLatch.h +0 -0
  558. /data/{ext → dist}/ice/cpp/include/IceUtil/DisableWarnings.h +0 -0
  559. /data/{ext → dist}/ice/cpp/include/IceUtil/Exception.h +0 -0
  560. /data/{ext → dist}/ice/cpp/include/IceUtil/FileUtil.h +0 -0
  561. /data/{ext → dist}/ice/cpp/include/IceUtil/Functional.h +0 -0
  562. /data/{ext → dist}/ice/cpp/include/IceUtil/Handle.h +0 -0
  563. /data/{ext → dist}/ice/cpp/include/IceUtil/IceUtil.h +0 -0
  564. /data/{ext → dist}/ice/cpp/include/IceUtil/Iterator.h +0 -0
  565. /data/{ext → dist}/ice/cpp/include/IceUtil/Lock.h +0 -0
  566. /data/{ext → dist}/ice/cpp/include/IceUtil/Monitor.h +0 -0
  567. /data/{ext → dist}/ice/cpp/include/IceUtil/Mutex.h +0 -0
  568. /data/{ext → dist}/ice/cpp/include/IceUtil/MutexProtocol.h +0 -0
  569. /data/{ext → dist}/ice/cpp/include/IceUtil/MutexPtrLock.h +0 -0
  570. /data/{ext → dist}/ice/cpp/include/IceUtil/MutexPtrTryLock.h +0 -0
  571. /data/{ext → dist}/ice/cpp/include/IceUtil/Optional.h +0 -0
  572. /data/{ext → dist}/ice/cpp/include/IceUtil/Options.h +0 -0
  573. /data/{ext → dist}/ice/cpp/include/IceUtil/OutputUtil.h +0 -0
  574. /data/{ext → dist}/ice/cpp/include/IceUtil/PopDisableWarnings.h +0 -0
  575. /data/{ext → dist}/ice/cpp/include/IceUtil/PushDisableWarnings.h +0 -0
  576. /data/{ext → dist}/ice/cpp/include/IceUtil/Random.h +0 -0
  577. /data/{ext → dist}/ice/cpp/include/IceUtil/RecMutex.h +0 -0
  578. /data/{ext → dist}/ice/cpp/include/IceUtil/ScannerConfig.h +0 -0
  579. /data/{ext → dist}/ice/cpp/include/IceUtil/ScopedArray.h +0 -0
  580. /data/{ext → dist}/ice/cpp/include/IceUtil/Shared.h +0 -0
  581. /data/{ext → dist}/ice/cpp/include/IceUtil/StopWatch.h +0 -0
  582. /data/{ext → dist}/ice/cpp/include/IceUtil/StringConverter.h +0 -0
  583. /data/{ext → dist}/ice/cpp/include/IceUtil/StringUtil.h +0 -0
  584. /data/{ext → dist}/ice/cpp/include/IceUtil/Thread.h +0 -0
  585. /data/{ext → dist}/ice/cpp/include/IceUtil/ThreadException.h +0 -0
  586. /data/{ext → dist}/ice/cpp/include/IceUtil/Time.h +0 -0
  587. /data/{ext → dist}/ice/cpp/include/IceUtil/UUID.h +0 -0
  588. /data/{ext → dist}/ice/cpp/include/IceUtil/UndefSysMacros.h +0 -0
  589. /data/{ext → dist}/ice/cpp/src/Ice/ACM.cpp +0 -0
  590. /data/{ext → dist}/ice/cpp/src/Ice/ACM.h +0 -0
  591. /data/{ext → dist}/ice/cpp/src/Ice/ACMF.h +0 -0
  592. /data/{ext → dist}/ice/cpp/src/Ice/Acceptor.cpp +0 -0
  593. /data/{ext → dist}/ice/cpp/src/Ice/Acceptor.h +0 -0
  594. /data/{ext → dist}/ice/cpp/src/Ice/AcceptorF.h +0 -0
  595. /data/{ext → dist}/ice/cpp/src/Ice/ArgVector.cpp +0 -0
  596. /data/{ext → dist}/ice/cpp/src/Ice/ArgVector.h +0 -0
  597. /data/{ext → dist}/ice/cpp/src/Ice/AsyncResult.cpp +0 -0
  598. /data/{ext → dist}/ice/cpp/src/Ice/Base64.cpp +0 -0
  599. /data/{ext → dist}/ice/cpp/src/Ice/Base64.h +0 -0
  600. /data/{ext → dist}/ice/cpp/src/Ice/BatchRequestQueue.cpp +0 -0
  601. /data/{ext → dist}/ice/cpp/src/Ice/BatchRequestQueue.h +0 -0
  602. /data/{ext → dist}/ice/cpp/src/Ice/Buffer.cpp +0 -0
  603. /data/{ext → dist}/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +0 -0
  604. /data/{ext → dist}/ice/cpp/src/Ice/CollocatedRequestHandler.h +0 -0
  605. /data/{ext → dist}/ice/cpp/src/Ice/CommunicatorI.cpp +0 -0
  606. /data/{ext → dist}/ice/cpp/src/Ice/CommunicatorI.h +0 -0
  607. /data/{ext → dist}/ice/cpp/src/Ice/Cond.cpp +0 -0
  608. /data/{ext → dist}/ice/cpp/src/Ice/ConnectRequestHandler.cpp +0 -0
  609. /data/{ext → dist}/ice/cpp/src/Ice/ConnectRequestHandler.h +0 -0
  610. /data/{ext → dist}/ice/cpp/src/Ice/ConnectRequestHandlerF.h +0 -0
  611. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionFactory.cpp +0 -0
  612. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionFactory.h +0 -0
  613. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionFactoryF.h +0 -0
  614. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionI.cpp +0 -0
  615. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionI.h +0 -0
  616. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +0 -0
  617. /data/{ext → dist}/ice/cpp/src/Ice/ConnectionRequestHandler.h +0 -0
  618. /data/{ext → dist}/ice/cpp/src/Ice/Connector.cpp +0 -0
  619. /data/{ext → dist}/ice/cpp/src/Ice/Connector.h +0 -0
  620. /data/{ext → dist}/ice/cpp/src/Ice/ConnectorF.h +0 -0
  621. /data/{ext → dist}/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +0 -0
  622. /data/{ext → dist}/ice/cpp/src/Ice/DefaultsAndOverrides.h +0 -0
  623. /data/{ext → dist}/ice/cpp/src/Ice/DefaultsAndOverridesF.h +0 -0
  624. /data/{ext → dist}/ice/cpp/src/Ice/DispatchInterceptor.cpp +0 -0
  625. /data/{ext → dist}/ice/cpp/src/Ice/DynamicLibrary.cpp +0 -0
  626. /data/{ext → dist}/ice/cpp/src/Ice/EndpointFactory.h +0 -0
  627. /data/{ext → dist}/ice/cpp/src/Ice/EndpointFactoryF.h +0 -0
  628. /data/{ext → dist}/ice/cpp/src/Ice/EndpointFactoryManager.cpp +0 -0
  629. /data/{ext → dist}/ice/cpp/src/Ice/EndpointFactoryManager.h +0 -0
  630. /data/{ext → dist}/ice/cpp/src/Ice/EndpointFactoryManagerF.h +0 -0
  631. /data/{ext → dist}/ice/cpp/src/Ice/EndpointI.h +0 -0
  632. /data/{ext → dist}/ice/cpp/src/Ice/EndpointIF.h +0 -0
  633. /data/{ext → dist}/ice/cpp/src/Ice/EventHandler.cpp +0 -0
  634. /data/{ext → dist}/ice/cpp/src/Ice/EventHandler.h +0 -0
  635. /data/{ext → dist}/ice/cpp/src/Ice/EventHandlerF.h +0 -0
  636. /data/{ext → dist}/ice/cpp/src/Ice/Exception.cpp +0 -0
  637. /data/{ext → dist}/ice/cpp/src/Ice/FactoryTable.cpp +0 -0
  638. /data/{ext → dist}/ice/cpp/src/Ice/FactoryTableInit.cpp +0 -0
  639. /data/{ext → dist}/ice/cpp/src/Ice/GCObject.cpp +0 -0
  640. /data/{ext → dist}/ice/cpp/src/Ice/HashUtil.h +0 -0
  641. /data/{ext → dist}/ice/cpp/src/Ice/HttpParser.cpp +0 -0
  642. /data/{ext → dist}/ice/cpp/src/Ice/HttpParser.h +0 -0
  643. /data/{ext → dist}/ice/cpp/src/Ice/IPEndpointI.cpp +0 -0
  644. /data/{ext → dist}/ice/cpp/src/Ice/IPEndpointI.h +0 -0
  645. /data/{ext → dist}/ice/cpp/src/Ice/IPEndpointIF.h +0 -0
  646. /data/{ext → dist}/ice/cpp/src/Ice/IconvStringConverter.cpp +0 -0
  647. /data/{ext → dist}/ice/cpp/src/Ice/ImplicitContextI.cpp +0 -0
  648. /data/{ext → dist}/ice/cpp/src/Ice/ImplicitContextI.h +0 -0
  649. /data/{ext → dist}/ice/cpp/src/Ice/Incoming.cpp +0 -0
  650. /data/{ext → dist}/ice/cpp/src/Ice/IncomingAsync.cpp +0 -0
  651. /data/{ext → dist}/ice/cpp/src/Ice/IncomingRequest.h +0 -0
  652. /data/{ext → dist}/ice/cpp/src/Ice/Initialize.cpp +0 -0
  653. /data/{ext → dist}/ice/cpp/src/Ice/Instance.cpp +0 -0
  654. /data/{ext → dist}/ice/cpp/src/Ice/Instance.h +0 -0
  655. /data/{ext → dist}/ice/cpp/src/Ice/InstrumentationI.cpp +0 -0
  656. /data/{ext → dist}/ice/cpp/src/Ice/InstrumentationI.h +0 -0
  657. /data/{ext → dist}/ice/cpp/src/Ice/LocalObject.cpp +0 -0
  658. /data/{ext → dist}/ice/cpp/src/Ice/LocatorInfo.cpp +0 -0
  659. /data/{ext → dist}/ice/cpp/src/Ice/LocatorInfo.h +0 -0
  660. /data/{ext → dist}/ice/cpp/src/Ice/LocatorInfoF.h +0 -0
  661. /data/{ext → dist}/ice/cpp/src/Ice/LoggerAdminI.cpp +0 -0
  662. /data/{ext → dist}/ice/cpp/src/Ice/LoggerAdminI.h +0 -0
  663. /data/{ext → dist}/ice/cpp/src/Ice/LoggerI.cpp +0 -0
  664. /data/{ext → dist}/ice/cpp/src/Ice/LoggerI.h +0 -0
  665. /data/{ext → dist}/ice/cpp/src/Ice/LoggerUtil.cpp +0 -0
  666. /data/{ext → dist}/ice/cpp/src/Ice/MetricsObserverI.cpp +0 -0
  667. /data/{ext → dist}/ice/cpp/src/Ice/Network.h +0 -0
  668. /data/{ext → dist}/ice/cpp/src/Ice/NetworkF.h +0 -0
  669. /data/{ext → dist}/ice/cpp/src/Ice/NetworkProxy.cpp +0 -0
  670. /data/{ext → dist}/ice/cpp/src/Ice/NetworkProxy.h +0 -0
  671. /data/{ext → dist}/ice/cpp/src/Ice/NetworkProxyF.h +0 -0
  672. /data/{ext → dist}/ice/cpp/src/Ice/OSLogLoggerI.cpp +0 -0
  673. /data/{ext → dist}/ice/cpp/src/Ice/OSLogLoggerI.h +0 -0
  674. /data/{ext → dist}/ice/cpp/src/Ice/Object.cpp +0 -0
  675. /data/{ext → dist}/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +0 -0
  676. /data/{ext → dist}/ice/cpp/src/Ice/ObjectAdapterFactory.h +0 -0
  677. /data/{ext → dist}/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +0 -0
  678. /data/{ext → dist}/ice/cpp/src/Ice/ObjectAdapterI.h +0 -0
  679. /data/{ext → dist}/ice/cpp/src/Ice/ObserverHelper.cpp +0 -0
  680. /data/{ext → dist}/ice/cpp/src/Ice/OpaqueEndpointI.cpp +0 -0
  681. /data/{ext → dist}/ice/cpp/src/Ice/OpaqueEndpointI.h +0 -0
  682. /data/{ext → dist}/ice/cpp/src/Ice/OutputStream.cpp +0 -0
  683. /data/{ext → dist}/ice/cpp/src/Ice/PluginManagerI.h +0 -0
  684. /data/{ext → dist}/ice/cpp/src/Ice/PropertiesAdminI.cpp +0 -0
  685. /data/{ext → dist}/ice/cpp/src/Ice/PropertiesAdminI.h +0 -0
  686. /data/{ext → dist}/ice/cpp/src/Ice/PropertiesI.cpp +0 -0
  687. /data/{ext → dist}/ice/cpp/src/Ice/PropertiesI.h +0 -0
  688. /data/{ext → dist}/ice/cpp/src/Ice/Protocol.cpp +0 -0
  689. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -0
  690. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolInstance.h +0 -0
  691. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolInstanceF.h +0 -0
  692. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +0 -0
  693. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolPluginFacade.h +0 -0
  694. /data/{ext → dist}/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +0 -0
  695. /data/{ext → dist}/ice/cpp/src/Ice/ProxyFactory.cpp +0 -0
  696. /data/{ext → dist}/ice/cpp/src/Ice/ProxyFactory.h +0 -0
  697. /data/{ext → dist}/ice/cpp/src/Ice/Reference.cpp +0 -0
  698. /data/{ext → dist}/ice/cpp/src/Ice/Reference.h +0 -0
  699. /data/{ext → dist}/ice/cpp/src/Ice/ReferenceFactory.cpp +0 -0
  700. /data/{ext → dist}/ice/cpp/src/Ice/ReferenceFactory.h +0 -0
  701. /data/{ext → dist}/ice/cpp/src/Ice/ReferenceFactoryF.h +0 -0
  702. /data/{ext → dist}/ice/cpp/src/Ice/RegisterPluginsInit.cpp +0 -0
  703. /data/{ext → dist}/ice/cpp/src/Ice/RegisterPluginsInit.h +0 -0
  704. /data/{ext → dist}/ice/cpp/src/Ice/ReplyStatus.h +0 -0
  705. /data/{ext → dist}/ice/cpp/src/Ice/RequestHandler.cpp +0 -0
  706. /data/{ext → dist}/ice/cpp/src/Ice/RequestHandler.h +0 -0
  707. /data/{ext → dist}/ice/cpp/src/Ice/RequestHandlerFactory.cpp +0 -0
  708. /data/{ext → dist}/ice/cpp/src/Ice/RequestHandlerFactory.h +0 -0
  709. /data/{ext → dist}/ice/cpp/src/Ice/ResponseHandler.cpp +0 -0
  710. /data/{ext → dist}/ice/cpp/src/Ice/ResponseHandler.h +0 -0
  711. /data/{ext → dist}/ice/cpp/src/Ice/RetryQueue.cpp +0 -0
  712. /data/{ext → dist}/ice/cpp/src/Ice/RetryQueue.h +0 -0
  713. /data/{ext → dist}/ice/cpp/src/Ice/RetryQueueF.h +0 -0
  714. /data/{ext → dist}/ice/cpp/src/Ice/RouterInfo.cpp +0 -0
  715. /data/{ext → dist}/ice/cpp/src/Ice/RouterInfo.h +0 -0
  716. /data/{ext → dist}/ice/cpp/src/Ice/RouterInfoF.h +0 -0
  717. /data/{ext → dist}/ice/cpp/src/Ice/SHA1.cpp +0 -0
  718. /data/{ext → dist}/ice/cpp/src/Ice/Selector.h +0 -0
  719. /data/{ext → dist}/ice/cpp/src/Ice/ServantManager.cpp +0 -0
  720. /data/{ext → dist}/ice/cpp/src/Ice/ServantManager.h +0 -0
  721. /data/{ext → dist}/ice/cpp/src/Ice/SharedContext.h +0 -0
  722. /data/{ext → dist}/ice/cpp/src/Ice/SliceChecksums.cpp +0 -0
  723. /data/{ext → dist}/ice/cpp/src/Ice/SlicedData.cpp +0 -0
  724. /data/{ext → dist}/ice/cpp/src/Ice/StreamSocket.cpp +0 -0
  725. /data/{ext → dist}/ice/cpp/src/Ice/StreamSocket.h +0 -0
  726. /data/{ext → dist}/ice/cpp/src/Ice/StringConverterPlugin.cpp +0 -0
  727. /data/{ext → dist}/ice/cpp/src/Ice/StringUtil.h +0 -0
  728. /data/{ext → dist}/ice/cpp/src/Ice/SysLoggerI.cpp +0 -0
  729. /data/{ext → dist}/ice/cpp/src/Ice/SysLoggerI.h +0 -0
  730. /data/{ext → dist}/ice/cpp/src/Ice/SystemdJournalI.cpp +0 -0
  731. /data/{ext → dist}/ice/cpp/src/Ice/SystemdJournalI.h +0 -0
  732. /data/{ext → dist}/ice/cpp/src/Ice/TcpAcceptor.cpp +0 -0
  733. /data/{ext → dist}/ice/cpp/src/Ice/TcpAcceptor.h +0 -0
  734. /data/{ext → dist}/ice/cpp/src/Ice/TcpConnector.cpp +0 -0
  735. /data/{ext → dist}/ice/cpp/src/Ice/TcpConnector.h +0 -0
  736. /data/{ext → dist}/ice/cpp/src/Ice/TcpEndpointI.cpp +0 -0
  737. /data/{ext → dist}/ice/cpp/src/Ice/TcpEndpointI.h +0 -0
  738. /data/{ext → dist}/ice/cpp/src/Ice/TcpTransceiver.cpp +0 -0
  739. /data/{ext → dist}/ice/cpp/src/Ice/TcpTransceiver.h +0 -0
  740. /data/{ext → dist}/ice/cpp/src/Ice/Thread.cpp +0 -0
  741. /data/{ext → dist}/ice/cpp/src/Ice/ThreadPool.h +0 -0
  742. /data/{ext → dist}/ice/cpp/src/Ice/Timer.cpp +0 -0
  743. /data/{ext → dist}/ice/cpp/src/Ice/TraceLevels.cpp +0 -0
  744. /data/{ext → dist}/ice/cpp/src/Ice/TraceLevels.h +0 -0
  745. /data/{ext → dist}/ice/cpp/src/Ice/TraceLevelsF.h +0 -0
  746. /data/{ext → dist}/ice/cpp/src/Ice/TraceUtil.cpp +0 -0
  747. /data/{ext → dist}/ice/cpp/src/Ice/TraceUtil.h +0 -0
  748. /data/{ext → dist}/ice/cpp/src/Ice/Transceiver.cpp +0 -0
  749. /data/{ext → dist}/ice/cpp/src/Ice/Transceiver.h +0 -0
  750. /data/{ext → dist}/ice/cpp/src/Ice/TransceiverF.h +0 -0
  751. /data/{ext → dist}/ice/cpp/src/Ice/UdpConnector.cpp +0 -0
  752. /data/{ext → dist}/ice/cpp/src/Ice/UdpConnector.h +0 -0
  753. /data/{ext → dist}/ice/cpp/src/Ice/UdpEndpointI.cpp +0 -0
  754. /data/{ext → dist}/ice/cpp/src/Ice/UdpEndpointI.h +0 -0
  755. /data/{ext → dist}/ice/cpp/src/Ice/UdpTransceiver.cpp +0 -0
  756. /data/{ext → dist}/ice/cpp/src/Ice/UdpTransceiver.h +0 -0
  757. /data/{ext → dist}/ice/cpp/src/Ice/Value.cpp +0 -0
  758. /data/{ext → dist}/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +0 -0
  759. /data/{ext → dist}/ice/cpp/src/Ice/ValueFactoryManagerI.h +0 -0
  760. /data/{ext → dist}/ice/cpp/src/Ice/VirtualShared.h +0 -0
  761. /data/{ext → dist}/ice/cpp/src/Ice/WSAcceptor.cpp +0 -0
  762. /data/{ext → dist}/ice/cpp/src/Ice/WSAcceptor.h +0 -0
  763. /data/{ext → dist}/ice/cpp/src/Ice/WSConnector.cpp +0 -0
  764. /data/{ext → dist}/ice/cpp/src/Ice/WSConnector.h +0 -0
  765. /data/{ext → dist}/ice/cpp/src/Ice/WSEndpoint.cpp +0 -0
  766. /data/{ext → dist}/ice/cpp/src/Ice/WSEndpoint.h +0 -0
  767. /data/{ext → dist}/ice/cpp/src/Ice/WSTransceiver.cpp +0 -0
  768. /data/{ext → dist}/ice/cpp/src/Ice/WSTransceiver.h +0 -0
  769. /data/{ext → dist}/ice/cpp/src/IceDiscovery/LocatorI.cpp +0 -0
  770. /data/{ext → dist}/ice/cpp/src/IceDiscovery/LocatorI.h +0 -0
  771. /data/{ext → dist}/ice/cpp/src/IceDiscovery/LookupI.cpp +0 -0
  772. /data/{ext → dist}/ice/cpp/src/IceDiscovery/LookupI.h +0 -0
  773. /data/{ext → dist}/ice/cpp/src/IceDiscovery/PluginI.cpp +0 -0
  774. /data/{ext → dist}/ice/cpp/src/IceDiscovery/PluginI.h +0 -0
  775. /data/{ext → dist}/ice/cpp/src/IceLocatorDiscovery/Plugin.h +0 -0
  776. /data/{ext → dist}/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +0 -0
  777. /data/{ext → dist}/ice/cpp/src/IceSSL/AcceptorI.cpp +0 -0
  778. /data/{ext → dist}/ice/cpp/src/IceSSL/AcceptorI.h +0 -0
  779. /data/{ext → dist}/ice/cpp/src/IceSSL/CertificateI.cpp +0 -0
  780. /data/{ext → dist}/ice/cpp/src/IceSSL/CertificateI.h +0 -0
  781. /data/{ext → dist}/ice/cpp/src/IceSSL/ConnectorI.cpp +0 -0
  782. /data/{ext → dist}/ice/cpp/src/IceSSL/ConnectorI.h +0 -0
  783. /data/{ext → dist}/ice/cpp/src/IceSSL/EndpointI.cpp +0 -0
  784. /data/{ext → dist}/ice/cpp/src/IceSSL/EndpointI.h +0 -0
  785. /data/{ext → dist}/ice/cpp/src/IceSSL/Instance.cpp +0 -0
  786. /data/{ext → dist}/ice/cpp/src/IceSSL/Instance.h +0 -0
  787. /data/{ext → dist}/ice/cpp/src/IceSSL/InstanceF.h +0 -0
  788. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +0 -0
  789. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +0 -0
  790. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLEngine.h +0 -0
  791. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLEngineF.h +0 -0
  792. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +0 -0
  793. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +0 -0
  794. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +0 -0
  795. /data/{ext → dist}/ice/cpp/src/IceSSL/OpenSSLUtil.h +0 -0
  796. /data/{ext → dist}/ice/cpp/src/IceSSL/PluginI.h +0 -0
  797. /data/{ext → dist}/ice/cpp/src/IceSSL/RFC2253.cpp +0 -0
  798. /data/{ext → dist}/ice/cpp/src/IceSSL/RFC2253.h +0 -0
  799. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +0 -0
  800. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelEngine.cpp +0 -0
  801. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelEngine.h +0 -0
  802. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelEngineF.h +0 -0
  803. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelPluginI.cpp +0 -0
  804. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +0 -0
  805. /data/{ext → dist}/ice/cpp/src/IceSSL/SChannelTransceiverI.h +0 -0
  806. /data/{ext → dist}/ice/cpp/src/IceSSL/SSLEngine.cpp +0 -0
  807. /data/{ext → dist}/ice/cpp/src/IceSSL/SSLEngine.h +0 -0
  808. /data/{ext → dist}/ice/cpp/src/IceSSL/SSLEngineF.h +0 -0
  809. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +0 -0
  810. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +0 -0
  811. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportEngine.h +0 -0
  812. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportEngineF.h +0 -0
  813. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +0 -0
  814. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +0 -0
  815. /data/{ext → dist}/ice/cpp/src/IceSSL/SecureTransportUtil.h +0 -0
  816. /data/{ext → dist}/ice/cpp/src/IceSSL/TrustManager.cpp +0 -0
  817. /data/{ext → dist}/ice/cpp/src/IceSSL/TrustManager.h +0 -0
  818. /data/{ext → dist}/ice/cpp/src/IceSSL/TrustManagerF.h +0 -0
  819. /data/{ext → dist}/ice/cpp/src/IceSSL/Util.cpp +0 -0
  820. /data/{ext → dist}/ice/cpp/src/IceSSL/Util.h +0 -0
  821. /data/{ext → dist}/ice/cpp/src/IceUtil/ConsoleUtil.cpp +0 -0
  822. /data/{ext → dist}/ice/cpp/src/IceUtil/ConvertUTF.cpp +0 -0
  823. /data/{ext → dist}/ice/cpp/src/IceUtil/ConvertUTF.h +0 -0
  824. /data/{ext → dist}/ice/cpp/src/IceUtil/CtrlCHandler.cpp +0 -0
  825. /data/{ext → dist}/ice/cpp/src/IceUtil/FileUtil.cpp +0 -0
  826. /data/{ext → dist}/ice/cpp/src/IceUtil/InputUtil.cpp +0 -0
  827. /data/{ext → dist}/ice/cpp/src/IceUtil/MutexProtocol.cpp +0 -0
  828. /data/{ext → dist}/ice/cpp/src/IceUtil/Options.cpp +0 -0
  829. /data/{ext → dist}/ice/cpp/src/IceUtil/OutputUtil.cpp +0 -0
  830. /data/{ext → dist}/ice/cpp/src/IceUtil/Random.cpp +0 -0
  831. /data/{ext → dist}/ice/cpp/src/IceUtil/RecMutex.cpp +0 -0
  832. /data/{ext → dist}/ice/cpp/src/IceUtil/Shared.cpp +0 -0
  833. /data/{ext → dist}/ice/cpp/src/IceUtil/StringUtil.cpp +0 -0
  834. /data/{ext → dist}/ice/cpp/src/IceUtil/ThreadException.cpp +0 -0
  835. /data/{ext → dist}/ice/cpp/src/IceUtil/Time.cpp +0 -0
  836. /data/{ext → dist}/ice/cpp/src/IceUtil/UUID.cpp +0 -0
  837. /data/{ext → dist}/ice/cpp/src/IceUtil/Unicode.cpp +0 -0
  838. /data/{ext → dist}/ice/cpp/src/IceUtil/Unicode.h +0 -0
  839. /data/{ext → dist}/ice/cpp/src/IceUtil/UtilException.cpp +0 -0
  840. /data/{ext → dist}/ice/cpp/src/Slice/CPlusPlusUtil.cpp +0 -0
  841. /data/{ext → dist}/ice/cpp/src/Slice/CPlusPlusUtil.h +0 -0
  842. /data/{ext → dist}/ice/cpp/src/Slice/Checksum.cpp +0 -0
  843. /data/{ext → dist}/ice/cpp/src/Slice/Checksum.h +0 -0
  844. /data/{ext → dist}/ice/cpp/src/Slice/FileTracker.cpp +0 -0
  845. /data/{ext → dist}/ice/cpp/src/Slice/FileTracker.h +0 -0
  846. /data/{ext → dist}/ice/cpp/src/Slice/Grammar.cpp +0 -0
  847. /data/{ext → dist}/ice/cpp/src/Slice/Grammar.h +0 -0
  848. /data/{ext → dist}/ice/cpp/src/Slice/GrammarUtil.h +0 -0
  849. /data/{ext → dist}/ice/cpp/src/Slice/JavaUtil.h +0 -0
  850. /data/{ext → dist}/ice/cpp/src/Slice/MD5.cpp +0 -0
  851. /data/{ext → dist}/ice/cpp/src/Slice/MD5.h +0 -0
  852. /data/{ext → dist}/ice/cpp/src/Slice/MD5I.cpp +0 -0
  853. /data/{ext → dist}/ice/cpp/src/Slice/MD5I.h +0 -0
  854. /data/{ext → dist}/ice/cpp/src/Slice/PHPUtil.cpp +0 -0
  855. /data/{ext → dist}/ice/cpp/src/Slice/PHPUtil.h +0 -0
  856. /data/{ext → dist}/ice/cpp/src/Slice/Parser.cpp +0 -0
  857. /data/{ext → dist}/ice/cpp/src/Slice/Parser.h +0 -0
  858. /data/{ext → dist}/ice/cpp/src/Slice/Preprocessor.cpp +0 -0
  859. /data/{ext → dist}/ice/cpp/src/Slice/Preprocessor.h +0 -0
  860. /data/{ext → dist}/ice/cpp/src/Slice/Python.cpp +0 -0
  861. /data/{ext → dist}/ice/cpp/src/Slice/PythonUtil.cpp +0 -0
  862. /data/{ext → dist}/ice/cpp/src/Slice/PythonUtil.h +0 -0
  863. /data/{ext → dist}/ice/cpp/src/Slice/Ruby.cpp +0 -0
  864. /data/{ext → dist}/ice/cpp/src/Slice/RubyUtil.cpp +0 -0
  865. /data/{ext → dist}/ice/cpp/src/Slice/RubyUtil.h +0 -0
  866. /data/{ext → dist}/ice/cpp/src/Slice/Scanner.cpp +0 -0
  867. /data/{ext → dist}/ice/cpp/src/Slice/SliceUtil.cpp +0 -0
  868. /data/{ext → dist}/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -0
  869. /data/{ext → dist}/ice/cpp/src/Slice/Util.h +0 -0
  870. /data/{ext → dist}/ice/mcpp/config.h +0 -0
  871. /data/{ext → dist}/ice/mcpp/configed.H +0 -0
  872. /data/{ext → dist}/ice/mcpp/eval.c +0 -0
  873. /data/{ext → dist}/ice/mcpp/expand.c +0 -0
  874. /data/{ext → dist}/ice/mcpp/mbchar.c +0 -0
  875. /data/{ext → dist}/ice/mcpp/mcpp_lib.h +0 -0
  876. /data/{ext → dist}/ice/mcpp/mcpp_out.h +0 -0
  877. /data/{ext → dist}/ice/mcpp/system.H +0 -0
  878. /data/{slice → dist/ice/slice}/Glacier2/Metrics.ice +0 -0
  879. /data/{slice → dist/ice/slice}/Glacier2/PermissionsVerifier.ice +0 -0
  880. /data/{slice → dist/ice/slice}/Glacier2/PermissionsVerifierF.ice +0 -0
  881. /data/{slice → dist/ice/slice}/Glacier2/Router.ice +0 -0
  882. /data/{slice → dist/ice/slice}/Glacier2/RouterF.ice +0 -0
  883. /data/{slice → dist/ice/slice}/Glacier2/SSLInfo.ice +0 -0
  884. /data/{slice → dist/ice/slice}/Glacier2/Session.ice +0 -0
  885. /data/{slice → dist/ice/slice}/Ice/BuiltinSequences.ice +0 -0
  886. /data/{slice → dist/ice/slice}/Ice/Communicator.ice +0 -0
  887. /data/{slice → dist/ice/slice}/Ice/CommunicatorF.ice +0 -0
  888. /data/{slice → dist/ice/slice}/Ice/ConnectionF.ice +0 -0
  889. /data/{slice → dist/ice/slice}/Ice/Current.ice +0 -0
  890. /data/{slice → dist/ice/slice}/Ice/Endpoint.ice +0 -0
  891. /data/{slice → dist/ice/slice}/Ice/EndpointF.ice +0 -0
  892. /data/{slice → dist/ice/slice}/Ice/EndpointTypes.ice +0 -0
  893. /data/{slice → dist/ice/slice}/Ice/FacetMap.ice +0 -0
  894. /data/{slice → dist/ice/slice}/Ice/Identity.ice +0 -0
  895. /data/{slice → dist/ice/slice}/Ice/ImplicitContext.ice +0 -0
  896. /data/{slice → dist/ice/slice}/Ice/ImplicitContextF.ice +0 -0
  897. /data/{slice → dist/ice/slice}/Ice/Instrumentation.ice +0 -0
  898. /data/{slice → dist/ice/slice}/Ice/InstrumentationF.ice +0 -0
  899. /data/{slice → dist/ice/slice}/Ice/LocalException.ice +0 -0
  900. /data/{slice → dist/ice/slice}/Ice/LocatorF.ice +0 -0
  901. /data/{slice → dist/ice/slice}/Ice/Logger.ice +0 -0
  902. /data/{slice → dist/ice/slice}/Ice/LoggerF.ice +0 -0
  903. /data/{slice → dist/ice/slice}/Ice/ObjectAdapterF.ice +0 -0
  904. /data/{slice → dist/ice/slice}/Ice/ObjectFactory.ice +0 -0
  905. /data/{slice → dist/ice/slice}/Ice/Plugin.ice +0 -0
  906. /data/{slice → dist/ice/slice}/Ice/PluginF.ice +0 -0
  907. /data/{slice → dist/ice/slice}/Ice/Process.ice +0 -0
  908. /data/{slice → dist/ice/slice}/Ice/ProcessF.ice +0 -0
  909. /data/{slice → dist/ice/slice}/Ice/Properties.ice +0 -0
  910. /data/{slice → dist/ice/slice}/Ice/PropertiesAdmin.ice +0 -0
  911. /data/{slice → dist/ice/slice}/Ice/PropertiesF.ice +0 -0
  912. /data/{slice → dist/ice/slice}/Ice/RemoteLogger.ice +0 -0
  913. /data/{slice → dist/ice/slice}/Ice/RouterF.ice +0 -0
  914. /data/{slice → dist/ice/slice}/Ice/ServantLocator.ice +0 -0
  915. /data/{slice → dist/ice/slice}/Ice/ServantLocatorF.ice +0 -0
  916. /data/{slice → dist/ice/slice}/Ice/SliceChecksumDict.ice +0 -0
  917. /data/{slice → dist/ice/slice}/Ice/ValueFactory.ice +0 -0
  918. /data/{slice → dist/ice/slice}/Ice/Version.ice +0 -0
  919. /data/{slice → dist/ice/slice}/IceBox/IceBox.ice +0 -0
  920. /data/{slice → dist/ice/slice}/IceGrid/Admin.ice +0 -0
  921. /data/{slice → dist/ice/slice}/IceGrid/Descriptor.ice +0 -0
  922. /data/{slice → dist/ice/slice}/IceGrid/Exception.ice +0 -0
  923. /data/{slice → dist/ice/slice}/IceGrid/FileParser.ice +0 -0
  924. /data/{slice → dist/ice/slice}/IceGrid/Registry.ice +0 -0
  925. /data/{slice → dist/ice/slice}/IceGrid/Session.ice +0 -0
  926. /data/{slice → dist/ice/slice}/IceGrid/UserAccountMapper.ice +0 -0
  927. /data/{slice → dist/ice/slice}/IcePatch2/FileInfo.ice +0 -0
  928. /data/{slice → dist/ice/slice}/IcePatch2/FileServer.ice +0 -0
  929. /data/{slice → dist/ice/slice}/IceStorm/Metrics.ice +0 -0
  930. /data/{lib → dist/lib}/Glacier2.rb +0 -0
  931. /data/{lib → dist/lib}/Ice.rb +0 -0
  932. /data/{lib → dist/lib}/IceBox.rb +0 -0
  933. /data/{lib → dist/lib}/IceGrid.rb +0 -0
  934. /data/{lib → dist/lib}/IcePatch2.rb +0 -0
  935. /data/{lib → dist/lib}/IceStorm.rb +0 -0
  936. /data/{bin → scripts}/slice2rb +0 -0
@@ -0,0 +1,3336 @@
1
+ //
2
+ // Copyright (c) ZeroC, Inc. All rights reserved.
3
+ //
4
+
5
+ #if defined(__clang__)
6
+ # pragma clang diagnostic ignored "-Wdeprecated-declarations"
7
+ #endif
8
+
9
+ #include <Types.h>
10
+ #include <Proxy.h>
11
+ #include <Util.h>
12
+ #include <IceUtil/InputUtil.h>
13
+ #include <IceUtil/OutputUtil.h>
14
+ #include <IceUtil/ScopedArray.h>
15
+ #include <Ice/InputStream.h>
16
+ #include <Ice/LocalException.h>
17
+ #include <Ice/OutputStream.h>
18
+ #include <Ice/SlicedData.h>
19
+ #include <list>
20
+ #include <limits>
21
+ #include <math.h>
22
+
23
+ //
24
+ // Required for RHASH_SIZE to work properly with Ruby 1.8.x.
25
+ // T_ZOMBIE is only defined in Ruby 1.9.
26
+ //
27
+ #ifndef T_ZOMBIE
28
+ # include "st.h"
29
+ #endif
30
+
31
+ #ifndef RHASH_SIZE
32
+ # define RHASH_SIZE(v) RHASH(v)->tbl->num_entries
33
+ #endif
34
+
35
+ using namespace std;
36
+ using namespace IceRuby;
37
+ using namespace IceUtil;
38
+ using namespace IceUtilInternal;
39
+
40
+ static VALUE _typeInfoClass, _exceptionInfoClass, _unsetTypeClass;
41
+
42
+ typedef map<string, ClassInfoPtr> ClassInfoMap;
43
+ static ClassInfoMap _classInfoMap;
44
+
45
+ typedef map<Ice::Int, ClassInfoPtr> CompactIdMap;
46
+ static CompactIdMap _compactIdMap;
47
+
48
+ typedef map<string, ProxyInfoPtr> ProxyInfoMap;
49
+ static ProxyInfoMap _proxyInfoMap;
50
+
51
+ typedef map<string, ExceptionInfoPtr> ExceptionInfoMap;
52
+ static ExceptionInfoMap _exceptionInfoMap;
53
+
54
+ namespace IceRuby
55
+ {
56
+
57
+ VALUE Unset;
58
+
59
+ class InfoMapDestroyer
60
+ {
61
+ public:
62
+
63
+ ~InfoMapDestroyer();
64
+ };
65
+ static InfoMapDestroyer infoMapDestroyer;
66
+
67
+ string
68
+ escapeString(const string& str)
69
+ {
70
+ static const string basicSourceChars = "abcdefghijklmnopqrstuvwxyz"
71
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
72
+ "0123456789"
73
+ "_{}[]#()<>%:;.?*+-/^&|~!=,\\\"' ";
74
+ static const set<char> charSet(basicSourceChars.begin(), basicSourceChars.end());
75
+
76
+ ostringstream out;
77
+
78
+ for(string::const_iterator c = str.begin(); c != str.end(); ++c)
79
+ {
80
+ if(charSet.find(*c) == charSet.end())
81
+ {
82
+ unsigned char uc = static_cast<unsigned char>(*c); // char may be signed, so make it positive
83
+ ostringstream s;
84
+ s << "\\"; // Print as octal if not in basic source character set
85
+ s.width(3);
86
+ s.fill('0');
87
+ s << oct;
88
+ s << static_cast<unsigned>(uc);
89
+ out << s.str();
90
+ }
91
+ else
92
+ {
93
+ out << *c; // Print normally if in basic source character set
94
+ }
95
+ }
96
+
97
+ return out.str();
98
+ }
99
+
100
+ }
101
+
102
+ //
103
+ // addClassInfo()
104
+ //
105
+ static void
106
+ addClassInfo(const string& id, const ClassInfoPtr& info)
107
+ {
108
+ //
109
+ // Do not assert. An application may load statically-
110
+ // translated definitions and then dynamically load
111
+ // duplicate definitions.
112
+ //
113
+ // assert(_classInfoMap.find(id) == _classInfoMap.end());
114
+ ClassInfoMap::iterator p = _classInfoMap.find(id);
115
+ if(p != _classInfoMap.end())
116
+ {
117
+ _classInfoMap.erase(p);
118
+ }
119
+ _classInfoMap.insert(ClassInfoMap::value_type(id, info));
120
+ }
121
+
122
+ //
123
+ // addProxyInfo()
124
+ //
125
+ static void
126
+ addProxyInfo(const string& id, const ProxyInfoPtr& info)
127
+ {
128
+ //
129
+ // Do not assert. An application may load statically-
130
+ // translated definitions and then dynamically load
131
+ // duplicate definitions.
132
+ //
133
+ // assert(_proxyInfoMap.find(id) == _proxyInfoMap.end());
134
+ ProxyInfoMap::iterator p = _proxyInfoMap.find(id);
135
+ if(p != _proxyInfoMap.end())
136
+ {
137
+ _proxyInfoMap.erase(p);
138
+ }
139
+ _proxyInfoMap.insert(ProxyInfoMap::value_type(id, info));
140
+ }
141
+
142
+ //
143
+ // lookupProxyInfo()
144
+ //
145
+ static IceRuby::ProxyInfoPtr
146
+ lookupProxyInfo(const string& id)
147
+ {
148
+ ProxyInfoMap::iterator p = _proxyInfoMap.find(id);
149
+ if(p != _proxyInfoMap.end())
150
+ {
151
+ return p->second;
152
+ }
153
+ return 0;
154
+ }
155
+
156
+ //
157
+ // addExceptionInfo()
158
+ //
159
+ static void
160
+ addExceptionInfo(const string& id, const ExceptionInfoPtr& info)
161
+ {
162
+ //
163
+ // Do not assert. An application may load statically-
164
+ // translated definitions and then dynamically load
165
+ // duplicate definitions.
166
+ //
167
+ // assert(_exceptionInfoMap.find(id) == _exceptionInfoMap.end());
168
+ _exceptionInfoMap.insert(ExceptionInfoMap::value_type(id, info));
169
+ }
170
+
171
+ //
172
+ // StreamUtil implementation
173
+ //
174
+ VALUE IceRuby::StreamUtil::_slicedDataType = Qnil;
175
+ VALUE IceRuby::StreamUtil::_sliceInfoType = Qnil;
176
+
177
+ IceRuby::StreamUtil::StreamUtil()
178
+ {
179
+ }
180
+
181
+ IceRuby::StreamUtil::~StreamUtil()
182
+ {
183
+ //
184
+ // Make sure we break any cycles among the ObjectReaders in preserved slices.
185
+ //
186
+ for(set<ObjectReaderPtr>::iterator p = _readers.begin(); p != _readers.end(); ++p)
187
+ {
188
+ Ice::SlicedDataPtr slicedData = (*p)->getSlicedData();
189
+ for(Ice::SliceInfoSeq::const_iterator q = slicedData->slices.begin(); q != slicedData->slices.end(); ++q)
190
+ {
191
+ //
192
+ // Don't just call (*q)->instances.clear(), as releasing references
193
+ // to the instances could have unexpected side effects. We exchange
194
+ // the vector into a temporary and then let the temporary fall out
195
+ // of scope.
196
+ //
197
+ vector<Ice::ObjectPtr> tmp;
198
+ tmp.swap((*q)->instances);
199
+ }
200
+ }
201
+ }
202
+
203
+ void
204
+ IceRuby::StreamUtil::add(const ReadObjectCallbackPtr& callback)
205
+ {
206
+ _callbacks.push_back(callback);
207
+ }
208
+
209
+ void
210
+ IceRuby::StreamUtil::add(const ObjectReaderPtr& reader)
211
+ {
212
+ assert(reader->getSlicedData());
213
+ _readers.insert(reader);
214
+ }
215
+
216
+ void
217
+ IceRuby::StreamUtil::updateSlicedData()
218
+ {
219
+ for(set<ObjectReaderPtr>::iterator p = _readers.begin(); p != _readers.end(); ++p)
220
+ {
221
+ setSlicedDataMember((*p)->getObject(), (*p)->getSlicedData());
222
+ }
223
+ }
224
+
225
+ void
226
+ IceRuby::StreamUtil::setSlicedDataMember(VALUE obj, const Ice::SlicedDataPtr& slicedData)
227
+ {
228
+ //
229
+ // Create a Ruby equivalent of the SlicedData object.
230
+ //
231
+
232
+ assert(slicedData);
233
+
234
+ if(_slicedDataType == Qnil)
235
+ {
236
+ _slicedDataType = callRuby(rb_path2class, "Ice::SlicedData");
237
+ assert(!NIL_P(_slicedDataType));
238
+ }
239
+ if(_sliceInfoType == Qnil)
240
+ {
241
+ _sliceInfoType = callRuby(rb_path2class, "Ice::SliceInfo");
242
+ assert(!NIL_P(_sliceInfoType));
243
+ }
244
+
245
+ volatile VALUE sd = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), _slicedDataType);
246
+
247
+ volatile VALUE slices = createArray(static_cast<long>(slicedData->slices.size()));
248
+
249
+ callRuby(rb_iv_set, sd, "@slices", slices);
250
+
251
+ //
252
+ // Translate each SliceInfo object into its Ruby equivalent.
253
+ //
254
+ int i = 0;
255
+ for(vector<Ice::SliceInfoPtr>::const_iterator p = slicedData->slices.begin(); p != slicedData->slices.end(); ++p)
256
+ {
257
+ volatile VALUE slice = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), _sliceInfoType);
258
+
259
+ RARRAY_ASET(slices, i, slice);
260
+ i++;
261
+
262
+ //
263
+ // typeId
264
+ //
265
+ volatile VALUE typeId = createString((*p)->typeId);
266
+ callRuby(rb_iv_set, slice, "@typeId", typeId);
267
+
268
+ //
269
+ // compactId
270
+ //
271
+ volatile VALUE compactId = INT2FIX((*p)->compactId);
272
+ callRuby(rb_iv_set, slice, "@compactId", compactId);
273
+
274
+ //
275
+ // bytes
276
+ //
277
+ volatile VALUE bytes = callRuby(rb_str_new,
278
+ (*p)->bytes.empty() ? 0 : reinterpret_cast<const char*>(&(*p)->bytes[0]),
279
+ static_cast<long>((*p)->bytes.size()));
280
+ callRuby(rb_iv_set, slice, "@bytes", bytes);
281
+
282
+ //
283
+ // instances
284
+ //
285
+ volatile VALUE instances = createArray(static_cast<long>((*p)->instances.size()));
286
+ callRuby(rb_iv_set, slice, "@instances", instances);
287
+
288
+ int j = 0;
289
+ for(vector<Ice::ObjectPtr>::iterator q = (*p)->instances.begin(); q != (*p)->instances.end(); ++q)
290
+ {
291
+ //
292
+ // Each element in the instances list is an instance of ObjectReader that wraps a Ruby object.
293
+ //
294
+ assert(*q);
295
+ ObjectReaderPtr r = ObjectReaderPtr::dynamicCast(*q);
296
+ assert(r);
297
+ VALUE o = r->getObject();
298
+ assert(o != Qnil); // Should be non-nil.
299
+ RARRAY_ASET(instances, j, o);
300
+ j++;
301
+ }
302
+
303
+ //
304
+ // hasOptionalMembers
305
+ //
306
+ callRuby(rb_iv_set, slice, "@hasOptionalMembers", (*p)->hasOptionalMembers ? Qtrue : Qfalse);
307
+
308
+ //
309
+ // isLastSlice
310
+ //
311
+ callRuby(rb_iv_set, slice, "@isLastSlice", (*p)->isLastSlice ? Qtrue : Qfalse);
312
+ }
313
+
314
+ callRuby(rb_iv_set, obj, "@_ice_slicedData", sd);
315
+ }
316
+
317
+ //
318
+ // Instances of preserved class and exception types may have a data member
319
+ // named _ice_slicedData which is an instance of the Ruby class Ice::SlicedData.
320
+ //
321
+ Ice::SlicedDataPtr
322
+ IceRuby::StreamUtil::getSlicedDataMember(VALUE obj, ObjectMap* objectMap)
323
+ {
324
+ Ice::SlicedDataPtr slicedData;
325
+
326
+ if(callRuby(rb_ivar_defined, obj, rb_intern("@_ice_slicedData")) == Qtrue)
327
+ {
328
+ volatile VALUE sd = callRuby(rb_iv_get, obj, "@_ice_slicedData");
329
+
330
+ if(sd != Qnil)
331
+ {
332
+ //
333
+ // The "slices" member is an array of Ice::SliceInfo objects.
334
+ //
335
+ volatile VALUE sl = callRuby(rb_iv_get, sd, "@slices");
336
+ assert(TYPE(sl) == T_ARRAY);
337
+
338
+ Ice::SliceInfoSeq slices;
339
+
340
+ long sz = RARRAY_LEN(sl);
341
+ for(long i = 0; i < sz; ++i)
342
+ {
343
+ volatile VALUE s = RARRAY_AREF(sl, i);
344
+
345
+ Ice::SliceInfoPtr info = new Ice::SliceInfo;
346
+
347
+ volatile VALUE typeId = callRuby(rb_iv_get, s, "@typeId");
348
+ info->typeId = getString(typeId);
349
+
350
+ volatile VALUE compactId = callRuby(rb_iv_get, s, "@compactId");
351
+ info->compactId = static_cast<Ice::Int>(getInteger(compactId));
352
+
353
+ volatile VALUE bytes = callRuby(rb_iv_get, s, "@bytes");
354
+ assert(TYPE(bytes) == T_STRING);
355
+ const char* str = RSTRING_PTR(bytes);
356
+ const long len = RSTRING_LEN(bytes);
357
+ if(str != 0 && len != 0)
358
+ {
359
+ vector<Ice::Byte> vtmp(reinterpret_cast<const Ice::Byte*>(str),
360
+ reinterpret_cast<const Ice::Byte*>(str + len));
361
+ info->bytes.swap(vtmp);
362
+ }
363
+
364
+ volatile VALUE instances = callRuby(rb_iv_get, s, "@instances");
365
+ assert(TYPE(instances) == T_ARRAY);
366
+ long osz = RARRAY_LEN(instances);
367
+ for(long j = 0; j < osz; ++j)
368
+ {
369
+ VALUE o = RARRAY_AREF(instances, j);
370
+
371
+ Ice::ObjectPtr writer;
372
+
373
+ ObjectMap::iterator k = objectMap->find(o);
374
+ if(k == objectMap->end())
375
+ {
376
+ writer = new ObjectWriter(o, objectMap, 0);
377
+ objectMap->insert(ObjectMap::value_type(o, writer));
378
+ }
379
+ else
380
+ {
381
+ writer = k->second;
382
+ }
383
+
384
+ info->instances.push_back(writer);
385
+ }
386
+
387
+ volatile VALUE hasOptionalMembers = callRuby(rb_iv_get, s, "@hasOptionalMembers");
388
+ info->hasOptionalMembers = hasOptionalMembers == Qtrue;
389
+
390
+ volatile VALUE isLastSlice = callRuby(rb_iv_get, s, "@isLastSlice");
391
+ info->isLastSlice = isLastSlice == Qtrue;
392
+
393
+ slices.push_back(info);
394
+ }
395
+
396
+ slicedData = new Ice::SlicedData(slices);
397
+ }
398
+ }
399
+
400
+ return slicedData;
401
+ }
402
+
403
+ //
404
+ // UnmarshalCallback implementation.
405
+ //
406
+ IceRuby::UnmarshalCallback::~UnmarshalCallback()
407
+ {
408
+ }
409
+
410
+ //
411
+ // TypeInfo implementation.
412
+ //
413
+ IceRuby::TypeInfo::TypeInfo()
414
+ {
415
+ }
416
+
417
+ bool
418
+ IceRuby::TypeInfo::usesClasses() const
419
+ {
420
+ return false;
421
+ }
422
+
423
+ void
424
+ IceRuby::TypeInfo::unmarshaled(VALUE, VALUE, void*)
425
+ {
426
+ assert(false);
427
+ }
428
+
429
+ void
430
+ IceRuby::TypeInfo::destroy()
431
+ {
432
+ }
433
+
434
+ //
435
+ // PrimitiveInfo implementation.
436
+ //
437
+ IceRuby::PrimitiveInfo::PrimitiveInfo()
438
+ {
439
+ }
440
+
441
+ IceRuby::PrimitiveInfo::PrimitiveInfo(Kind k) : kind(k)
442
+ {
443
+ }
444
+
445
+ string
446
+ IceRuby::PrimitiveInfo::getId() const
447
+ {
448
+ switch(kind)
449
+ {
450
+ case KindBool:
451
+ return "bool";
452
+ case KindByte:
453
+ return "byte";
454
+ case KindShort:
455
+ return "short";
456
+ case KindInt:
457
+ return "int";
458
+ case KindLong:
459
+ return "long";
460
+ case KindFloat:
461
+ return "float";
462
+ case KindDouble:
463
+ return "double";
464
+ case KindString:
465
+ return "string";
466
+ }
467
+ assert(false);
468
+ return string();
469
+ }
470
+
471
+ bool
472
+ IceRuby::PrimitiveInfo::validate(VALUE)
473
+ {
474
+ //
475
+ // Ruby supports type coercion, such that it's technically possible for any
476
+ // value to be coerced to a primitive type. It would be expensive to perform
477
+ // this coercion twice, once to validate and again to marshal, so we skip
478
+ // the validation here.
479
+ //
480
+ return true;
481
+ }
482
+
483
+ bool
484
+ IceRuby::PrimitiveInfo::variableLength() const
485
+ {
486
+ return kind == KindString;
487
+ }
488
+
489
+ int
490
+ IceRuby::PrimitiveInfo::wireSize() const
491
+ {
492
+ switch(kind)
493
+ {
494
+ case KindBool:
495
+ case KindByte:
496
+ return 1;
497
+ case KindShort:
498
+ return 2;
499
+ case KindInt:
500
+ return 4;
501
+ case KindLong:
502
+ return 8;
503
+ case KindFloat:
504
+ return 4;
505
+ case KindDouble:
506
+ return 8;
507
+ case KindString:
508
+ return 1;
509
+ }
510
+ assert(false);
511
+ return 0;
512
+ }
513
+
514
+ Ice::OptionalFormat
515
+ IceRuby::PrimitiveInfo::optionalFormat() const
516
+ {
517
+ switch(kind)
518
+ {
519
+ case KindBool:
520
+ case KindByte:
521
+ return Ice::OptionalFormatF1;
522
+ case KindShort:
523
+ return Ice::OptionalFormatF2;
524
+ case KindInt:
525
+ return Ice::OptionalFormatF4;
526
+ case KindLong:
527
+ return Ice::OptionalFormatF8;
528
+ case KindFloat:
529
+ return Ice::OptionalFormatF4;
530
+ case KindDouble:
531
+ return Ice::OptionalFormatF8;
532
+ case KindString:
533
+ return Ice::OptionalFormatVSize;
534
+ }
535
+
536
+ assert(false);
537
+ return Ice::OptionalFormatF1;
538
+ }
539
+
540
+ void
541
+ IceRuby::PrimitiveInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap*, bool)
542
+ {
543
+ switch(kind)
544
+ {
545
+ case PrimitiveInfo::KindBool:
546
+ {
547
+ os->write(static_cast<bool>(RTEST(p)));
548
+ break;
549
+ }
550
+ case PrimitiveInfo::KindByte:
551
+ {
552
+ long i = getInteger(p);
553
+ if(i >= 0 && i <= 255)
554
+ {
555
+ os->write(static_cast<Ice::Byte>(i));
556
+ break;
557
+ }
558
+ throw RubyException(rb_eTypeError, "value is out of range for a byte");
559
+ }
560
+ case PrimitiveInfo::KindShort:
561
+ {
562
+ long i = getInteger(p);
563
+ if(i >= SHRT_MIN && i <= SHRT_MAX)
564
+ {
565
+ os->write(static_cast<Ice::Short>(i));
566
+ break;
567
+ }
568
+ throw RubyException(rb_eTypeError, "value is out of range for a short");
569
+ }
570
+ case PrimitiveInfo::KindInt:
571
+ {
572
+ long i = getInteger(p);
573
+ if(i >= INT_MIN && i <= INT_MAX)
574
+ {
575
+ os->write(static_cast<Ice::Int>(i));
576
+ break;
577
+ }
578
+ throw RubyException(rb_eTypeError, "value is out of range for an int");
579
+ }
580
+ case PrimitiveInfo::KindLong:
581
+ {
582
+ os->write(getLong(p));
583
+ break;
584
+ }
585
+ case PrimitiveInfo::KindFloat:
586
+ {
587
+ volatile VALUE val = callRuby(rb_Float, p);
588
+ if(NIL_P(val))
589
+ {
590
+ throw RubyException(rb_eTypeError, "unable to convert value to a float");
591
+ }
592
+ assert(TYPE(val) == T_FLOAT);
593
+ double d = static_cast<double>(RFLOAT_VALUE(val));
594
+ if(
595
+ #if defined(_MSC_VER) && (_MSC_VER <= 1700)
596
+ _finite(val) &&
597
+ #else
598
+ isfinite(d) &&
599
+ #endif
600
+ (d > numeric_limits<float>::max() || d < -numeric_limits<float>::max()))
601
+ {
602
+ throw RubyException(rb_eTypeError, "value is out of range for a float");
603
+ }
604
+ os->write(static_cast<float>(d));
605
+ break;
606
+ }
607
+ case PrimitiveInfo::KindDouble:
608
+ {
609
+ volatile VALUE val = callRuby(rb_Float, p);
610
+ if(NIL_P(val))
611
+ {
612
+ throw RubyException(rb_eTypeError, "unable to convert value to a double");
613
+ }
614
+ assert(TYPE(val) == T_FLOAT);
615
+ os->write(static_cast<double>(RFLOAT_VALUE(val)));
616
+ break;
617
+ }
618
+ case PrimitiveInfo::KindString:
619
+ {
620
+ string val = getString(p);
621
+ #ifdef HAVE_RUBY_ENCODING_H
622
+ os->write(val, false); // Bypass string conversion.
623
+ #else
624
+ os->write(val, true);
625
+ #endif
626
+ break;
627
+ }
628
+ }
629
+ }
630
+
631
+ void
632
+ IceRuby::PrimitiveInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
633
+ void* closure, bool)
634
+ {
635
+ volatile VALUE val = Qnil;
636
+ switch(kind)
637
+ {
638
+ case PrimitiveInfo::KindBool:
639
+ {
640
+ bool b;
641
+ is->read(b);
642
+ val = b ? Qtrue : Qfalse;
643
+ break;
644
+ }
645
+ case PrimitiveInfo::KindByte:
646
+ {
647
+ Ice::Byte b;
648
+ is->read(b);
649
+ val = callRuby(rb_int2inum, b);
650
+ break;
651
+ }
652
+ case PrimitiveInfo::KindShort:
653
+ {
654
+ Ice::Short sh;
655
+ is->read(sh);
656
+ val = callRuby(rb_int2inum, sh);
657
+ break;
658
+ }
659
+ case PrimitiveInfo::KindInt:
660
+ {
661
+ Ice::Int i;
662
+ is->read(i);
663
+ val = callRuby(rb_int2inum, i);
664
+ break;
665
+ }
666
+ case PrimitiveInfo::KindLong:
667
+ {
668
+ Ice::Long l;
669
+ is->read(l);
670
+ val = callRuby(rb_ll2inum, l);
671
+ break;
672
+ }
673
+ case PrimitiveInfo::KindFloat:
674
+ {
675
+ Ice::Float f;
676
+ is->read(f);
677
+ val = callRuby(rb_float_new, f);
678
+ break;
679
+ }
680
+ case PrimitiveInfo::KindDouble:
681
+ {
682
+ Ice::Double d;
683
+ is->read(d);
684
+ val = callRuby(rb_float_new, d);
685
+ break;
686
+ }
687
+ case PrimitiveInfo::KindString:
688
+ {
689
+ string str;
690
+ #ifdef HAVE_RUBY_ENCODING_H
691
+ is->read(str, false); // Bypass string conversion.
692
+ #else
693
+ is->read(str, true);
694
+ #endif
695
+ val = createString(str);
696
+ break;
697
+ }
698
+ }
699
+ cb->unmarshaled(val, target, closure);
700
+ }
701
+
702
+ void
703
+ IceRuby::PrimitiveInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory*)
704
+ {
705
+ switch(kind)
706
+ {
707
+ case PrimitiveInfo::KindBool:
708
+ {
709
+ out << (RTEST(value) ? "true" : "false");
710
+ break;
711
+ }
712
+ case PrimitiveInfo::KindByte:
713
+ case PrimitiveInfo::KindShort:
714
+ case PrimitiveInfo::KindInt:
715
+ {
716
+ out << getInteger(value);
717
+ break;
718
+ }
719
+ case PrimitiveInfo::KindLong:
720
+ {
721
+ Ice::Long l = getLong(value);
722
+ out << IceUtilInternal::int64ToString(l);
723
+ break;
724
+ }
725
+ case PrimitiveInfo::KindFloat:
726
+ case PrimitiveInfo::KindDouble:
727
+ {
728
+ double d = toDouble(value);
729
+ out << d;
730
+ break;
731
+ }
732
+ case PrimitiveInfo::KindString:
733
+ {
734
+ out << "'" << getString(value) << "'";
735
+ break;
736
+ }
737
+ }
738
+ }
739
+
740
+ double
741
+ IceRuby::PrimitiveInfo::toDouble(VALUE v)
742
+ {
743
+ volatile VALUE val = callRuby(rb_Float, v);
744
+ if(NIL_P(val))
745
+ {
746
+ throw RubyException(rb_eTypeError, "unable to convert value to a double");
747
+ }
748
+ assert(TYPE(val) == T_FLOAT);
749
+ return RFLOAT_VALUE(val);
750
+ }
751
+
752
+ //
753
+ // EnumInfo implementation.
754
+ //
755
+
756
+ namespace
757
+ {
758
+ struct EnumDefinitionIterator : public IceRuby::HashIterator
759
+ {
760
+ EnumDefinitionIterator() :
761
+ maxValue(0)
762
+ {
763
+ }
764
+
765
+ virtual void element(VALUE key, VALUE value)
766
+ {
767
+ const Ice::Int v = static_cast<Ice::Int>(getInteger(key));
768
+ assert(enumerators.find(v) == enumerators.end());
769
+ enumerators[v] = value;
770
+
771
+ if(v > maxValue)
772
+ {
773
+ maxValue = v;
774
+ }
775
+ }
776
+
777
+ Ice::Int maxValue;
778
+ IceRuby::EnumeratorMap enumerators;
779
+ };
780
+ }
781
+
782
+ IceRuby::EnumInfo::EnumInfo(VALUE ident, VALUE t, VALUE e) :
783
+ rubyClass(t), maxValue(0)
784
+ {
785
+ const_cast<string&>(id) = getString(ident);
786
+
787
+ EnumDefinitionIterator iter;
788
+ hashIterate(e, iter);
789
+
790
+ const_cast<Ice::Int&>(maxValue) = iter.maxValue;
791
+ const_cast<EnumeratorMap&>(enumerators) = iter.enumerators;
792
+ }
793
+
794
+ string
795
+ IceRuby::EnumInfo::getId() const
796
+ {
797
+ return id;
798
+ }
799
+
800
+ bool
801
+ IceRuby::EnumInfo::validate(VALUE val)
802
+ {
803
+ return callRuby(rb_obj_is_instance_of, val, rubyClass) == Qtrue;
804
+ }
805
+
806
+ bool
807
+ IceRuby::EnumInfo::variableLength() const
808
+ {
809
+ return true;
810
+ }
811
+
812
+ int
813
+ IceRuby::EnumInfo::wireSize() const
814
+ {
815
+ return 1;
816
+ }
817
+
818
+ Ice::OptionalFormat
819
+ IceRuby::EnumInfo::optionalFormat() const
820
+ {
821
+ return Ice::OptionalFormatSize;
822
+ }
823
+
824
+ void
825
+ IceRuby::EnumInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap*, bool)
826
+ {
827
+ assert(callRuby(rb_obj_is_instance_of, p, rubyClass) == Qtrue); // validate() should have caught this.
828
+
829
+ //
830
+ // Validate value.
831
+ //
832
+ volatile VALUE val = callRuby(rb_iv_get, p, "@value");
833
+ const Ice::Int ival = static_cast<Ice::Int>(getInteger(val));
834
+ if(enumerators.find(ival) == enumerators.end())
835
+ {
836
+ throw RubyException(rb_eRangeError, "invalid enumerator %ld for enum %s", ival, id.c_str());
837
+ }
838
+
839
+ os->writeEnum(ival, maxValue);
840
+ }
841
+
842
+ void
843
+ IceRuby::EnumInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target, void* closure,
844
+ bool)
845
+ {
846
+ Ice::Int val = is->readEnum(maxValue);
847
+
848
+ EnumeratorMap::const_iterator p = enumerators.find(val);
849
+ if(p == enumerators.end())
850
+ {
851
+ ostringstream ostr;
852
+ ostr << "invalid enumerator " << val << " for enum " << id;
853
+ throw Ice::MarshalException(__FILE__, __LINE__, ostr.str());
854
+ }
855
+
856
+ cb->unmarshaled(p->second, target, closure);
857
+ }
858
+
859
+ void
860
+ IceRuby::EnumInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory*)
861
+ {
862
+ if(!validate(value))
863
+ {
864
+ out << "<invalid value - expected " << id << ">";
865
+ return;
866
+ }
867
+ volatile VALUE str = callRuby(rb_funcall, value, rb_intern("inspect"), 0);
868
+ out << getString(str);
869
+ }
870
+
871
+ //
872
+ // DataMember implementation.
873
+ //
874
+ void
875
+ IceRuby::DataMember::unmarshaled(VALUE val, VALUE target, void*)
876
+ {
877
+ callRuby(rb_ivar_set, target, rubyID, val);
878
+ }
879
+
880
+ static void
881
+ convertDataMembers(VALUE members, DataMemberList& reqMembers, DataMemberList& optMembers, bool allowOptional)
882
+ {
883
+ list<DataMemberPtr> optList;
884
+
885
+ volatile VALUE arr = callRuby(rb_check_array_type, members);
886
+ assert(!NIL_P(arr));
887
+ for(long i = 0; i < RARRAY_LEN(arr); ++i)
888
+ {
889
+ volatile VALUE m = callRuby(rb_check_array_type, RARRAY_AREF(arr, i));
890
+ assert(!NIL_P(m));
891
+ assert(RARRAY_LEN(m) == (allowOptional ? 4 : 2));
892
+
893
+ DataMemberPtr member = new DataMember;
894
+
895
+ member->name = getString(RARRAY_AREF(m, 0));
896
+ member->type = getType(RARRAY_AREF(m, 1));
897
+ string s = "@" + member->name;
898
+ member->rubyID = rb_intern(s.c_str());
899
+
900
+ if(allowOptional)
901
+ {
902
+ member->optional = RTEST(RARRAY_AREF(m, 2));
903
+ member->tag = static_cast<int>(getInteger(RARRAY_AREF(m, 3)));
904
+ }
905
+ else
906
+ {
907
+ member->optional = false;
908
+ member->tag = 0;
909
+ }
910
+
911
+ if(member->optional)
912
+ {
913
+ optList.push_back(member);
914
+ }
915
+ else
916
+ {
917
+ reqMembers.push_back(member);
918
+ }
919
+ }
920
+
921
+ if(allowOptional)
922
+ {
923
+ class SortFn
924
+ {
925
+ public:
926
+ static bool compare(const DataMemberPtr& lhs, const DataMemberPtr& rhs)
927
+ {
928
+ return lhs->tag < rhs->tag;
929
+ }
930
+ };
931
+
932
+ optList.sort(SortFn::compare);
933
+ copy(optList.begin(), optList.end(), back_inserter(optMembers));
934
+ }
935
+ }
936
+
937
+ //
938
+ // StructInfo implementation.
939
+ //
940
+ IceRuby::StructInfo::StructInfo(VALUE ident, VALUE t, VALUE m) :
941
+ rubyClass(t), _nullMarshalValue(Qnil)
942
+ {
943
+ const_cast<string&>(id) = getString(ident);
944
+
945
+ DataMemberList opt;
946
+ convertDataMembers(m, const_cast<DataMemberList&>(members), opt, false);
947
+ assert(opt.empty());
948
+
949
+ _variableLength = false;
950
+ _wireSize = 0;
951
+ for(DataMemberList::const_iterator p = members.begin(); p != members.end(); ++p)
952
+ {
953
+ if(!_variableLength && (*p)->type->variableLength())
954
+ {
955
+ _variableLength = true;
956
+ }
957
+ _wireSize += (*p)->type->wireSize();
958
+ }
959
+ }
960
+
961
+ string
962
+ IceRuby::StructInfo::getId() const
963
+ {
964
+ return id;
965
+ }
966
+
967
+ bool
968
+ IceRuby::StructInfo::validate(VALUE val)
969
+ {
970
+ return NIL_P(val) || callRuby(rb_obj_is_kind_of, val, rubyClass) == Qtrue;
971
+ }
972
+
973
+ bool
974
+ IceRuby::StructInfo::variableLength() const
975
+ {
976
+ return _variableLength;
977
+ }
978
+
979
+ int
980
+ IceRuby::StructInfo::wireSize() const
981
+ {
982
+ return _wireSize;
983
+ }
984
+
985
+ Ice::OptionalFormat
986
+ IceRuby::StructInfo::optionalFormat() const
987
+ {
988
+ return _variableLength ? Ice::OptionalFormatFSize : Ice::OptionalFormatVSize;
989
+ }
990
+
991
+ bool
992
+ IceRuby::StructInfo::usesClasses() const
993
+ {
994
+ for(DataMemberList::const_iterator p = members.begin(); p != members.end(); ++p)
995
+ {
996
+ if((*p)->type->usesClasses())
997
+ {
998
+ return true;
999
+ }
1000
+ }
1001
+
1002
+ return false;
1003
+ }
1004
+
1005
+ void
1006
+ IceRuby::StructInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap* objectMap, bool optional)
1007
+ {
1008
+ assert(NIL_P(p) || callRuby(rb_obj_is_kind_of, p, rubyClass) == Qtrue); // validate() should have caught this.
1009
+
1010
+ if(NIL_P(p))
1011
+ {
1012
+ if(NIL_P(_nullMarshalValue))
1013
+ {
1014
+ _nullMarshalValue = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), rubyClass);
1015
+ rb_gc_register_address(&_nullMarshalValue); // Prevent garbage collection
1016
+ }
1017
+ p = _nullMarshalValue;
1018
+ }
1019
+
1020
+ Ice::OutputStream::size_type sizePos = 0;
1021
+ if(optional)
1022
+ {
1023
+ if(_variableLength)
1024
+ {
1025
+ sizePos = os->startSize();
1026
+ }
1027
+ else
1028
+ {
1029
+ os->writeSize(_wireSize);
1030
+ }
1031
+ }
1032
+
1033
+ for(DataMemberList::const_iterator q = members.begin(); q != members.end(); ++q)
1034
+ {
1035
+ DataMemberPtr member = *q;
1036
+ volatile VALUE val = callRuby(rb_ivar_get, p, member->rubyID);
1037
+ if(!member->type->validate(val))
1038
+ {
1039
+ throw RubyException(rb_eTypeError, "invalid value for %s member `%s'", const_cast<char*>(id.c_str()),
1040
+ member->name.c_str());
1041
+ }
1042
+ member->type->marshal(val, os, objectMap, false);
1043
+ }
1044
+
1045
+ if(optional && _variableLength)
1046
+ {
1047
+ os->endSize(sizePos);
1048
+ }
1049
+ }
1050
+
1051
+ void
1052
+ IceRuby::StructInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
1053
+ void* closure, bool optional)
1054
+ {
1055
+ volatile VALUE obj = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), rubyClass);
1056
+
1057
+ if(optional)
1058
+ {
1059
+ if(_variableLength)
1060
+ {
1061
+ is->skip(4);
1062
+ }
1063
+ else
1064
+ {
1065
+ is->skipSize();
1066
+ }
1067
+ }
1068
+
1069
+ for(DataMemberList::const_iterator q = members.begin(); q != members.end(); ++q)
1070
+ {
1071
+ DataMemberPtr member = *q;
1072
+ member->type->unmarshal(is, member, obj, 0, false);
1073
+ }
1074
+
1075
+ cb->unmarshaled(obj, target, closure);
1076
+ }
1077
+
1078
+ void
1079
+ IceRuby::StructInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
1080
+ {
1081
+ if(!validate(value))
1082
+ {
1083
+ out << "<invalid value - expected " << id << ">";
1084
+ return;
1085
+ }
1086
+
1087
+ if(NIL_P(value))
1088
+ {
1089
+ out << "<nil>";
1090
+ }
1091
+ else
1092
+ {
1093
+ out.sb();
1094
+ for(DataMemberList::const_iterator q = members.begin(); q != members.end(); ++q)
1095
+ {
1096
+ DataMemberPtr member = *q;
1097
+ out << nl << member->name << " = ";
1098
+ if(callRuby(rb_ivar_defined, value, member->rubyID) == Qfalse)
1099
+ {
1100
+ out << "<not defined>";
1101
+ }
1102
+ else
1103
+ {
1104
+ volatile VALUE val = callRuby(rb_ivar_get, value, member->rubyID);
1105
+ member->type->print(val, out, history);
1106
+ }
1107
+ }
1108
+ out.eb();
1109
+ }
1110
+ }
1111
+
1112
+ void
1113
+ IceRuby::StructInfo::destroy()
1114
+ {
1115
+ for(DataMemberList::const_iterator p = members.begin(); p != members.end(); ++p)
1116
+ {
1117
+ (*p)->type->destroy();
1118
+ }
1119
+ const_cast<DataMemberList&>(members).clear();
1120
+ if(!NIL_P(_nullMarshalValue))
1121
+ {
1122
+ rb_gc_unregister_address(&_nullMarshalValue); // Prevent garbage collection
1123
+ _nullMarshalValue = Qnil;
1124
+ }
1125
+ }
1126
+
1127
+ //
1128
+ // SequenceInfo implementation.
1129
+ //
1130
+ IceRuby::SequenceInfo::SequenceInfo(VALUE ident, VALUE t)
1131
+ {
1132
+ const_cast<string&>(id) = getString(ident);
1133
+ const_cast<TypeInfoPtr&>(elementType) = getType(t);
1134
+ }
1135
+
1136
+ string
1137
+ IceRuby::SequenceInfo::getId() const
1138
+ {
1139
+ return id;
1140
+ }
1141
+
1142
+ bool
1143
+ IceRuby::SequenceInfo::validate(VALUE val)
1144
+ {
1145
+ //
1146
+ // Accept nil, an array, a string (for sequence<byte>), or any object that responds to to_ary.
1147
+ //
1148
+ if(NIL_P(val) || TYPE(val) == T_ARRAY)
1149
+ {
1150
+ return true;
1151
+ }
1152
+ if(TYPE(val) == T_STRING)
1153
+ {
1154
+ PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
1155
+ if(pi && pi->kind == PrimitiveInfo::KindByte)
1156
+ {
1157
+ return true;
1158
+ }
1159
+ }
1160
+ ID rbid = rb_intern("to_ary");
1161
+ return callRuby(rb_respond_to, val, rbid) != 0;
1162
+ }
1163
+
1164
+ bool
1165
+ IceRuby::SequenceInfo::variableLength() const
1166
+ {
1167
+ return true;
1168
+ }
1169
+
1170
+ int
1171
+ IceRuby::SequenceInfo::wireSize() const
1172
+ {
1173
+ return 1;
1174
+ }
1175
+
1176
+ Ice::OptionalFormat
1177
+ IceRuby::SequenceInfo::optionalFormat() const
1178
+ {
1179
+ return elementType->variableLength() ? Ice::OptionalFormatFSize : Ice::OptionalFormatVSize;
1180
+ }
1181
+
1182
+ bool
1183
+ IceRuby::SequenceInfo::usesClasses() const
1184
+ {
1185
+ return elementType->usesClasses();
1186
+ }
1187
+
1188
+ void
1189
+ IceRuby::SequenceInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap* objectMap, bool optional)
1190
+ {
1191
+ PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
1192
+
1193
+ volatile VALUE arr = Qnil;
1194
+
1195
+ Ice::OutputStream::size_type sizePos = 0;
1196
+ if(optional)
1197
+ {
1198
+ if(elementType->variableLength())
1199
+ {
1200
+ sizePos = os->startSize();
1201
+ }
1202
+ else if(elementType->wireSize() > 1)
1203
+ {
1204
+ //
1205
+ // Determine the sequence size.
1206
+ //
1207
+ int sz = 0;
1208
+ if(!NIL_P(p))
1209
+ {
1210
+ if(TYPE(p) == T_ARRAY)
1211
+ {
1212
+ sz = static_cast<int>(RARRAY_LEN(p));
1213
+ }
1214
+ else
1215
+ {
1216
+ arr = callRuby(rb_Array, p);
1217
+ if(NIL_P(arr))
1218
+ {
1219
+ throw RubyException(rb_eTypeError, "unable to convert value to an array");
1220
+ }
1221
+ sz = static_cast<int>(RARRAY_LEN(arr));
1222
+ }
1223
+ }
1224
+ os->writeSize(sz == 0 ? 1 : sz * elementType->wireSize() + (sz > 254 ? 5 : 1));
1225
+ }
1226
+ }
1227
+
1228
+ if(NIL_P(p))
1229
+ {
1230
+ os->writeSize(0);
1231
+ }
1232
+ else if(pi)
1233
+ {
1234
+ marshalPrimitiveSequence(pi, p, os);
1235
+ }
1236
+ else
1237
+ {
1238
+ if(NIL_P(arr))
1239
+ {
1240
+ arr = callRuby(rb_Array, p);
1241
+ if(NIL_P(arr))
1242
+ {
1243
+ throw RubyException(rb_eTypeError, "unable to convert value to an array");
1244
+ }
1245
+ }
1246
+
1247
+ long sz = RARRAY_LEN(arr);
1248
+ os->writeSize(static_cast<Ice::Int>(sz));
1249
+ for(long i = 0; i < sz; ++i)
1250
+ {
1251
+ if(!elementType->validate(RARRAY_AREF(arr, i)))
1252
+ {
1253
+ throw RubyException(rb_eTypeError, "invalid value for element %ld of `%s'", i,
1254
+ const_cast<char*>(id.c_str()));
1255
+ }
1256
+ elementType->marshal(RARRAY_AREF(arr, i), os, objectMap, false);
1257
+ }
1258
+ }
1259
+
1260
+ if(optional && elementType->variableLength())
1261
+ {
1262
+ os->endSize(sizePos);
1263
+ }
1264
+ }
1265
+
1266
+ void
1267
+ IceRuby::SequenceInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
1268
+ void* closure, bool optional)
1269
+ {
1270
+ if(optional)
1271
+ {
1272
+ if(elementType->variableLength())
1273
+ {
1274
+ is->skip(4);
1275
+ }
1276
+ else if(elementType->wireSize() > 1)
1277
+ {
1278
+ is->skipSize();
1279
+ }
1280
+ }
1281
+
1282
+ PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
1283
+ if(pi)
1284
+ {
1285
+ unmarshalPrimitiveSequence(pi, is, cb, target, closure);
1286
+ return;
1287
+ }
1288
+
1289
+ Ice::Int sz = is->readSize();
1290
+ volatile VALUE arr = createArray(sz);
1291
+
1292
+ for(Ice::Int i = 0; i < sz; ++i)
1293
+ {
1294
+ void* cl = reinterpret_cast<void*>(i);
1295
+ elementType->unmarshal(is, this, arr, cl, false);
1296
+ }
1297
+
1298
+ cb->unmarshaled(arr, target, closure);
1299
+ }
1300
+
1301
+ void
1302
+ IceRuby::SequenceInfo::unmarshaled(VALUE val, VALUE target, void* closure)
1303
+ {
1304
+ #ifdef ICE_64
1305
+ long i = static_cast<long>(reinterpret_cast<long long>(closure));
1306
+ #else
1307
+ long i = reinterpret_cast<long>(closure);
1308
+ #endif
1309
+ RARRAY_ASET(target, i, val);
1310
+ }
1311
+
1312
+ void
1313
+ IceRuby::SequenceInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
1314
+ {
1315
+ if(!validate(value))
1316
+ {
1317
+ out << "<invalid value - expected " << id << ">";
1318
+ return;
1319
+ }
1320
+
1321
+ if(NIL_P(value))
1322
+ {
1323
+ out << "{}";
1324
+ }
1325
+ else
1326
+ {
1327
+ if(TYPE(value) == T_STRING)
1328
+ {
1329
+ PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
1330
+ if(pi && pi->kind == PrimitiveInfo::KindByte)
1331
+ {
1332
+ out << "'" << escapeString(getString(value)) << "'";
1333
+ return;
1334
+ }
1335
+ }
1336
+
1337
+ volatile VALUE arr = callRuby(rb_Array, value);
1338
+ if(NIL_P(arr))
1339
+ {
1340
+ throw RubyException(rb_eTypeError, "unable to convert value to an array");
1341
+ }
1342
+
1343
+ long sz = RARRAY_LEN(arr);
1344
+
1345
+ out.sb();
1346
+ for(long i = 0; i < sz; ++i)
1347
+ {
1348
+ out << nl << '[' << i << "] = ";
1349
+ elementType->print(RARRAY_AREF(arr, i), out, history);
1350
+ }
1351
+ out.eb();
1352
+ }
1353
+ }
1354
+
1355
+ void
1356
+ IceRuby::SequenceInfo::destroy()
1357
+ {
1358
+ if(elementType)
1359
+ {
1360
+ elementType->destroy();
1361
+ const_cast<TypeInfoPtr&>(elementType) = 0;
1362
+ }
1363
+ }
1364
+
1365
+ void
1366
+ IceRuby::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, VALUE p, Ice::OutputStream* os)
1367
+ {
1368
+ volatile VALUE arr = Qnil;
1369
+ volatile VALUE str = Qnil;
1370
+
1371
+ //
1372
+ // Accept a string or an array for sequence<byte>.
1373
+ //
1374
+ if(pi->kind == PrimitiveInfo::KindByte)
1375
+ {
1376
+ if(TYPE(p) == T_STRING)
1377
+ {
1378
+ str = p;
1379
+ }
1380
+ else
1381
+ {
1382
+ arr = callRuby(rb_Array, p);
1383
+ if(NIL_P(arr))
1384
+ {
1385
+ throw RubyException(rb_eTypeError, "argument is not a string or an array");
1386
+ }
1387
+ }
1388
+ }
1389
+ else
1390
+ {
1391
+ arr = callRuby(rb_Array, p);
1392
+ if(NIL_P(arr))
1393
+ {
1394
+ throw RubyException(rb_eTypeError, "unable to convert value to an array");
1395
+ }
1396
+ }
1397
+
1398
+ switch(pi->kind)
1399
+ {
1400
+ case PrimitiveInfo::KindBool:
1401
+ {
1402
+ long sz = RARRAY_LEN(arr);
1403
+ Ice::BoolSeq seq(static_cast<size_t>(sz));
1404
+ for(long i = 0; i < sz; ++i)
1405
+ {
1406
+ seq[static_cast<size_t>(i)] = RTEST(RARRAY_AREF(arr, i));
1407
+ }
1408
+ os->write(seq);
1409
+ break;
1410
+ }
1411
+ case PrimitiveInfo::KindByte:
1412
+ {
1413
+ if(!NIL_P(str))
1414
+ {
1415
+ const char* s = RSTRING_PTR(str);
1416
+ const long len = RSTRING_LEN(str);
1417
+ if(s == 0 || len == 0)
1418
+ {
1419
+ os->write(Ice::Int(0));
1420
+ }
1421
+ else
1422
+ {
1423
+ os->write(reinterpret_cast<const Ice::Byte*>(s), reinterpret_cast<const Ice::Byte*>(s + len));
1424
+ }
1425
+ }
1426
+ else
1427
+ {
1428
+ long sz = RARRAY_LEN(arr);
1429
+ Ice::ByteSeq seq(static_cast<size_t>(sz));
1430
+ for(long i = 0; i < sz; ++i)
1431
+ {
1432
+ long val = getInteger(RARRAY_AREF(arr, i));
1433
+ if(val < 0 || val > 255)
1434
+ {
1435
+ throw RubyException(rb_eTypeError, "invalid value for element %ld of sequence<byte>", i);
1436
+ }
1437
+ seq[static_cast<size_t>(i)] = static_cast<Ice::Byte>(val);
1438
+ }
1439
+ os->write(seq);
1440
+ }
1441
+ break;
1442
+ }
1443
+ case PrimitiveInfo::KindShort:
1444
+ {
1445
+ long sz = RARRAY_LEN(arr);
1446
+ Ice::ShortSeq seq(static_cast<size_t>(sz));
1447
+ for(long i = 0; i < sz; ++i)
1448
+ {
1449
+ long val = getInteger(RARRAY_AREF(arr, i));
1450
+ if(val < SHRT_MIN || val > SHRT_MAX)
1451
+ {
1452
+ throw RubyException(rb_eTypeError, "invalid value for element %ld of sequence<short>", i);
1453
+ }
1454
+ seq[static_cast<size_t>(i)] = static_cast<Ice::Short>(val);
1455
+ }
1456
+ os->write(seq);
1457
+ break;
1458
+ }
1459
+ case PrimitiveInfo::KindInt:
1460
+ {
1461
+ long sz = RARRAY_LEN(arr);
1462
+ Ice::IntSeq seq(static_cast<size_t>(sz));
1463
+ for(long i = 0; i < sz; ++i)
1464
+ {
1465
+ long val = getInteger(RARRAY_AREF(arr, i));
1466
+ if(val < INT_MIN || val > INT_MAX)
1467
+ {
1468
+ throw RubyException(rb_eTypeError, "invalid value for element %ld of sequence<int>", i);
1469
+ }
1470
+ seq[static_cast<size_t>(i)] = static_cast<Ice::Int>(val);
1471
+ }
1472
+ os->write(seq);
1473
+ break;
1474
+ }
1475
+ case PrimitiveInfo::KindLong:
1476
+ {
1477
+ long sz = RARRAY_LEN(arr);
1478
+ Ice::LongSeq seq(static_cast<size_t>(sz));
1479
+ for(long i = 0; i < sz; ++i)
1480
+ {
1481
+ seq[static_cast<size_t>(i)] = getLong(RARRAY_AREF(arr, i));
1482
+ }
1483
+ os->write(seq);
1484
+ break;
1485
+ }
1486
+ case PrimitiveInfo::KindFloat:
1487
+ {
1488
+ long sz = RARRAY_LEN(arr);
1489
+ Ice::FloatSeq seq(static_cast<size_t>(sz));
1490
+ for(long i = 0; i < sz; ++i)
1491
+ {
1492
+ volatile VALUE v = callRuby(rb_Float, RARRAY_AREF(arr, i));
1493
+ if(NIL_P(v))
1494
+ {
1495
+ throw RubyException(rb_eTypeError, "unable to convert array element %ld to a float", i);
1496
+ }
1497
+ assert(TYPE(v) == T_FLOAT);
1498
+ seq[static_cast<size_t>(i)] = static_cast<Ice::Float>(RFLOAT_VALUE(v));
1499
+ }
1500
+ os->write(seq);
1501
+ break;
1502
+ }
1503
+ case PrimitiveInfo::KindDouble:
1504
+ {
1505
+ long sz = RARRAY_LEN(arr);
1506
+ Ice::DoubleSeq seq(static_cast<size_t>(sz));
1507
+ for(long i = 0; i < sz; ++i)
1508
+ {
1509
+ volatile VALUE v = callRuby(rb_Float, RARRAY_AREF(arr, i));
1510
+ if(NIL_P(v))
1511
+ {
1512
+ throw RubyException(rb_eTypeError, "unable to convert array element %ld to a double", i);
1513
+ }
1514
+ assert(TYPE(v) == T_FLOAT);
1515
+ seq[static_cast<size_t>(i)] = RFLOAT_VALUE(v);
1516
+ }
1517
+ os->write(seq);
1518
+ break;
1519
+ }
1520
+ case PrimitiveInfo::KindString:
1521
+ {
1522
+ long sz = RARRAY_LEN(arr);
1523
+ Ice::StringSeq seq(static_cast<size_t>(sz));
1524
+ for(long i = 0; i < sz; ++i)
1525
+ {
1526
+ seq[static_cast<size_t>(i)] = getString(RARRAY_AREF(arr, i));
1527
+ }
1528
+ if(seq.empty())
1529
+ {
1530
+ os->write(seq);
1531
+ }
1532
+ else
1533
+ {
1534
+ #ifdef HAVE_RUBY_ENCODING_H
1535
+ os->write(&seq[0], &seq[0] + seq.size(), false); // Bypass string conversion.
1536
+ #else
1537
+ os->write(&seq[0], &seq[0] + seq.size(), true);
1538
+ #endif
1539
+ }
1540
+ break;
1541
+ }
1542
+ }
1543
+ }
1544
+
1545
+ void
1546
+ IceRuby::SequenceInfo::unmarshalPrimitiveSequence(const PrimitiveInfoPtr& pi, Ice::InputStream* is,
1547
+ const UnmarshalCallbackPtr& cb, VALUE target, void* closure)
1548
+ {
1549
+ volatile VALUE result = Qnil;
1550
+
1551
+ switch(pi->kind)
1552
+ {
1553
+ case PrimitiveInfo::KindBool:
1554
+ {
1555
+ pair<const bool*, const bool*> p;
1556
+ IceUtil::ScopedArray<bool> sa;
1557
+ is->read(p, sa);
1558
+ long sz = static_cast<long>(p.second - p.first);
1559
+ result = createArray(sz);
1560
+
1561
+ if(sz > 0)
1562
+ {
1563
+ for(long i = 0; i < sz; ++i)
1564
+ {
1565
+ RARRAY_ASET(result, i, p.first[i] ? Qtrue : Qfalse);
1566
+ }
1567
+ }
1568
+ break;
1569
+ }
1570
+ case PrimitiveInfo::KindByte:
1571
+ {
1572
+ pair<const Ice::Byte*, const Ice::Byte*> p;
1573
+ is->read(p);
1574
+ result = callRuby(rb_str_new, reinterpret_cast<const char*>(p.first), static_cast<long>(p.second - p.first));
1575
+ break;
1576
+ }
1577
+ case PrimitiveInfo::KindShort:
1578
+ {
1579
+ pair<const Ice::Short*, const Ice::Short*> p;
1580
+ IceUtil::ScopedArray<Ice::Short> sa;
1581
+ is->read(p, sa);
1582
+ long sz = static_cast<long>(p.second - p.first);
1583
+ result = createArray(sz);
1584
+
1585
+ if(sz > 0)
1586
+ {
1587
+ for(long i = 0; i < sz; ++i)
1588
+ {
1589
+ RARRAY_ASET(result, i, INT2FIX(p.first[i]));
1590
+ }
1591
+ }
1592
+ break;
1593
+ }
1594
+ case PrimitiveInfo::KindInt:
1595
+ {
1596
+ pair<const Ice::Int*, const Ice::Int*> p;
1597
+ IceUtil::ScopedArray<Ice::Int> sa;
1598
+ is->read(p, sa);
1599
+ long sz = static_cast<long>(p.second - p.first);
1600
+ result = createArray(sz);
1601
+
1602
+ if(sz > 0)
1603
+ {
1604
+ for(long i = 0; i < sz; ++i)
1605
+ {
1606
+ RARRAY_ASET(result, i, INT2FIX(p.first[i]));
1607
+ }
1608
+ }
1609
+ break;
1610
+ }
1611
+ case PrimitiveInfo::KindLong:
1612
+ {
1613
+ pair<const Ice::Long*, const Ice::Long*> p;
1614
+ IceUtil::ScopedArray<Ice::Long> sa;
1615
+ is->read(p, sa);
1616
+ long sz = static_cast<long>(p.second - p.first);
1617
+ result = createArray(sz);
1618
+
1619
+ if(sz > 0)
1620
+ {
1621
+ for(long i = 0; i < sz; ++i)
1622
+ {
1623
+ RARRAY_ASET(result, i, callRuby(rb_ll2inum, p.first[i]));
1624
+ }
1625
+ }
1626
+ break;
1627
+ }
1628
+ case PrimitiveInfo::KindFloat:
1629
+ {
1630
+ pair<const Ice::Float*, const Ice::Float*> p;
1631
+ IceUtil::ScopedArray<Ice::Float> sa;
1632
+ is->read(p, sa);
1633
+ long sz = static_cast<long>(p.second - p.first);
1634
+ result = createArray(sz);
1635
+
1636
+ if(sz > 0)
1637
+ {
1638
+ for(long i = 0; i < sz; ++i)
1639
+ {
1640
+ RARRAY_ASET(result, i, callRuby(rb_float_new, p.first[i]));
1641
+ }
1642
+ }
1643
+ break;
1644
+ }
1645
+ case PrimitiveInfo::KindDouble:
1646
+ {
1647
+ pair<const Ice::Double*, const Ice::Double*> p;
1648
+ IceUtil::ScopedArray<Ice::Double> sa;
1649
+ is->read(p, sa);
1650
+ long sz = static_cast<long>(p.second - p.first);
1651
+ result = createArray(sz);
1652
+
1653
+ if(sz > 0)
1654
+ {
1655
+ for(long i = 0; i < sz; ++i)
1656
+ {
1657
+ RARRAY_ASET(result, i, callRuby(rb_float_new, p.first[i]));
1658
+ }
1659
+ }
1660
+ break;
1661
+ }
1662
+ case PrimitiveInfo::KindString:
1663
+ {
1664
+ Ice::StringSeq seq;
1665
+ #ifdef HAVE_RUBY_ENCODING_H
1666
+ is->read(seq, false); // Bypass string conversion.
1667
+ #else
1668
+ is->read(seq, true);
1669
+ #endif
1670
+ long sz = static_cast<long>(seq.size());
1671
+ result = createArray(sz);
1672
+
1673
+ for(long i = 0; i < sz; ++i)
1674
+ {
1675
+ RARRAY_ASET(result, i, createString(seq[static_cast<size_t>(i)]));
1676
+ }
1677
+ break;
1678
+ }
1679
+ }
1680
+ cb->unmarshaled(result, target, closure);
1681
+ }
1682
+
1683
+ //
1684
+ // DictionaryInfo implementation.
1685
+ //
1686
+ IceRuby::DictionaryInfo::DictionaryInfo(VALUE ident, VALUE kt, VALUE vt)
1687
+ {
1688
+ const_cast<string&>(id) = getString(ident);
1689
+ const_cast<TypeInfoPtr&>(keyType) = getType(kt);
1690
+ const_cast<TypeInfoPtr&>(valueType) = getType(vt);
1691
+
1692
+ _variableLength = keyType->variableLength() || valueType->variableLength();
1693
+ _wireSize = keyType->wireSize() + valueType->wireSize();
1694
+ }
1695
+
1696
+ string
1697
+ IceRuby::DictionaryInfo::getId() const
1698
+ {
1699
+ return id;
1700
+ }
1701
+
1702
+ bool
1703
+ IceRuby::DictionaryInfo::validate(VALUE val)
1704
+ {
1705
+ //
1706
+ // Accept nil, a hash, or any object that responds to to_hash.
1707
+ //
1708
+ if(NIL_P(val) || TYPE(val) == T_HASH)
1709
+ {
1710
+ return true;
1711
+ }
1712
+ ID rbid = rb_intern("to_hash");
1713
+ return callRuby(rb_respond_to, val, rbid) != 0;
1714
+ }
1715
+
1716
+ bool
1717
+ IceRuby::DictionaryInfo::variableLength() const
1718
+ {
1719
+ return true;
1720
+ }
1721
+
1722
+ int
1723
+ IceRuby::DictionaryInfo::wireSize() const
1724
+ {
1725
+ return 1;
1726
+ }
1727
+
1728
+ Ice::OptionalFormat
1729
+ IceRuby::DictionaryInfo::optionalFormat() const
1730
+ {
1731
+ return _variableLength ? Ice::OptionalFormatFSize : Ice::OptionalFormatVSize;
1732
+ }
1733
+
1734
+ bool
1735
+ IceRuby::DictionaryInfo::usesClasses() const
1736
+ {
1737
+ return valueType->usesClasses();
1738
+ }
1739
+
1740
+ namespace
1741
+ {
1742
+ struct DictionaryMarshalIterator : public IceRuby::HashIterator
1743
+ {
1744
+ DictionaryMarshalIterator(const IceRuby::DictionaryInfoPtr& d, Ice::OutputStream* o, IceRuby::ObjectMap* m)
1745
+ : dict(d), os(o), objectMap(m)
1746
+ {
1747
+ }
1748
+
1749
+ virtual void element(VALUE key, VALUE value)
1750
+ {
1751
+ dict->marshalElement(key, value, os, objectMap);
1752
+ }
1753
+
1754
+ IceRuby::DictionaryInfoPtr dict;
1755
+ Ice::OutputStream* os;
1756
+ IceRuby::ObjectMap* objectMap;
1757
+ };
1758
+ }
1759
+
1760
+ void
1761
+ IceRuby::DictionaryInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap* objectMap, bool optional)
1762
+ {
1763
+ volatile VALUE hash = Qnil;
1764
+
1765
+ if(!NIL_P(p))
1766
+ {
1767
+ hash = callRuby(rb_convert_type, p, T_HASH, "Hash", "to_hash");
1768
+ if(NIL_P(hash))
1769
+ {
1770
+ throw RubyException(rb_eTypeError, "unable to convert value to a hash");
1771
+ }
1772
+ }
1773
+
1774
+ Ice::Int sz = 0;
1775
+ if(!NIL_P(hash))
1776
+ {
1777
+ sz = static_cast<Ice::Int>(RHASH_SIZE(hash));
1778
+ }
1779
+
1780
+ Ice::OutputStream::size_type sizePos = 0;
1781
+ if(optional)
1782
+ {
1783
+ if(_variableLength)
1784
+ {
1785
+ sizePos = os->startSize();
1786
+ }
1787
+ else
1788
+ {
1789
+ os->writeSize(sz == 0 ? 1 : sz * _wireSize + (sz > 254 ? 5 : 1));
1790
+ }
1791
+ }
1792
+
1793
+ if(NIL_P(hash))
1794
+ {
1795
+ os->writeSize(0);
1796
+ }
1797
+ else
1798
+ {
1799
+ os->writeSize(sz);
1800
+ if(sz > 0)
1801
+ {
1802
+ DictionaryMarshalIterator iter(this, os, objectMap);
1803
+ hashIterate(hash, iter);
1804
+ }
1805
+ }
1806
+
1807
+ if(optional && _variableLength)
1808
+ {
1809
+ os->endSize(sizePos);
1810
+ }
1811
+ }
1812
+
1813
+ void
1814
+ IceRuby::DictionaryInfo::marshalElement(VALUE key, VALUE value, Ice::OutputStream* os, ObjectMap* objectMap)
1815
+ {
1816
+ if(!keyType->validate(key))
1817
+ {
1818
+ throw RubyException(rb_eTypeError, "invalid key in `%s' element", const_cast<char*>(id.c_str()));
1819
+ }
1820
+
1821
+ if(!valueType->validate(value))
1822
+ {
1823
+ throw RubyException(rb_eTypeError, "invalid value in `%s' element", const_cast<char*>(id.c_str()));
1824
+ }
1825
+
1826
+ keyType->marshal(key, os, objectMap, false);
1827
+ valueType->marshal(value, os, objectMap, false);
1828
+ }
1829
+
1830
+ void
1831
+ IceRuby::DictionaryInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
1832
+ void* closure, bool optional)
1833
+ {
1834
+ if(optional)
1835
+ {
1836
+ if(_variableLength)
1837
+ {
1838
+ is->skip(4);
1839
+ }
1840
+ else
1841
+ {
1842
+ is->skipSize();
1843
+ }
1844
+ }
1845
+
1846
+ volatile VALUE hash = callRuby(rb_hash_new);
1847
+
1848
+ KeyCallbackPtr keyCB = new KeyCallback;
1849
+ keyCB->key = Qnil;
1850
+
1851
+ Ice::Int sz = is->readSize();
1852
+ for(Ice::Int i = 0; i < sz; ++i)
1853
+ {
1854
+ //
1855
+ // A dictionary key cannot be a class (or contain one), so the key must be
1856
+ // available immediately.
1857
+ //
1858
+ keyType->unmarshal(is, keyCB, Qnil, 0, false);
1859
+ assert(!NIL_P(keyCB->key));
1860
+ if (valueType->usesClasses())
1861
+ {
1862
+ // Temporarily set the entry with a Qnil value to ensure the key is not GC
1863
+ // while unmarshaling a value class
1864
+ if (RB_TYPE_P(keyCB->key, T_STRING))
1865
+ {
1866
+ // For string keys create a frozen string to ensure that the key used
1867
+ // in the map matches the one keep in the closure
1868
+ keyCB->key = rb_str_new_frozen(keyCB->key);
1869
+ }
1870
+ callRuby(rb_hash_aset, hash, keyCB->key, Qnil);
1871
+ }
1872
+ //
1873
+ // The callback will set the dictionary entry with the unmarshaled value,
1874
+ // so we pass it the key.
1875
+ //
1876
+ void* cl = reinterpret_cast<void*>(keyCB->key);
1877
+ valueType->unmarshal(is, this, hash, cl, false);
1878
+ }
1879
+
1880
+ cb->unmarshaled(hash, target, closure);
1881
+ }
1882
+
1883
+ void
1884
+ IceRuby::DictionaryInfo::unmarshaled(VALUE val, VALUE target, void* closure)
1885
+ {
1886
+ volatile VALUE key = reinterpret_cast<VALUE>(closure);
1887
+ callRuby(rb_hash_aset, target, key, val);
1888
+ }
1889
+
1890
+ namespace
1891
+ {
1892
+ struct DictionaryPrintIterator : public IceRuby::HashIterator
1893
+ {
1894
+ DictionaryPrintIterator(const DictionaryInfoPtr& d, IceUtilInternal::Output& o, PrintObjectHistory* h) :
1895
+ dict(d), out(o), history(h)
1896
+ {
1897
+ }
1898
+
1899
+ virtual void element(VALUE key, VALUE value)
1900
+ {
1901
+ dict->printElement(key, value, out, history);
1902
+ }
1903
+
1904
+ IceRuby::DictionaryInfoPtr dict;
1905
+ IceUtilInternal::Output& out;
1906
+ IceRuby::PrintObjectHistory* history;
1907
+ };
1908
+ }
1909
+
1910
+ void
1911
+ IceRuby::DictionaryInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
1912
+ {
1913
+ if(!validate(value))
1914
+ {
1915
+ out << "<invalid value - expected " << id << ">";
1916
+ return;
1917
+ }
1918
+
1919
+ if(NIL_P(value))
1920
+ {
1921
+ out << "{}";
1922
+ }
1923
+ else
1924
+ {
1925
+ volatile VALUE hash = callRuby(rb_convert_type, value, T_HASH, "Hash", "to_hash");
1926
+ if(NIL_P(hash))
1927
+ {
1928
+ throw RubyException(rb_eTypeError, "unable to convert value to a hash");
1929
+ }
1930
+
1931
+ if(RHASH_SIZE(hash) == 0)
1932
+ {
1933
+ out << "{}";
1934
+ return;
1935
+ }
1936
+
1937
+ out.sb();
1938
+ DictionaryPrintIterator iter(this, out, history);
1939
+ hashIterate(hash, iter);
1940
+ out.eb();
1941
+ }
1942
+ }
1943
+
1944
+ void
1945
+ IceRuby::DictionaryInfo::printElement(VALUE key, VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
1946
+ {
1947
+ out << nl << "key = ";
1948
+ keyType->print(key, out, history);
1949
+ out << nl << "value = ";
1950
+ valueType->print(value, out, history);
1951
+ }
1952
+
1953
+ void
1954
+ IceRuby::DictionaryInfo::KeyCallback::unmarshaled(VALUE val, VALUE, void*)
1955
+ {
1956
+ key = val;
1957
+ }
1958
+
1959
+ void
1960
+ IceRuby::DictionaryInfo::destroy()
1961
+ {
1962
+ if(keyType)
1963
+ {
1964
+ keyType->destroy();
1965
+ const_cast<TypeInfoPtr&>(keyType) = 0;
1966
+ }
1967
+ if(valueType)
1968
+ {
1969
+ valueType->destroy();
1970
+ const_cast<TypeInfoPtr&>(valueType) = 0;
1971
+ }
1972
+ }
1973
+
1974
+ //
1975
+ // ClassInfo implementation.
1976
+ //
1977
+ IceRuby::ClassInfo::ClassInfo(VALUE ident, bool loc) :
1978
+ compactId(-1), isBase(false), isLocal(loc), preserve(false), interface(false), rubyClass(Qnil), typeObj(Qnil),
1979
+ defined(false)
1980
+ {
1981
+ const_cast<string&>(id) = getString(ident);
1982
+ if(isLocal)
1983
+ {
1984
+ const_cast<bool&>(isBase) = id == "::Ice::LocalObject";
1985
+ }
1986
+ else
1987
+ {
1988
+ const_cast<bool&>(isBase) = id == Ice::Object::ice_staticId();
1989
+ }
1990
+ const_cast<VALUE&>(typeObj) = createType(this);
1991
+ }
1992
+
1993
+ void
1994
+ IceRuby::ClassInfo::define(VALUE t, VALUE compact, VALUE pres, VALUE intf, VALUE b, VALUE m)
1995
+ {
1996
+ if(!NIL_P(b))
1997
+ {
1998
+ const_cast<ClassInfoPtr&>(base) = ClassInfoPtr::dynamicCast(getType(b));
1999
+ assert(base);
2000
+ }
2001
+
2002
+ const_cast<Ice::Int&>(compactId) = static_cast<Ice::Int>(getInteger(compact));
2003
+ const_cast<bool&>(preserve) = RTEST(pres);
2004
+ const_cast<bool&>(interface) = RTEST(intf);
2005
+ convertDataMembers(m, const_cast<DataMemberList&>(members), const_cast<DataMemberList&>(optionalMembers), true);
2006
+ const_cast<VALUE&>(rubyClass) = t;
2007
+ const_cast<bool&>(defined) = true;
2008
+ }
2009
+
2010
+ string
2011
+ IceRuby::ClassInfo::getId() const
2012
+ {
2013
+ return id;
2014
+ }
2015
+
2016
+ bool
2017
+ IceRuby::ClassInfo::validate(VALUE val)
2018
+ {
2019
+ if(NIL_P(val))
2020
+ {
2021
+ return true;
2022
+ }
2023
+
2024
+ //
2025
+ // We consider an object to be an instance of this class if its class contains
2026
+ // an ICE_TYPE constant that refers to this class, or a subclass of this class.
2027
+ //
2028
+ volatile VALUE cls = CLASS_OF(val);
2029
+ volatile VALUE type = Qnil;
2030
+ try
2031
+ {
2032
+ type = callRuby(rb_const_get, cls, rb_intern("ICE_TYPE"));
2033
+ }
2034
+ catch(const RubyException& ex)
2035
+ {
2036
+ if(callRuby(rb_obj_is_instance_of, ex.ex, rb_eNameError) == Qtrue)
2037
+ {
2038
+ //
2039
+ // The ICE_TYPE constant will be missing from an instance of LocalObject
2040
+ // if it does not implement a user-defined type. This means the user
2041
+ // could potentially pass any kind of object; there isn't much we can do
2042
+ // since LocalObject maps to the base object type.
2043
+ //
2044
+ return id == "::Ice::LocalObject";
2045
+ }
2046
+ else
2047
+ {
2048
+ throw;
2049
+ }
2050
+ }
2051
+ assert(!NIL_P(type));
2052
+ ClassInfoPtr info = ClassInfoPtr::dynamicCast(getType(type));
2053
+ assert(info);
2054
+ return this->interface || info->isA(this);
2055
+ }
2056
+
2057
+ bool
2058
+ IceRuby::ClassInfo::variableLength() const
2059
+ {
2060
+ return true;
2061
+ }
2062
+
2063
+ int
2064
+ IceRuby::ClassInfo::wireSize() const
2065
+ {
2066
+ return 1;
2067
+ }
2068
+
2069
+ Ice::OptionalFormat
2070
+ IceRuby::ClassInfo::optionalFormat() const
2071
+ {
2072
+ return Ice::OptionalFormatClass;
2073
+ }
2074
+
2075
+ bool
2076
+ IceRuby::ClassInfo::usesClasses() const
2077
+ {
2078
+ return true;
2079
+ }
2080
+
2081
+ void
2082
+ IceRuby::ClassInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap* objectMap, bool)
2083
+ {
2084
+ if(!defined)
2085
+ {
2086
+ throw RubyException(rb_eRuntimeError, "class %s is declared but not defined", id.c_str());
2087
+ }
2088
+
2089
+ if(NIL_P(p))
2090
+ {
2091
+ Ice::ObjectPtr nil;
2092
+ os->write(nil);
2093
+ return;
2094
+ }
2095
+
2096
+ //
2097
+ // Ice::ObjectWriter is a subclass of Ice::Object that wraps a Ruby object for marshaling.
2098
+ // It is possible that this Ruby object has already been marshaled, therefore we first must
2099
+ // check the object map to see if this object is present. If so, we use the existing ObjectWriter,
2100
+ // otherwise we create a new one.
2101
+ //
2102
+ Ice::ObjectPtr writer;
2103
+ assert(objectMap);
2104
+ ObjectMap::iterator q = objectMap->find(p);
2105
+ if(q == objectMap->end())
2106
+ {
2107
+ writer = new ObjectWriter(p, objectMap, this);
2108
+ objectMap->insert(ObjectMap::value_type(p, writer));
2109
+ }
2110
+ else
2111
+ {
2112
+ writer = q->second;
2113
+ }
2114
+
2115
+ //
2116
+ // Give the writer to the stream. The stream will eventually call write() on it.
2117
+ //
2118
+ os->write(writer);
2119
+ }
2120
+
2121
+ namespace
2122
+ {
2123
+
2124
+ void
2125
+ patchObject(void* addr, const Ice::ObjectPtr& v)
2126
+ {
2127
+ ReadObjectCallback* cb = static_cast<ReadObjectCallback*>(addr);
2128
+ assert(cb);
2129
+ cb->invoke(v);
2130
+ }
2131
+
2132
+ }
2133
+
2134
+ void
2135
+ IceRuby::ClassInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target, void* closure, bool)
2136
+ {
2137
+ if(!defined)
2138
+ {
2139
+ throw RubyException(rb_eRuntimeError, "class %s is declared but not defined", id.c_str());
2140
+ }
2141
+
2142
+ //
2143
+ // This callback is notified when the Slice value is actually read. The StreamUtil object
2144
+ // attached to the stream keeps a reference to the callback object to ensure it lives
2145
+ // long enough.
2146
+ //
2147
+ ReadObjectCallbackPtr rocb = new ReadObjectCallback(this, cb, target, closure);
2148
+ StreamUtil* util = reinterpret_cast<StreamUtil*>(is->getClosure());
2149
+ assert(util);
2150
+ util->add(rocb);
2151
+ is->read(patchObject, rocb.get());
2152
+ }
2153
+
2154
+ void
2155
+ IceRuby::ClassInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
2156
+ {
2157
+ if(!validate(value))
2158
+ {
2159
+ out << "<invalid value - expected " << id << ">";
2160
+ return;
2161
+ }
2162
+
2163
+ if(NIL_P(value))
2164
+ {
2165
+ out << "<nil>";
2166
+ }
2167
+ else
2168
+ {
2169
+ map<VALUE, int>::iterator q = history->objects.find(value);
2170
+ if(q != history->objects.end())
2171
+ {
2172
+ out << "<object #" << q->second << ">";
2173
+ }
2174
+ else
2175
+ {
2176
+ volatile VALUE cls = CLASS_OF(value);
2177
+ volatile VALUE type = Qnil;
2178
+ ClassInfoPtr info;
2179
+ try
2180
+ {
2181
+ type = callRuby(rb_const_get, cls, rb_intern("ICE_TYPE"));
2182
+ info = ClassInfoPtr::dynamicCast(getType(type));
2183
+ }
2184
+ catch(const RubyException& ex)
2185
+ {
2186
+ if(callRuby(rb_obj_is_instance_of, ex.ex, rb_eNameError) == Qtrue)
2187
+ {
2188
+ //
2189
+ // The ICE_TYPE constant will be missing from an instance of LocalObject
2190
+ // if it does not implement a user-defined type. This means the user
2191
+ // could potentially pass any kind of object; there isn't much we can do
2192
+ // since LocalObject maps to the base object type.
2193
+ //
2194
+ if(id == "::Ice::LocalObject")
2195
+ {
2196
+ info = this;
2197
+ }
2198
+ else
2199
+ {
2200
+ out << "<invalid value - expected " << id << ">";
2201
+ return;
2202
+ }
2203
+ }
2204
+ else
2205
+ {
2206
+ throw;
2207
+ }
2208
+ }
2209
+ assert(info);
2210
+ out << "object #" << history->index << " (" << info->id << ')';
2211
+ history->objects.insert(map<VALUE, int>::value_type(value, history->index));
2212
+ ++history->index;
2213
+ out.sb();
2214
+ info->printMembers(value, out, history);
2215
+ out.eb();
2216
+ }
2217
+ }
2218
+ }
2219
+
2220
+ void
2221
+ IceRuby::ClassInfo::destroy()
2222
+ {
2223
+ const_cast<ClassInfoPtr&>(base) = 0;
2224
+ if(!members.empty())
2225
+ {
2226
+ DataMemberList ml = members;
2227
+ const_cast<DataMemberList&>(members).clear();
2228
+ for(DataMemberList::iterator p = ml.begin(); p != ml.end(); ++p)
2229
+ {
2230
+ (*p)->type->destroy();
2231
+ }
2232
+ }
2233
+ }
2234
+
2235
+ void
2236
+ IceRuby::ClassInfo::printMembers(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
2237
+ {
2238
+ if(base)
2239
+ {
2240
+ base->printMembers(value, out, history);
2241
+ }
2242
+
2243
+ DataMemberList::const_iterator q;
2244
+
2245
+ for(q = members.begin(); q != members.end(); ++q)
2246
+ {
2247
+ DataMemberPtr member = *q;
2248
+ out << nl << member->name << " = ";
2249
+ if(callRuby(rb_ivar_defined, value, member->rubyID) == Qfalse)
2250
+ {
2251
+ out << "<not defined>";
2252
+ }
2253
+ else
2254
+ {
2255
+ volatile VALUE val = callRuby(rb_ivar_get, value, member->rubyID);
2256
+ member->type->print(val, out, history);
2257
+ }
2258
+ }
2259
+
2260
+ for(q = optionalMembers.begin(); q != optionalMembers.end(); ++q)
2261
+ {
2262
+ DataMemberPtr member = *q;
2263
+ out << nl << member->name << " = ";
2264
+ if(callRuby(rb_ivar_defined, value, member->rubyID) == Qfalse)
2265
+ {
2266
+ out << "<not defined>";
2267
+ }
2268
+ else
2269
+ {
2270
+ volatile VALUE val = callRuby(rb_ivar_get, value, member->rubyID);
2271
+ if(val == Unset)
2272
+ {
2273
+ out << "<unset>";
2274
+ }
2275
+ else
2276
+ {
2277
+ member->type->print(val, out, history);
2278
+ }
2279
+ }
2280
+ }
2281
+ }
2282
+
2283
+ bool
2284
+ IceRuby::ClassInfo::isA(const ClassInfoPtr& info)
2285
+ {
2286
+ //
2287
+ // Return true if this class has an is-a relationship with info.
2288
+ //
2289
+ if(info->isBase && isLocal == info->isLocal)
2290
+ {
2291
+ return true;
2292
+ }
2293
+ else if(this == info.get())
2294
+ {
2295
+ return true;
2296
+ }
2297
+
2298
+ return base && base->isA(info);
2299
+ }
2300
+
2301
+ //
2302
+ // ProxyInfo implementation.
2303
+ //
2304
+ IceRuby::ProxyInfo::ProxyInfo(VALUE ident) :
2305
+ isBase(false), rubyClass(Qnil), typeObj(Qnil)
2306
+ {
2307
+ const_cast<string&>(id) = getString(ident);
2308
+ const_cast<bool&>(isBase) = id == "::Ice::Object";
2309
+ const_cast<VALUE&>(typeObj) = createType(this);
2310
+ }
2311
+
2312
+ void
2313
+ IceRuby::ProxyInfo::define(VALUE t, VALUE b, VALUE i)
2314
+ {
2315
+ if(!NIL_P(b))
2316
+ {
2317
+ const_cast<ProxyInfoPtr&>(base) = ProxyInfoPtr::dynamicCast(getType(b));
2318
+ assert(base);
2319
+ }
2320
+
2321
+ volatile VALUE arr = callRuby(rb_check_array_type, i);
2322
+ assert(!NIL_P(arr));
2323
+ for(int n = 0; n < RARRAY_LEN(arr); ++n)
2324
+ {
2325
+ ProxyInfoPtr iface = ProxyInfoPtr::dynamicCast(getType(RARRAY_AREF(arr, n)));
2326
+ assert(iface);
2327
+ const_cast<ProxyInfoList&>(interfaces).push_back(iface);
2328
+ }
2329
+
2330
+ const_cast<VALUE&>(rubyClass) = t;
2331
+ }
2332
+
2333
+ string
2334
+ IceRuby::ProxyInfo::getId() const
2335
+ {
2336
+ return id;
2337
+ }
2338
+
2339
+ bool
2340
+ IceRuby::ProxyInfo::validate(VALUE val)
2341
+ {
2342
+ if(!NIL_P(val))
2343
+ {
2344
+ if(!checkProxy(val))
2345
+ {
2346
+ return false;
2347
+ }
2348
+ volatile VALUE cls = CLASS_OF(val);
2349
+ volatile VALUE type = callRuby(rb_const_get, cls, rb_intern("ICE_TYPE"));
2350
+ assert(!NIL_P(type));
2351
+ ProxyInfoPtr info = ProxyInfoPtr::dynamicCast(getType(type));
2352
+ assert(info);
2353
+ return info->isA(this);
2354
+ }
2355
+ return true;
2356
+ }
2357
+
2358
+ bool
2359
+ IceRuby::ProxyInfo::variableLength() const
2360
+ {
2361
+ return true;
2362
+ }
2363
+
2364
+ int
2365
+ IceRuby::ProxyInfo::wireSize() const
2366
+ {
2367
+ return 1;
2368
+ }
2369
+
2370
+ Ice::OptionalFormat
2371
+ IceRuby::ProxyInfo::optionalFormat() const
2372
+ {
2373
+ return Ice::OptionalFormatFSize;
2374
+ }
2375
+
2376
+ void
2377
+ IceRuby::ProxyInfo::marshal(VALUE p, Ice::OutputStream* os, ObjectMap*, bool optional)
2378
+ {
2379
+ Ice::OutputStream::size_type sizePos = 0;
2380
+ if(optional)
2381
+ {
2382
+ sizePos = os->startSize();
2383
+ }
2384
+
2385
+ if(NIL_P(p))
2386
+ {
2387
+ os->write(Ice::ObjectPrx());
2388
+ }
2389
+ else
2390
+ {
2391
+ assert(checkProxy(p)); // validate() should have caught this.
2392
+ os->write(getProxy(p));
2393
+ }
2394
+
2395
+ if(optional)
2396
+ {
2397
+ os->endSize(sizePos);
2398
+ }
2399
+ }
2400
+
2401
+ void
2402
+ IceRuby::ProxyInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& cb, VALUE target,
2403
+ void* closure, bool optional)
2404
+ {
2405
+ if(optional)
2406
+ {
2407
+ is->skip(4);
2408
+ }
2409
+
2410
+ Ice::ObjectPrx proxy;
2411
+ is->read(proxy);
2412
+
2413
+ if(!proxy)
2414
+ {
2415
+ cb->unmarshaled(Qnil, target, closure);
2416
+ return;
2417
+ }
2418
+
2419
+ if(NIL_P(rubyClass))
2420
+ {
2421
+ throw RubyException(rb_eRuntimeError, "class %s is declared but not defined", id.c_str());
2422
+ }
2423
+
2424
+ volatile VALUE p = createProxy(proxy, rubyClass);
2425
+ cb->unmarshaled(p, target, closure);
2426
+ }
2427
+
2428
+ void
2429
+ IceRuby::ProxyInfo::print(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory*)
2430
+ {
2431
+ if(!validate(value))
2432
+ {
2433
+ out << "<invalid value - expected " << getId() << ">";
2434
+ return;
2435
+ }
2436
+
2437
+ if(NIL_P(value))
2438
+ {
2439
+ out << "<nil>";
2440
+ }
2441
+ else
2442
+ {
2443
+ out << getString(value);
2444
+ }
2445
+ }
2446
+
2447
+ bool
2448
+ IceRuby::ProxyInfo::isA(const ProxyInfoPtr& info)
2449
+ {
2450
+ //
2451
+ // Return true if this class has an is-a relationship with info.
2452
+ //
2453
+ if(info->isBase)
2454
+ {
2455
+ return true;
2456
+ }
2457
+ else if(this == info.get())
2458
+ {
2459
+ return true;
2460
+ }
2461
+ else if(base && base->isA(info))
2462
+ {
2463
+ return true;
2464
+ }
2465
+ else if(!interfaces.empty())
2466
+ {
2467
+ for(ProxyInfoList::const_iterator p = interfaces.begin(); p != interfaces.end(); ++p)
2468
+ {
2469
+ if((*p)->isA(info))
2470
+ {
2471
+ return true;
2472
+ }
2473
+ }
2474
+ }
2475
+
2476
+ return false;
2477
+ }
2478
+
2479
+ void
2480
+ IceRuby::ProxyInfo::destroy()
2481
+ {
2482
+ const_cast<ProxyInfoPtr&>(base) = 0;
2483
+ const_cast<ProxyInfoList&>(interfaces).clear();
2484
+ }
2485
+
2486
+ //
2487
+ // ObjectWriter implementation.
2488
+ //
2489
+ IceRuby::ObjectWriter::ObjectWriter(VALUE object, ObjectMap* objectMap, const ClassInfoPtr& formal) :
2490
+ _object(object), _map(objectMap), _formal(formal)
2491
+ {
2492
+ //
2493
+ // Mark the object as in use for the lifetime of this wrapper.
2494
+ //
2495
+ rb_gc_register_address(&_object);
2496
+ if(!_formal || !_formal->interface)
2497
+ {
2498
+ volatile VALUE cls = CLASS_OF(object);
2499
+ volatile VALUE type = callRuby(rb_const_get, cls, rb_intern("ICE_TYPE"));
2500
+ assert(!NIL_P(type));
2501
+ _info = ClassInfoPtr::dynamicCast(getType(type));
2502
+ assert(_info);
2503
+ }
2504
+ }
2505
+
2506
+ IceRuby::ObjectWriter::~ObjectWriter()
2507
+ {
2508
+ rb_gc_unregister_address(&_object);
2509
+ }
2510
+
2511
+ void
2512
+ IceRuby::ObjectWriter::ice_preMarshal()
2513
+ {
2514
+ ID id = rb_intern("ice_preMarshal");
2515
+ if(callRuby(rb_respond_to, _object, id))
2516
+ {
2517
+ callRuby(rb_funcall, _object, id, 0);
2518
+ }
2519
+ }
2520
+
2521
+ void
2522
+ IceRuby::ObjectWriter::_iceWrite(Ice::OutputStream* os) const
2523
+ {
2524
+ Ice::SlicedDataPtr slicedData;
2525
+
2526
+ if(_info && _info->preserve)
2527
+ {
2528
+ //
2529
+ // Retrieve the SlicedData object that we stored as a hidden member of the Ruby object.
2530
+ //
2531
+ slicedData = StreamUtil::getSlicedDataMember(_object, const_cast<ObjectMap*>(_map));
2532
+ }
2533
+
2534
+ os->startValue(slicedData);
2535
+ if(_formal && _formal->interface)
2536
+ {
2537
+ ID op = rb_intern("ice_id");
2538
+ string id = getString(callRuby(rb_funcall, _object, op, 0));
2539
+ os->startSlice(id, -1, true);
2540
+ os->endSlice();
2541
+ }
2542
+ else
2543
+ {
2544
+ if(_info->id != "::Ice::UnknownSlicedValue")
2545
+ {
2546
+ ClassInfoPtr info = _info;
2547
+ while(info)
2548
+ {
2549
+ os->startSlice(info->id, info->compactId, !info->base);
2550
+
2551
+ writeMembers(os, info->members);
2552
+ writeMembers(os, info->optionalMembers); // The optional members have already been sorted by tag.
2553
+
2554
+ os->endSlice();
2555
+
2556
+ info = info->base;
2557
+ }
2558
+ }
2559
+ }
2560
+ os->endValue();
2561
+ }
2562
+
2563
+ void
2564
+ IceRuby::ObjectWriter::_iceRead(Ice::InputStream*)
2565
+ {
2566
+ assert(false);
2567
+ }
2568
+
2569
+ void
2570
+ IceRuby::ObjectWriter::writeMembers(Ice::OutputStream* os, const DataMemberList& members) const
2571
+ {
2572
+ for(DataMemberList::const_iterator q = members.begin(); q != members.end(); ++q)
2573
+ {
2574
+ DataMemberPtr member = *q;
2575
+
2576
+ volatile VALUE val = callRuby(rb_ivar_get, _object, member->rubyID);
2577
+
2578
+ if(member->optional && (val == Unset || !os->writeOptional(member->tag, member->type->optionalFormat())))
2579
+ {
2580
+ continue;
2581
+ }
2582
+
2583
+ if(!member->type->validate(val))
2584
+ {
2585
+ throw RubyException(rb_eTypeError, "invalid value for %s member `%s'", _info->id.c_str(),
2586
+ member->name.c_str());
2587
+ }
2588
+
2589
+ member->type->marshal(val, os, _map, member->optional);
2590
+ }
2591
+ }
2592
+
2593
+ //
2594
+ // ObjectReader implementation.
2595
+ //
2596
+ IceRuby::ObjectReader::ObjectReader(VALUE object, const ClassInfoPtr& info) :
2597
+ _object(object), _info(info)
2598
+ {
2599
+ //
2600
+ // Mark the object as in use for the lifetime of this wrapper.
2601
+ //
2602
+ rb_gc_register_address(&_object);
2603
+ }
2604
+
2605
+ IceRuby::ObjectReader::~ObjectReader()
2606
+ {
2607
+ rb_gc_unregister_address(&_object);
2608
+ }
2609
+
2610
+ void
2611
+ IceRuby::ObjectReader::ice_postUnmarshal()
2612
+ {
2613
+ ID id = rb_intern("ice_postUnmarshal");
2614
+ if(callRuby(rb_respond_to, _object, id))
2615
+ {
2616
+ callRuby(rb_funcall, _object, id, 0);
2617
+ }
2618
+ }
2619
+
2620
+ void
2621
+ IceRuby::ObjectReader::_iceWrite(Ice::OutputStream*) const
2622
+ {
2623
+ assert(false);
2624
+ }
2625
+
2626
+ void
2627
+ IceRuby::ObjectReader::_iceRead(Ice::InputStream* is)
2628
+ {
2629
+ is->startValue();
2630
+
2631
+ const bool unknown = _info->id == "::Ice::UnknownSlicedValue";
2632
+
2633
+ //
2634
+ // Unmarshal the slices of a user-defined class.
2635
+ //
2636
+ if(!unknown && _info->id != Ice::Object::ice_staticId())
2637
+ {
2638
+ ClassInfoPtr info = _info;
2639
+ while(info)
2640
+ {
2641
+ is->startSlice();
2642
+
2643
+ DataMemberList::const_iterator p;
2644
+
2645
+ for(p = info->members.begin(); p != info->members.end(); ++p)
2646
+ {
2647
+ DataMemberPtr member = *p;
2648
+ member->type->unmarshal(is, member, _object, 0, false);
2649
+ }
2650
+
2651
+ //
2652
+ // The optional members have already been sorted by tag.
2653
+ //
2654
+ for(p = info->optionalMembers.begin(); p != info->optionalMembers.end(); ++p)
2655
+ {
2656
+ DataMemberPtr member = *p;
2657
+ if(is->readOptional(member->tag, member->type->optionalFormat()))
2658
+ {
2659
+ member->type->unmarshal(is, member, _object, 0, true);
2660
+ }
2661
+ else
2662
+ {
2663
+ callRuby(rb_ivar_set, _object, member->rubyID, Unset);
2664
+ }
2665
+ }
2666
+
2667
+ is->endSlice();
2668
+
2669
+ info = info->base;
2670
+ }
2671
+ }
2672
+
2673
+ _slicedData = is->endValue(_info->preserve);
2674
+
2675
+ if(_slicedData)
2676
+ {
2677
+ StreamUtil* util = reinterpret_cast<StreamUtil*>(is->getClosure());
2678
+ assert(util);
2679
+ util->add(this);
2680
+
2681
+ //
2682
+ // Define the "unknownTypeId" member for an instance of UnknownSlicedValue.
2683
+ //
2684
+ if(unknown)
2685
+ {
2686
+ assert(!_slicedData->slices.empty());
2687
+
2688
+ volatile VALUE typeId = createString(_slicedData->slices[0]->typeId);
2689
+ callRuby(rb_iv_set, _object, "@unknownTypeId", typeId);
2690
+ }
2691
+ }
2692
+ }
2693
+
2694
+ ClassInfoPtr
2695
+ IceRuby::ObjectReader::getInfo() const
2696
+ {
2697
+ return _info;
2698
+ }
2699
+
2700
+ VALUE
2701
+ IceRuby::ObjectReader::getObject() const
2702
+ {
2703
+ return _object;
2704
+ }
2705
+
2706
+ Ice::SlicedDataPtr
2707
+ IceRuby::ObjectReader::getSlicedData() const
2708
+ {
2709
+ return _slicedData;
2710
+ }
2711
+
2712
+ //
2713
+ // InfoMapDestroyer implementation.
2714
+ //
2715
+ IceRuby::InfoMapDestroyer::~InfoMapDestroyer()
2716
+ {
2717
+ {
2718
+ for(ProxyInfoMap::iterator p = _proxyInfoMap.begin(); p != _proxyInfoMap.end(); ++p)
2719
+ {
2720
+ p->second->destroy();
2721
+ }
2722
+ }
2723
+ {
2724
+ for(ClassInfoMap::iterator p = _classInfoMap.begin(); p != _classInfoMap.end(); ++p)
2725
+ {
2726
+ p->second->destroy();
2727
+ }
2728
+ }
2729
+ _compactIdMap.clear();
2730
+ _exceptionInfoMap.clear();
2731
+ }
2732
+
2733
+ //
2734
+ // ReadObjectCallback implementation.
2735
+ //
2736
+ IceRuby::ReadObjectCallback::ReadObjectCallback(const ClassInfoPtr& info, const UnmarshalCallbackPtr& cb,
2737
+ VALUE target, void* closure) :
2738
+ _info(info), _cb(cb), _target(target), _closure(closure)
2739
+ {
2740
+ }
2741
+
2742
+ void
2743
+ IceRuby::ReadObjectCallback::invoke(const Ice::ObjectPtr& p)
2744
+ {
2745
+ if(p)
2746
+ {
2747
+ ObjectReaderPtr reader = ObjectReaderPtr::dynamicCast(p);
2748
+ assert(reader);
2749
+
2750
+ //
2751
+ // Verify that the unmarshaled object is compatible with the formal type.
2752
+ //
2753
+ volatile VALUE obj = reader->getObject();
2754
+ if(!_info->interface && !_info->validate(obj))
2755
+ {
2756
+ Ice::UnexpectedObjectException ex(__FILE__, __LINE__);
2757
+ ex.reason = "unmarshaled object is not an instance of " + _info->id;
2758
+ ex.type = reader->getInfo()->getId();
2759
+ ex.expectedType = _info->id;
2760
+ throw ex;
2761
+ }
2762
+ #ifndef NDEBUG
2763
+ // With debug builds we force a GC to ensure that all data members are correctly keep alive.
2764
+ rb_gc();
2765
+ #endif
2766
+ _cb->unmarshaled(obj, _target, _closure);
2767
+ }
2768
+ else
2769
+ {
2770
+ _cb->unmarshaled(Qnil, _target, _closure);
2771
+ }
2772
+ }
2773
+
2774
+ //
2775
+ // ExceptionInfo implementation.
2776
+ //
2777
+ VALUE
2778
+ IceRuby::ExceptionInfo::unmarshal(Ice::InputStream* is)
2779
+ {
2780
+ volatile VALUE obj = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), rubyClass);
2781
+
2782
+ ExceptionInfoPtr info = this;
2783
+ while(info)
2784
+ {
2785
+ is->startSlice();
2786
+
2787
+ DataMemberList::iterator q;
2788
+
2789
+ for(q = info->members.begin(); q != info->members.end(); ++q)
2790
+ {
2791
+ DataMemberPtr member = *q;
2792
+ member->type->unmarshal(is, member, obj, 0, false);
2793
+ }
2794
+
2795
+ //
2796
+ // The optional members have already been sorted by tag.
2797
+ //
2798
+ for(q = info->optionalMembers.begin(); q != info->optionalMembers.end(); ++q)
2799
+ {
2800
+ DataMemberPtr member = *q;
2801
+ if(is->readOptional(member->tag, member->type->optionalFormat()))
2802
+ {
2803
+ member->type->unmarshal(is, member, obj, 0, true);
2804
+ }
2805
+ else
2806
+ {
2807
+ callRuby(rb_ivar_set, obj, member->rubyID, Unset);
2808
+ }
2809
+ }
2810
+
2811
+ is->endSlice();
2812
+
2813
+ info = info->base;
2814
+ }
2815
+
2816
+ return obj;
2817
+ }
2818
+
2819
+ void
2820
+ IceRuby::ExceptionInfo::print(VALUE value, IceUtilInternal::Output& out)
2821
+ {
2822
+ if(callRuby(rb_obj_is_kind_of, value, rubyClass) == Qfalse)
2823
+ {
2824
+ out << "<invalid value - expected " << id << ">";
2825
+ return;
2826
+ }
2827
+
2828
+ PrintObjectHistory history;
2829
+ history.index = 0;
2830
+
2831
+ out << "exception " << id;
2832
+ out.sb();
2833
+ printMembers(value, out, &history);
2834
+ out.eb();
2835
+ }
2836
+
2837
+ void
2838
+ IceRuby::ExceptionInfo::printMembers(VALUE value, IceUtilInternal::Output& out, PrintObjectHistory* history)
2839
+ {
2840
+ if(base)
2841
+ {
2842
+ base->printMembers(value, out, history);
2843
+ }
2844
+
2845
+ DataMemberList::const_iterator q;
2846
+
2847
+ for(q = members.begin(); q != members.end(); ++q)
2848
+ {
2849
+ DataMemberPtr member = *q;
2850
+ out << nl << member->name << " = ";
2851
+ if(callRuby(rb_ivar_defined, value, member->rubyID) == Qfalse)
2852
+ {
2853
+ out << "<not defined>";
2854
+ }
2855
+ else
2856
+ {
2857
+ volatile VALUE val = callRuby(rb_ivar_get, value, member->rubyID);
2858
+ member->type->print(val, out, history);
2859
+ }
2860
+ }
2861
+
2862
+ for(q = optionalMembers.begin(); q != optionalMembers.end(); ++q)
2863
+ {
2864
+ DataMemberPtr member = *q;
2865
+ out << nl << member->name << " = ";
2866
+ if(callRuby(rb_ivar_defined, value, member->rubyID) == Qfalse)
2867
+ {
2868
+ out << "<not defined>";
2869
+ }
2870
+ else
2871
+ {
2872
+ volatile VALUE val = callRuby(rb_ivar_get, value, member->rubyID);
2873
+ if(val == Unset)
2874
+ {
2875
+ out << "<unset>";
2876
+ }
2877
+ else
2878
+ {
2879
+ member->type->print(val, out, history);
2880
+ }
2881
+ }
2882
+ }
2883
+ }
2884
+
2885
+ //
2886
+ // ExceptionReader implementation.
2887
+ //
2888
+ IceRuby::ExceptionReader::ExceptionReader(const ExceptionInfoPtr& info) :
2889
+ _info(info)
2890
+ {
2891
+ }
2892
+
2893
+ #if defined(__clang__)
2894
+ # pragma clang diagnostic push
2895
+ # pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-dtor"
2896
+ # pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
2897
+ #endif
2898
+ IceRuby::ExceptionReader::~ExceptionReader() throw()
2899
+ {
2900
+ rb_gc_unregister_address(&_ex);
2901
+ }
2902
+ #if defined(__clang__)
2903
+ # pragma clang diagnostic pop
2904
+ #endif
2905
+
2906
+ string
2907
+ IceRuby::ExceptionReader::ice_id() const
2908
+ {
2909
+ return _info->id;
2910
+ }
2911
+
2912
+ #ifndef ICE_CPP11_MAPPING
2913
+ Ice::UserException*
2914
+ IceRuby::ExceptionReader::ice_clone() const
2915
+ {
2916
+ assert(false);
2917
+ return 0;
2918
+ }
2919
+ #endif
2920
+
2921
+ void
2922
+ IceRuby::ExceptionReader::ice_throw() const
2923
+ {
2924
+ throw *this;
2925
+ }
2926
+
2927
+ void
2928
+ IceRuby::ExceptionReader::_write(Ice::OutputStream*) const
2929
+ {
2930
+ assert(false);
2931
+ }
2932
+
2933
+ void
2934
+ IceRuby::ExceptionReader::_read(Ice::InputStream* is)
2935
+ {
2936
+ is->startException();
2937
+
2938
+ const_cast<VALUE&>(_ex) = _info->unmarshal(is);
2939
+ rb_gc_register_address(&_ex);
2940
+
2941
+ const_cast<Ice::SlicedDataPtr&>(_slicedData) = is->endException(_info->preserve);
2942
+ }
2943
+
2944
+ bool
2945
+ IceRuby::ExceptionReader::_usesClasses() const
2946
+ {
2947
+ return _info->usesClasses;
2948
+ }
2949
+
2950
+ VALUE
2951
+ IceRuby::ExceptionReader::getException() const
2952
+ {
2953
+ return _ex;
2954
+ }
2955
+
2956
+ Ice::SlicedDataPtr
2957
+ IceRuby::ExceptionReader::getSlicedData() const
2958
+ {
2959
+ return _slicedData;
2960
+ }
2961
+
2962
+ //
2963
+ // IdResolver
2964
+ //
2965
+ string
2966
+ IceRuby::IdResolver::resolve(Ice::Int id) const
2967
+ {
2968
+ CompactIdMap::iterator p = _compactIdMap.find(id);
2969
+ if(p != _compactIdMap.end())
2970
+ {
2971
+ return p->second->id;
2972
+ }
2973
+ return string();
2974
+ }
2975
+
2976
+ extern "C"
2977
+ VALUE
2978
+ IceRuby_defineEnum(VALUE /*self*/, VALUE id, VALUE type, VALUE enumerators)
2979
+ {
2980
+ ICE_RUBY_TRY
2981
+ {
2982
+ EnumInfoPtr info = new EnumInfo(id, type, enumerators);
2983
+ return createType(info);
2984
+ }
2985
+ ICE_RUBY_CATCH
2986
+ return Qnil;
2987
+ }
2988
+
2989
+ extern "C"
2990
+ VALUE
2991
+ IceRuby_defineStruct(VALUE /*self*/, VALUE id, VALUE type, VALUE members)
2992
+ {
2993
+ ICE_RUBY_TRY
2994
+ {
2995
+ StructInfoPtr info = new StructInfo(id, type, members);
2996
+ return createType(info);
2997
+ }
2998
+ ICE_RUBY_CATCH
2999
+ return Qnil;
3000
+ }
3001
+
3002
+ extern "C"
3003
+ VALUE
3004
+ IceRuby_defineSequence(VALUE /*self*/, VALUE id, VALUE elementType)
3005
+ {
3006
+ ICE_RUBY_TRY
3007
+ {
3008
+ SequenceInfoPtr info = new SequenceInfo(id, elementType);
3009
+ return createType(info);
3010
+ }
3011
+ ICE_RUBY_CATCH
3012
+ return Qnil;
3013
+ }
3014
+
3015
+ extern "C"
3016
+ VALUE
3017
+ IceRuby_defineDictionary(VALUE /*self*/, VALUE id, VALUE keyType, VALUE valueType)
3018
+ {
3019
+ ICE_RUBY_TRY
3020
+ {
3021
+ DictionaryInfoPtr info = new DictionaryInfo(id, keyType, valueType);
3022
+ return createType(info);
3023
+ }
3024
+ ICE_RUBY_CATCH
3025
+ return Qnil;
3026
+ }
3027
+
3028
+ extern "C"
3029
+ VALUE
3030
+ IceRuby_declareProxy(VALUE /*self*/, VALUE id)
3031
+ {
3032
+ ICE_RUBY_TRY
3033
+ {
3034
+ string proxyId = getString(id);
3035
+ proxyId += "Prx";
3036
+
3037
+ ProxyInfoPtr info = lookupProxyInfo(proxyId);
3038
+ if(!info)
3039
+ {
3040
+ info = new ProxyInfo(id);
3041
+ addProxyInfo(proxyId, info);
3042
+ }
3043
+
3044
+ return info->typeObj;
3045
+ }
3046
+ ICE_RUBY_CATCH
3047
+ return Qnil;
3048
+ }
3049
+
3050
+ extern "C"
3051
+ VALUE
3052
+ IceRuby_declareClass(VALUE /*self*/, VALUE id)
3053
+ {
3054
+ ICE_RUBY_TRY
3055
+ {
3056
+ string idstr = getString(id);
3057
+ ClassInfoPtr info = lookupClassInfo(idstr);
3058
+ if(!info)
3059
+ {
3060
+ info = new ClassInfo(id, false);
3061
+ addClassInfo(idstr, info);
3062
+ }
3063
+
3064
+ return info->typeObj;
3065
+ }
3066
+ ICE_RUBY_CATCH
3067
+ return Qnil;
3068
+ }
3069
+
3070
+ extern "C"
3071
+ VALUE
3072
+ IceRuby_declareLocalClass(VALUE /*self*/, VALUE id)
3073
+ {
3074
+ ICE_RUBY_TRY
3075
+ {
3076
+ string idstr = getString(id);
3077
+ ClassInfoPtr info = lookupClassInfo(idstr);
3078
+ if(!info)
3079
+ {
3080
+ info = new ClassInfo(id, true);
3081
+ addClassInfo(idstr, info);
3082
+ }
3083
+
3084
+ return info->typeObj;
3085
+ }
3086
+ ICE_RUBY_CATCH
3087
+ return Qnil;
3088
+ }
3089
+
3090
+ extern "C"
3091
+ VALUE
3092
+ IceRuby_defineException(VALUE /*self*/, VALUE id, VALUE type, VALUE preserve, VALUE base, VALUE members)
3093
+ {
3094
+ ICE_RUBY_TRY
3095
+ {
3096
+ ExceptionInfoPtr info = new ExceptionInfo;
3097
+ info->id = getString(id);
3098
+
3099
+ info->preserve = preserve == Qtrue;
3100
+
3101
+ if(!NIL_P(base))
3102
+ {
3103
+ info->base = ExceptionInfoPtr::dynamicCast(getException(base));
3104
+ assert(info->base);
3105
+ }
3106
+
3107
+ convertDataMembers(members, info->members, info->optionalMembers, true);
3108
+
3109
+ info->usesClasses = false;
3110
+
3111
+ //
3112
+ // Only examine the required members to see if any use classes.
3113
+ //
3114
+ for(DataMemberList::iterator p = info->members.begin(); p != info->members.end(); ++p)
3115
+ {
3116
+ if(!info->usesClasses)
3117
+ {
3118
+ info->usesClasses = (*p)->type->usesClasses();
3119
+ }
3120
+ }
3121
+
3122
+ info->rubyClass = type;
3123
+
3124
+ addExceptionInfo(info->id, info);
3125
+
3126
+ return createException(info);
3127
+ }
3128
+ ICE_RUBY_CATCH
3129
+ return Qnil;
3130
+ }
3131
+
3132
+ extern "C"
3133
+ VALUE
3134
+ IceRuby_TypeInfo_defineProxy(VALUE self, VALUE type, VALUE base, VALUE interfaces)
3135
+ {
3136
+ ICE_RUBY_TRY
3137
+ {
3138
+ ProxyInfoPtr info = ProxyInfoPtr::dynamicCast(getType(self));
3139
+ assert(info);
3140
+
3141
+ info->define(type, base, interfaces);
3142
+ rb_define_const(type, "ICE_TYPE", self);
3143
+ rb_define_const(type, "ICE_ID", createString(info->id));
3144
+ }
3145
+ ICE_RUBY_CATCH
3146
+ return Qnil;
3147
+ }
3148
+
3149
+ extern "C"
3150
+ VALUE
3151
+ IceRuby_TypeInfo_defineClass(VALUE self, VALUE type, VALUE compactId, VALUE preserve, VALUE interface, VALUE base,
3152
+ VALUE members)
3153
+ {
3154
+ ICE_RUBY_TRY
3155
+ {
3156
+ ClassInfoPtr info = ClassInfoPtr::dynamicCast(getType(self));
3157
+ assert(info);
3158
+
3159
+ info->define(type, compactId, preserve, interface, base, members);
3160
+
3161
+ if(info->compactId != -1)
3162
+ {
3163
+ CompactIdMap::iterator q = _compactIdMap.find(info->compactId);
3164
+ if(q != _compactIdMap.end())
3165
+ {
3166
+ _compactIdMap.erase(q);
3167
+ }
3168
+ _compactIdMap.insert(CompactIdMap::value_type(info->compactId, info));
3169
+ }
3170
+
3171
+ if(type != Qnil && !info->interface)
3172
+ {
3173
+ rb_define_const(type, "ICE_TYPE", self);
3174
+ rb_define_const(type, "ICE_ID", createString(info->id));
3175
+ }
3176
+ }
3177
+ ICE_RUBY_CATCH
3178
+ return Qnil;
3179
+ }
3180
+
3181
+ extern "C"
3182
+ VALUE
3183
+ IceRuby_stringify(VALUE /*self*/, VALUE obj, VALUE type)
3184
+ {
3185
+ ICE_RUBY_TRY
3186
+ {
3187
+ TypeInfoPtr info = getType(type);
3188
+
3189
+ ostringstream ostr;
3190
+ IceUtilInternal::Output out(ostr);
3191
+ PrintObjectHistory history;
3192
+ history.index = 0;
3193
+ info->print(obj, out, &history);
3194
+
3195
+ string str = ostr.str();
3196
+ return createString(str);
3197
+ }
3198
+ ICE_RUBY_CATCH
3199
+ return Qnil;
3200
+ }
3201
+
3202
+ extern "C"
3203
+ VALUE
3204
+ IceRuby_stringifyException(VALUE /*self*/, VALUE exc)
3205
+ {
3206
+ ICE_RUBY_TRY
3207
+ {
3208
+ volatile VALUE cls = CLASS_OF(exc);
3209
+ volatile VALUE type = callRuby(rb_const_get, cls, rb_intern("ICE_TYPE"));
3210
+ ExceptionInfoPtr info = getException(type);
3211
+
3212
+ ostringstream ostr;
3213
+ IceUtilInternal::Output out(ostr);
3214
+ info->print(exc, out);
3215
+
3216
+ string str = ostr.str();
3217
+ return createString(str);
3218
+ }
3219
+ ICE_RUBY_CATCH
3220
+ return Qnil;
3221
+ }
3222
+
3223
+ //
3224
+ // lookupClassInfo()
3225
+ //
3226
+ IceRuby::ClassInfoPtr
3227
+ IceRuby::lookupClassInfo(const string& id)
3228
+ {
3229
+ ClassInfoMap::iterator p = _classInfoMap.find(id);
3230
+ if(p != _classInfoMap.end())
3231
+ {
3232
+ return p->second;
3233
+ }
3234
+ return 0;
3235
+ }
3236
+
3237
+ //
3238
+ // lookupExceptionInfo()
3239
+ //
3240
+ IceRuby::ExceptionInfoPtr
3241
+ IceRuby::lookupExceptionInfo(const string& id)
3242
+ {
3243
+ ExceptionInfoMap::iterator p = _exceptionInfoMap.find(id);
3244
+ if(p != _exceptionInfoMap.end())
3245
+ {
3246
+ return p->second;
3247
+ }
3248
+ return 0;
3249
+ }
3250
+
3251
+ bool
3252
+ IceRuby::initTypes(VALUE iceModule)
3253
+ {
3254
+ //
3255
+ // Define a class to represent TypeInfo, and another to represent ExceptionInfo.
3256
+ //
3257
+ _typeInfoClass = rb_define_class_under(iceModule, "Internal_TypeInfo", rb_cObject);
3258
+ rb_undef_alloc_func(_typeInfoClass);
3259
+ _exceptionInfoClass = rb_define_class_under(iceModule, "Internal_ExceptionInfo", rb_cObject);
3260
+ rb_undef_alloc_func(_exceptionInfoClass);
3261
+
3262
+ rb_define_const(iceModule, "T_bool", createType(new PrimitiveInfo(PrimitiveInfo::KindBool)));
3263
+ rb_define_const(iceModule, "T_byte", createType(new PrimitiveInfo(PrimitiveInfo::KindByte)));
3264
+ rb_define_const(iceModule, "T_short", createType(new PrimitiveInfo(PrimitiveInfo::KindShort)));
3265
+ rb_define_const(iceModule, "T_int", createType(new PrimitiveInfo(PrimitiveInfo::KindInt)));
3266
+ rb_define_const(iceModule, "T_long", createType(new PrimitiveInfo(PrimitiveInfo::KindLong)));
3267
+ rb_define_const(iceModule, "T_float", createType(new PrimitiveInfo(PrimitiveInfo::KindFloat)));
3268
+ rb_define_const(iceModule, "T_double", createType(new PrimitiveInfo(PrimitiveInfo::KindDouble)));
3269
+ rb_define_const(iceModule, "T_string", createType(new PrimitiveInfo(PrimitiveInfo::KindString)));
3270
+
3271
+ rb_define_module_function(iceModule, "__defineEnum", CAST_METHOD(IceRuby_defineEnum), 3);
3272
+ rb_define_module_function(iceModule, "__defineStruct", CAST_METHOD(IceRuby_defineStruct), 3);
3273
+ rb_define_module_function(iceModule, "__defineSequence", CAST_METHOD(IceRuby_defineSequence), 2);
3274
+ rb_define_module_function(iceModule, "__defineDictionary", CAST_METHOD(IceRuby_defineDictionary), 3);
3275
+ rb_define_module_function(iceModule, "__declareProxy", CAST_METHOD(IceRuby_declareProxy), 1);
3276
+ rb_define_module_function(iceModule, "__declareClass", CAST_METHOD(IceRuby_declareClass), 1);
3277
+ rb_define_module_function(iceModule, "__declareLocalClass", CAST_METHOD(IceRuby_declareLocalClass), 1);
3278
+ rb_define_module_function(iceModule, "__defineException", CAST_METHOD(IceRuby_defineException), 5);
3279
+
3280
+ rb_define_method(_typeInfoClass, "defineClass", CAST_METHOD(IceRuby_TypeInfo_defineClass), 6);
3281
+ rb_define_method(_typeInfoClass, "defineProxy", CAST_METHOD(IceRuby_TypeInfo_defineProxy), 3);
3282
+
3283
+ rb_define_module_function(iceModule, "__stringify", CAST_METHOD(IceRuby_stringify), 2);
3284
+ rb_define_module_function(iceModule, "__stringifyException", CAST_METHOD(IceRuby_stringifyException), 1);
3285
+
3286
+ _unsetTypeClass = rb_define_class_under(iceModule, "Internal_UnsetType", rb_cObject);
3287
+ Unset = callRuby(rb_class_new_instance, 0, static_cast<VALUE*>(0), _unsetTypeClass);
3288
+ rb_undef_alloc_func(_unsetTypeClass);
3289
+ rb_define_const(iceModule, "Unset", Unset);
3290
+
3291
+ return true;
3292
+ }
3293
+
3294
+ IceRuby::TypeInfoPtr
3295
+ IceRuby::getType(VALUE obj)
3296
+ {
3297
+ assert(TYPE(obj) == T_DATA);
3298
+ assert(rb_obj_is_instance_of(obj, _typeInfoClass) == Qtrue);
3299
+ TypeInfoPtr* p = reinterpret_cast<TypeInfoPtr*>(DATA_PTR(obj));
3300
+ return *p;
3301
+ }
3302
+
3303
+ extern "C"
3304
+ void
3305
+ IceRuby_TypeInfo_free(TypeInfoPtr* p)
3306
+ {
3307
+ delete p;
3308
+ }
3309
+
3310
+ VALUE
3311
+ IceRuby::createType(const TypeInfoPtr& info)
3312
+ {
3313
+ return Data_Wrap_Struct(_typeInfoClass, 0, IceRuby_TypeInfo_free, new TypeInfoPtr(info));
3314
+ }
3315
+
3316
+ IceRuby::ExceptionInfoPtr
3317
+ IceRuby::getException(VALUE obj)
3318
+ {
3319
+ assert(TYPE(obj) == T_DATA);
3320
+ assert(rb_obj_is_instance_of(obj, _exceptionInfoClass) == Qtrue);
3321
+ ExceptionInfoPtr* p = reinterpret_cast<ExceptionInfoPtr*>(DATA_PTR(obj));
3322
+ return *p;
3323
+ }
3324
+
3325
+ extern "C"
3326
+ void
3327
+ IceRuby_ExceptionInfo_free(ExceptionInfoPtr* p)
3328
+ {
3329
+ delete p;
3330
+ }
3331
+
3332
+ VALUE
3333
+ IceRuby::createException(const ExceptionInfoPtr& info)
3334
+ {
3335
+ return Data_Wrap_Struct(_exceptionInfoClass, 0, IceRuby_ExceptionInfo_free, new ExceptionInfoPtr(info));
3336
+ }