zeroc-ice 3.6b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ICE_LICENSE +54 -0
- data/LICENSE +339 -0
- data/bin/slice2rb +17 -0
- data/ext/Communicator.cpp +596 -0
- data/ext/Communicator.h +25 -0
- data/ext/Config.h +111 -0
- data/ext/Connection.cpp +381 -0
- data/ext/Connection.h +26 -0
- data/ext/Endpoint.cpp +311 -0
- data/ext/Endpoint.h +27 -0
- data/ext/ImplicitContext.cpp +152 -0
- data/ext/ImplicitContext.h +25 -0
- data/ext/Init.cpp +52 -0
- data/ext/Logger.cpp +151 -0
- data/ext/Logger.h +28 -0
- data/ext/ObjectFactory.cpp +140 -0
- data/ext/ObjectFactory.h +50 -0
- data/ext/Operation.cpp +676 -0
- data/ext/Operation.h +36 -0
- data/ext/Properties.cpp +369 -0
- data/ext/Properties.h +25 -0
- data/ext/Proxy.cpp +1354 -0
- data/ext/Proxy.h +27 -0
- data/ext/Slice.cpp +223 -0
- data/ext/Slice.h +22 -0
- data/ext/Types.cpp +3160 -0
- data/ext/Types.h +545 -0
- data/ext/Util.cpp +792 -0
- data/ext/Util.h +511 -0
- data/ext/extconf.rb +118 -0
- data/ext/ice/BZIP_LICENSE +42 -0
- data/ext/ice/MCPP_LICENSE +36 -0
- data/ext/ice/bzip2/blocksort.c +1094 -0
- data/ext/ice/bzip2/bzlib.c +1572 -0
- data/ext/ice/bzip2/bzlib.h +282 -0
- data/ext/ice/bzip2/bzlib_private.h +509 -0
- data/ext/ice/bzip2/compress.c +672 -0
- data/ext/ice/bzip2/crctable.c +104 -0
- data/ext/ice/bzip2/decompress.c +646 -0
- data/ext/ice/bzip2/huffman.c +205 -0
- data/ext/ice/bzip2/randtable.c +84 -0
- data/ext/ice/cpp/include/Ice/ACMF.h +30 -0
- data/ext/ice/cpp/include/Ice/Application.h +156 -0
- data/ext/ice/cpp/include/Ice/AsyncResult.h +363 -0
- data/ext/ice/cpp/include/Ice/AsyncResultF.h +26 -0
- data/ext/ice/cpp/include/Ice/BasicStream.h +1315 -0
- data/ext/ice/cpp/include/Ice/Buffer.h +159 -0
- data/ext/ice/cpp/include/Ice/BuiltinSequences.h +74 -0
- data/ext/ice/cpp/include/Ice/Communicator.h +194 -0
- data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +115 -0
- data/ext/ice/cpp/include/Ice/CommunicatorF.h +60 -0
- data/ext/ice/cpp/include/Ice/Config.h +97 -0
- data/ext/ice/cpp/include/Ice/Connection.h +495 -0
- data/ext/ice/cpp/include/Ice/ConnectionAsync.h +115 -0
- data/ext/ice/cpp/include/Ice/ConnectionF.h +72 -0
- data/ext/ice/cpp/include/Ice/ConnectionFactoryF.h +30 -0
- data/ext/ice/cpp/include/Ice/ConnectionIF.h +37 -0
- data/ext/ice/cpp/include/Ice/Current.h +94 -0
- data/ext/ice/cpp/include/Ice/DefaultObjectFactory.h +48 -0
- data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +62 -0
- data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +33 -0
- data/ext/ice/cpp/include/Ice/Dispatcher.h +51 -0
- data/ext/ice/cpp/include/Ice/DynamicLibrary.h +105 -0
- data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +29 -0
- data/ext/ice/cpp/include/Ice/Endpoint.h +350 -0
- data/ext/ice/cpp/include/Ice/EndpointF.h +97 -0
- data/ext/ice/cpp/include/Ice/EndpointTypes.h +74 -0
- data/ext/ice/cpp/include/Ice/Exception.h +114 -0
- data/ext/ice/cpp/include/Ice/FacetMap.h +56 -0
- data/ext/ice/cpp/include/Ice/FactoryTable.h +69 -0
- data/ext/ice/cpp/include/Ice/FactoryTableInit.h +87 -0
- data/ext/ice/cpp/include/Ice/Format.h +39 -0
- data/ext/ice/cpp/include/Ice/Functional.h +138 -0
- data/ext/ice/cpp/include/Ice/GCObject.h +73 -0
- data/ext/ice/cpp/include/Ice/Handle.h +192 -0
- data/ext/ice/cpp/include/Ice/Ice.h +54 -0
- data/ext/ice/cpp/include/Ice/Identity.h +160 -0
- data/ext/ice/cpp/include/Ice/ImplicitContext.h +96 -0
- data/ext/ice/cpp/include/Ice/ImplicitContextF.h +60 -0
- data/ext/ice/cpp/include/Ice/Incoming.h +131 -0
- data/ext/ice/cpp/include/Ice/IncomingAsync.h +108 -0
- data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +35 -0
- data/ext/ice/cpp/include/Ice/Initialize.h +141 -0
- data/ext/ice/cpp/include/Ice/InstanceF.h +26 -0
- data/ext/ice/cpp/include/Ice/Instrumentation.h +377 -0
- data/ext/ice/cpp/include/Ice/InstrumentationF.h +71 -0
- data/ext/ice/cpp/include/Ice/LocalException.h +1022 -0
- data/ext/ice/cpp/include/Ice/LocalObject.h +36 -0
- data/ext/ice/cpp/include/Ice/LocalObjectF.h +26 -0
- data/ext/ice/cpp/include/Ice/Locator.h +2191 -0
- data/ext/ice/cpp/include/Ice/LocatorF.h +89 -0
- data/ext/ice/cpp/include/Ice/Logger.h +94 -0
- data/ext/ice/cpp/include/Ice/LoggerF.h +60 -0
- data/ext/ice/cpp/include/Ice/LoggerUtil.h +153 -0
- data/ext/ice/cpp/include/Ice/Makefile +26 -0
- data/ext/ice/cpp/include/Ice/Metrics.h +2989 -0
- data/ext/ice/cpp/include/Ice/MetricsAdminI.h +662 -0
- data/ext/ice/cpp/include/Ice/MetricsFunctional.h +144 -0
- data/ext/ice/cpp/include/Ice/MetricsObserverI.h +576 -0
- data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +55 -0
- data/ext/ice/cpp/include/Ice/Object.h +165 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapter.h +162 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +60 -0
- data/ext/ice/cpp/include/Ice/ObjectAdapterFactoryF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObjectF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObjectFactory.h +86 -0
- data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +60 -0
- data/ext/ice/cpp/include/Ice/ObjectFactoryManagerF.h +26 -0
- data/ext/ice/cpp/include/Ice/ObserverHelper.h +177 -0
- data/ext/ice/cpp/include/Ice/Outgoing.h +197 -0
- data/ext/ice/cpp/include/Ice/OutgoingAsync.h +264 -0
- data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +38 -0
- data/ext/ice/cpp/include/Ice/Plugin.h +121 -0
- data/ext/ice/cpp/include/Ice/PluginF.h +66 -0
- data/ext/ice/cpp/include/Ice/Process.h +568 -0
- data/ext/ice/cpp/include/Ice/ProcessF.h +77 -0
- data/ext/ice/cpp/include/Ice/Properties.h +130 -0
- data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +824 -0
- data/ext/ice/cpp/include/Ice/PropertiesF.h +83 -0
- data/ext/ice/cpp/include/Ice/Protocol.h +242 -0
- data/ext/ice/cpp/include/Ice/Proxy.h +2448 -0
- data/ext/ice/cpp/include/Ice/ProxyF.h +78 -0
- data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +26 -0
- data/ext/ice/cpp/include/Ice/ProxyHandle.h +330 -0
- data/ext/ice/cpp/include/Ice/ReferenceF.h +34 -0
- data/ext/ice/cpp/include/Ice/RemoteLogger.h +1496 -0
- data/ext/ice/cpp/include/Ice/RequestHandlerF.h +29 -0
- data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +25 -0
- data/ext/ice/cpp/include/Ice/Router.h +1155 -0
- data/ext/ice/cpp/include/Ice/RouterF.h +77 -0
- data/ext/ice/cpp/include/Ice/ServantLocator.h +90 -0
- data/ext/ice/cpp/include/Ice/ServantLocatorF.h +60 -0
- data/ext/ice/cpp/include/Ice/ServantManagerF.h +26 -0
- data/ext/ice/cpp/include/Ice/Service.h +260 -0
- data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +56 -0
- data/ext/ice/cpp/include/Ice/SliceChecksums.h +34 -0
- data/ext/ice/cpp/include/Ice/SlicedData.h +103 -0
- data/ext/ice/cpp/include/Ice/SlicedDataF.h +34 -0
- data/ext/ice/cpp/include/Ice/Stream.h +449 -0
- data/ext/ice/cpp/include/Ice/StreamF.h +30 -0
- data/ext/ice/cpp/include/Ice/StreamHelpers.h +877 -0
- data/ext/ice/cpp/include/Ice/ThreadPoolF.h +28 -0
- data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +56 -0
- data/ext/ice/cpp/include/Ice/Version.h +254 -0
- data/ext/ice/cpp/include/IceSSL/Config.h +23 -0
- data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +119 -0
- data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +101 -0
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +22 -0
- data/ext/ice/cpp/include/IceSSL/Makefile +26 -0
- data/ext/ice/cpp/include/IceSSL/Plugin.h +558 -0
- data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +119 -0
- data/ext/ice/cpp/include/IceUtil/Cache.h +362 -0
- data/ext/ice/cpp/include/IceUtil/Cond.h +323 -0
- data/ext/ice/cpp/include/IceUtil/Config.h +234 -0
- data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +50 -0
- data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +70 -0
- data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +45 -0
- data/ext/ice/cpp/include/IceUtil/Exception.h +184 -0
- data/ext/ice/cpp/include/IceUtil/Functional.h +389 -0
- data/ext/ice/cpp/include/IceUtil/Handle.h +266 -0
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +51 -0
- data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +302 -0
- data/ext/ice/cpp/include/IceUtil/InputUtil.h +47 -0
- data/ext/ice/cpp/include/IceUtil/Iterator.h +36 -0
- data/ext/ice/cpp/include/IceUtil/Lock.h +135 -0
- data/ext/ice/cpp/include/IceUtil/Makefile +26 -0
- data/ext/ice/cpp/include/IceUtil/Monitor.h +249 -0
- data/ext/ice/cpp/include/IceUtil/Mutex.h +357 -0
- data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +28 -0
- data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +83 -0
- data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +82 -0
- data/ext/ice/cpp/include/IceUtil/Optional.h +322 -0
- data/ext/ice/cpp/include/IceUtil/Options.h +141 -0
- data/ext/ice/cpp/include/IceUtil/OutputUtil.h +362 -0
- data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +19 -0
- data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +26 -0
- data/ext/ice/cpp/include/IceUtil/Random.h +24 -0
- data/ext/ice/cpp/include/IceUtil/RecMutex.h +113 -0
- data/ext/ice/cpp/include/IceUtil/SHA1.h +65 -0
- data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +44 -0
- data/ext/ice/cpp/include/IceUtil/ScopedArray.h +97 -0
- data/ext/ice/cpp/include/IceUtil/Shared.h +168 -0
- data/ext/ice/cpp/include/IceUtil/StringConverter.h +175 -0
- data/ext/ice/cpp/include/IceUtil/StringUtil.h +91 -0
- data/ext/ice/cpp/include/IceUtil/Thread.h +181 -0
- data/ext/ice/cpp/include/IceUtil/ThreadException.h +108 -0
- data/ext/ice/cpp/include/IceUtil/Time.h +209 -0
- data/ext/ice/cpp/include/IceUtil/Timer.h +143 -0
- data/ext/ice/cpp/include/IceUtil/UUID.h +22 -0
- data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +42 -0
- data/ext/ice/cpp/include/IceUtil/UniquePtr.h +101 -0
- data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +64 -0
- data/ext/ice/cpp/include/Slice/Checksum.h +26 -0
- data/ext/ice/cpp/include/Slice/CsUtil.h +92 -0
- data/ext/ice/cpp/include/Slice/DotNetNames.h +34 -0
- data/ext/ice/cpp/include/Slice/FileTracker.h +71 -0
- data/ext/ice/cpp/include/Slice/JavaUtil.h +277 -0
- data/ext/ice/cpp/include/Slice/Makefile +26 -0
- data/ext/ice/cpp/include/Slice/PHPUtil.h +50 -0
- data/ext/ice/cpp/include/Slice/Parser.h +1116 -0
- data/ext/ice/cpp/include/Slice/Preprocessor.h +68 -0
- data/ext/ice/cpp/include/Slice/PythonUtil.h +64 -0
- data/ext/ice/cpp/include/Slice/RubyUtil.h +54 -0
- data/ext/ice/cpp/include/Slice/Util.h +33 -0
- data/ext/ice/cpp/src/Ice/ACM.cpp +343 -0
- data/ext/ice/cpp/src/Ice/ACM.h +117 -0
- data/ext/ice/cpp/src/Ice/Acceptor.cpp +16 -0
- data/ext/ice/cpp/src/Ice/Acceptor.h +41 -0
- data/ext/ice/cpp/src/Ice/AcceptorF.h +30 -0
- data/ext/ice/cpp/src/Ice/Application.cpp +760 -0
- data/ext/ice/cpp/src/Ice/AsyncResult.cpp +599 -0
- data/ext/ice/cpp/src/Ice/Base64.cpp +269 -0
- data/ext/ice/cpp/src/Ice/Base64.h +36 -0
- data/ext/ice/cpp/src/Ice/BasicStream.cpp +3393 -0
- data/ext/ice/cpp/src/Ice/Buffer.cpp +98 -0
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +34 -0
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +718 -0
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +106 -0
- data/ext/ice/cpp/src/Ice/Communicator.cpp +45 -0
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +386 -0
- data/ext/ice/cpp/src/Ice/CommunicatorI.h +112 -0
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +546 -0
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +97 -0
- data/ext/ice/cpp/src/Ice/Connection.cpp +58 -0
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +1639 -0
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +236 -0
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +3876 -0
- data/ext/ice/cpp/src/Ice/ConnectionI.h +364 -0
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +115 -0
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +50 -0
- data/ext/ice/cpp/src/Ice/Connector.cpp +16 -0
- data/ext/ice/cpp/src/Ice/Connector.h +36 -0
- data/ext/ice/cpp/src/Ice/ConnectorF.h +26 -0
- data/ext/ice/cpp/src/Ice/Current.cpp +38 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +168 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +57 -0
- data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +26 -0
- data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +60 -0
- data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +49 -0
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +281 -0
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +53 -0
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +25 -0
- data/ext/ice/cpp/src/Ice/EndpointFactory.h +44 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +26 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +208 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +46 -0
- data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +26 -0
- data/ext/ice/cpp/src/Ice/EndpointI.cpp +87 -0
- data/ext/ice/cpp/src/Ice/EndpointI.h +165 -0
- data/ext/ice/cpp/src/Ice/EndpointIF.h +41 -0
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +38 -0
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +35 -0
- data/ext/ice/cpp/src/Ice/EventHandler.h +78 -0
- data/ext/ice/cpp/src/Ice/EventHandlerF.h +26 -0
- data/ext/ice/cpp/src/Ice/EventLoggerMsg.h +53 -0
- data/ext/ice/cpp/src/Ice/Exception.cpp +832 -0
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +34 -0
- data/ext/ice/cpp/src/Ice/FactoryTable.cpp +158 -0
- data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +95 -0
- data/ext/ice/cpp/src/Ice/GCObject.cpp +444 -0
- data/ext/ice/cpp/src/Ice/HashUtil.h +59 -0
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +680 -0
- data/ext/ice/cpp/src/Ice/HttpParser.h +124 -0
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +733 -0
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +157 -0
- data/ext/ice/cpp/src/Ice/IPEndpointIF.h +29 -0
- data/ext/ice/cpp/src/Ice/Identity.cpp +42 -0
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +639 -0
- data/ext/ice/cpp/src/Ice/ImplicitContextI.h +51 -0
- data/ext/ice/cpp/src/Ice/Incoming.cpp +757 -0
- data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +340 -0
- data/ext/ice/cpp/src/Ice/IncomingRequest.h +37 -0
- data/ext/ice/cpp/src/Ice/Initialize.cpp +401 -0
- data/ext/ice/cpp/src/Ice/Instance.cpp +1928 -0
- data/ext/ice/cpp/src/Ice/Instance.h +198 -0
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +68 -0
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +43 -0
- data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1083 -0
- data/ext/ice/cpp/src/Ice/InstrumentationI.h +262 -0
- data/ext/ice/cpp/src/Ice/LocalException.cpp +2091 -0
- data/ext/ice/cpp/src/Ice/LocalObject.cpp +29 -0
- data/ext/ice/cpp/src/Ice/Locator.cpp +1946 -0
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +917 -0
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +193 -0
- data/ext/ice/cpp/src/Ice/LocatorInfoF.h +34 -0
- data/ext/ice/cpp/src/Ice/Logger.cpp +40 -0
- data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +862 -0
- data/ext/ice/cpp/src/Ice/LoggerAdminI.h +46 -0
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +199 -0
- data/ext/ice/cpp/src/Ice/LoggerI.h +57 -0
- data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +107 -0
- data/ext/ice/cpp/src/Ice/Makefile +190 -0
- data/ext/ice/cpp/src/Ice/Metrics.cpp +2159 -0
- data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +669 -0
- data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +14 -0
- data/ext/ice/cpp/src/Ice/Network.cpp +2694 -0
- data/ext/ice/cpp/src/Ice/Network.h +291 -0
- data/ext/ice/cpp/src/Ice/NetworkF.h +28 -0
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +325 -0
- data/ext/ice/cpp/src/Ice/NetworkProxy.h +74 -0
- data/ext/ice/cpp/src/Ice/NetworkProxyF.h +26 -0
- data/ext/ice/cpp/src/Ice/Object.cpp +440 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +241 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +52 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +1498 -0
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +155 -0
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +140 -0
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +43 -0
- data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +84 -0
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +407 -0
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +70 -0
- data/ext/ice/cpp/src/Ice/Outgoing.cpp +737 -0
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +874 -0
- data/ext/ice/cpp/src/Ice/Plugin.cpp +43 -0
- data/ext/ice/cpp/src/Ice/PluginF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +503 -0
- data/ext/ice/cpp/src/Ice/PluginManagerI.h +67 -0
- data/ext/ice/cpp/src/Ice/Process.cpp +299 -0
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/Properties.cpp +45 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +555 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +207 -0
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +45 -0
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +759 -0
- data/ext/ice/cpp/src/Ice/PropertiesI.h +78 -0
- data/ext/ice/cpp/src/Ice/PropertyNames.cpp +1293 -0
- data/ext/ice/cpp/src/Ice/PropertyNames.h +81 -0
- data/ext/ice/cpp/src/Ice/Protocol.cpp +137 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +98 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstance.h +91 -0
- data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +26 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +51 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +67 -0
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +26 -0
- data/ext/ice/cpp/src/Ice/Proxy.cpp +1810 -0
- data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +305 -0
- data/ext/ice/cpp/src/Ice/ProxyFactory.h +57 -0
- data/ext/ice/cpp/src/Ice/Reference.cpp +1947 -0
- data/ext/ice/cpp/src/Ice/Reference.h +305 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +937 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactory.h +81 -0
- data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +24 -0
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +958 -0
- data/ext/ice/cpp/src/Ice/ReplyStatus.h +29 -0
- data/ext/ice/cpp/src/Ice/RequestHandler.cpp +40 -0
- data/ext/ice/cpp/src/Ice/RequestHandler.h +90 -0
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +70 -0
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +41 -0
- data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +20 -0
- data/ext/ice/cpp/src/Ice/ResponseHandler.h +39 -0
- data/ext/ice/cpp/src/Ice/RetryQueue.cpp +154 -0
- data/ext/ice/cpp/src/Ice/RetryQueue.h +69 -0
- data/ext/ice/cpp/src/Ice/RetryQueueF.h +24 -0
- data/ext/ice/cpp/src/Ice/Router.cpp +849 -0
- data/ext/ice/cpp/src/Ice/RouterF.cpp +39 -0
- data/ext/ice/cpp/src/Ice/RouterInfo.cpp +381 -0
- data/ext/ice/cpp/src/Ice/RouterInfo.h +148 -0
- data/ext/ice/cpp/src/Ice/RouterInfoF.h +30 -0
- data/ext/ice/cpp/src/Ice/Selector.cpp +926 -0
- data/ext/ice/cpp/src/Ice/Selector.h +231 -0
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +41 -0
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +38 -0
- data/ext/ice/cpp/src/Ice/ServantManager.cpp +495 -0
- data/ext/ice/cpp/src/Ice/ServantManager.h +74 -0
- data/ext/ice/cpp/src/Ice/Service.cpp +1897 -0
- data/ext/ice/cpp/src/Ice/SharedContext.h +51 -0
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +34 -0
- data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +80 -0
- data/ext/ice/cpp/src/Ice/SlicedData.cpp +80 -0
- data/ext/ice/cpp/src/Ice/Stream.cpp +53 -0
- data/ext/ice/cpp/src/Ice/StreamI.cpp +832 -0
- data/ext/ice/cpp/src/Ice/StreamI.h +198 -0
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +521 -0
- data/ext/ice/cpp/src/Ice/StreamSocket.h +85 -0
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +145 -0
- data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +167 -0
- data/ext/ice/cpp/src/Ice/SysLoggerI.h +43 -0
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +235 -0
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +67 -0
- data/ext/ice/cpp/src/Ice/TcpConnector.cpp +133 -0
- data/ext/ice/cpp/src/Ice/TcpConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +397 -0
- data/ext/ice/cpp/src/Ice/TcpEndpointI.h +93 -0
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +127 -0
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +61 -0
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +1357 -0
- data/ext/ice/cpp/src/Ice/ThreadPool.h +399 -0
- data/ext/ice/cpp/src/Ice/TraceLevels.cpp +43 -0
- data/ext/ice/cpp/src/Ice/TraceLevels.h +50 -0
- data/ext/ice/cpp/src/Ice/TraceLevelsF.h +26 -0
- data/ext/ice/cpp/src/Ice/TraceUtil.cpp +452 -0
- data/ext/ice/cpp/src/Ice/TraceUtil.h +28 -0
- data/ext/ice/cpp/src/Ice/Transceiver.cpp +24 -0
- data/ext/ice/cpp/src/Ice/Transceiver.h +52 -0
- data/ext/ice/cpp/src/Ice/TransceiverF.h +38 -0
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +144 -0
- data/ext/ice/cpp/src/Ice/UdpConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +483 -0
- data/ext/ice/cpp/src/Ice/UdpEndpointI.h +95 -0
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +1156 -0
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +123 -0
- data/ext/ice/cpp/src/Ice/Version.cpp +46 -0
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +103 -0
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +61 -0
- data/ext/ice/cpp/src/Ice/WSConnector.cpp +113 -0
- data/ext/ice/cpp/src/Ice/WSConnector.h +51 -0
- data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +441 -0
- data/ext/ice/cpp/src/Ice/WSEndpoint.h +97 -0
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +1728 -0
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +149 -0
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +594 -0
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +1035 -0
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +208 -0
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +78 -0
- data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +308 -0
- data/ext/ice/cpp/src/IceDiscovery/LookupI.h +183 -0
- data/ext/ice/cpp/src/IceDiscovery/Makefile +61 -0
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +148 -0
- data/ext/ice/cpp/src/IceDiscovery/PluginI.h +39 -0
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +258 -0
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +66 -0
- data/ext/ice/cpp/src/IceSSL/Certificate.cpp +1334 -0
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +42 -0
- data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +151 -0
- data/ext/ice/cpp/src/IceSSL/ConnectorI.h +56 -0
- data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +397 -0
- data/ext/ice/cpp/src/IceSSL/EndpointI.h +96 -0
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +41 -0
- data/ext/ice/cpp/src/IceSSL/Instance.cpp +38 -0
- data/ext/ice/cpp/src/IceSSL/Instance.h +42 -0
- data/ext/ice/cpp/src/IceSSL/InstanceF.h +34 -0
- data/ext/ice/cpp/src/IceSSL/Makefile +82 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +1001 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +607 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +75 -0
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +102 -0
- data/ext/ice/cpp/src/IceSSL/PluginI.h +56 -0
- data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +541 -0
- data/ext/ice/cpp/src/IceSSL/RFC2253.h +67 -0
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +729 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +1062 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +130 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +291 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngine.h +264 -0
- data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +41 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +1514 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +609 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +91 -0
- data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +246 -0
- data/ext/ice/cpp/src/IceSSL/TrustManager.h +51 -0
- data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +26 -0
- data/ext/ice/cpp/src/IceSSL/Util.cpp +1423 -0
- data/ext/ice/cpp/src/IceSSL/Util.h +136 -0
- data/ext/ice/cpp/src/IceUtil/ArgVector.cpp +65 -0
- data/ext/ice/cpp/src/IceUtil/ArgVector.h +41 -0
- data/ext/ice/cpp/src/IceUtil/Cond.cpp +386 -0
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +477 -0
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +144 -0
- data/ext/ice/cpp/src/IceUtil/CountDownLatch.cpp +184 -0
- data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +273 -0
- data/ext/ice/cpp/src/IceUtil/Exception.cpp +782 -0
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +532 -0
- data/ext/ice/cpp/src/IceUtil/FileUtil.h +159 -0
- data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +41 -0
- data/ext/ice/cpp/src/IceUtil/Makefile +68 -0
- data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +24 -0
- data/ext/ice/cpp/src/IceUtil/Options.cpp +1049 -0
- data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +591 -0
- data/ext/ice/cpp/src/IceUtil/Random.cpp +185 -0
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +257 -0
- data/ext/ice/cpp/src/IceUtil/SHA1.cpp +126 -0
- data/ext/ice/cpp/src/IceUtil/Shared.cpp +200 -0
- data/ext/ice/cpp/src/IceUtil/StopWatch.h +54 -0
- data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +450 -0
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +842 -0
- data/ext/ice/cpp/src/IceUtil/Thread.cpp +809 -0
- data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +172 -0
- data/ext/ice/cpp/src/IceUtil/Time.cpp +306 -0
- data/ext/ice/cpp/src/IceUtil/Timer.cpp +251 -0
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +174 -0
- data/ext/ice/cpp/src/IceUtil/Unicode.cpp +131 -0
- data/ext/ice/cpp/src/IceUtil/Unicode.h +49 -0
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +1139 -0
- data/ext/ice/cpp/src/Slice/Checksum.cpp +452 -0
- data/ext/ice/cpp/src/Slice/CsUtil.cpp +2650 -0
- data/ext/ice/cpp/src/Slice/DotNetNames.cpp +146 -0
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +203 -0
- data/ext/ice/cpp/src/Slice/Grammar.cpp +4755 -0
- data/ext/ice/cpp/src/Slice/Grammar.h +98 -0
- data/ext/ice/cpp/src/Slice/GrammarUtil.h +234 -0
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +4376 -0
- data/ext/ice/cpp/src/Slice/MD5.cpp +57 -0
- data/ext/ice/cpp/src/Slice/MD5.h +44 -0
- data/ext/ice/cpp/src/Slice/MD5I.cpp +385 -0
- data/ext/ice/cpp/src/Slice/MD5I.h +91 -0
- data/ext/ice/cpp/src/Slice/Makefile +65 -0
- data/ext/ice/cpp/src/Slice/PHPUtil.cpp +156 -0
- data/ext/ice/cpp/src/Slice/Parser.cpp +6386 -0
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +686 -0
- data/ext/ice/cpp/src/Slice/Python.cpp +675 -0
- data/ext/ice/cpp/src/Slice/PythonUtil.cpp +2614 -0
- data/ext/ice/cpp/src/Slice/Ruby.cpp +317 -0
- data/ext/ice/cpp/src/Slice/RubyUtil.cpp +1774 -0
- data/ext/ice/cpp/src/Slice/Scanner.cpp +2426 -0
- data/ext/ice/cpp/src/Slice/Util.cpp +325 -0
- data/ext/ice/mcpp/config.h.Darwin +227 -0
- data/ext/ice/mcpp/config.h.Linux +227 -0
- data/ext/ice/mcpp/config.h.MINGW +7 -0
- data/ext/ice/mcpp/configed.H +382 -0
- data/ext/ice/mcpp/directive.c +1699 -0
- data/ext/ice/mcpp/eval.c +1673 -0
- data/ext/ice/mcpp/expand.c +2980 -0
- data/ext/ice/mcpp/internal.H +564 -0
- data/ext/ice/mcpp/main.c +1131 -0
- data/ext/ice/mcpp/mbchar.c +869 -0
- data/ext/ice/mcpp/mcpp_lib.h +31 -0
- data/ext/ice/mcpp/mcpp_out.h +13 -0
- data/ext/ice/mcpp/support.c +2811 -0
- data/ext/ice/mcpp/system.H +396 -0
- data/ext/ice/mcpp/system.c +4940 -0
- data/ice.gemspec +41 -0
- data/lib/Glacier2.rb +12 -0
- data/lib/Glacier2/Metrics.rb +99 -0
- data/lib/Glacier2/PermissionsVerifier.rb +168 -0
- data/lib/Glacier2/PermissionsVerifierF.rb +34 -0
- data/lib/Glacier2/Router.rb +141 -0
- data/lib/Glacier2/RouterF.rb +29 -0
- data/lib/Glacier2/SSLInfo.rb +79 -0
- data/lib/Glacier2/Session.rb +470 -0
- data/lib/Ice.rb +659 -0
- data/lib/Ice/BuiltinSequences.rb +64 -0
- data/lib/Ice/Communicator.rb +93 -0
- data/lib/Ice/CommunicatorF.rb +28 -0
- data/lib/Ice/Connection.rb +414 -0
- data/lib/Ice/ConnectionF.rb +36 -0
- data/lib/Ice/Current.rb +152 -0
- data/lib/Ice/Endpoint.rb +265 -0
- data/lib/Ice/EndpointF.rb +52 -0
- data/lib/Ice/EndpointTypes.rb +77 -0
- data/lib/Ice/FacetMap.rb +28 -0
- data/lib/Ice/Identity.rb +70 -0
- data/lib/Ice/ImplicitContext.rb +59 -0
- data/lib/Ice/ImplicitContextF.rb +28 -0
- data/lib/Ice/Instrumentation.rb +425 -0
- data/lib/Ice/InstrumentationF.rb +35 -0
- data/lib/Ice/LocalException.rb +1081 -0
- data/lib/Ice/Locator.rb +314 -0
- data/lib/Ice/LocatorF.rb +34 -0
- data/lib/Ice/Logger.rb +57 -0
- data/lib/Ice/LoggerF.rb +28 -0
- data/lib/Ice/Metrics.rb +696 -0
- data/lib/Ice/ObjectAdapterF.rb +28 -0
- data/lib/Ice/ObjectFactory.rb +53 -0
- data/lib/Ice/ObjectFactoryF.rb +28 -0
- data/lib/Ice/Plugin.rb +87 -0
- data/lib/Ice/PluginF.rb +32 -0
- data/lib/Ice/Process.rb +93 -0
- data/lib/Ice/ProcessF.rb +29 -0
- data/lib/Ice/Properties.rb +65 -0
- data/lib/Ice/PropertiesAdmin.rb +104 -0
- data/lib/Ice/PropertiesF.rb +33 -0
- data/lib/Ice/Router.rb +163 -0
- data/lib/Ice/RouterF.rb +29 -0
- data/lib/Ice/SliceChecksumDict.rb +28 -0
- data/lib/Ice/Version.rb +100 -0
- data/lib/IceBox.rb +10 -0
- data/lib/IceBox/IceBox.rb +272 -0
- data/lib/IceGrid.rb +17 -0
- data/lib/IceGrid/Admin.rb +1076 -0
- data/lib/IceGrid/Descriptor.rb +1505 -0
- data/lib/IceGrid/Exception.rb +401 -0
- data/lib/IceGrid/FileParser.rb +105 -0
- data/lib/IceGrid/Locator.rb +105 -0
- data/lib/IceGrid/Observer.rb +571 -0
- data/lib/IceGrid/Query.rb +168 -0
- data/lib/IceGrid/Registry.rb +120 -0
- data/lib/IceGrid/Session.rb +114 -0
- data/lib/IceGrid/UserAccountMapper.rb +101 -0
- data/lib/IcePatch2.rb +10 -0
- data/lib/IcePatch2/FileInfo.rb +75 -0
- data/lib/IcePatch2/FileServer.rb +141 -0
- data/lib/IceStorm.rb +11 -0
- data/lib/IceStorm/IceStorm.rb +463 -0
- data/lib/IceStorm/Metrics.rb +155 -0
- data/slice/Freeze/BackgroundSaveEvictor.ice +111 -0
- data/slice/Freeze/CatalogData.ice +49 -0
- data/slice/Freeze/Connection.ice +111 -0
- data/slice/Freeze/ConnectionF.ice +20 -0
- data/slice/Freeze/DB.ice +37 -0
- data/slice/Freeze/Evictor.ice +339 -0
- data/slice/Freeze/EvictorF.ice +22 -0
- data/slice/Freeze/EvictorStorage.ice +72 -0
- data/slice/Freeze/Exception.ice +100 -0
- data/slice/Freeze/Transaction.ice +57 -0
- data/slice/Freeze/TransactionalEvictor.ice +50 -0
- data/slice/Glacier2/Metrics.ice +77 -0
- data/slice/Glacier2/PermissionsVerifier.ice +105 -0
- data/slice/Glacier2/PermissionsVerifierF.ice +21 -0
- data/slice/Glacier2/Router.ice +178 -0
- data/slice/Glacier2/RouterF.ice +20 -0
- data/slice/Glacier2/SSLInfo.ice +50 -0
- data/slice/Glacier2/Session.ice +273 -0
- data/slice/Ice/BuiltinSequences.ice +48 -0
- data/slice/Ice/Communicator.ice +567 -0
- data/slice/Ice/CommunicatorF.ice +20 -0
- data/slice/Ice/Connection.ice +323 -0
- data/slice/Ice/ConnectionF.ice +22 -0
- data/slice/Ice/Current.ice +160 -0
- data/slice/Ice/Endpoint.ice +227 -0
- data/slice/Ice/EndpointF.ice +32 -0
- data/slice/Ice/EndpointTypes.ice +38 -0
- data/slice/Ice/FacetMap.ice +25 -0
- data/slice/Ice/Identity.ice +59 -0
- data/slice/Ice/ImplicitContext.ice +109 -0
- data/slice/Ice/ImplicitContextF.ice +20 -0
- data/slice/Ice/Instrumentation.ice +499 -0
- data/slice/Ice/InstrumentationF.ice +26 -0
- data/slice/Ice/LocalException.ice +1015 -0
- data/slice/Ice/Locator.ice +227 -0
- data/slice/Ice/LocatorF.ice +21 -0
- data/slice/Ice/Logger.ice +86 -0
- data/slice/Ice/LoggerF.ice +20 -0
- data/slice/Ice/Metrics.ice +422 -0
- data/slice/Ice/ObjectAdapter.ice +673 -0
- data/slice/Ice/ObjectAdapterF.ice +20 -0
- data/slice/Ice/ObjectFactory.ice +60 -0
- data/slice/Ice/ObjectFactoryF.ice +20 -0
- data/slice/Ice/Plugin.ice +117 -0
- data/slice/Ice/PluginF.ice +21 -0
- data/slice/Ice/Process.ice +54 -0
- data/slice/Ice/ProcessF.ice +20 -0
- data/slice/Ice/Properties.ice +228 -0
- data/slice/Ice/PropertiesAdmin.ice +75 -0
- data/slice/Ice/PropertiesF.ice +21 -0
- data/slice/Ice/RemoteLogger.ice +232 -0
- data/slice/Ice/Router.ice +83 -0
- data/slice/Ice/RouterF.ice +20 -0
- data/slice/Ice/ServantLocator.ice +117 -0
- data/slice/Ice/ServantLocatorF.ice +20 -0
- data/slice/Ice/SliceChecksumDict.ice +25 -0
- data/slice/Ice/Version.ice +39 -0
- data/slice/IceBox/IceBox.ice +194 -0
- data/slice/IceDiscovery/IceDiscovery.ice +32 -0
- data/slice/IceGrid/Admin.ice +1578 -0
- data/slice/IceGrid/Descriptor.ice +1079 -0
- data/slice/IceGrid/Discovery.ice +73 -0
- data/slice/IceGrid/Exception.ice +383 -0
- data/slice/IceGrid/FileParser.ice +61 -0
- data/slice/IceGrid/Locator.ice +56 -0
- data/slice/IceGrid/Observer.ice +394 -0
- data/slice/IceGrid/PluginFacade.ice +316 -0
- data/slice/IceGrid/Query.ice +130 -0
- data/slice/IceGrid/Registry.ice +138 -0
- data/slice/IceGrid/Session.ice +124 -0
- data/slice/IceGrid/UserAccountMapper.ice +58 -0
- data/slice/IcePatch2/FileInfo.ice +49 -0
- data/slice/IcePatch2/FileServer.ice +129 -0
- data/slice/IceSSL/ConnectionInfo.ice +34 -0
- data/slice/IceSSL/EndpointInfo.ice +41 -0
- data/slice/IceStorm/IceStorm.ice +405 -0
- data/slice/IceStorm/Metrics.ice +71 -0
- metadata +737 -0
@@ -0,0 +1,317 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#include <IceUtil/DisableWarnings.h>
|
11
|
+
#include <IceUtil/Options.h>
|
12
|
+
#include <IceUtil/CtrlCHandler.h>
|
13
|
+
#include <IceUtil/Mutex.h>
|
14
|
+
#include <IceUtil/MutexPtrLock.h>
|
15
|
+
#include <Slice/Preprocessor.h>
|
16
|
+
#include <Slice/FileTracker.h>
|
17
|
+
#include <Slice/RubyUtil.h>
|
18
|
+
#include <Slice/Util.h>
|
19
|
+
|
20
|
+
#include <string.h>
|
21
|
+
|
22
|
+
using namespace std;
|
23
|
+
using namespace Slice;
|
24
|
+
using namespace Slice::Ruby;
|
25
|
+
|
26
|
+
namespace
|
27
|
+
{
|
28
|
+
|
29
|
+
IceUtil::Mutex* globalMutex = 0;
|
30
|
+
bool interrupted = false;
|
31
|
+
|
32
|
+
class Init
|
33
|
+
{
|
34
|
+
public:
|
35
|
+
|
36
|
+
Init()
|
37
|
+
{
|
38
|
+
globalMutex = new IceUtil::Mutex;
|
39
|
+
}
|
40
|
+
|
41
|
+
~Init()
|
42
|
+
{
|
43
|
+
delete globalMutex;
|
44
|
+
globalMutex = 0;
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
Init init;
|
49
|
+
|
50
|
+
void
|
51
|
+
interruptedCallback(int /*signal*/)
|
52
|
+
{
|
53
|
+
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex);
|
54
|
+
|
55
|
+
interrupted = true;
|
56
|
+
}
|
57
|
+
|
58
|
+
void
|
59
|
+
usage(const char* n)
|
60
|
+
{
|
61
|
+
getErrorStream() << "Usage: " << n << " [options] slice-files...\n";
|
62
|
+
getErrorStream() <<
|
63
|
+
"Options:\n"
|
64
|
+
"-h, --help Show this message.\n"
|
65
|
+
"-v, --version Display the Ice version.\n"
|
66
|
+
"-DNAME Define NAME as 1.\n"
|
67
|
+
"-DNAME=DEF Define NAME as DEF.\n"
|
68
|
+
"-UNAME Remove any definition for NAME.\n"
|
69
|
+
"-IDIR Put DIR in the include file search path.\n"
|
70
|
+
"-E Print preprocessor output on stdout.\n"
|
71
|
+
"--output-dir DIR Create files in the directory DIR.\n"
|
72
|
+
"--depend Generate Makefile dependencies.\n"
|
73
|
+
"-d, --debug Print debug messages.\n"
|
74
|
+
"--ice Permit `Ice' prefix (for building Ice source code only).\n"
|
75
|
+
"--underscore Permit underscores in Slice identifiers.\n"
|
76
|
+
"--all Generate code for Slice definitions in included files.\n"
|
77
|
+
"--checksum Generate checksums for Slice definitions.\n"
|
78
|
+
;
|
79
|
+
}
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
int
|
84
|
+
Slice::Ruby::compile(int argc, char* argv[])
|
85
|
+
{
|
86
|
+
IceUtilInternal::Options opts;
|
87
|
+
opts.addOpt("h", "help");
|
88
|
+
opts.addOpt("v", "version");
|
89
|
+
opts.addOpt("D", "", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
|
90
|
+
opts.addOpt("U", "", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
|
91
|
+
opts.addOpt("I", "", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
|
92
|
+
opts.addOpt("E");
|
93
|
+
opts.addOpt("", "output-dir", IceUtilInternal::Options::NeedArg);
|
94
|
+
opts.addOpt("", "depend");
|
95
|
+
opts.addOpt("d", "debug");
|
96
|
+
opts.addOpt("", "ice");
|
97
|
+
opts.addOpt("", "underscore");
|
98
|
+
opts.addOpt("", "all");
|
99
|
+
opts.addOpt("", "checksum");
|
100
|
+
|
101
|
+
vector<string> args;
|
102
|
+
try
|
103
|
+
{
|
104
|
+
args = opts.parse(argc, const_cast<const char**>(argv));
|
105
|
+
}
|
106
|
+
catch(const IceUtilInternal::BadOptException& e)
|
107
|
+
{
|
108
|
+
getErrorStream() << argv[0] << ": error: " << e.reason << endl;
|
109
|
+
usage(argv[0]);
|
110
|
+
return EXIT_FAILURE;
|
111
|
+
}
|
112
|
+
|
113
|
+
if(opts.isSet("help"))
|
114
|
+
{
|
115
|
+
usage(argv[0]);
|
116
|
+
return EXIT_SUCCESS;
|
117
|
+
}
|
118
|
+
|
119
|
+
if(opts.isSet("version"))
|
120
|
+
{
|
121
|
+
getErrorStream() << ICE_STRING_VERSION << endl;
|
122
|
+
return EXIT_SUCCESS;
|
123
|
+
}
|
124
|
+
|
125
|
+
vector<string> cppArgs;
|
126
|
+
vector<string> optargs = opts.argVec("D");
|
127
|
+
for(vector<string>::const_iterator i = optargs.begin(); i != optargs.end(); ++i)
|
128
|
+
{
|
129
|
+
cppArgs.push_back("-D" + *i);
|
130
|
+
}
|
131
|
+
|
132
|
+
optargs = opts.argVec("U");
|
133
|
+
for(vector<string>::const_iterator i = optargs.begin(); i != optargs.end(); ++i)
|
134
|
+
{
|
135
|
+
cppArgs.push_back("-U" + *i);
|
136
|
+
}
|
137
|
+
|
138
|
+
vector<string> includePaths = opts.argVec("I");
|
139
|
+
for(vector<string>::const_iterator i = includePaths.begin(); i != includePaths.end(); ++i)
|
140
|
+
{
|
141
|
+
cppArgs.push_back("-I" + Preprocessor::normalizeIncludePath(*i));
|
142
|
+
}
|
143
|
+
|
144
|
+
bool preprocess = opts.isSet("E");
|
145
|
+
|
146
|
+
string output = opts.optArg("output-dir");
|
147
|
+
|
148
|
+
bool depend = opts.isSet("depend");
|
149
|
+
|
150
|
+
bool debug = opts.isSet("debug");
|
151
|
+
|
152
|
+
bool ice = opts.isSet("ice");
|
153
|
+
|
154
|
+
bool underscore = opts.isSet("underscore");
|
155
|
+
|
156
|
+
bool all = opts.isSet("all");
|
157
|
+
|
158
|
+
bool checksum = opts.isSet("checksum");
|
159
|
+
|
160
|
+
if(args.empty())
|
161
|
+
{
|
162
|
+
getErrorStream() << argv[0] << ": error: no input file" << endl;
|
163
|
+
usage(argv[0]);
|
164
|
+
return EXIT_FAILURE;
|
165
|
+
}
|
166
|
+
|
167
|
+
int status = EXIT_SUCCESS;
|
168
|
+
|
169
|
+
IceUtil::CtrlCHandler ctrlCHandler;
|
170
|
+
ctrlCHandler.setCallback(interruptedCallback);
|
171
|
+
|
172
|
+
for(vector<string>::const_iterator i = args.begin(); i != args.end(); ++i)
|
173
|
+
{
|
174
|
+
//
|
175
|
+
// Ignore duplicates.
|
176
|
+
//
|
177
|
+
vector<string>::iterator p = find(args.begin(), args.end(), *i);
|
178
|
+
if(p != i)
|
179
|
+
{
|
180
|
+
continue;
|
181
|
+
}
|
182
|
+
|
183
|
+
if(depend)
|
184
|
+
{
|
185
|
+
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
|
186
|
+
FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2RB__");
|
187
|
+
|
188
|
+
if(cppHandle == 0)
|
189
|
+
{
|
190
|
+
return EXIT_FAILURE;
|
191
|
+
}
|
192
|
+
|
193
|
+
UnitPtr u = Unit::createUnit(false, false, ice, underscore);
|
194
|
+
int parseStatus = u->parse(*i, cppHandle, debug);
|
195
|
+
u->destroy();
|
196
|
+
|
197
|
+
if(parseStatus == EXIT_FAILURE)
|
198
|
+
{
|
199
|
+
return EXIT_FAILURE;
|
200
|
+
}
|
201
|
+
|
202
|
+
if(!icecpp->printMakefileDependencies(Preprocessor::Ruby, includePaths,
|
203
|
+
"-D__SLICE2RB__"))
|
204
|
+
{
|
205
|
+
return EXIT_FAILURE;
|
206
|
+
}
|
207
|
+
|
208
|
+
if(!icecpp->close())
|
209
|
+
{
|
210
|
+
return EXIT_FAILURE;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
else
|
214
|
+
{
|
215
|
+
PreprocessorPtr icecpp = Preprocessor::create(argv[0], *i, cppArgs);
|
216
|
+
FILE* cppHandle = icecpp->preprocess(false, "-D__SLICE2RB__");
|
217
|
+
|
218
|
+
if(cppHandle == 0)
|
219
|
+
{
|
220
|
+
return EXIT_FAILURE;
|
221
|
+
}
|
222
|
+
|
223
|
+
if(preprocess)
|
224
|
+
{
|
225
|
+
char buf[4096];
|
226
|
+
while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
|
227
|
+
{
|
228
|
+
if(fputs(buf, stdout) == EOF)
|
229
|
+
{
|
230
|
+
return EXIT_FAILURE;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
if(!icecpp->close())
|
234
|
+
{
|
235
|
+
return EXIT_FAILURE;
|
236
|
+
}
|
237
|
+
}
|
238
|
+
else
|
239
|
+
{
|
240
|
+
UnitPtr u = Unit::createUnit(false, all, ice, underscore);
|
241
|
+
int parseStatus = u->parse(*i, cppHandle, debug);
|
242
|
+
|
243
|
+
if(!icecpp->close())
|
244
|
+
{
|
245
|
+
u->destroy();
|
246
|
+
return EXIT_FAILURE;
|
247
|
+
}
|
248
|
+
|
249
|
+
if(parseStatus == EXIT_FAILURE)
|
250
|
+
{
|
251
|
+
status = EXIT_FAILURE;
|
252
|
+
}
|
253
|
+
else
|
254
|
+
{
|
255
|
+
string base = icecpp->getBaseName();
|
256
|
+
string::size_type pos = base.find_last_of("/\\");
|
257
|
+
if(pos != string::npos)
|
258
|
+
{
|
259
|
+
base.erase(0, pos + 1);
|
260
|
+
}
|
261
|
+
|
262
|
+
string file = base + ".rb";
|
263
|
+
if(!output.empty())
|
264
|
+
{
|
265
|
+
file = output + '/' + file;
|
266
|
+
}
|
267
|
+
|
268
|
+
try
|
269
|
+
{
|
270
|
+
IceUtilInternal::Output out;
|
271
|
+
out.open(file.c_str());
|
272
|
+
if(!out)
|
273
|
+
{
|
274
|
+
ostringstream os;
|
275
|
+
os << "cannot open`" << file << "': " << strerror(errno);
|
276
|
+
throw FileException(__FILE__, __LINE__, os.str());
|
277
|
+
}
|
278
|
+
FileTracker::instance()->addFile(file);
|
279
|
+
|
280
|
+
printHeader(out);
|
281
|
+
printGeneratedHeader(out, base + ".ice", "#");
|
282
|
+
|
283
|
+
//
|
284
|
+
// Generate the Ruby mapping.
|
285
|
+
//
|
286
|
+
generate(u, all, checksum, includePaths, out);
|
287
|
+
|
288
|
+
out.close();
|
289
|
+
}
|
290
|
+
catch(const Slice::FileException& ex)
|
291
|
+
{
|
292
|
+
// If a file could not be created, then cleanup
|
293
|
+
// any created files.
|
294
|
+
FileTracker::instance()->cleanup();
|
295
|
+
u->destroy();
|
296
|
+
getErrorStream() << argv[0] << ": error: " << ex.reason() << endl;
|
297
|
+
return EXIT_FAILURE;
|
298
|
+
}
|
299
|
+
}
|
300
|
+
|
301
|
+
u->destroy();
|
302
|
+
}
|
303
|
+
}
|
304
|
+
|
305
|
+
{
|
306
|
+
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex);
|
307
|
+
|
308
|
+
if(interrupted)
|
309
|
+
{
|
310
|
+
FileTracker::instance()->cleanup();
|
311
|
+
return EXIT_FAILURE;
|
312
|
+
}
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
return status;
|
317
|
+
}
|
@@ -0,0 +1,1774 @@
|
|
1
|
+
// **********************************************************************
|
2
|
+
//
|
3
|
+
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
|
4
|
+
//
|
5
|
+
// This copy of Ice is licensed to you under the terms described in the
|
6
|
+
// ICE_LICENSE file included in this distribution.
|
7
|
+
//
|
8
|
+
// **********************************************************************
|
9
|
+
|
10
|
+
#include <Slice/RubyUtil.h>
|
11
|
+
#include <Slice/Checksum.h>
|
12
|
+
#include <Slice/Util.h>
|
13
|
+
#include <IceUtil/Functional.h>
|
14
|
+
#include <IceUtil/InputUtil.h>
|
15
|
+
#include <iterator>
|
16
|
+
|
17
|
+
using namespace std;
|
18
|
+
using namespace Slice;
|
19
|
+
using namespace IceUtil;
|
20
|
+
using namespace IceUtilInternal;
|
21
|
+
|
22
|
+
namespace Slice
|
23
|
+
{
|
24
|
+
namespace Ruby
|
25
|
+
{
|
26
|
+
|
27
|
+
//
|
28
|
+
// CodeVisitor generates the Ruby mapping for a translation unit.
|
29
|
+
//
|
30
|
+
class CodeVisitor : public ParserVisitor
|
31
|
+
{
|
32
|
+
public:
|
33
|
+
|
34
|
+
CodeVisitor(IceUtilInternal::Output&);
|
35
|
+
|
36
|
+
virtual bool visitModuleStart(const ModulePtr&);
|
37
|
+
virtual void visitModuleEnd(const ModulePtr&);
|
38
|
+
virtual void visitClassDecl(const ClassDeclPtr&);
|
39
|
+
virtual bool visitClassDefStart(const ClassDefPtr&);
|
40
|
+
virtual bool visitExceptionStart(const ExceptionPtr&);
|
41
|
+
virtual bool visitStructStart(const StructPtr&);
|
42
|
+
virtual void visitSequence(const SequencePtr&);
|
43
|
+
virtual void visitDictionary(const DictionaryPtr&);
|
44
|
+
virtual void visitEnum(const EnumPtr&);
|
45
|
+
virtual void visitConst(const ConstPtr&);
|
46
|
+
|
47
|
+
private:
|
48
|
+
|
49
|
+
//
|
50
|
+
// Return a Python symbol for the given parser element.
|
51
|
+
//
|
52
|
+
string getSymbol(const ContainedPtr&);
|
53
|
+
|
54
|
+
//
|
55
|
+
// Emit Python code to assign the given symbol in the current module.
|
56
|
+
//
|
57
|
+
void registerName(const string&);
|
58
|
+
|
59
|
+
//
|
60
|
+
// Emit the array that describes a Slice type.
|
61
|
+
//
|
62
|
+
void writeType(const TypePtr&);
|
63
|
+
|
64
|
+
//
|
65
|
+
// Get an initializer value for a given type.
|
66
|
+
//
|
67
|
+
string getInitializer(const TypePtr&);
|
68
|
+
|
69
|
+
//
|
70
|
+
// Add a value to a hash code.
|
71
|
+
//
|
72
|
+
void writeHash(const string&, const TypePtr&, int&);
|
73
|
+
|
74
|
+
//
|
75
|
+
// Write a constant value.
|
76
|
+
//
|
77
|
+
void writeConstantValue(const TypePtr&, const SyntaxTreeBasePtr&, const string&);
|
78
|
+
|
79
|
+
struct MemberInfo
|
80
|
+
{
|
81
|
+
string lowerName; // Mapped name beginning with a lower-case letter for use as the name of a local variable.
|
82
|
+
string fixedName;
|
83
|
+
bool inherited;
|
84
|
+
DataMemberPtr dataMember;
|
85
|
+
};
|
86
|
+
typedef list<MemberInfo> MemberInfoList;
|
87
|
+
|
88
|
+
//
|
89
|
+
// Write constructor parameters with default values.
|
90
|
+
//
|
91
|
+
void writeConstructorParams(const MemberInfoList&);
|
92
|
+
|
93
|
+
void collectClassMembers(const ClassDefPtr&, MemberInfoList&, bool);
|
94
|
+
void collectExceptionMembers(const ExceptionPtr&, MemberInfoList&, bool);
|
95
|
+
|
96
|
+
Output& _out;
|
97
|
+
set<string> _classHistory;
|
98
|
+
};
|
99
|
+
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
static string
|
104
|
+
lookupKwd(const string& name)
|
105
|
+
{
|
106
|
+
//
|
107
|
+
// Keyword list. *Must* be kept in alphabetical order.
|
108
|
+
//
|
109
|
+
// This list only contains keywords that might conflict with a Slice
|
110
|
+
// identifier, so keywords like "defined?" are not necessary.
|
111
|
+
//
|
112
|
+
// This list also contains the names of methods on Object that might
|
113
|
+
// conflict with a Slice identifier, so names such as "inspect" and
|
114
|
+
// "send" are included but "to_s" is not.
|
115
|
+
//
|
116
|
+
static const string keywordList[] =
|
117
|
+
{
|
118
|
+
"BEGIN", "END", "alias", "and", "begin", "break", "case", "class", "clone", "def", "display", "do", "dup",
|
119
|
+
"else", "elsif", "end", "ensure", "extend", "false", "for", "freeze", "hash", "if", "in", "initialize_copy",
|
120
|
+
"inspect", "instance_eval", "instance_variable_get", "instance_variable_set", "instance_variables", "method",
|
121
|
+
"method_missing", "methods", "module", "new", "next", "nil", "not", "object_id", "or", "private_methods",
|
122
|
+
"protected_methods", "public_methods", "redo", "rescue", "retry", "return", "self", "send",
|
123
|
+
"singleton_methods", "super", "taint", "then", "to_a", "to_s", "true", "undef", "unless", "untaint", "until",
|
124
|
+
"when", "while", "yield"
|
125
|
+
};
|
126
|
+
bool found = binary_search(&keywordList[0],
|
127
|
+
&keywordList[sizeof(keywordList) / sizeof(*keywordList)],
|
128
|
+
name);
|
129
|
+
return found ? "_" + name : name;
|
130
|
+
}
|
131
|
+
|
132
|
+
//
|
133
|
+
// Split a scoped name into its components and return the components as a list of (unscoped) identifiers.
|
134
|
+
//
|
135
|
+
static vector<string>
|
136
|
+
splitScopedName(const string& scoped)
|
137
|
+
{
|
138
|
+
assert(scoped[0] == ':');
|
139
|
+
vector<string> ids;
|
140
|
+
string::size_type next = 0;
|
141
|
+
string::size_type pos;
|
142
|
+
while((pos = scoped.find("::", next)) != string::npos)
|
143
|
+
{
|
144
|
+
pos += 2;
|
145
|
+
if(pos != scoped.size())
|
146
|
+
{
|
147
|
+
string::size_type endpos = scoped.find("::", pos);
|
148
|
+
if(endpos != string::npos && endpos > pos)
|
149
|
+
{
|
150
|
+
ids.push_back(scoped.substr(pos, endpos - pos));
|
151
|
+
}
|
152
|
+
}
|
153
|
+
next = pos;
|
154
|
+
}
|
155
|
+
if(next != scoped.size())
|
156
|
+
{
|
157
|
+
ids.push_back(scoped.substr(next));
|
158
|
+
}
|
159
|
+
|
160
|
+
return ids;
|
161
|
+
}
|
162
|
+
|
163
|
+
//
|
164
|
+
// CodeVisitor implementation.
|
165
|
+
//
|
166
|
+
Slice::Ruby::CodeVisitor::CodeVisitor(Output& out) :
|
167
|
+
_out(out)
|
168
|
+
{
|
169
|
+
}
|
170
|
+
|
171
|
+
bool
|
172
|
+
Slice::Ruby::CodeVisitor::visitModuleStart(const ModulePtr& p)
|
173
|
+
{
|
174
|
+
_out << sp << nl << "module " << fixIdent(p->name(), IdentToUpper);
|
175
|
+
_out.inc();
|
176
|
+
return true;
|
177
|
+
}
|
178
|
+
|
179
|
+
void
|
180
|
+
Slice::Ruby::CodeVisitor::visitModuleEnd(const ModulePtr&)
|
181
|
+
{
|
182
|
+
_out.dec();
|
183
|
+
_out << nl << "end";
|
184
|
+
}
|
185
|
+
|
186
|
+
void
|
187
|
+
Slice::Ruby::CodeVisitor::visitClassDecl(const ClassDeclPtr& p)
|
188
|
+
{
|
189
|
+
//
|
190
|
+
// Emit forward declarations.
|
191
|
+
//
|
192
|
+
string scoped = p->scoped();
|
193
|
+
if(_classHistory.count(scoped) == 0)
|
194
|
+
{
|
195
|
+
string name = "T_" + fixIdent(p->name(), IdentToUpper);
|
196
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
|
197
|
+
_out.inc();
|
198
|
+
if(p->isLocal())
|
199
|
+
{
|
200
|
+
_out << nl << name << " = ::Ice::__declareLocalClass('" << scoped << "')";
|
201
|
+
}
|
202
|
+
else
|
203
|
+
{
|
204
|
+
_out << nl << name << " = ::Ice::__declareClass('" << scoped << "')";
|
205
|
+
_out << nl << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
|
206
|
+
}
|
207
|
+
_out.dec();
|
208
|
+
_out << nl << "end";
|
209
|
+
_classHistory.insert(scoped); // Avoid redundant declarations.
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
bool
|
214
|
+
Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
|
215
|
+
{
|
216
|
+
string scoped = p->scoped();
|
217
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
218
|
+
ClassList bases = p->bases();
|
219
|
+
ClassDefPtr base;
|
220
|
+
OperationList ops = p->operations();
|
221
|
+
|
222
|
+
//
|
223
|
+
// Define a mix-in module for the class.
|
224
|
+
//
|
225
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_mixin)";
|
226
|
+
_out.inc();
|
227
|
+
_out << nl << "module " << name << "_mixin";
|
228
|
+
_out.inc();
|
229
|
+
|
230
|
+
if(!p->isLocal())
|
231
|
+
{
|
232
|
+
if(!bases.empty() && !bases.front()->isInterface())
|
233
|
+
{
|
234
|
+
base = bases.front();
|
235
|
+
_out << nl << "include " << getAbsolute(bases.front(), IdentToUpper) << "_mixin";
|
236
|
+
}
|
237
|
+
else
|
238
|
+
{
|
239
|
+
_out << nl << "include ::Ice::Object_mixin";
|
240
|
+
}
|
241
|
+
|
242
|
+
//
|
243
|
+
// ice_ids
|
244
|
+
//
|
245
|
+
ClassList allBases = p->allBases();
|
246
|
+
StringList ids;
|
247
|
+
#if defined(__IBMCPP__) && defined(NDEBUG)
|
248
|
+
//
|
249
|
+
// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
|
250
|
+
// when inlining is on. The code below issues a warning: better
|
251
|
+
// than an error!
|
252
|
+
//
|
253
|
+
transform(allBases.begin(), allBases.end(), back_inserter(ids),
|
254
|
+
IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
|
255
|
+
#else
|
256
|
+
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
|
257
|
+
#endif
|
258
|
+
StringList other;
|
259
|
+
other.push_back(scoped);
|
260
|
+
other.push_back("::Ice::Object");
|
261
|
+
other.sort();
|
262
|
+
ids.merge(other);
|
263
|
+
ids.unique();
|
264
|
+
_out << sp << nl << "def ice_ids(current=nil)";
|
265
|
+
_out.inc();
|
266
|
+
_out << nl << "[";
|
267
|
+
for(StringList::iterator q = ids.begin(); q != ids.end(); ++q)
|
268
|
+
{
|
269
|
+
if(q != ids.begin())
|
270
|
+
{
|
271
|
+
_out << ", ";
|
272
|
+
}
|
273
|
+
_out << "'" << *q << "'";
|
274
|
+
}
|
275
|
+
_out << ']';
|
276
|
+
_out.dec();
|
277
|
+
_out << nl << "end";
|
278
|
+
|
279
|
+
//
|
280
|
+
// ice_id
|
281
|
+
//
|
282
|
+
_out << sp << nl << "def ice_id(current=nil)";
|
283
|
+
_out.inc();
|
284
|
+
_out << nl << "'" << scoped << "'";
|
285
|
+
_out.dec();
|
286
|
+
_out << nl << "end";
|
287
|
+
}
|
288
|
+
|
289
|
+
if(!ops.empty())
|
290
|
+
{
|
291
|
+
//
|
292
|
+
// Emit a comment for each operation.
|
293
|
+
//
|
294
|
+
_out << sp
|
295
|
+
<< nl << "#"
|
296
|
+
<< nl << "# Operation signatures."
|
297
|
+
<< nl << "#";
|
298
|
+
for(OperationList::iterator oli = ops.begin(); oli != ops.end(); ++oli)
|
299
|
+
{
|
300
|
+
string fixedOpName = fixIdent((*oli)->name(), IdentNormal);
|
301
|
+
/* If AMI/AMD is ever implemented...
|
302
|
+
if(!p->isLocal() && (p->hasMetaData("amd") || (*oli)->hasMetaData("amd")))
|
303
|
+
{
|
304
|
+
_out << nl << "# def " << fixedOpName << "_async(_cb";
|
305
|
+
|
306
|
+
ParamDeclList params = (*oli)->parameters();
|
307
|
+
|
308
|
+
for(ParamDeclList::iterator pli = params.begin(); pli != params.end(); ++pli)
|
309
|
+
{
|
310
|
+
if(!(*pli)->isOutParam())
|
311
|
+
{
|
312
|
+
_out << ", " << fixIdent((*pli)->name(), IdentToLower);
|
313
|
+
}
|
314
|
+
}
|
315
|
+
if(!p->isLocal())
|
316
|
+
{
|
317
|
+
_out << ", current=nil";
|
318
|
+
}
|
319
|
+
_out << ")";
|
320
|
+
}
|
321
|
+
else
|
322
|
+
*/
|
323
|
+
{
|
324
|
+
_out << nl << "# def " << fixedOpName << "(";
|
325
|
+
|
326
|
+
ParamDeclList params = (*oli)->parameters();
|
327
|
+
|
328
|
+
bool first = true;
|
329
|
+
for(ParamDeclList::iterator pli = params.begin(); pli != params.end(); ++pli)
|
330
|
+
{
|
331
|
+
if(!(*pli)->isOutParam())
|
332
|
+
{
|
333
|
+
if(first)
|
334
|
+
{
|
335
|
+
first = false;
|
336
|
+
}
|
337
|
+
else
|
338
|
+
{
|
339
|
+
_out << ", ";
|
340
|
+
}
|
341
|
+
_out << fixIdent((*pli)->name(), IdentToLower);
|
342
|
+
}
|
343
|
+
}
|
344
|
+
if(!p->isLocal())
|
345
|
+
{
|
346
|
+
if(!first)
|
347
|
+
{
|
348
|
+
_out << ", ";
|
349
|
+
}
|
350
|
+
_out << "current=nil";
|
351
|
+
}
|
352
|
+
_out << ")";
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
//
|
358
|
+
// inspect
|
359
|
+
//
|
360
|
+
_out << sp << nl << "def inspect";
|
361
|
+
_out.inc();
|
362
|
+
_out << nl << "::Ice::__stringify(self, T_" << name << ")";
|
363
|
+
_out.dec();
|
364
|
+
_out << nl << "end";
|
365
|
+
|
366
|
+
//
|
367
|
+
// read/write accessors for data members.
|
368
|
+
//
|
369
|
+
DataMemberList members = p->dataMembers();
|
370
|
+
if(!members.empty())
|
371
|
+
{
|
372
|
+
bool prot = p->hasMetaData("protected");
|
373
|
+
DataMemberList protectedMembers;
|
374
|
+
|
375
|
+
_out << sp << nl << "attr_accessor ";
|
376
|
+
for(DataMemberList::iterator q = members.begin(); q != members.end(); ++q)
|
377
|
+
{
|
378
|
+
if(q != members.begin())
|
379
|
+
{
|
380
|
+
_out << ", ";
|
381
|
+
}
|
382
|
+
_out << ":" << fixIdent((*q)->name(), IdentNormal);
|
383
|
+
if(prot || (*q)->hasMetaData("protected"))
|
384
|
+
{
|
385
|
+
protectedMembers.push_back(*q);
|
386
|
+
}
|
387
|
+
}
|
388
|
+
|
389
|
+
if(!protectedMembers.empty())
|
390
|
+
{
|
391
|
+
_out << nl << "protected ";
|
392
|
+
for(DataMemberList::iterator q = protectedMembers.begin(); q != protectedMembers.end(); ++q)
|
393
|
+
{
|
394
|
+
if(q != protectedMembers.begin())
|
395
|
+
{
|
396
|
+
_out << ", ";
|
397
|
+
}
|
398
|
+
//
|
399
|
+
// We need to list the symbols of the reader and the writer (e.g., ":member" and ":member=").
|
400
|
+
//
|
401
|
+
_out << ":" << fixIdent((*q)->name(), IdentNormal) << ", :"
|
402
|
+
<< fixIdent((*q)->name(), IdentNormal) << '=';
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
|
407
|
+
_out.dec();
|
408
|
+
_out << nl << "end"; // End of mix-in module for class.
|
409
|
+
|
410
|
+
if(p->isInterface())
|
411
|
+
{
|
412
|
+
//
|
413
|
+
// Class.
|
414
|
+
//
|
415
|
+
_out << nl << "class " << name;
|
416
|
+
_out.inc();
|
417
|
+
_out << nl << "include " << name << "_mixin";
|
418
|
+
_out << nl;
|
419
|
+
_out << nl << "def " << name << ".ice_staticId()";
|
420
|
+
_out.inc();
|
421
|
+
_out << nl << "'" << scoped << "'";
|
422
|
+
_out.dec();
|
423
|
+
_out << nl << "end";
|
424
|
+
_out.dec();
|
425
|
+
_out << nl << "end";
|
426
|
+
}
|
427
|
+
else
|
428
|
+
{
|
429
|
+
//
|
430
|
+
// Class.
|
431
|
+
//
|
432
|
+
_out << nl << "class " << name;
|
433
|
+
if(base)
|
434
|
+
{
|
435
|
+
_out << " < " << getAbsolute(base, IdentToUpper);
|
436
|
+
}
|
437
|
+
_out.inc();
|
438
|
+
_out << nl << "include " << name << "_mixin";
|
439
|
+
_out << nl;
|
440
|
+
_out << nl << "def " << name << ".ice_staticId()";
|
441
|
+
_out.inc();
|
442
|
+
_out << nl << "'" << scoped << "'";
|
443
|
+
_out.dec();
|
444
|
+
_out << nl << "end";
|
445
|
+
|
446
|
+
//
|
447
|
+
// initialize
|
448
|
+
//
|
449
|
+
MemberInfoList allMembers;
|
450
|
+
collectClassMembers(p, allMembers, false);
|
451
|
+
if(!allMembers.empty())
|
452
|
+
{
|
453
|
+
_out << sp << nl << "def initialize(";
|
454
|
+
writeConstructorParams(allMembers);
|
455
|
+
_out << ')';
|
456
|
+
_out.inc();
|
457
|
+
|
458
|
+
bool inheritsMembers = false;
|
459
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
460
|
+
{
|
461
|
+
if(q->inherited)
|
462
|
+
{
|
463
|
+
inheritsMembers = true;
|
464
|
+
break;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
|
468
|
+
if(inheritsMembers)
|
469
|
+
{
|
470
|
+
_out << nl << "super" << spar;
|
471
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
472
|
+
{
|
473
|
+
if(q->inherited)
|
474
|
+
{
|
475
|
+
_out << q->lowerName;
|
476
|
+
}
|
477
|
+
}
|
478
|
+
_out << epar;
|
479
|
+
}
|
480
|
+
|
481
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
482
|
+
{
|
483
|
+
if(!q->inherited)
|
484
|
+
{
|
485
|
+
_out << nl << '@' << q->fixedName << " = " << q->lowerName;
|
486
|
+
}
|
487
|
+
}
|
488
|
+
|
489
|
+
_out.dec();
|
490
|
+
_out << nl << "end";
|
491
|
+
}
|
492
|
+
|
493
|
+
_out.dec();
|
494
|
+
_out << nl << "end"; // End of class.
|
495
|
+
}
|
496
|
+
|
497
|
+
//
|
498
|
+
// Generate proxy support. This includes a mix-in module for the proxy's
|
499
|
+
// operations and a class for the proxy itself.
|
500
|
+
//
|
501
|
+
if(!p->isLocal())
|
502
|
+
{
|
503
|
+
_out << nl << "module " << name << "Prx_mixin";
|
504
|
+
_out.inc();
|
505
|
+
for(ClassList::iterator cli = bases.begin(); cli != bases.end(); ++cli)
|
506
|
+
{
|
507
|
+
_out << nl << "include " << getAbsolute(*cli, IdentToUpper) << "Prx_mixin";
|
508
|
+
}
|
509
|
+
for(OperationList::iterator oli = ops.begin(); oli != ops.end(); ++oli)
|
510
|
+
{
|
511
|
+
string fixedOpName = fixIdent((*oli)->name(), IdentNormal);
|
512
|
+
if(fixedOpName == "checkedCast" || fixedOpName == "uncheckedCast")
|
513
|
+
{
|
514
|
+
fixedOpName.insert(0, "_");
|
515
|
+
}
|
516
|
+
TypePtr ret = (*oli)->returnType();
|
517
|
+
ParamDeclList paramList = (*oli)->parameters();
|
518
|
+
string inParams;
|
519
|
+
|
520
|
+
for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q)
|
521
|
+
{
|
522
|
+
if(!(*q)->isOutParam())
|
523
|
+
{
|
524
|
+
if(!inParams.empty())
|
525
|
+
{
|
526
|
+
inParams.append(", ");
|
527
|
+
}
|
528
|
+
inParams.append(fixIdent((*q)->name(), IdentToLower));
|
529
|
+
}
|
530
|
+
}
|
531
|
+
|
532
|
+
_out << sp << nl << "def " << fixedOpName << "(";
|
533
|
+
if(!inParams.empty())
|
534
|
+
{
|
535
|
+
_out << inParams << ", ";
|
536
|
+
}
|
537
|
+
_out << "_ctx=nil)";
|
538
|
+
_out.inc();
|
539
|
+
_out << nl << name << "_mixin::OP_" << (*oli)->name() << ".invoke(self, [" << inParams;
|
540
|
+
_out << "], _ctx)";
|
541
|
+
_out.dec();
|
542
|
+
_out << nl << "end";
|
543
|
+
}
|
544
|
+
_out.dec();
|
545
|
+
_out << nl << "end"; // End of mix-in module for proxy.
|
546
|
+
|
547
|
+
_out << nl << "class " << name << "Prx < ::Ice::ObjectPrx";
|
548
|
+
_out.inc();
|
549
|
+
_out << nl << "include " << name << "Prx_mixin";
|
550
|
+
|
551
|
+
_out << sp << nl << "def " << name << "Prx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)";
|
552
|
+
_out.inc();
|
553
|
+
_out << nl << "ice_checkedCast(proxy, '" << scoped << "', facetOrCtx, _ctx)";
|
554
|
+
_out.dec();
|
555
|
+
_out << nl << "end";
|
556
|
+
|
557
|
+
_out << sp << nl << "def " << name << "Prx.uncheckedCast(proxy, facet=nil)";
|
558
|
+
_out.inc();
|
559
|
+
_out << nl << "ice_uncheckedCast(proxy, facet)";
|
560
|
+
_out.dec();
|
561
|
+
_out << nl << "end";
|
562
|
+
|
563
|
+
_out << nl << "def " << name << "Prx.ice_staticId()";
|
564
|
+
_out.inc();
|
565
|
+
_out << nl << "'" << scoped << "'";
|
566
|
+
_out.dec();
|
567
|
+
_out << nl << "end";
|
568
|
+
|
569
|
+
_out.dec();
|
570
|
+
_out << nl << "end"; // End of proxy class.
|
571
|
+
}
|
572
|
+
|
573
|
+
//
|
574
|
+
// Emit type descriptions.
|
575
|
+
//
|
576
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
|
577
|
+
_out.inc();
|
578
|
+
if(p->isLocal())
|
579
|
+
{
|
580
|
+
_out << nl << "T_" << name << " = ::Ice::__declareLocalClass('" << scoped << "')";
|
581
|
+
}
|
582
|
+
else
|
583
|
+
{
|
584
|
+
_out << nl << "T_" << name << " = ::Ice::__declareClass('" << scoped << "')";
|
585
|
+
_out << nl << "T_" << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
|
586
|
+
}
|
587
|
+
_out.dec();
|
588
|
+
_out << nl << "end";
|
589
|
+
_classHistory.insert(scoped); // Avoid redundant declarations.
|
590
|
+
|
591
|
+
bool isAbstract = p->isInterface() || p->allOperations().size() > 0; // Don't use isAbstract() here - see bug 3739
|
592
|
+
const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
|
593
|
+
_out << sp << nl << "T_" << name << ".defineClass(" << name << ", " << p->compactId() << ", "
|
594
|
+
<< (isAbstract ? "true" : "false") << ", " << (preserved ? "true" : "false") << ", ";
|
595
|
+
if(!base)
|
596
|
+
{
|
597
|
+
_out << "nil";
|
598
|
+
}
|
599
|
+
else
|
600
|
+
{
|
601
|
+
_out << getAbsolute(base, IdentToUpper, "T_");
|
602
|
+
}
|
603
|
+
_out << ", [";
|
604
|
+
//
|
605
|
+
// Interfaces
|
606
|
+
//
|
607
|
+
{
|
608
|
+
int interfaceCount = 0;
|
609
|
+
for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q)
|
610
|
+
{
|
611
|
+
if((*q)->isInterface())
|
612
|
+
{
|
613
|
+
if(interfaceCount > 0)
|
614
|
+
{
|
615
|
+
_out << ", ";
|
616
|
+
}
|
617
|
+
_out << getAbsolute(*q, IdentToUpper, "T_");
|
618
|
+
++interfaceCount;
|
619
|
+
}
|
620
|
+
}
|
621
|
+
}
|
622
|
+
//
|
623
|
+
// Members
|
624
|
+
//
|
625
|
+
// Data members are represented as an array:
|
626
|
+
//
|
627
|
+
// ['MemberName', MemberType, Optional, Tag]
|
628
|
+
//
|
629
|
+
// where MemberType is either a primitive type constant (T_INT, etc.) or the id of a constructed type.
|
630
|
+
//
|
631
|
+
_out << "], [";
|
632
|
+
if(members.size() > 1)
|
633
|
+
{
|
634
|
+
_out.inc();
|
635
|
+
_out << nl;
|
636
|
+
}
|
637
|
+
{
|
638
|
+
for(DataMemberList::iterator q = members.begin(); q != members.end(); ++q)
|
639
|
+
{
|
640
|
+
if(q != members.begin())
|
641
|
+
{
|
642
|
+
_out << ',' << nl;
|
643
|
+
}
|
644
|
+
_out << "['" << fixIdent((*q)->name(), IdentNormal) << "', ";
|
645
|
+
writeType((*q)->type());
|
646
|
+
_out << ", " << ((*q)->optional() ? "true" : "false") << ", " << ((*q)->optional() ? (*q)->tag() : 0)
|
647
|
+
<< ']';
|
648
|
+
}
|
649
|
+
}
|
650
|
+
if(members.size() > 1)
|
651
|
+
{
|
652
|
+
_out.dec();
|
653
|
+
_out << nl;
|
654
|
+
}
|
655
|
+
_out << "])";
|
656
|
+
_out << nl << name << "_mixin::ICE_TYPE = T_" << name;
|
657
|
+
|
658
|
+
//
|
659
|
+
// Define each operation. The arguments to __defineOperation are:
|
660
|
+
//
|
661
|
+
// 'opName', Mode, IsAmd, FormatType, [InParams], [OutParams], ReturnParam, [Exceptions]
|
662
|
+
//
|
663
|
+
// where InParams and OutParams are arrays of type descriptions, and Exceptions
|
664
|
+
// is an array of exception types.
|
665
|
+
//
|
666
|
+
if(!p->isLocal())
|
667
|
+
{
|
668
|
+
_out << sp << nl << "T_" << name << "Prx.defineProxy(" << name << "Prx, T_" << name << ')';
|
669
|
+
_out << nl << name << "Prx::ICE_TYPE = T_" << name << "Prx";
|
670
|
+
|
671
|
+
if(!ops.empty())
|
672
|
+
{
|
673
|
+
_out << sp;
|
674
|
+
}
|
675
|
+
for(OperationList::iterator s = ops.begin(); s != ops.end(); ++s)
|
676
|
+
{
|
677
|
+
ParamDeclList params = (*s)->parameters();
|
678
|
+
ParamDeclList::iterator t;
|
679
|
+
int count;
|
680
|
+
string format;
|
681
|
+
switch((*s)->format())
|
682
|
+
{
|
683
|
+
case DefaultFormat:
|
684
|
+
format = "nil";
|
685
|
+
break;
|
686
|
+
case CompactFormat:
|
687
|
+
format = "::Ice::FormatType::CompactFormat";
|
688
|
+
break;
|
689
|
+
case SlicedFormat:
|
690
|
+
format = "::Ice::FormatType::SlicedFormat";
|
691
|
+
break;
|
692
|
+
}
|
693
|
+
|
694
|
+
_out << nl << name << "_mixin::OP_" << (*s)->name() << " = ::Ice::__defineOperation('"
|
695
|
+
<< (*s)->name() << "', ";
|
696
|
+
switch((*s)->mode())
|
697
|
+
{
|
698
|
+
case Operation::Normal:
|
699
|
+
_out << "::Ice::OperationMode::Normal";
|
700
|
+
break;
|
701
|
+
case Operation::Nonmutating:
|
702
|
+
_out << "::Ice::OperationMode::Nonmutating";
|
703
|
+
break;
|
704
|
+
case Operation::Idempotent:
|
705
|
+
_out << "::Ice::OperationMode::Idempotent";
|
706
|
+
break;
|
707
|
+
}
|
708
|
+
_out << ", ";
|
709
|
+
switch((*s)->sendMode())
|
710
|
+
{
|
711
|
+
case Operation::Normal:
|
712
|
+
_out << "::Ice::OperationMode::Normal";
|
713
|
+
break;
|
714
|
+
case Operation::Nonmutating:
|
715
|
+
_out << "::Ice::OperationMode::Nonmutating";
|
716
|
+
break;
|
717
|
+
case Operation::Idempotent:
|
718
|
+
_out << "::Ice::OperationMode::Idempotent";
|
719
|
+
break;
|
720
|
+
}
|
721
|
+
_out << ", " << ((p->hasMetaData("amd") || (*s)->hasMetaData("amd")) ? "true" : "false") << ", " << format
|
722
|
+
<< ", [";
|
723
|
+
for(t = params.begin(), count = 0; t != params.end(); ++t)
|
724
|
+
{
|
725
|
+
if(!(*t)->isOutParam())
|
726
|
+
{
|
727
|
+
if(count > 0)
|
728
|
+
{
|
729
|
+
_out << ", ";
|
730
|
+
}
|
731
|
+
_out << '[';
|
732
|
+
writeType((*t)->type());
|
733
|
+
_out << ", " << ((*t)->optional() ? "true" : "false") << ", "
|
734
|
+
<< ((*t)->optional() ? (*t)->tag() : 0) << ']';
|
735
|
+
++count;
|
736
|
+
}
|
737
|
+
}
|
738
|
+
_out << "], [";
|
739
|
+
for(t = params.begin(), count = 0; t != params.end(); ++t)
|
740
|
+
{
|
741
|
+
if((*t)->isOutParam())
|
742
|
+
{
|
743
|
+
if(count > 0)
|
744
|
+
{
|
745
|
+
_out << ", ";
|
746
|
+
}
|
747
|
+
_out << '[';
|
748
|
+
writeType((*t)->type());
|
749
|
+
_out << ", " << ((*t)->optional() ? "true" : "false") << ", "
|
750
|
+
<< ((*t)->optional() ? (*t)->tag() : 0) << ']';
|
751
|
+
++count;
|
752
|
+
}
|
753
|
+
}
|
754
|
+
_out << "], ";
|
755
|
+
TypePtr returnType = (*s)->returnType();
|
756
|
+
if(returnType)
|
757
|
+
{
|
758
|
+
//
|
759
|
+
// The return type has the same format as an in/out parameter:
|
760
|
+
//
|
761
|
+
// Type, Optional?, OptionalTag
|
762
|
+
//
|
763
|
+
_out << '[';
|
764
|
+
writeType(returnType);
|
765
|
+
_out << ", " << ((*s)->returnIsOptional() ? "true" : "false") << ", "
|
766
|
+
<< ((*s)->returnIsOptional() ? (*s)->returnTag() : 0) << ']';
|
767
|
+
}
|
768
|
+
else
|
769
|
+
{
|
770
|
+
_out << "nil";
|
771
|
+
}
|
772
|
+
_out << ", [";
|
773
|
+
ExceptionList exceptions = (*s)->throws();
|
774
|
+
for(ExceptionList::iterator u = exceptions.begin(); u != exceptions.end(); ++u)
|
775
|
+
{
|
776
|
+
if(u != exceptions.begin())
|
777
|
+
{
|
778
|
+
_out << ", ";
|
779
|
+
}
|
780
|
+
_out << getAbsolute(*u, IdentToUpper, "T_");
|
781
|
+
}
|
782
|
+
_out << "])";
|
783
|
+
|
784
|
+
string deprecateMetadata;
|
785
|
+
if((*s)->findMetaData("deprecate", deprecateMetadata) || p->findMetaData("deprecate", deprecateMetadata))
|
786
|
+
{
|
787
|
+
string msg;
|
788
|
+
string::size_type pos = deprecateMetadata.find(':');
|
789
|
+
if(pos != string::npos && pos < deprecateMetadata.size() - 1)
|
790
|
+
{
|
791
|
+
msg = deprecateMetadata.substr(pos + 1);
|
792
|
+
}
|
793
|
+
_out << nl << name << "_mixin::OP_" << (*s)->name() << ".deprecate(\"" << msg << "\")";
|
794
|
+
}
|
795
|
+
}
|
796
|
+
}
|
797
|
+
|
798
|
+
_out.dec();
|
799
|
+
_out << nl << "end"; // if not defined?()
|
800
|
+
|
801
|
+
return false;
|
802
|
+
}
|
803
|
+
|
804
|
+
bool
|
805
|
+
Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
|
806
|
+
{
|
807
|
+
string scoped = p->scoped();
|
808
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
809
|
+
|
810
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
|
811
|
+
_out.inc();
|
812
|
+
_out << nl << "class " << name << " < ";
|
813
|
+
ExceptionPtr base = p->base();
|
814
|
+
string baseName;
|
815
|
+
if(base)
|
816
|
+
{
|
817
|
+
baseName = getAbsolute(base, IdentToUpper);
|
818
|
+
_out << baseName;
|
819
|
+
}
|
820
|
+
else if(p->isLocal())
|
821
|
+
{
|
822
|
+
_out << "Ice::LocalException";
|
823
|
+
}
|
824
|
+
else
|
825
|
+
{
|
826
|
+
_out << "Ice::UserException";
|
827
|
+
}
|
828
|
+
_out.inc();
|
829
|
+
|
830
|
+
DataMemberList members = p->dataMembers();
|
831
|
+
|
832
|
+
//
|
833
|
+
// initialize
|
834
|
+
//
|
835
|
+
_out << nl << "def initialize";
|
836
|
+
MemberInfoList allMembers;
|
837
|
+
collectExceptionMembers(p, allMembers, false);
|
838
|
+
bool inheritsMembers = false;
|
839
|
+
if(!allMembers.empty())
|
840
|
+
{
|
841
|
+
_out << '(';
|
842
|
+
writeConstructorParams(allMembers);
|
843
|
+
_out << ')';
|
844
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
845
|
+
{
|
846
|
+
if(q->inherited)
|
847
|
+
{
|
848
|
+
inheritsMembers = true;
|
849
|
+
}
|
850
|
+
}
|
851
|
+
}
|
852
|
+
_out.inc();
|
853
|
+
if(!allMembers.empty())
|
854
|
+
{
|
855
|
+
if(inheritsMembers)
|
856
|
+
{
|
857
|
+
_out << nl << "super" << spar;
|
858
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
859
|
+
{
|
860
|
+
if(q->inherited)
|
861
|
+
{
|
862
|
+
_out << q->lowerName;
|
863
|
+
}
|
864
|
+
}
|
865
|
+
_out << epar;
|
866
|
+
}
|
867
|
+
for(MemberInfoList::iterator q = allMembers.begin(); q != allMembers.end(); ++q)
|
868
|
+
{
|
869
|
+
if(!q->inherited)
|
870
|
+
{
|
871
|
+
_out << nl << '@' << q->fixedName << " = " << q->lowerName;
|
872
|
+
}
|
873
|
+
}
|
874
|
+
}
|
875
|
+
_out.dec();
|
876
|
+
_out << nl << "end";
|
877
|
+
|
878
|
+
//
|
879
|
+
// to_s
|
880
|
+
//
|
881
|
+
_out << sp << nl << "def to_s";
|
882
|
+
_out.inc();
|
883
|
+
_out << nl << "'" << scoped.substr(2) << "'";
|
884
|
+
_out.dec();
|
885
|
+
_out << nl << "end";
|
886
|
+
|
887
|
+
//
|
888
|
+
// read/write accessors for data members.
|
889
|
+
//
|
890
|
+
if(!members.empty())
|
891
|
+
{
|
892
|
+
_out << sp << nl << "attr_accessor ";
|
893
|
+
for(DataMemberList::iterator dmli = members.begin(); dmli != members.end(); ++dmli)
|
894
|
+
{
|
895
|
+
if(dmli != members.begin())
|
896
|
+
{
|
897
|
+
_out << ", ";
|
898
|
+
}
|
899
|
+
_out << ':' << fixIdent((*dmli)->name(), IdentNormal);
|
900
|
+
}
|
901
|
+
}
|
902
|
+
|
903
|
+
_out.dec();
|
904
|
+
_out << nl << "end"; // End of class.
|
905
|
+
|
906
|
+
//
|
907
|
+
// Emit the type information.
|
908
|
+
//
|
909
|
+
const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
|
910
|
+
_out << sp << nl << "T_" << name << " = ::Ice::__defineException('" << scoped << "', " << name << ", "
|
911
|
+
<< (preserved ? "true" : "false") << ", ";
|
912
|
+
if(!base)
|
913
|
+
{
|
914
|
+
_out << "nil";
|
915
|
+
}
|
916
|
+
else
|
917
|
+
{
|
918
|
+
_out << getAbsolute(base, IdentToUpper, "T_");
|
919
|
+
}
|
920
|
+
_out << ", [";
|
921
|
+
if(members.size() > 1)
|
922
|
+
{
|
923
|
+
_out.inc();
|
924
|
+
_out << nl;
|
925
|
+
}
|
926
|
+
//
|
927
|
+
// Data members are represented as an array:
|
928
|
+
//
|
929
|
+
// ['MemberName', MemberType, Optional, Tag]
|
930
|
+
//
|
931
|
+
// where MemberType is either a primitive type constant (T_INT, etc.) or the id of a constructed type.
|
932
|
+
//
|
933
|
+
for(DataMemberList::iterator dmli = members.begin(); dmli != members.end(); ++dmli)
|
934
|
+
{
|
935
|
+
if(dmli != members.begin())
|
936
|
+
{
|
937
|
+
_out << ',' << nl;
|
938
|
+
}
|
939
|
+
_out << "[\"" << fixIdent((*dmli)->name(), IdentNormal) << "\", ";
|
940
|
+
writeType((*dmli)->type());
|
941
|
+
_out << ", " << ((*dmli)->optional() ? "true" : "false") << ", " << ((*dmli)->optional() ? (*dmli)->tag() : 0)
|
942
|
+
<< ']';
|
943
|
+
}
|
944
|
+
if(members.size() > 1)
|
945
|
+
{
|
946
|
+
_out.dec();
|
947
|
+
_out << nl;
|
948
|
+
}
|
949
|
+
_out << "])";
|
950
|
+
_out << nl << name << "::ICE_TYPE = T_" << name;
|
951
|
+
|
952
|
+
_out.dec();
|
953
|
+
_out << nl << "end"; // if not defined?()
|
954
|
+
|
955
|
+
return false;
|
956
|
+
}
|
957
|
+
|
958
|
+
bool
|
959
|
+
Slice::Ruby::CodeVisitor::visitStructStart(const StructPtr& p)
|
960
|
+
{
|
961
|
+
string scoped = p->scoped();
|
962
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
963
|
+
MemberInfoList memberList;
|
964
|
+
|
965
|
+
{
|
966
|
+
DataMemberList members = p->dataMembers();
|
967
|
+
for(DataMemberList::iterator q = members.begin(); q != members.end(); ++q)
|
968
|
+
{
|
969
|
+
memberList.push_back(MemberInfo());
|
970
|
+
memberList.back().lowerName = fixIdent((*q)->name(), IdentToLower);
|
971
|
+
memberList.back().fixedName = fixIdent((*q)->name(), IdentNormal);
|
972
|
+
memberList.back().inherited = false;
|
973
|
+
memberList.back().dataMember = *q;
|
974
|
+
}
|
975
|
+
}
|
976
|
+
|
977
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
|
978
|
+
_out.inc();
|
979
|
+
_out << nl << "class " << name;
|
980
|
+
_out.inc();
|
981
|
+
if(!memberList.empty())
|
982
|
+
{
|
983
|
+
_out << nl << "def initialize(";
|
984
|
+
writeConstructorParams(memberList);
|
985
|
+
_out << ")";
|
986
|
+
_out.inc();
|
987
|
+
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
|
988
|
+
{
|
989
|
+
_out << nl << '@' << r->fixedName << " = " << r->lowerName;
|
990
|
+
}
|
991
|
+
_out.dec();
|
992
|
+
_out << nl << "end";
|
993
|
+
}
|
994
|
+
|
995
|
+
//
|
996
|
+
// hash
|
997
|
+
//
|
998
|
+
_out << sp << nl << "def hash";
|
999
|
+
_out.inc();
|
1000
|
+
_out << nl << "_h = 0";
|
1001
|
+
int iter = 0;
|
1002
|
+
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
|
1003
|
+
{
|
1004
|
+
writeHash("@" + r->fixedName, r->dataMember->type(), iter);
|
1005
|
+
}
|
1006
|
+
_out << nl << "_h % 0x7fffffff";
|
1007
|
+
_out.dec();
|
1008
|
+
_out << nl << "end";
|
1009
|
+
|
1010
|
+
//
|
1011
|
+
// ==
|
1012
|
+
//
|
1013
|
+
_out << sp << nl << "def ==(other)";
|
1014
|
+
_out.inc();
|
1015
|
+
_out << nl << "return false if";
|
1016
|
+
_out.inc();
|
1017
|
+
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
|
1018
|
+
{
|
1019
|
+
if(r != memberList.begin())
|
1020
|
+
{
|
1021
|
+
_out << " or";
|
1022
|
+
}
|
1023
|
+
_out << nl << "@" << r->fixedName << " != other." << r->fixedName;
|
1024
|
+
}
|
1025
|
+
_out.dec();
|
1026
|
+
_out << nl << "true";
|
1027
|
+
_out.dec();
|
1028
|
+
_out << nl << "end";
|
1029
|
+
|
1030
|
+
//
|
1031
|
+
// eql?
|
1032
|
+
//
|
1033
|
+
// This method is used to determine the equality of keys in a Hash object.
|
1034
|
+
//
|
1035
|
+
_out << sp << nl << "def eql?(other)";
|
1036
|
+
_out.inc();
|
1037
|
+
_out << nl << "return other.class == self.class && other == self";
|
1038
|
+
_out.dec();
|
1039
|
+
_out << nl << "end";
|
1040
|
+
|
1041
|
+
//
|
1042
|
+
// inspect
|
1043
|
+
//
|
1044
|
+
_out << sp << nl << "def inspect";
|
1045
|
+
_out.inc();
|
1046
|
+
_out << nl << "::Ice::__stringify(self, T_" << name << ")";
|
1047
|
+
_out.dec();
|
1048
|
+
_out << nl << "end";
|
1049
|
+
|
1050
|
+
//
|
1051
|
+
// read/write accessors for data members.
|
1052
|
+
//
|
1053
|
+
if(!memberList.empty())
|
1054
|
+
{
|
1055
|
+
_out << sp << nl << "attr_accessor ";
|
1056
|
+
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
|
1057
|
+
{
|
1058
|
+
if(r != memberList.begin())
|
1059
|
+
{
|
1060
|
+
_out << ", ";
|
1061
|
+
}
|
1062
|
+
_out << ':' << r->fixedName;
|
1063
|
+
}
|
1064
|
+
}
|
1065
|
+
|
1066
|
+
_out.dec();
|
1067
|
+
_out << nl << "end"; // End of class.
|
1068
|
+
|
1069
|
+
//
|
1070
|
+
// Emit the type information.
|
1071
|
+
//
|
1072
|
+
_out << sp << nl << "T_" << name << " = ::Ice::__defineStruct('" << scoped << "', " << name << ", [";
|
1073
|
+
//
|
1074
|
+
// Data members are represented as an array:
|
1075
|
+
//
|
1076
|
+
// ['MemberName', MemberType]
|
1077
|
+
//
|
1078
|
+
// where MemberType is either a primitive type constant (T_INT, etc.) or the id of a constructed type.
|
1079
|
+
//
|
1080
|
+
if(memberList.size() > 1)
|
1081
|
+
{
|
1082
|
+
_out.inc();
|
1083
|
+
_out << nl;
|
1084
|
+
}
|
1085
|
+
for(MemberInfoList::iterator r = memberList.begin(); r != memberList.end(); ++r)
|
1086
|
+
{
|
1087
|
+
if(r != memberList.begin())
|
1088
|
+
{
|
1089
|
+
_out << ',' << nl;
|
1090
|
+
}
|
1091
|
+
_out << "[\"" << r->fixedName << "\", ";
|
1092
|
+
writeType(r->dataMember->type());
|
1093
|
+
_out << ']';
|
1094
|
+
}
|
1095
|
+
if(memberList.size() > 1)
|
1096
|
+
{
|
1097
|
+
_out.dec();
|
1098
|
+
_out << nl;
|
1099
|
+
}
|
1100
|
+
_out << "])";
|
1101
|
+
|
1102
|
+
_out.dec();
|
1103
|
+
_out << nl << "end"; // if not defined?()
|
1104
|
+
|
1105
|
+
return false;
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
void
|
1109
|
+
Slice::Ruby::CodeVisitor::visitSequence(const SequencePtr& p)
|
1110
|
+
{
|
1111
|
+
//
|
1112
|
+
// Emit the type information.
|
1113
|
+
//
|
1114
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
1115
|
+
string scoped = p->scoped();
|
1116
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
|
1117
|
+
_out.inc();
|
1118
|
+
_out << nl << "T_" << name << " = ::Ice::__defineSequence('" << scoped << "', ";
|
1119
|
+
writeType(p->type());
|
1120
|
+
_out << ")";
|
1121
|
+
_out.dec();
|
1122
|
+
_out << nl << "end"; // if not defined?()
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
void
|
1126
|
+
Slice::Ruby::CodeVisitor::visitDictionary(const DictionaryPtr& p)
|
1127
|
+
{
|
1128
|
+
//
|
1129
|
+
// Emit the type information.
|
1130
|
+
//
|
1131
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
1132
|
+
string scoped = p->scoped();
|
1133
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
|
1134
|
+
_out.inc();
|
1135
|
+
_out << nl << "T_" << name << " = ::Ice::__defineDictionary('" << scoped << "', ";
|
1136
|
+
writeType(p->keyType());
|
1137
|
+
_out << ", ";
|
1138
|
+
writeType(p->valueType());
|
1139
|
+
_out << ")";
|
1140
|
+
_out.dec();
|
1141
|
+
_out << nl << "end"; // if not defined?()
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
void
|
1145
|
+
Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p)
|
1146
|
+
{
|
1147
|
+
string scoped = p->scoped();
|
1148
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
1149
|
+
EnumeratorList enums = p->getEnumerators();
|
1150
|
+
|
1151
|
+
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
|
1152
|
+
_out.inc();
|
1153
|
+
_out << nl << "class " << name;
|
1154
|
+
_out.inc();
|
1155
|
+
_out << nl << "include Comparable";
|
1156
|
+
_out << sp << nl << "def initialize(name, value)";
|
1157
|
+
_out.inc();
|
1158
|
+
_out << nl << "@name = name";
|
1159
|
+
_out << nl << "@value = value";
|
1160
|
+
_out.dec();
|
1161
|
+
_out << nl << "end";
|
1162
|
+
|
1163
|
+
//
|
1164
|
+
// from_int
|
1165
|
+
//
|
1166
|
+
{
|
1167
|
+
_out << sp << nl << "def " << name << ".from_int(val)";
|
1168
|
+
ostringstream sz;
|
1169
|
+
sz << enums.size() - 1;
|
1170
|
+
_out.inc();
|
1171
|
+
_out << nl << "@@_enumerators[val]"; // Evaluates to nil if the key is not found
|
1172
|
+
_out.dec();
|
1173
|
+
_out << nl << "end";
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
//
|
1177
|
+
// to_s
|
1178
|
+
//
|
1179
|
+
_out << sp << nl << "def to_s";
|
1180
|
+
_out.inc();
|
1181
|
+
_out << nl << "@name";
|
1182
|
+
_out.dec();
|
1183
|
+
_out << nl << "end";
|
1184
|
+
|
1185
|
+
//
|
1186
|
+
// to_i
|
1187
|
+
//
|
1188
|
+
_out << sp << nl << "def to_i";
|
1189
|
+
_out.inc();
|
1190
|
+
_out << nl << "@value";
|
1191
|
+
_out.dec();
|
1192
|
+
_out << nl << "end";
|
1193
|
+
|
1194
|
+
//
|
1195
|
+
// <=>
|
1196
|
+
//
|
1197
|
+
_out << sp << nl << "def <=>(other)";
|
1198
|
+
_out.inc();
|
1199
|
+
_out << nl << "other.is_a?(" << name << ") or raise ArgumentError, \"value must be a " << name << "\"";
|
1200
|
+
_out << nl << "@value <=> other.to_i";
|
1201
|
+
_out.dec();
|
1202
|
+
_out << nl << "end";
|
1203
|
+
|
1204
|
+
//
|
1205
|
+
// hash
|
1206
|
+
//
|
1207
|
+
_out << sp << nl << "def hash";
|
1208
|
+
_out.inc();
|
1209
|
+
_out << nl << "@value.hash";
|
1210
|
+
_out.dec();
|
1211
|
+
_out << nl << "end";
|
1212
|
+
|
1213
|
+
//
|
1214
|
+
// inspect
|
1215
|
+
//
|
1216
|
+
_out << sp << nl << "def inspect";
|
1217
|
+
_out.inc();
|
1218
|
+
_out << nl << "@name + \"(#{@value})\"";
|
1219
|
+
_out.dec();
|
1220
|
+
_out << nl << "end";
|
1221
|
+
|
1222
|
+
//
|
1223
|
+
// each
|
1224
|
+
//
|
1225
|
+
_out << sp << nl << "def " << name << ".each(&block)";
|
1226
|
+
_out.inc();
|
1227
|
+
_out << nl << "@@_enumerators.each_value(&block)";
|
1228
|
+
_out.dec();
|
1229
|
+
_out << nl << "end";
|
1230
|
+
|
1231
|
+
//
|
1232
|
+
// Constant for each enumerator.
|
1233
|
+
//
|
1234
|
+
_out << sp;
|
1235
|
+
int i = 0;
|
1236
|
+
for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q, ++i)
|
1237
|
+
{
|
1238
|
+
ostringstream idx;
|
1239
|
+
idx << i;
|
1240
|
+
_out << nl << fixIdent((*q)->name(), IdentToUpper) << " = " << name << ".new(\"" << (*q)->name()
|
1241
|
+
<< "\", " << (*q)->value() << ')';
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
_out << sp << nl << "@@_enumerators = {";
|
1245
|
+
for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q)
|
1246
|
+
{
|
1247
|
+
if(q != enums.begin())
|
1248
|
+
{
|
1249
|
+
_out << ", ";
|
1250
|
+
}
|
1251
|
+
_out << (*q)->value() << "=>" << fixIdent((*q)->name(), IdentToUpper);
|
1252
|
+
}
|
1253
|
+
_out << '}';
|
1254
|
+
|
1255
|
+
_out << sp << nl << "def " << name << "._enumerators";
|
1256
|
+
_out.inc();
|
1257
|
+
_out << nl << "@@_enumerators";
|
1258
|
+
_out.dec();
|
1259
|
+
_out << nl << "end";
|
1260
|
+
|
1261
|
+
_out << sp << nl << "private_class_method :new";
|
1262
|
+
|
1263
|
+
_out.dec();
|
1264
|
+
_out << nl << "end"; // End of class.
|
1265
|
+
|
1266
|
+
//
|
1267
|
+
// Emit the type information.
|
1268
|
+
//
|
1269
|
+
_out << sp << nl << "T_" << name << " = ::Ice::__defineEnum('" << scoped << "', " << name << ", " << name
|
1270
|
+
<< "::_enumerators)";
|
1271
|
+
|
1272
|
+
_out.dec();
|
1273
|
+
_out << nl << "end"; // if not defined?()
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
void
|
1277
|
+
Slice::Ruby::CodeVisitor::visitConst(const ConstPtr& p)
|
1278
|
+
{
|
1279
|
+
Slice::TypePtr type = p->type();
|
1280
|
+
string name = fixIdent(p->name(), IdentToUpper);
|
1281
|
+
|
1282
|
+
_out << sp << nl << name << " = ";
|
1283
|
+
writeConstantValue(type, p->valueType(), p->value());
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
void
|
1287
|
+
Slice::Ruby::CodeVisitor::writeType(const TypePtr& p)
|
1288
|
+
{
|
1289
|
+
BuiltinPtr builtin = BuiltinPtr::dynamicCast(p);
|
1290
|
+
if(builtin)
|
1291
|
+
{
|
1292
|
+
switch(builtin->kind())
|
1293
|
+
{
|
1294
|
+
case Builtin::KindBool:
|
1295
|
+
{
|
1296
|
+
_out << "::Ice::T_bool";
|
1297
|
+
break;
|
1298
|
+
}
|
1299
|
+
case Builtin::KindByte:
|
1300
|
+
{
|
1301
|
+
_out << "::Ice::T_byte";
|
1302
|
+
break;
|
1303
|
+
}
|
1304
|
+
case Builtin::KindShort:
|
1305
|
+
{
|
1306
|
+
_out << "::Ice::T_short";
|
1307
|
+
break;
|
1308
|
+
}
|
1309
|
+
case Builtin::KindInt:
|
1310
|
+
{
|
1311
|
+
_out << "::Ice::T_int";
|
1312
|
+
break;
|
1313
|
+
}
|
1314
|
+
case Builtin::KindLong:
|
1315
|
+
{
|
1316
|
+
_out << "::Ice::T_long";
|
1317
|
+
break;
|
1318
|
+
}
|
1319
|
+
case Builtin::KindFloat:
|
1320
|
+
{
|
1321
|
+
_out << "::Ice::T_float";
|
1322
|
+
break;
|
1323
|
+
}
|
1324
|
+
case Builtin::KindDouble:
|
1325
|
+
{
|
1326
|
+
_out << "::Ice::T_double";
|
1327
|
+
break;
|
1328
|
+
}
|
1329
|
+
case Builtin::KindString:
|
1330
|
+
{
|
1331
|
+
_out << "::Ice::T_string";
|
1332
|
+
break;
|
1333
|
+
}
|
1334
|
+
case Builtin::KindObject:
|
1335
|
+
{
|
1336
|
+
_out << "::Ice::T_Object";
|
1337
|
+
break;
|
1338
|
+
}
|
1339
|
+
case Builtin::KindObjectProxy:
|
1340
|
+
{
|
1341
|
+
_out << "::Ice::T_ObjectPrx";
|
1342
|
+
break;
|
1343
|
+
}
|
1344
|
+
case Builtin::KindLocalObject:
|
1345
|
+
{
|
1346
|
+
_out << "::Ice::T_LocalObject";
|
1347
|
+
break;
|
1348
|
+
}
|
1349
|
+
}
|
1350
|
+
return;
|
1351
|
+
}
|
1352
|
+
|
1353
|
+
ProxyPtr prx = ProxyPtr::dynamicCast(p);
|
1354
|
+
if(prx)
|
1355
|
+
{
|
1356
|
+
_out << getAbsolute(prx->_class(), IdentToUpper, "T_") << "Prx";
|
1357
|
+
return;
|
1358
|
+
}
|
1359
|
+
|
1360
|
+
ContainedPtr cont = ContainedPtr::dynamicCast(p);
|
1361
|
+
assert(cont);
|
1362
|
+
_out << getAbsolute(cont, IdentToUpper, "T_");
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
string
|
1366
|
+
Slice::Ruby::CodeVisitor::getInitializer(const TypePtr& p)
|
1367
|
+
{
|
1368
|
+
BuiltinPtr builtin = BuiltinPtr::dynamicCast(p);
|
1369
|
+
if(builtin)
|
1370
|
+
{
|
1371
|
+
switch(builtin->kind())
|
1372
|
+
{
|
1373
|
+
case Builtin::KindBool:
|
1374
|
+
{
|
1375
|
+
return "false";
|
1376
|
+
}
|
1377
|
+
case Builtin::KindByte:
|
1378
|
+
case Builtin::KindShort:
|
1379
|
+
case Builtin::KindInt:
|
1380
|
+
case Builtin::KindLong:
|
1381
|
+
{
|
1382
|
+
return "0";
|
1383
|
+
}
|
1384
|
+
case Builtin::KindFloat:
|
1385
|
+
case Builtin::KindDouble:
|
1386
|
+
{
|
1387
|
+
return "0.0";
|
1388
|
+
}
|
1389
|
+
case Builtin::KindString:
|
1390
|
+
{
|
1391
|
+
return "''";
|
1392
|
+
}
|
1393
|
+
case Builtin::KindObject:
|
1394
|
+
case Builtin::KindObjectProxy:
|
1395
|
+
case Builtin::KindLocalObject:
|
1396
|
+
{
|
1397
|
+
return "nil";
|
1398
|
+
}
|
1399
|
+
}
|
1400
|
+
}
|
1401
|
+
|
1402
|
+
EnumPtr en = EnumPtr::dynamicCast(p);
|
1403
|
+
if(en)
|
1404
|
+
{
|
1405
|
+
EnumeratorList enums = en->getEnumerators();
|
1406
|
+
return getAbsolute(en, IdentToUpper) + "::" + fixIdent(enums.front()->name(), IdentToUpper);
|
1407
|
+
}
|
1408
|
+
|
1409
|
+
StructPtr st = StructPtr::dynamicCast(p);
|
1410
|
+
if(st)
|
1411
|
+
{
|
1412
|
+
return getAbsolute(st, IdentToUpper) + ".new";
|
1413
|
+
}
|
1414
|
+
|
1415
|
+
return "nil";
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
void
|
1419
|
+
Slice::Ruby::CodeVisitor::writeHash(const string& name, const TypePtr&, int&)
|
1420
|
+
{
|
1421
|
+
_out << nl << "_h = 5 * _h + " << name << ".hash";
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
void
|
1425
|
+
Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTreeBasePtr& valueType,
|
1426
|
+
const string& value)
|
1427
|
+
{
|
1428
|
+
ConstPtr constant = ConstPtr::dynamicCast(valueType);
|
1429
|
+
if(constant)
|
1430
|
+
{
|
1431
|
+
_out << fixIdent(constant->scoped(), IdentToUpper);
|
1432
|
+
}
|
1433
|
+
else
|
1434
|
+
{
|
1435
|
+
Slice::BuiltinPtr b = Slice::BuiltinPtr::dynamicCast(type);
|
1436
|
+
Slice::EnumPtr en = Slice::EnumPtr::dynamicCast(type);
|
1437
|
+
if(b)
|
1438
|
+
{
|
1439
|
+
switch(b->kind())
|
1440
|
+
{
|
1441
|
+
case Slice::Builtin::KindBool:
|
1442
|
+
case Slice::Builtin::KindByte:
|
1443
|
+
case Slice::Builtin::KindShort:
|
1444
|
+
case Slice::Builtin::KindInt:
|
1445
|
+
case Slice::Builtin::KindFloat:
|
1446
|
+
case Slice::Builtin::KindDouble:
|
1447
|
+
{
|
1448
|
+
_out << value;
|
1449
|
+
break;
|
1450
|
+
}
|
1451
|
+
case Slice::Builtin::KindLong:
|
1452
|
+
{
|
1453
|
+
IceUtil::Int64 l;
|
1454
|
+
IceUtilInternal::stringToInt64(value, l);
|
1455
|
+
_out << value;
|
1456
|
+
break;
|
1457
|
+
}
|
1458
|
+
case Slice::Builtin::KindString:
|
1459
|
+
{
|
1460
|
+
//
|
1461
|
+
// Expand strings into the basic source character set. We can't use isalpha() and the like
|
1462
|
+
// here because they are sensitive to the current locale.
|
1463
|
+
//
|
1464
|
+
static const string basicSourceChars = "abcdefghijklmnopqrstuvwxyz"
|
1465
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
1466
|
+
"0123456789"
|
1467
|
+
"_{}[]#()<>%:;.?*+-/^&|~!=, '";
|
1468
|
+
static const set<char> charSet(basicSourceChars.begin(), basicSourceChars.end());
|
1469
|
+
|
1470
|
+
_out << "\""; // Opening "
|
1471
|
+
|
1472
|
+
for(string::const_iterator c = value.begin(); c != value.end(); ++c)
|
1473
|
+
{
|
1474
|
+
switch(*c)
|
1475
|
+
{
|
1476
|
+
case '"':
|
1477
|
+
{
|
1478
|
+
_out << "\\\"";
|
1479
|
+
break;
|
1480
|
+
}
|
1481
|
+
case '\\':
|
1482
|
+
{
|
1483
|
+
_out << "\\\\";
|
1484
|
+
break;
|
1485
|
+
}
|
1486
|
+
case '\r':
|
1487
|
+
{
|
1488
|
+
_out << "\\r";
|
1489
|
+
break;
|
1490
|
+
}
|
1491
|
+
case '\n':
|
1492
|
+
{
|
1493
|
+
_out << "\\n";
|
1494
|
+
break;
|
1495
|
+
}
|
1496
|
+
case '\t':
|
1497
|
+
{
|
1498
|
+
_out << "\\t";
|
1499
|
+
break;
|
1500
|
+
}
|
1501
|
+
case '\b':
|
1502
|
+
{
|
1503
|
+
_out << "\\b";
|
1504
|
+
break;
|
1505
|
+
}
|
1506
|
+
case '\f':
|
1507
|
+
{
|
1508
|
+
_out << "\\f";
|
1509
|
+
break;
|
1510
|
+
}
|
1511
|
+
default:
|
1512
|
+
{
|
1513
|
+
if(charSet.find(*c) == charSet.end())
|
1514
|
+
{
|
1515
|
+
unsigned char uc = *c; // Char may be signed, so make it positive.
|
1516
|
+
stringstream s;
|
1517
|
+
s << "\\"; // Print as octal if not in basic source character set.
|
1518
|
+
s.flags(ios_base::oct);
|
1519
|
+
s.width(3);
|
1520
|
+
s.fill('0');
|
1521
|
+
s << static_cast<unsigned>(uc);
|
1522
|
+
_out << s.str();
|
1523
|
+
}
|
1524
|
+
else
|
1525
|
+
{
|
1526
|
+
_out << *c; // Print normally if in basic source character set.
|
1527
|
+
}
|
1528
|
+
break;
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
_out << "\""; // Closing "
|
1534
|
+
break;
|
1535
|
+
}
|
1536
|
+
|
1537
|
+
case Slice::Builtin::KindObject:
|
1538
|
+
case Slice::Builtin::KindObjectProxy:
|
1539
|
+
case Slice::Builtin::KindLocalObject:
|
1540
|
+
assert(false);
|
1541
|
+
}
|
1542
|
+
}
|
1543
|
+
else if(en)
|
1544
|
+
{
|
1545
|
+
_out << getAbsolute(en, IdentToUpper) << "::";
|
1546
|
+
string::size_type colon = value.rfind(':');
|
1547
|
+
if(colon != string::npos)
|
1548
|
+
{
|
1549
|
+
_out << fixIdent(value.substr(colon + 1), IdentToUpper);
|
1550
|
+
}
|
1551
|
+
else
|
1552
|
+
{
|
1553
|
+
_out << fixIdent(value, IdentToUpper);
|
1554
|
+
}
|
1555
|
+
}
|
1556
|
+
else
|
1557
|
+
{
|
1558
|
+
assert(false); // Unknown const type.
|
1559
|
+
}
|
1560
|
+
}
|
1561
|
+
}
|
1562
|
+
|
1563
|
+
void
|
1564
|
+
Slice::Ruby::CodeVisitor::writeConstructorParams(const MemberInfoList& members)
|
1565
|
+
{
|
1566
|
+
for(MemberInfoList::const_iterator p = members.begin(); p != members.end(); ++p)
|
1567
|
+
{
|
1568
|
+
if(p != members.begin())
|
1569
|
+
{
|
1570
|
+
_out << ", ";
|
1571
|
+
}
|
1572
|
+
_out << p->lowerName << "=";
|
1573
|
+
|
1574
|
+
const DataMemberPtr member = p->dataMember;
|
1575
|
+
if(member->defaultValueType())
|
1576
|
+
{
|
1577
|
+
writeConstantValue(member->type(), member->defaultValueType(), member->defaultValue());
|
1578
|
+
}
|
1579
|
+
else if(member->optional())
|
1580
|
+
{
|
1581
|
+
_out << "::Ice::Unset";
|
1582
|
+
}
|
1583
|
+
else
|
1584
|
+
{
|
1585
|
+
_out << getInitializer(member->type());
|
1586
|
+
}
|
1587
|
+
}
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
void
|
1591
|
+
Slice::Ruby::CodeVisitor::collectClassMembers(const ClassDefPtr& p, MemberInfoList& allMembers, bool inherited)
|
1592
|
+
{
|
1593
|
+
ClassList bases = p->bases();
|
1594
|
+
if(!bases.empty() && !bases.front()->isInterface())
|
1595
|
+
{
|
1596
|
+
collectClassMembers(bases.front(), allMembers, true);
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
DataMemberList members = p->dataMembers();
|
1600
|
+
|
1601
|
+
for(DataMemberList::iterator q = members.begin(); q != members.end(); ++q)
|
1602
|
+
{
|
1603
|
+
MemberInfo m;
|
1604
|
+
m.lowerName = fixIdent((*q)->name(), IdentToLower);
|
1605
|
+
m.fixedName = fixIdent((*q)->name(), IdentNormal);
|
1606
|
+
m.inherited = inherited;
|
1607
|
+
m.dataMember = *q;
|
1608
|
+
allMembers.push_back(m);
|
1609
|
+
}
|
1610
|
+
}
|
1611
|
+
|
1612
|
+
void
|
1613
|
+
Slice::Ruby::CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberInfoList& allMembers, bool inherited)
|
1614
|
+
{
|
1615
|
+
ExceptionPtr base = p->base();
|
1616
|
+
if(base)
|
1617
|
+
{
|
1618
|
+
collectExceptionMembers(base, allMembers, true);
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
DataMemberList members = p->dataMembers();
|
1622
|
+
|
1623
|
+
for(DataMemberList::iterator q = members.begin(); q != members.end(); ++q)
|
1624
|
+
{
|
1625
|
+
MemberInfo m;
|
1626
|
+
m.lowerName = fixIdent((*q)->name(), IdentToLower);
|
1627
|
+
m.fixedName = fixIdent((*q)->name(), IdentNormal);
|
1628
|
+
m.inherited = inherited;
|
1629
|
+
m.dataMember = *q;
|
1630
|
+
allMembers.push_back(m);
|
1631
|
+
}
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
void
|
1635
|
+
Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out)
|
1636
|
+
{
|
1637
|
+
out << nl << "require 'Ice'";
|
1638
|
+
|
1639
|
+
if(!all)
|
1640
|
+
{
|
1641
|
+
vector<string> paths = includePaths;
|
1642
|
+
for(vector<string>::iterator p = paths.begin(); p != paths.end(); ++p)
|
1643
|
+
{
|
1644
|
+
*p = fullPath(*p);
|
1645
|
+
}
|
1646
|
+
|
1647
|
+
StringList includes = un->includeFiles();
|
1648
|
+
for(StringList::const_iterator q = includes.begin(); q != includes.end(); ++q)
|
1649
|
+
{
|
1650
|
+
string file = changeInclude(*q, paths);
|
1651
|
+
out << nl << "require '" << file << ".rb'";
|
1652
|
+
}
|
1653
|
+
}
|
1654
|
+
|
1655
|
+
CodeVisitor codeVisitor(out);
|
1656
|
+
un->visit(&codeVisitor, false);
|
1657
|
+
|
1658
|
+
if(checksum)
|
1659
|
+
{
|
1660
|
+
ChecksumMap checksums = createChecksums(un);
|
1661
|
+
if(!checksums.empty())
|
1662
|
+
{
|
1663
|
+
out << sp;
|
1664
|
+
for(ChecksumMap::const_iterator p = checksums.begin(); p != checksums.end(); ++p)
|
1665
|
+
{
|
1666
|
+
out << nl << "::Ice::SliceChecksums[\"" << p->first << "\"] = \"";
|
1667
|
+
ostringstream str;
|
1668
|
+
str.flags(ios_base::hex);
|
1669
|
+
str.fill('0');
|
1670
|
+
for(vector<unsigned char>::const_iterator q = p->second.begin(); q != p->second.end(); ++q)
|
1671
|
+
{
|
1672
|
+
str << static_cast<int>(*q);
|
1673
|
+
}
|
1674
|
+
out << str.str() << "\"";
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
}
|
1678
|
+
|
1679
|
+
out << nl; // Trailing newline.
|
1680
|
+
}
|
1681
|
+
|
1682
|
+
string
|
1683
|
+
Slice::Ruby::fixIdent(const string& ident, IdentStyle style)
|
1684
|
+
{
|
1685
|
+
assert(!ident.empty());
|
1686
|
+
if(ident[0] != ':')
|
1687
|
+
{
|
1688
|
+
string id = ident;
|
1689
|
+
switch(style)
|
1690
|
+
{
|
1691
|
+
case IdentNormal:
|
1692
|
+
break;
|
1693
|
+
case IdentToUpper:
|
1694
|
+
// Special case BEGIN & END for class/module names.
|
1695
|
+
if(id == "BEGIN" || id == "END")
|
1696
|
+
{
|
1697
|
+
return id + "_";
|
1698
|
+
}
|
1699
|
+
if(id[0] >= 'a' && id[0] <= 'z')
|
1700
|
+
{
|
1701
|
+
id[0] += 'A' - 'a';
|
1702
|
+
}
|
1703
|
+
break;
|
1704
|
+
case IdentToLower:
|
1705
|
+
if(id[0] >= 'A' && id[0] <= 'Z')
|
1706
|
+
{
|
1707
|
+
id[0] += 'a' - 'A';
|
1708
|
+
}
|
1709
|
+
break;
|
1710
|
+
}
|
1711
|
+
return lookupKwd(id);
|
1712
|
+
}
|
1713
|
+
|
1714
|
+
vector<string> ids = splitScopedName(ident);
|
1715
|
+
assert(!ids.empty());
|
1716
|
+
|
1717
|
+
ostringstream result;
|
1718
|
+
|
1719
|
+
for(vector<string>::size_type i = 0; i < ids.size() - 1; ++i)
|
1720
|
+
{
|
1721
|
+
//
|
1722
|
+
// We assume all intermediate names must be upper-case (i.e., they represent
|
1723
|
+
// the names of modules or classes).
|
1724
|
+
//
|
1725
|
+
result << "::" << fixIdent(ids[i], IdentToUpper);
|
1726
|
+
}
|
1727
|
+
|
1728
|
+
result << "::" << fixIdent(ids[ids.size() - 1], style);
|
1729
|
+
|
1730
|
+
//
|
1731
|
+
// Preserve trailing scope resolution operator if necessary.
|
1732
|
+
//
|
1733
|
+
if(ident.rfind("::") == ident.size() - 2)
|
1734
|
+
{
|
1735
|
+
result << "::";
|
1736
|
+
}
|
1737
|
+
|
1738
|
+
return result.str();
|
1739
|
+
}
|
1740
|
+
|
1741
|
+
string
|
1742
|
+
Slice::Ruby::getAbsolute(const ContainedPtr& cont, IdentStyle style, const string& prefix)
|
1743
|
+
{
|
1744
|
+
string scope = fixIdent(cont->scope(), IdentToUpper);
|
1745
|
+
|
1746
|
+
if(prefix.empty())
|
1747
|
+
{
|
1748
|
+
return scope + fixIdent(cont->name(), style);
|
1749
|
+
}
|
1750
|
+
else
|
1751
|
+
{
|
1752
|
+
return scope + prefix + fixIdent(cont->name(), style);
|
1753
|
+
}
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
void
|
1757
|
+
Slice::Ruby::printHeader(IceUtilInternal::Output& out)
|
1758
|
+
{
|
1759
|
+
static const char* header =
|
1760
|
+
"# **********************************************************************\n"
|
1761
|
+
"#\n"
|
1762
|
+
"# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\n"
|
1763
|
+
"#\n"
|
1764
|
+
"# This copy of Ice is licensed to you under the terms described in the\n"
|
1765
|
+
"# ICE_LICENSE file included in this distribution.\n"
|
1766
|
+
"#\n"
|
1767
|
+
"# **********************************************************************\n"
|
1768
|
+
;
|
1769
|
+
|
1770
|
+
out << header;
|
1771
|
+
out << "#\n";
|
1772
|
+
out << "# Ice version " << ICE_STRING_VERSION << "\n";
|
1773
|
+
out << "#\n";
|
1774
|
+
}
|