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