From 4325bb1901a609893c315654e25a40bc1f1a970e Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Mon, 5 Feb 2024 09:25:49 -0500 Subject: [PATCH 1/2] Rework -std flag on Linux/macos (#1751) --- .devcontainer/Dockerfile | 2 +- config/Make.project.rules | 2 +- config/Make.rules.Darwin | 10 +++++++--- config/Make.rules.Linux | 8 ++++---- cpp/config/Make.rules | 5 +---- cpp/include/IceBT/ConnectionInfo.h | 2 ++ cpp/include/IceBT/EndpointInfo.h | 2 ++ cpp/include/IceBT/Types.h | 2 ++ cpp/include/IceIAP/ConnectionInfo.h | 2 ++ cpp/include/IceIAP/EndpointInfo.h | 2 ++ cpp/src/IceBT/TransceiverI.h | 3 +-- .../project.pbxproj | 16 ++++++++-------- php/config/Make.rules | 2 +- python/config/Make.rules | 2 +- ruby/config/Make.rules | 2 +- swift/Rakefile | 2 +- 16 files changed, 37 insertions(+), 27 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ccabb3daa23..a622934433b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,7 @@ RUN set -eux \ && sudo dpkg -i packages-microsoft-prod.deb \ && rm packages-microsoft-prod.deb \ && sudo apt update \ - && sudo apt-get install -y python3 ruby-full \ + && sudo apt-get install -y python3 python3-dev python3-passlib ruby-full \ && sudo apt-get install -y libbluetooth-dev libbz2-dev libdbus-1-dev libedit-dev libexpat1-dev liblmdb-dev libmcpp-dev libssl-dev libsystemd-dev \ && sudo rm -rf /var/lib/apt/lists/* \ && sudo apt-get clean diff --git a/config/Make.project.rules b/config/Make.project.rules index 2c5c73dc43d..d6c8202c4f1 100644 --- a/config/Make.project.rules +++ b/config/Make.project.rules @@ -133,7 +133,7 @@ $3/%.o: $1/%.mm $3/%.o: $1/%.mm $(E) "Compiling [$8-$9] $$<" $(Q)$(or $($8_cxx),$(platform_cxx)) $(CXXFLAGS) $(call depend-cppflags,$3/$$*.Td,$$@)\ - $(strip $6) $(CPPFLAGS) -std=c++17 -c $$< -o $$@ + $(strip $6) $(CPPFLAGS) -c $$< -o $$@ $(Q)$(MV) $3/$$*.Td $3/$$*.mm.d endif diff --git a/config/Make.rules.Darwin b/config/Make.rules.Darwin index e97883697cf..ab6a8b40474 100644 --- a/config/Make.rules.Darwin +++ b/config/Make.rules.Darwin @@ -42,9 +42,13 @@ ifeq ($(MAXWARN),yes) cppflags += -Wweak-vtables endif -# -Wshadow issues false warnings with clang 3.x (Apple LLVM 9.0) -ifeq ($(shell clang -v 2>&1 | sed -ne 's/.*version \([0-9]*\)\.\([0-9]*\).*/\1\2/p'),90) - cppflags := $(filter-out -Wshadow -Wshadow-all,$(cppflags)) +clang_version = $(shell clang -dumpversion 2>&1 | cut -f1 -d\.) + +# We use -std=c++20 with clang 15.0 and later. +ifeq ($(shell test $(clang_version) -ge 15 && echo yes),yes) + cppflags += -std=c++20 +else + cppflags += -std=c++17 endif nodeprecatedwarnings-cppflags := -Wno-deprecated-declarations diff --git a/config/Make.rules.Linux b/config/Make.rules.Linux index b1d819ecad8..02e20de81c6 100644 --- a/config/Make.rules.Linux +++ b/config/Make.rules.Linux @@ -140,10 +140,10 @@ shared_ldflags = $(if $(filter-out program,$($1_target)),\ cppflags = -Wall -Wextra -Wredundant-decls -Wshadow -Wdeprecated -Werror -pthread $(if $(filter yes,$(OPTIMIZE)),-DNDEBUG,-g) ldflags = -pthread -# -Wshadow is too strict with gcc 4 -ifeq ($(shell $(CXX) -dumpversion | cut -f1 -d\.),4) - cppflags := $(filter-out -Wshadow,$(cppflags)) -endif +gcc_version = $(shell $(CXX) -dumpversion 2>&1 | cut -f1 -d\.) + +# As of GCC 13.4, https://gcc.gnu.org/projects/cxx-status.html#cxx20 still describes C++20 support as "experimental". +cppflags += -std=c++17 nodeprecatedwarnings-cppflags := -Wno-deprecated-declarations nounusedparameter-cppflags := -Wno-unused-parameter diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index 018bff9dbee..b8f4a6bf211 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -17,9 +17,6 @@ ifeq ($(os),Darwin) include $(lang_srcdir)/config/Make.xcodesdk.rules endif -# We assume Make.rules.$(os) defines cppflags. -cppflags += -std=c++17 - # Validate platforms and configs $(eval $(call validate-config)) @@ -78,7 +75,7 @@ define make-cpp-src-project ifeq ($(filter all cpp,$(ICE_BIN_DIST)),) $1_slicecompiler := slice2cpp $1_sliceflags += -I$(slicedir) -$1_cppflags += -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC -std=c++17 +$1_cppflags += -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC $(make-project) srcs:: $1 endif diff --git a/cpp/include/IceBT/ConnectionInfo.h b/cpp/include/IceBT/ConnectionInfo.h index 328f5536eb3..04578549f4b 100644 --- a/cpp/include/IceBT/ConnectionInfo.h +++ b/cpp/include/IceBT/ConnectionInfo.h @@ -5,6 +5,7 @@ #ifndef __IceBT_ConnectionInfo_h__ #define __IceBT_ConnectionInfo_h__ +#include #include #include #include @@ -130,4 +131,5 @@ using ConnectionInfoPtr = ::std::shared_ptr; } /// \endcond +#include #endif diff --git a/cpp/include/IceBT/EndpointInfo.h b/cpp/include/IceBT/EndpointInfo.h index 8ee188629d4..2f07b4b380b 100644 --- a/cpp/include/IceBT/EndpointInfo.h +++ b/cpp/include/IceBT/EndpointInfo.h @@ -5,6 +5,7 @@ #ifndef __IceBT_EndpointInfo_h__ #define __IceBT_EndpointInfo_h__ +#include #include #include #include @@ -89,4 +90,5 @@ using EndpointInfoPtr = ::std::shared_ptr; } /// \endcond +#include #endif diff --git a/cpp/include/IceBT/Types.h b/cpp/include/IceBT/Types.h index e04c235050c..a45becaebec 100644 --- a/cpp/include/IceBT/Types.h +++ b/cpp/include/IceBT/Types.h @@ -5,6 +5,7 @@ #ifndef __IceBT_Types_h__ #define __IceBT_Types_h__ +#include #include #include #include @@ -90,4 +91,5 @@ class ICE_CLASS(ICEBT_API) BluetoothException : public ::Ice::LocalExceptionHelp } +#include #endif diff --git a/cpp/include/IceIAP/ConnectionInfo.h b/cpp/include/IceIAP/ConnectionInfo.h index 8e0beff214a..bc2d4d13b51 100644 --- a/cpp/include/IceIAP/ConnectionInfo.h +++ b/cpp/include/IceIAP/ConnectionInfo.h @@ -5,6 +5,7 @@ #ifndef __IceIAP_ConnectionInfo_h__ #define __IceIAP_ConnectionInfo_h__ +#include #include #include #include @@ -115,4 +116,5 @@ using ConnectionInfoPtr = ::std::shared_ptr; } /// \endcond +#include #endif diff --git a/cpp/include/IceIAP/EndpointInfo.h b/cpp/include/IceIAP/EndpointInfo.h index 68badd0241a..b0b9d9dadcf 100644 --- a/cpp/include/IceIAP/EndpointInfo.h +++ b/cpp/include/IceIAP/EndpointInfo.h @@ -5,6 +5,7 @@ #ifndef __IceIAP_EndpointInfo_h__ #define __IceIAP_EndpointInfo_h__ +#include #include #include #include @@ -104,4 +105,5 @@ using EndpointInfoPtr = ::std::shared_ptr; } /// \endcond +#include #endif diff --git a/cpp/src/IceBT/TransceiverI.h b/cpp/src/IceBT/TransceiverI.h index 4a9ca020efb..a628f9094cc 100644 --- a/cpp/src/IceBT/TransceiverI.h +++ b/cpp/src/IceBT/TransceiverI.h @@ -10,7 +10,6 @@ #include #include -#include namespace IceBT { @@ -51,7 +50,7 @@ class TransceiverI : public IceInternal::Transceiver std::string _addr; std::string _uuid; bool _needConnect; - IceInternal::UniquePtr _exception; + std::unique_ptr _exception; IceUtil::Monitor _lock; void connectCompleted(int, const ConnectionPtr&); diff --git a/cpp/test/ios/controller/C++ Test Controller.xcodeproj/project.pbxproj b/cpp/test/ios/controller/C++ Test Controller.xcodeproj/project.pbxproj index 622dff4a948..be35501b64b 100644 --- a/cpp/test/ios/controller/C++ Test Controller.xcodeproj/project.pbxproj +++ b/cpp/test/ios/controller/C++ Test Controller.xcodeproj/project.pbxproj @@ -547,7 +547,7 @@ 1440D8701E0186FF00CF7ED3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = U4TBVKNQ7F; @@ -586,7 +586,7 @@ 1440D8711E0186FF00CF7ED3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = U4TBVKNQ7F; @@ -625,7 +625,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = U4TBVKNQ7F; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -658,7 +658,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = U4TBVKNQ7F; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -795,7 +795,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = U4TBVKNQ7F; INFOPLIST_FILE = Classes/Info.plist; @@ -824,7 +824,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = U4TBVKNQ7F; INFOPLIST_FILE = Classes/Info.plist; @@ -852,7 +852,7 @@ 14E3982F1E01B14B00A89291 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = U4TBVKNQ7F; @@ -891,7 +891,7 @@ 14E398301E01B14B00A89291 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = U4TBVKNQ7F; diff --git a/php/config/Make.rules b/php/config/Make.rules index 6f70fcd2ab3..1bad6e40dae 100644 --- a/php/config/Make.rules +++ b/php/config/Make.rules @@ -50,7 +50,7 @@ ifneq ($(shell type $(PHP_CONFIG) > /dev/null 2>&1 && echo 0),0) $(error $(PHP_CONFIG) not found review your PHP installation and ensure $(PHP_CONFIG) is in your PATH) endif -php_cppflags = -std=c++17 $(shell $(PHP_CONFIG) --includes) +php_cppflags = $(shell $(PHP_CONFIG) --includes) ifeq ($(os),Darwin) php_cppflags := $(php_cppflags) -Wno-unused-parameter -Wno-missing-field-initializers diff --git a/python/config/Make.rules b/python/config/Make.rules index 48826f58e45..cb28fa96485 100644 --- a/python/config/Make.rules +++ b/python/config/Make.rules @@ -22,7 +22,7 @@ ifeq ($(os),Linux) cppflags := $(filter-out -Wredundant-decls,$(cppflags)) endif -python_cppflags := -std=c++17 $(or $(PYTHON_CPPFLAGS),$(shell $(python-config) --cflags)) +python_cppflags := $(or $(PYTHON_CPPFLAGS),$(shell $(python-config) --cflags)) python_ldflags := $(or $(PYTHON_LDLFLAGS),$(shell $(python-config) --ldflags)) # Use .so as default value --extension-suffix is not supported by python-config in all platforms diff --git a/ruby/config/Make.rules b/ruby/config/Make.rules index 5b242f5b359..210b4a445dc 100644 --- a/ruby/config/Make.rules +++ b/ruby/config/Make.rules @@ -15,7 +15,7 @@ ruby-call = $(shell $(RUBY) -e 'require "rbconfig"; puts RbConfig::expand("$1")' # Ruby compiler flags platform_cxx := $(call ruby-call, $$(CXX)) -ruby_cppflags := -std=c++17 -I$(call ruby-call,$$(rubyhdrdir)) +ruby_cppflags := -I$(call ruby-call,$$(rubyhdrdir)) ruby_config_dir := $(call ruby-call,$$(includedir)/$$(arch)/ruby-$$(ruby_version)) ruby_arch := $(call ruby-call,$$(arch)) ifeq ($(wildcard $(ruby_config_dir)/ruby/config.h),) diff --git a/swift/Rakefile b/swift/Rakefile index 045d4ed943c..684bdbec9e3 100644 --- a/swift/Rakefile +++ b/swift/Rakefile @@ -737,7 +737,7 @@ def target_set_common_build_settings(target, product, platform, plist: nil, swif config.build_settings["GCC_SYMBOLS_PRIVATE_EXTERN"] = "YES" config.build_settings["ENABLE_TESTABILITY"] = "NO" config.build_settings["GCC_TREAT_WARNINGS_AS_ERRORS"] = "YES" - config.build_settings["CLANG_CXX_LANGUAGE_STANDARD"] = "c++17" + config.build_settings["CLANG_CXX_LANGUAGE_STANDARD"] = "c++20" config.build_settings["CURRENT_PROJECT_VERSION"] = $projectVersion config.build_settings["DYLIB_CURRENT_VERSION"] = $projectVersion config.build_settings["DYLIB_COMPATIBILITY_VERSION"] = "0" From dd14cad20c10d7502cefc8929e210e780ee8ed6b Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Mon, 5 Feb 2024 09:30:55 -0500 Subject: [PATCH 2/2] Remove Ice::optional and IceUtil::Optional (#1752) --- CHANGELOG-3.8.md | 40 +-- cpp/include/Ice/Communicator.h | 2 +- cpp/include/Ice/CommunicatorF.h | 2 +- cpp/include/Ice/Connection.h | 4 +- cpp/include/Ice/ConnectionF.h | 2 +- cpp/include/Ice/Current.h | 2 +- cpp/include/Ice/Endpoint.h | 2 +- cpp/include/Ice/EndpointF.h | 2 +- cpp/include/Ice/EndpointSelectionType.h | 2 +- cpp/include/Ice/Ice.h | 2 +- cpp/include/Ice/ImplicitContext.h | 2 +- cpp/include/Ice/ImplicitContextF.h | 2 +- cpp/include/Ice/InputStream.h | 8 +- cpp/include/Ice/LocalException.h | 2 +- cpp/include/Ice/Logger.h | 2 +- cpp/include/Ice/LoggerF.h | 2 +- cpp/include/Ice/Optional.h | 66 ---- cpp/include/Ice/OutputStream.h | 6 +- cpp/include/Ice/Plugin.h | 2 +- cpp/include/Ice/PluginF.h | 2 +- cpp/include/Ice/Properties.h | 2 +- cpp/include/Ice/PropertiesF.h | 2 +- cpp/include/Ice/Proxy.h | 4 +- cpp/include/IceBT/ConnectionInfo.h | 2 +- cpp/include/IceBT/EndpointInfo.h | 2 +- cpp/include/IceBT/Types.h | 2 +- cpp/include/IceBox/Service.h | 2 +- cpp/include/IceGrid/PluginFacade.h | 2 +- cpp/include/IceIAP/ConnectionInfo.h | 2 +- cpp/include/IceIAP/EndpointInfo.h | 2 +- cpp/include/IceSSL/ConnectionInfo.h | 2 +- cpp/include/IceSSL/ConnectionInfoF.h | 2 +- cpp/include/IceSSL/EndpointInfo.h | 2 +- cpp/src/Glacier2/Instrumentation.h | 2 +- cpp/src/Glacier2/RouterI.cpp | 2 +- cpp/src/Glacier2/RouterI.h | 2 +- cpp/src/Glacier2/SessionRouterI.cpp | 2 +- cpp/src/Glacier2/SessionRouterI.h | 2 +- cpp/src/Glacier2Lib/Application.cpp | 2 +- cpp/src/Glacier2Lib/SessionHelper.cpp | 2 +- cpp/src/Ice/ACM.cpp | 12 +- cpp/src/Ice/ACM.h | 18 +- cpp/src/Ice/ConnectionI.cpp | 6 +- cpp/src/Ice/ConnectionI.h | 6 +- cpp/src/Ice/Proxy.cpp | 4 +- cpp/src/Ice/Reference.cpp | 10 +- cpp/src/Ice/Reference.h | 12 +- cpp/src/Ice/ReferenceFactory.cpp | 2 +- cpp/src/Ice/RouterInfo.cpp | 6 +- cpp/src/Ice/RouterInfo.h | 2 +- cpp/src/IceBridge/IceBridge.cpp | 2 +- cpp/src/IceGrid/Client.cpp | 4 +- cpp/src/IceGrid/ReplicaSessionI.cpp | 2 +- cpp/src/IceGrid/ReplicaSessionI.h | 2 +- cpp/src/IceGrid/ReplicaSessionManager.cpp | 2 +- cpp/src/IceStorm/Instrumentation.h | 2 +- cpp/test/Ice/acm/AllTests.cpp | 4 +- .../adapterDeactivation/ServantLocatorI.cpp | 2 +- cpp/test/Ice/background/Server.cpp | 2 +- cpp/test/Ice/optional/AllTests.cpp | 306 +++++++++--------- cpp/test/Ice/optional/TestAMDI.cpp | 150 ++++----- cpp/test/Ice/optional/TestAMDI.h | 150 ++++----- cpp/test/Ice/optional/TestI.cpp | 176 +++++----- cpp/test/Ice/optional/TestI.h | 194 +++++------ cpp/test/Ice/proxy/AllTests.cpp | 12 +- cpp/test/IceBridge/simple/AllTests.cpp | 2 +- cpp/test/IceBridge/simple/TestI.cpp | 2 +- cpp/test/IceGrid/activation/AllTests.cpp | 2 +- cpp/test/IceGrid/allocation/AllTests.cpp | 2 +- cpp/test/IceGrid/deployer/AllTests.cpp | 4 +- cpp/test/IceGrid/distribution/AllTests.cpp | 2 +- cpp/test/IceGrid/noRestartUpdate/AllTests.cpp | 2 +- cpp/test/IceGrid/replicaGroup/AllTests.cpp | 2 +- cpp/test/IceGrid/replication/AllTests.cpp | 2 +- cpp/test/IceGrid/session/AllTests.cpp | 18 +- cpp/test/IceGrid/simple/AllTests.cpp | 2 +- cpp/test/IceGrid/update/AllTests.cpp | 2 +- matlab/src/Connection.cpp | 6 +- php/src/Connection.cpp | 6 +- php/src/Proxy.cpp | 2 +- python/modules/IcePy/Connection.cpp | 6 +- python/modules/IcePy/Proxy.cpp | 4 +- ruby/src/IceRuby/Connection.cpp | 6 +- ruby/src/IceRuby/Proxy.cpp | 4 +- swift/src/IceImpl/Connection.mm | 6 +- 85 files changed, 633 insertions(+), 733 deletions(-) delete mode 100644 cpp/include/Ice/Optional.h diff --git a/CHANGELOG-3.8.md b/CHANGELOG-3.8.md index faf8690f3bb..6cda618e3a2 100644 --- a/CHANGELOG-3.8.md +++ b/CHANGELOG-3.8.md @@ -24,47 +24,13 @@ Ice 3.7. You can still define proxies with the usual syntax, `Greeter*`, where ` ## C++ Changes -- The C++98 mapping is now called the Original mapping. - -- The C++11 mapping is now called the New mapping. - -- (Original mapping) The base class for mapped class instances is now Ice::Value, like in the new mapping. Previously, -Ice::Object was the base class for both mapped class instances and servants. - -- (Original mapping) Ice::Value does not derive from IceUtil::Shared and the generated Ptr for mapped classed is now an -Ice::SharedPtr that behaves mostly like the previous IceUtil (and IceInternal) Handle by wrapping a std::shared_ptr. -The important differences are: - - the comparison operators of Ice::SharedPtr compare pointers like std::shared_ptr but unlike IceUtil::Handle. - - the pointed-to object no longer holds the reference count, and as result you must be careful and avoid creating - multiple SharedPtr managing the same object. For example: - ``` - MyClassPtr c1 = new MyClass(); // SharedPtr to class instance - MyClassPtr c2 = c1; // c1 and c2 point to the same instance - MyClassPtr c3 = c1.get(); // c3 points to the same instance. With Ice 3.7 and before, it's ok as it simply adds a - // a reference count to the shared instance. As of Ice 3.8, it's incorrect since c3 is a new - // independent SharedPtr with its own reference count. - ``` - -- (Original mapping) Removed all support for garbage collection (GC) of class instances. If you create or receive a -graph of class instances with a cycle, you must break this cycle to avoid a leak. - -- (New mapping) Ice::optional is now an alias for std::optional. - -- (Original mapping) IceUtil::Optional is now an alias for std::optional. When upgrading from Ice 3.7 or earlier, you -need to replace calls to `get()` on IceUtil::Optional by calls to `value()`. +- There is now a single C++ mapping, based on the C++11 mapping provided by Ice 3.7. This new C++ mapping requires a +C++ compiler with support for std=c++17 or higher. ## Objective-C Changes -- The base class for class instances is now Ice::Value. Previously, Ice::Object was the base class for both mapped class -instances and servants. - -- The slice compiler no longer generates an Objective-C protocol for Slice classes. It generates only an Objective-C -class (interface). +- The Objective-C mapping was removed. ## PHP Changes - Removed the flattened mapping deprecated in 3.7. - -## Ice Service Changes - -- The implementations of Glacier2, IceGrid, IceStorm and IcePatch2 were updated to use the new C++ mapping. diff --git a/cpp/include/Ice/Communicator.h b/cpp/include/Ice/Communicator.h index 85ad8550893..ee76b8b9542 100644 --- a/cpp/include/Ice/Communicator.h +++ b/cpp/include/Ice/Communicator.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/CommunicatorF.h b/cpp/include/Ice/CommunicatorF.h index e03423b7122..a406d69f1fa 100644 --- a/cpp/include/Ice/CommunicatorF.h +++ b/cpp/include/Ice/CommunicatorF.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Connection.h b/cpp/include/Ice/Connection.h index 953a05023ba..01ad3e11906 100644 --- a/cpp/include/Ice/Connection.h +++ b/cpp/include/Ice/Connection.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -409,7 +409,7 @@ class ICE_CLASS(ICE_API) Connection * @param close The close condition * @param heartbeat The hertbeat condition */ - virtual void setACM(const Ice::optional& timeout, const Ice::optional& close, const Ice::optional& heartbeat) = 0; + virtual void setACM(const std::optional& timeout, const std::optional& close, const std::optional& heartbeat) = 0; /** * Get the ACM parameters. diff --git a/cpp/include/Ice/ConnectionF.h b/cpp/include/Ice/ConnectionF.h index 842d8450636..a23b6f5932b 100644 --- a/cpp/include/Ice/ConnectionF.h +++ b/cpp/include/Ice/ConnectionF.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Current.h b/cpp/include/Ice/Current.h index 82f6b7133f7..06c9388a498 100644 --- a/cpp/include/Ice/Current.h +++ b/cpp/include/Ice/Current.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/Endpoint.h b/cpp/include/Ice/Endpoint.h index 55fb6e0ec2d..902735bbe60 100644 --- a/cpp/include/Ice/Endpoint.h +++ b/cpp/include/Ice/Endpoint.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/EndpointF.h b/cpp/include/Ice/EndpointF.h index ad67050e98a..16de1bb5933 100644 --- a/cpp/include/Ice/EndpointF.h +++ b/cpp/include/Ice/EndpointF.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/EndpointSelectionType.h b/cpp/include/Ice/EndpointSelectionType.h index e3560bf23d6..1ba1bb1b7c4 100644 --- a/cpp/include/Ice/EndpointSelectionType.h +++ b/cpp/include/Ice/EndpointSelectionType.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Ice.h b/cpp/include/Ice/Ice.h index d0965523875..f4509c83f86 100644 --- a/cpp/include/Ice/Ice.h +++ b/cpp/include/Ice/Ice.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/ImplicitContext.h b/cpp/include/Ice/ImplicitContext.h index bb70b5da8d6..7f216a8ac5f 100644 --- a/cpp/include/Ice/ImplicitContext.h +++ b/cpp/include/Ice/ImplicitContext.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/ImplicitContextF.h b/cpp/include/Ice/ImplicitContextF.h index 21e0eb3e235..1444ddcbf47 100644 --- a/cpp/include/Ice/ImplicitContextF.h +++ b/cpp/include/Ice/ImplicitContextF.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include namespace Ice diff --git a/cpp/include/Ice/InputStream.h b/cpp/include/Ice/InputStream.h index 452d16e0530..f48c224346f 100644 --- a/cpp/include/Ice/InputStream.h +++ b/cpp/include/Ice/InputStream.h @@ -632,7 +632,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param tag The tag ID. * @param v Holds the extracted data (if any). */ - template void read(Int tag, IceUtil::Optional& v) + template void read(Int tag, std::optional& v) { if(readOptional(tag, StreamOptionalHelper::helper, @@ -645,7 +645,7 @@ class ICE_API InputStream : public IceInternal::Buffer } else { - v = IceUtil::None; + v = std::nullopt; } } @@ -691,7 +691,7 @@ class ICE_API InputStream : public IceInternal::Buffer * Reads a list of optional data values. */ template - void readAll(std::initializer_list tags, IceUtil::Optional& v) + void readAll(std::initializer_list tags, std::optional& v) { read(*(tags.begin() + tags.size() - 1), v); } @@ -700,7 +700,7 @@ class ICE_API InputStream : public IceInternal::Buffer * Reads a list of optional data values. */ template - void readAll(std::initializer_list tags, IceUtil::Optional& v, IceUtil::Optional&... ve) + void readAll(std::initializer_list tags, std::optional& v, std::optional&... ve) { size_t index = tags.size() - sizeof...(ve) - 1; read(*(tags.begin() + index), v); diff --git a/cpp/include/Ice/LocalException.h b/cpp/include/Ice/LocalException.h index a4e35984f56..803f937f82c 100644 --- a/cpp/include/Ice/LocalException.h +++ b/cpp/include/Ice/LocalException.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/Logger.h b/cpp/include/Ice/Logger.h index 5e8bfea67a8..48b51357dee 100644 --- a/cpp/include/Ice/Logger.h +++ b/cpp/include/Ice/Logger.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/LoggerF.h b/cpp/include/Ice/LoggerF.h index bf25269db6b..e35b3fd9587 100644 --- a/cpp/include/Ice/LoggerF.h +++ b/cpp/include/Ice/LoggerF.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Optional.h b/cpp/include/Ice/Optional.h deleted file mode 100644 index a5481eba699..00000000000 --- a/cpp/include/Ice/Optional.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef ICE_OPTIONAL_H -#define ICE_OPTIONAL_H - -# include -namespace Ice -{ - -/** - * Ice::optional is an alias for std::optional, provided for compatibility with Ice 3.7; new code should use - * std::optional directly. - */ -template using optional = std::optional; - -using std::operator==; -using std::operator!=; -using std::operator<; -using std::operator<=; -using std::operator>; -using std::operator>=; - -/** Creates an optional object. */ -using std::make_optional; -/** Exchanges the state of an optional object with another one. */ -using std::swap; - -/** This type indicates that no value is provided. */ -using nullopt_t = std::nullopt_t; - -/** An instance of nullopt_t used as a marker value to indicate that no value is provided. */ -using std::nullopt; - -/** Raised when accessing an optional that doesn't contain a value. */ -using bad_optional_access = std::bad_optional_access; - -/** This type indicates that an optional value should be constructed in place. */ -using in_place_t = std::in_place_t; -/** An instance of in_place_t that indicates that an optional value should be constructed in place. */ -using std::in_place; - -} - -namespace IceUtil -{ - -/** - * IceUtil::Optional is an alias for std::optional, provided for compatibility with Ice 3.7 and earlier versions. - */ -template using Optional = std::optional; - -/** An alias for std::nullopt, provided for compatibility with Ice 3.7 and earlier versions. */ -constexpr std::nullopt_t None = std::nullopt; - -/** An alias for std::make_optional, provided for compatibility with Ice 3.7 and earlier versions. */ -template -constexpr std::optional> makeOptional(T&& value) -{ - return std::make_optional(value); -} - -} - -#endif diff --git a/cpp/include/Ice/OutputStream.h b/cpp/include/Ice/OutputStream.h index fbf55bc0867..525cb704c69 100644 --- a/cpp/include/Ice/OutputStream.h +++ b/cpp/include/Ice/OutputStream.h @@ -400,7 +400,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * @param tag The tag ID. * @param v The data value to be written (if any). */ - template void write(Int tag, const IceUtil::Optional& v) + template void write(Int tag, const std::optional& v) { if(!v) { @@ -489,7 +489,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * Writes a list of optional data values. */ template - void writeAll(std::initializer_list tags, const IceUtil::Optional& v) + void writeAll(std::initializer_list tags, const std::optional& v) { write(*(tags.begin() + tags.size() - 1), v); } @@ -498,7 +498,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * Writes a list of optional data values. */ template - void writeAll(std::initializer_list tags, const IceUtil::Optional& v, const IceUtil::Optional&... ve) + void writeAll(std::initializer_list tags, const std::optional& v, const std::optional&... ve) { size_t index = tags.size() - sizeof...(ve) - 1; write(*(tags.begin() + index), v); diff --git a/cpp/include/Ice/Plugin.h b/cpp/include/Ice/Plugin.h index b8a8a953aac..748cd31442b 100644 --- a/cpp/include/Ice/Plugin.h +++ b/cpp/include/Ice/Plugin.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/Ice/PluginF.h b/cpp/include/Ice/PluginF.h index ff907b65938..b85bb6e10fc 100644 --- a/cpp/include/Ice/PluginF.h +++ b/cpp/include/Ice/PluginF.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Properties.h b/cpp/include/Ice/Properties.h index 6e8e5616f48..47ea6b01e31 100644 --- a/cpp/include/Ice/Properties.h +++ b/cpp/include/Ice/Properties.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/Ice/PropertiesF.h b/cpp/include/Ice/PropertiesF.h index 89b28385ea7..f5bccc94d26 100644 --- a/cpp/include/Ice/PropertiesF.h +++ b/cpp/include/Ice/PropertiesF.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #ifndef ICE_API diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 624c16cea2f..5ab667a6b70 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -926,7 +926,7 @@ class ICE_API ObjectPrx : public ::std::enable_shared_from_this * @return The compression override setting. If nullopt is returned, no override is set. Otherwise, true * if compression is enabled, false otherwise. */ - ::Ice::optional ice_getCompress() const; + ::std::optional ice_getCompress() const; /** * Obtains a proxy that is identical to this proxy, except for its connection timeout setting @@ -941,7 +941,7 @@ class ICE_API ObjectPrx : public ::std::enable_shared_from_this * @return The timeout override. If nullopt is returned, no override is set. Otherwise, returns * the timeout override value. */ - ::Ice::optional ice_getTimeout() const; + ::std::optional ice_getTimeout() const; /** * Obtains a proxy that is identical to this proxy, except for its connection ID. diff --git a/cpp/include/IceBT/ConnectionInfo.h b/cpp/include/IceBT/ConnectionInfo.h index 04578549f4b..b79fcc498a0 100644 --- a/cpp/include/IceBT/ConnectionInfo.h +++ b/cpp/include/IceBT/ConnectionInfo.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/IceBT/EndpointInfo.h b/cpp/include/IceBT/EndpointInfo.h index 2f07b4b380b..c72d7a32faf 100644 --- a/cpp/include/IceBT/EndpointInfo.h +++ b/cpp/include/IceBT/EndpointInfo.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/IceBT/Types.h b/cpp/include/IceBT/Types.h index a45becaebec..573552621df 100644 --- a/cpp/include/IceBT/Types.h +++ b/cpp/include/IceBT/Types.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/IceBox/Service.h b/cpp/include/IceBox/Service.h index e5b1d580f58..06faf3e2fd5 100644 --- a/cpp/include/IceBox/Service.h +++ b/cpp/include/IceBox/Service.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/IceGrid/PluginFacade.h b/cpp/include/IceGrid/PluginFacade.h index 56a93c3a507..a595a68644a 100644 --- a/cpp/include/IceGrid/PluginFacade.h +++ b/cpp/include/IceGrid/PluginFacade.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/IceIAP/ConnectionInfo.h b/cpp/include/IceIAP/ConnectionInfo.h index bc2d4d13b51..958d9caf54a 100644 --- a/cpp/include/IceIAP/ConnectionInfo.h +++ b/cpp/include/IceIAP/ConnectionInfo.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/IceIAP/EndpointInfo.h b/cpp/include/IceIAP/EndpointInfo.h index b0b9d9dadcf..6d2b43668ad 100644 --- a/cpp/include/IceIAP/EndpointInfo.h +++ b/cpp/include/IceIAP/EndpointInfo.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/include/IceSSL/ConnectionInfo.h b/cpp/include/IceSSL/ConnectionInfo.h index f3516d946bd..cd5767d42aa 100644 --- a/cpp/include/IceSSL/ConnectionInfo.h +++ b/cpp/include/IceSSL/ConnectionInfo.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/IceSSL/ConnectionInfoF.h b/cpp/include/IceSSL/ConnectionInfoF.h index 7c8beecb8af..317e9de1915 100644 --- a/cpp/include/IceSSL/ConnectionInfoF.h +++ b/cpp/include/IceSSL/ConnectionInfoF.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #ifndef ICESSL_API diff --git a/cpp/include/IceSSL/EndpointInfo.h b/cpp/include/IceSSL/EndpointInfo.h index c767bcadd68..8e85f56f8fe 100644 --- a/cpp/include/IceSSL/EndpointInfo.h +++ b/cpp/include/IceSSL/EndpointInfo.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/src/Glacier2/Instrumentation.h b/cpp/src/Glacier2/Instrumentation.h index adf3e99ba99..27ff6175880 100644 --- a/cpp/src/Glacier2/Instrumentation.h +++ b/cpp/src/Glacier2/Instrumentation.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp index d23eadd477d..c24483b9fa0 100644 --- a/cpp/src/Glacier2/RouterI.cpp +++ b/cpp/src/Glacier2/RouterI.cpp @@ -108,7 +108,7 @@ Glacier2::RouterI::destroy(function error) } shared_ptr -Glacier2::RouterI::getClientProxy(Ice::optional& hasRoutingTable, const Current&) const +Glacier2::RouterI::getClientProxy(optional& hasRoutingTable, const Current&) const { // No mutex lock necessary, _clientProxy is immutable and is never destroyed. hasRoutingTable = true; diff --git a/cpp/src/Glacier2/RouterI.h b/cpp/src/Glacier2/RouterI.h index 024e728ba93..a42fd16fdbd 100644 --- a/cpp/src/Glacier2/RouterI.h +++ b/cpp/src/Glacier2/RouterI.h @@ -26,7 +26,7 @@ class RouterI final : public Router void destroy(std::function); - std::shared_ptr getClientProxy(Ice::optional&, const Ice::Current&) const override; + std::shared_ptr getClientProxy(std::optional&, const Ice::Current&) const override; std::shared_ptr getServerProxy(const Ice::Current&) const override; Ice::ObjectProxySeq addProxies(Ice::ObjectProxySeq, const Ice::Current&) override; std::string getCategoryForClient(const Ice::Current&) const override; diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp index 295ea5b45e1..a4de9ff10c7 100644 --- a/cpp/src/Glacier2/SessionRouterI.cpp +++ b/cpp/src/Glacier2/SessionRouterI.cpp @@ -605,7 +605,7 @@ SessionRouterI::destroy() } shared_ptr -SessionRouterI::getClientProxy(Ice::optional& hasRoutingTable, const Current& current) const +SessionRouterI::getClientProxy(optional& hasRoutingTable, const Current& current) const { return getRouter(current.con, current.id)->getClientProxy(hasRoutingTable, current); // Forward to the per-client router. } diff --git a/cpp/src/Glacier2/SessionRouterI.h b/cpp/src/Glacier2/SessionRouterI.h index e8d8b1963e5..ce20d1148e4 100644 --- a/cpp/src/Glacier2/SessionRouterI.h +++ b/cpp/src/Glacier2/SessionRouterI.h @@ -71,7 +71,7 @@ class SessionRouterI final : public Router, public Glacier2::Instrumentation::Ob ~SessionRouterI() override; void destroy(); - std::shared_ptr getClientProxy(Ice::optional&, const Ice::Current&) const override; + std::shared_ptr getClientProxy(std::optional&, const Ice::Current&) const override; std::shared_ptr getServerProxy(const Ice::Current&) const override; Ice::ObjectProxySeq addProxies(Ice::ObjectProxySeq, const Ice::Current&) override; std::string getCategoryForClient(const Ice::Current&) const override; diff --git a/cpp/src/Glacier2Lib/Application.cpp b/cpp/src/Glacier2Lib/Application.cpp index b39d25a82f5..8e8b5c38d5c 100644 --- a/cpp/src/Glacier2Lib/Application.cpp +++ b/cpp/src/Glacier2Lib/Application.cpp @@ -184,7 +184,7 @@ Glacier2::Application::doMain(Ice::StringSeq& args, const Ice::InitializationDat { Ice::ConnectionPtr connection = _router->ice_getCachedConnection(); assert(connection); - connection->setACM(acmTimeout, IceUtil::None, ACMHeartbeat::HeartbeatAlways); + connection->setACM(acmTimeout, nullopt, ACMHeartbeat::HeartbeatAlways); connection->setCloseCallback( [this](Ice::ConnectionPtr) { diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index 5d8d962ec21..10a8ac565ee 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -739,7 +739,7 @@ SessionHelperI::connected(const Glacier2::RouterPrxPtr& router, const Glacier2:: { Ice::ConnectionPtr connection = _router->ice_getCachedConnection(); assert(connection); - connection->setACM(acmTimeout, IceUtil::None, Ice::ACMHeartbeat::HeartbeatAlways); + connection->setACM(acmTimeout, nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto self = shared_from_this(); connection->setCloseCallback([self](Ice::ConnectionPtr) { diff --git a/cpp/src/Ice/ACM.cpp b/cpp/src/Ice/ACM.cpp index f9f221de437..97f5e51dd75 100644 --- a/cpp/src/Ice/ACM.cpp +++ b/cpp/src/Ice/ACM.cpp @@ -164,9 +164,9 @@ IceInternal::FactoryACMMonitor::reap(const ConnectionIPtr& connection) } ACMMonitorPtr -IceInternal::FactoryACMMonitor::acm(const IceUtil::Optional& timeout, - const IceUtil::Optional& close, - const IceUtil::Optional& heartbeat) +IceInternal::FactoryACMMonitor::acm(const optional& timeout, + const optional& close, + const optional& heartbeat) { Lock sync(*this); assert(_instance); @@ -330,9 +330,9 @@ IceInternal::ConnectionACMMonitor::reap(const ConnectionIPtr& connection) } ACMMonitorPtr -IceInternal::ConnectionACMMonitor::acm(const IceUtil::Optional& timeout, - const IceUtil::Optional& close, - const IceUtil::Optional& heartbeat) +IceInternal::ConnectionACMMonitor::acm(const optional& timeout, + const optional& close, + const optional& heartbeat) { return _parent->acm(timeout, close, heartbeat); } diff --git a/cpp/src/Ice/ACM.h b/cpp/src/Ice/ACM.h index fa847bf0f7e..5d7f7682030 100644 --- a/cpp/src/Ice/ACM.h +++ b/cpp/src/Ice/ACM.h @@ -39,9 +39,9 @@ class ACMMonitor : public IceUtil::TimerTask virtual void remove(const Ice::ConnectionIPtr&) = 0; virtual void reap(const Ice::ConnectionIPtr&) = 0; - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, - const IceUtil::Optional&) = 0; + virtual ACMMonitorPtr acm(const std::optional&, + const std::optional&, + const std::optional&) = 0; virtual Ice::ACM getACM() = 0; }; @@ -58,9 +58,9 @@ class FactoryACMMonitor : public ACMMonitor, virtual void remove(const Ice::ConnectionIPtr&); virtual void reap(const Ice::ConnectionIPtr&); - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, - const IceUtil::Optional&); + virtual ACMMonitorPtr acm(const std::optional&, + const std::optional&, + const std::optional&); virtual Ice::ACM getACM(); void destroy(); @@ -95,9 +95,9 @@ class ConnectionACMMonitor : public ACMMonitor, virtual void remove(const Ice::ConnectionIPtr&); virtual void reap(const Ice::ConnectionIPtr&); - virtual ACMMonitorPtr acm(const IceUtil::Optional&, - const IceUtil::Optional&, - const IceUtil::Optional&); + virtual ACMMonitorPtr acm(const std::optional&, + const std::optional&, + const std::optional&); virtual Ice::ACM getACM(); private: diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index f94afc997f7..548e68c532b 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -974,9 +974,9 @@ Ice::ConnectionI::closeCallback(const CloseCallback& callback) } void -Ice::ConnectionI::setACM(const IceUtil::Optional& timeout, - const IceUtil::Optional& close, - const IceUtil::Optional& heartbeat) +Ice::ConnectionI::setACM(const optional& timeout, + const optional& close, + const optional& heartbeat) { IceUtil::Monitor::Lock sync(*this); if(timeout && *timeout < 0) diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 4c6f2c529d9..8549b85a565 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -164,9 +164,9 @@ class ConnectionI : public Connection, virtual std::function heartbeatAsync(::std::function, ::std::function = nullptr); - virtual void setACM(const IceUtil::Optional&, - const IceUtil::Optional&, - const IceUtil::Optional&); + virtual void setACM(const std::optional&, + const std::optional&, + const std::optional&); virtual ACM getACM() noexcept; virtual void asyncRequestCanceled(const IceInternal::OutgoingAsyncBasePtr&, const LocalException&); diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index 5db7e6b8068..7e330c7e350 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -694,7 +694,7 @@ ICE_OBJECT_PRX::ice_compress(bool b) const } } -IceUtil::Optional +optional ICE_OBJECT_PRX::ice_getCompress() const { return _reference->getCompress(); @@ -722,7 +722,7 @@ ICE_OBJECT_PRX::ice_timeout(int t) const } } -IceUtil::Optional +optional ICE_OBJECT_PRX::ice_getTimeout() const { return _reference->getTimeout(); diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 00f8d0ed697..c695098c2bd 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -547,7 +547,7 @@ IceInternal::FixedReference::FixedReference(const InstancePtr& instance, const ConnectionIPtr& fixedConnection, int invocationTimeout, const Ice::Context& context, - const IceUtil::Optional& compress) : + const optional& compress) : Reference(instance, communicator, id, facet, mode, secure, protocol, encoding, invocationTimeout, context), _fixedConnection(fixedConnection) { @@ -606,10 +606,10 @@ IceInternal::FixedReference::getConnectionId() const return string(); } -IceUtil::Optional +optional IceInternal::FixedReference::getTimeout() const { - return IceUtil::Optional(); + return optional(); } ReferencePtr @@ -931,10 +931,10 @@ IceInternal::RoutableReference::getConnectionId() const return _connectionId; } -IceUtil::Optional +optional IceInternal::RoutableReference::getTimeout() const { - return _overrideTimeout ? IceUtil::Optional(_timeout) : IceUtil::None; + return _overrideTimeout ? optional(_timeout) : nullopt; } ReferencePtr diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h index 776cbf380b4..988b827e7e2 100644 --- a/cpp/src/Ice/Reference.h +++ b/cpp/src/Ice/Reference.h @@ -66,9 +66,9 @@ class Reference : public IceUtil::Shared const InstancePtr& getInstance() const { return _instance; } const SharedContextPtr& getContext() const { return _context; } int getInvocationTimeout() const { return _invocationTimeout; } - IceUtil::Optional getCompress() const + std::optional getCompress() const { - return _overrideCompress ? IceUtil::Optional(_compress) : IceUtil::None; + return _overrideCompress ? std::optional(_compress) : std::nullopt; } Ice::CommunicatorPtr getCommunicator() const; @@ -83,7 +83,7 @@ class Reference : public IceUtil::Shared virtual Ice::EndpointSelectionType getEndpointSelection() const = 0; virtual int getLocatorCacheTimeout() const = 0; virtual std::string getConnectionId() const = 0; - virtual IceUtil::Optional getTimeout() const = 0; + virtual std::optional getTimeout() const = 0; // // The change* methods (here and in derived classes) create @@ -186,7 +186,7 @@ class FixedReference : public Reference FixedReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const std::string&, Mode, bool, const Ice::ProtocolVersion&, const Ice::EncodingVersion&, const Ice::ConnectionIPtr&, - int, const Ice::Context&, const IceUtil::Optional&); + int, const Ice::Context&, const std::optional&); virtual std::vector getEndpoints() const; virtual std::string getAdapterId() const; @@ -196,7 +196,7 @@ class FixedReference : public Reference virtual Ice::EndpointSelectionType getEndpointSelection() const; virtual int getLocatorCacheTimeout() const; virtual std::string getConnectionId() const; - virtual IceUtil::Optional getTimeout() const; + virtual std::optional getTimeout() const; virtual ReferencePtr changeEndpoints(const std::vector&) const; virtual ReferencePtr changeAdapterId(const std::string&) const; @@ -252,7 +252,7 @@ class RoutableReference : public Reference virtual Ice::EndpointSelectionType getEndpointSelection() const; virtual int getLocatorCacheTimeout() const; virtual std::string getConnectionId() const; - virtual IceUtil::Optional getTimeout() const; + virtual std::optional getTimeout() const; virtual ReferencePtr changeEncoding(const Ice::EncodingVersion&) const; virtual ReferencePtr changeCompress(bool) const; diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index e80478a172d..ebeccfc246f 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -91,7 +91,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, const Ice::Connecti connection, -1, Ice::Context(), - IceUtil::Optional()); + optional()); } ReferencePtr diff --git a/cpp/src/Ice/RouterInfo.cpp b/cpp/src/Ice/RouterInfo.cpp index 89b4c367746..39e2899d9fc 100644 --- a/cpp/src/Ice/RouterInfo.cpp +++ b/cpp/src/Ice/RouterInfo.cpp @@ -141,14 +141,14 @@ IceInternal::RouterInfo::getClientEndpoints() } } - IceUtil::Optional hasRoutingTable; + optional hasRoutingTable; Ice::ObjectPrxPtr proxy = _router->getClientProxy(hasRoutingTable); return setClientEndpoints(proxy, hasRoutingTable ? hasRoutingTable.value() : true); } void IceInternal::RouterInfo::getClientProxyResponse(const Ice::ObjectPrxPtr& proxy, - const IceUtil::Optional& hasRoutingTable, + const optional& hasRoutingTable, const GetClientEndpointsCallbackPtr& callback) { callback->setEndpoints(setClientEndpoints(proxy, hasRoutingTable ? hasRoutingTable.value() : true)); @@ -178,7 +178,7 @@ IceInternal::RouterInfo::getClientEndpoints(const GetClientEndpointsCallbackPtr& RouterInfoPtr self = this; _router->getClientProxyAsync( - [self, callback](const Ice::ObjectPrxPtr& proxy, Ice::optional hasRoutingTable) + [self, callback](const Ice::ObjectPrxPtr& proxy, optional hasRoutingTable) { self->getClientProxyResponse(proxy, hasRoutingTable, callback); }, diff --git a/cpp/src/Ice/RouterInfo.h b/cpp/src/Ice/RouterInfo.h index 900dbc679b2..de5a5804323 100644 --- a/cpp/src/Ice/RouterInfo.h +++ b/cpp/src/Ice/RouterInfo.h @@ -81,7 +81,7 @@ class RouterInfo : public IceUtil::Shared, public IceUtil::Mutex // return _router; } - void getClientProxyResponse(const Ice::ObjectPrxPtr&, const IceUtil::Optional&, + void getClientProxyResponse(const Ice::ObjectPrxPtr&, const std::optional&, const GetClientEndpointsCallbackPtr&); void getClientProxyException(const Ice::Exception&, const GetClientEndpointsCallbackPtr&); std::vector getClientEndpoints(); diff --git a/cpp/src/IceBridge/IceBridge.cpp b/cpp/src/IceBridge/IceBridge.cpp index 1c5361dd737..8e75f0a4c8a 100644 --- a/cpp/src/IceBridge/IceBridge.cpp +++ b/cpp/src/IceBridge/IceBridge.cpp @@ -50,7 +50,7 @@ class RouterI final : public Router { public: - shared_ptr getClientProxy(Ice::optional& hasRoutingTable, const Current&) const override + shared_ptr getClientProxy(optional& hasRoutingTable, const Current&) const override { hasRoutingTable = false; // We don't maintain a routing table, no need to call addProxies on this impl. return nullptr; diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 3fa4165dc7a..4d6d9570a21 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -49,7 +49,7 @@ class ReuseConnectionRouter final : public Ice::Router } shared_ptr - getClientProxy(IceUtil::Optional& hasRoutingTable, const Ice::Current&) const override + getClientProxy(optional& hasRoutingTable, const Ice::Current&) const override { hasRoutingTable = false; return _clientProxy; @@ -630,7 +630,7 @@ run(const Ice::StringSeq& args) if(acmTimeout > 0) { - session->ice_getConnection()->setACM(acmTimeout, IceUtil::None, Ice::ACMHeartbeat::HeartbeatAlways); + session->ice_getConnection()->setACM(acmTimeout, nullopt, Ice::ACMHeartbeat::HeartbeatAlways); } { diff --git a/cpp/src/IceGrid/ReplicaSessionI.cpp b/cpp/src/IceGrid/ReplicaSessionI.cpp index 3333a600543..bddb4dabd75 100644 --- a/cpp/src/IceGrid/ReplicaSessionI.cpp +++ b/cpp/src/IceGrid/ReplicaSessionI.cpp @@ -102,7 +102,7 @@ ReplicaSessionI::getTimeout(const Ice::Current&) const void ReplicaSessionI::setDatabaseObserver(shared_ptr observer, - IceUtil::Optional slaveSerials, + optional slaveSerials, const Ice::Current&) { // diff --git a/cpp/src/IceGrid/ReplicaSessionI.h b/cpp/src/IceGrid/ReplicaSessionI.h index 86f3277d703..031da387b47 100644 --- a/cpp/src/IceGrid/ReplicaSessionI.h +++ b/cpp/src/IceGrid/ReplicaSessionI.h @@ -27,7 +27,7 @@ class ReplicaSessionI final : public ReplicaSession void keepAlive(const Ice::Current&) override; int getTimeout(const Ice::Current&) const override; - void setDatabaseObserver(std::shared_ptr, IceUtil::Optional, + void setDatabaseObserver(std::shared_ptr, std::optional, const Ice::Current&) override; void setEndpoints(StringObjectProxyDict, const Ice::Current&) override; void registerWellKnownObjects(ObjectInfoSeq, const Ice::Current&) override; diff --git a/cpp/src/IceGrid/ReplicaSessionManager.cpp b/cpp/src/IceGrid/ReplicaSessionManager.cpp index 094c7f112ff..368e68f61fb 100644 --- a/cpp/src/IceGrid/ReplicaSessionManager.cpp +++ b/cpp/src/IceGrid/ReplicaSessionManager.cpp @@ -601,7 +601,7 @@ ReplicaSessionManager::createSessionImpl(const shared_ptr& auto servant = make_shared(_thread, _database, session); _observer = Ice::uncheckedCast(_database->getInternalAdapter()->addWithUUID(servant)); StringLongDict serials = _database->getSerials(); - IceUtil::Optional serialsOpt; + optional serialsOpt; if(!serials.empty()) { serialsOpt = serials; // Don't provide serials parameter if serials aren't supported. diff --git a/cpp/src/IceStorm/Instrumentation.h b/cpp/src/IceStorm/Instrumentation.h index 457b321453c..e577616ea78 100644 --- a/cpp/src/IceStorm/Instrumentation.h +++ b/cpp/src/IceStorm/Instrumentation.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index eb8dd0ce7d3..cabbfcc22a1 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -545,7 +545,7 @@ class SetACMTest final : public TestCase try { - con->setACM(-19, IceUtil::None, IceUtil::None); + con->setACM(-19, nullopt, nullopt); test(false); } catch(const invalid_argument&) @@ -558,7 +558,7 @@ class SetACMTest final : public TestCase test(acm.close == Ice::ACMClose::CloseOnIdleForceful); test(acm.heartbeat == Ice::ACMHeartbeat::HeartbeatOff); - con->setACM(IceUtil::None, IceUtil::None, IceUtil::None); + con->setACM(nullopt, nullopt, nullopt); acm = con->getACM(); test(acm.timeout == 15); test(acm.close == Ice::ACMClose::CloseOnIdleForceful); diff --git a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp index a085815bcff..49e86ab7403 100644 --- a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp +++ b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp @@ -22,7 +22,7 @@ class RouterI : public Ice::Router } virtual Ice::ObjectPrxPtr - getClientProxy(IceUtil::Optional&, const Ice::Current&) const + getClientProxy(optional&, const Ice::Current&) const { return nullptr; } diff --git a/cpp/test/Ice/background/Server.cpp b/cpp/test/Ice/background/Server.cpp index b693e744515..5f45f9696da 100644 --- a/cpp/test/Ice/background/Server.cpp +++ b/cpp/test/Ice/background/Server.cpp @@ -70,7 +70,7 @@ class RouterI : public Ice::Router public: virtual Ice::ObjectPrxPtr - getClientProxy(IceUtil::Optional& hasRoutingTable, const Ice::Current& current) const + getClientProxy(optional& hasRoutingTable, const Ice::Current& current) const { hasRoutingTable = true; _controller->checkCallPause(current); diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp index 8b7e04aea51..fa2a27d375f 100644 --- a/cpp/test/Ice/optional/AllTests.cpp +++ b/cpp/test/Ice/optional/AllTests.cpp @@ -127,7 +127,7 @@ class DObjectWriter : public Ice::Value out->startSlice("::Test::D", -1, false); string s = "test"; out->write(s); - IceUtil::Optional > o; + optional > o; o = vector(); o->push_back("test1"); o->push_back("test2"); @@ -136,7 +136,7 @@ class DObjectWriter : public Ice::Value out->write(1, o); APtr a = make_shared(); a->mc = 18; - out->write(1000, IceUtil::Optional(a)); + out->write(1000, optional(a)); out->endSlice(); // ::Test::B out->startSlice(B::ice_staticId(), -1, false); @@ -174,7 +174,7 @@ class DObjectReader : public Ice::Value string s; in->read(s); test(s == "test"); - IceUtil::Optional > o; + optional > o; in->read(1, o); test(o && o->size() == 4 && (*o)[0] == "test1" && (*o)[1] == "test2" && (*o)[2] == "test3" && (*o)[3] == "test4"); @@ -207,7 +207,7 @@ class DObjectReader : public Ice::Value private: - IceUtil::Optional a; + optional a; }; class FObjectReader : public Ice::Value @@ -344,7 +344,7 @@ allTests(Test::TestHelper* helper, bool) *oo3 = *oo1; test(oo3->a && *oo3->a == 15); - OneOptionalPtr oon = make_shared(IceUtil::None); + OneOptionalPtr oon = make_shared(nullopt); test(!oon->a); MultiOptionalPtr mo1 = make_shared(); @@ -453,14 +453,14 @@ allTests(Test::TestHelper* helper, bool) test(mo1->a < static_cast(16) && mo1->a > static_cast(14) && mo1->a <= static_cast(15) && mo1->a >= static_cast(15) && mo1->a <= static_cast(16) && mo1->a >= static_cast(14)); - test(mo1->a > IceUtil::Optional() && IceUtil::Optional() < mo1->a); - test(14 > IceUtil::Optional() && IceUtil::Optional() < 14); + test(mo1->a > optional() && optional() < mo1->a); + test(14 > optional() && optional() < 14); test(mo1->h == string("test") && string("test") == mo1->h && mo1->h != string("testa") && string("testa") != mo1->h); test(mo1->h < string("test1") && mo1->h > string("tesa") && mo1->h <= string("test")); test(mo1->h >= string("test") && mo1->h <= string("test1") && mo1->h >= string("tesa")); - test(mo1->h > IceUtil::Optional() && IceUtil::Optional() < mo1->h); - test(string("test1") > IceUtil::Optional() && IceUtil::Optional() < string("test1")); + test(mo1->h > optional() && optional() < mo1->h); + test(string("test1") > optional() && optional() < string("test1")); cout << "ok" << endl; @@ -553,23 +553,23 @@ allTests(Test::TestHelper* helper, bool) // Clear the first half of the optional parameters MultiOptionalPtr mo6 = make_shared(*mo5); - mo6->a = IceUtil::None; - mo6->c = IceUtil::None; - mo6->e = IceUtil::None; - mo6->g = IceUtil::None; - mo6->i = IceUtil::None; - mo6->k = IceUtil::None; - mo6->ss = IceUtil::None; - mo6->sid = IceUtil::None; - mo6->vs = IceUtil::None; - - mo6->es = IceUtil::None; - mo6->vss = IceUtil::None; - mo6->mips = IceUtil::None; - - mo6->ied = IceUtil::None; - mo6->ivsd = IceUtil::None; - mo6->imipd = IceUtil::None; + mo6->a = nullopt; + mo6->c = nullopt; + mo6->e = nullopt; + mo6->g = nullopt; + mo6->i = nullopt; + mo6->k = nullopt; + mo6->ss = nullopt; + mo6->sid = nullopt; + mo6->vs = nullopt; + + mo6->es = nullopt; + mo6->vss = nullopt; + mo6->mips = nullopt; + + mo6->ied = nullopt; + mo6->ivsd = nullopt; + mo6->imipd = nullopt; MultiOptionalPtr mo7 = ICE_DYNAMIC_CAST(MultiOptional, initial->pingPong(mo6)); test(!mo7->a); @@ -605,21 +605,21 @@ allTests(Test::TestHelper* helper, bool) // Clear the second half of the optional parameters MultiOptionalPtr mo8 = make_shared(*mo5); - mo8->b = IceUtil::None; - mo8->d = IceUtil::None; - mo8->f = IceUtil::None; - mo8->h = IceUtil::None; - mo8->j = IceUtil::None; - mo8->bs = IceUtil::None; - mo8->iid = IceUtil::None; - mo8->fs = IceUtil::None; - - mo8->shs = IceUtil::None; - mo8->fss = IceUtil::None; - mo8->oos = IceUtil::None; - - mo8->ifsd = IceUtil::None; - mo8->iood = IceUtil::None; + mo8->b = nullopt; + mo8->d = nullopt; + mo8->f = nullopt; + mo8->h = nullopt; + mo8->j = nullopt; + mo8->bs = nullopt; + mo8->iid = nullopt; + mo8->fs = nullopt; + + mo8->shs = nullopt; + mo8->fss = nullopt; + mo8->oos = nullopt; + + mo8->ifsd = nullopt; + mo8->iood = nullopt; mo8->k = mo8; MultiOptionalPtr mo9 = ICE_DYNAMIC_CAST(MultiOptional, initial->pingPong(mo8)); @@ -711,7 +711,7 @@ allTests(Test::TestHelper* helper, bool) // // Use the 1.0 encoding with operations whose only class parameters are optional. // - IceUtil::Optional oo(make_shared(53)); + optional oo(make_shared(53)); initial->sendOptionalClass(true, oo); initial->ice_encodingVersion(Ice::Encoding_1_0)->sendOptionalClass(true, oo); @@ -745,8 +745,8 @@ allTests(Test::TestHelper* helper, bool) { Ice::OutputStream out(communicator); out.startEncapsulation(); - out.write(1, IceUtil::Optional(15)); - out.write(2, IceUtil::Optional("test")); + out.write(1, optional(15)); + out.write(2, optional("test")); out.endEncapsulation(); out.finished(inEncaps); test(initial->ice_invoke("opVoid", Ice::OperationMode::Normal, inEncaps, outEncaps)); @@ -870,8 +870,8 @@ allTests(Test::TestHelper* helper, bool) WDPtr wd = ICE_DYNAMIC_CAST(WD, initial->pingPong(make_shared())); test(*wd->a == 5); test(*wd->s == "test"); - wd->a = IceUtil::None; - wd->s = IceUtil::None; + wd->a = nullopt; + wd->s = nullopt; wd = ICE_DYNAMIC_CAST(WD, initial->pingPong(wd)); test(!wd->a); test(!wd->s); @@ -930,7 +930,7 @@ allTests(Test::TestHelper* helper, bool) Ice::OutputStream out(communicator); out.startEncapsulation(); out.write(a); - out.write(1, Ice::make_optional(make_shared())); + out.write(1, make_optional(make_shared())); out.endEncapsulation(); out.finished(inEncaps); test(initial->ice_invoke("opClassAndUnknownOptional", Ice::OperationMode::Normal, inEncaps, outEncaps)); @@ -944,9 +944,9 @@ allTests(Test::TestHelper* helper, bool) cout << "testing optional parameters... " << flush; { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opByte(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opByte(p1, p3); test(!p2 && !p3); const Ice::Byte bval = 56; @@ -966,7 +966,7 @@ allTests(Test::TestHelper* helper, bool) in.read(1, p2); in.read(3, p3); - IceUtil::Optional p4 = static_cast(0x08); + optional p4 = static_cast(0x08); in.read(89, p4); in.endEncapsulation(); @@ -978,9 +978,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opBool(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opBool(p1, p3); test(!p2 && !p3); p1 = true; @@ -1006,9 +1006,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opShort(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opShort(p1, p3); test(!p2 && !p3); const Ice::Short sval = 56; @@ -1036,9 +1036,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opInt(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opInt(p1, p3); test(!p2 && !p3); const Ice::Int ival = 56; @@ -1066,9 +1066,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opLong(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opLong(p1, p3); test(!p2 && !p3); const Ice::Long lval = 56; @@ -1096,9 +1096,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opFloat(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opFloat(p1, p3); test(!p2 && !p3); const Ice::Float fval = 1.0f; @@ -1126,9 +1126,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opDouble(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opDouble(p1, p3); test(!p2 && !p3); const Ice::Double dval = 1.0; @@ -1156,9 +1156,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opString(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opString(p1, p3); test(!p2 && !p3); const string sval = "test"; @@ -1188,9 +1188,9 @@ allTests(Test::TestHelper* helper, bool) { if(supportsCppStringView) { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opCustomString(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opCustomString(p1, p3); test(!p2 && !p3); const string sval = "test"; @@ -1219,9 +1219,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opMyEnum(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opMyEnum(p1, p3); test(!p2 && !p3); p1 = MyEnum::MyEnumMember; @@ -1247,9 +1247,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opSmallStruct(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opSmallStruct(p1, p3); test(!p2 && !p3); p1 = Test::SmallStruct(); @@ -1276,9 +1276,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opFixedStruct(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opFixedStruct(p1, p3); test(!p2 && !p3); p1 = Test::FixedStruct(); @@ -1305,9 +1305,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opVarStruct(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opVarStruct(p1, p3); test(!p2 && !p3); p1 = Test::VarStruct(); @@ -1334,9 +1334,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opOneOptional(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opOneOptional(p1, p3); test(!p2 && !p3); if(initial->supportsNullOptional()) @@ -1368,9 +1368,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opMyInterfaceProxy(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opMyInterfaceProxy(p1, p3); test(!p2 && !p3); p1 = ICE_UNCHECKED_CAST(MyInterfacePrx, communicator->stringToProxy("test")); @@ -1405,14 +1405,14 @@ allTests(Test::TestHelper* helper, bool) Ice::OutputStream out(communicator); out.startEncapsulation(); - out.write(1, Ice::make_optional(f)); - out.write(2, Ice::make_optional(f->ae)); + out.write(1, make_optional(f)); + out.write(2, make_optional(f->ae)); out.endEncapsulation(); out.finished(inEncaps); Ice::InputStream in(communicator, out.getEncoding(), inEncaps); in.startEncapsulation(); - IceUtil::Optional a; + optional a; in.read(2, a); in.endEncapsulation(); test(a && *a && (*a)->requiredA == 56); @@ -1421,9 +1421,9 @@ allTests(Test::TestHelper* helper, bool) cout << "testing optional parameters and custom sequences... " << flush; { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opByteSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opByteSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1452,9 +1452,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opBoolSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opBoolSeq(p1, p3); test(!p2 && !p3); bool bs[100]; @@ -1484,9 +1484,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opShortSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opShortSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1515,9 +1515,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opIntSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opIntSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1546,9 +1546,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opLongSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opLongSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1577,9 +1577,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opFloatSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opFloatSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1608,9 +1608,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opDoubleSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opDoubleSeq(p1, p3); test(!p2 && !p3); vector bs(100); @@ -1639,9 +1639,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opFixedStructSeq(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opFixedStructSeq(p1, p3); test(!p2 && !p3); std::pair p; @@ -1687,9 +1687,9 @@ allTests(Test::TestHelper* helper, bool) cout << "testing optional parameters and dictionaries... " << flush; { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opIntIntDict(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opIntIntDict(p1, p3); test(!p2 && !p3); IntIntDict ss; @@ -1718,9 +1718,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opStringIntDict(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opStringIntDict(p1, p3); test(!p2 && !p3); StringIntDict ss; @@ -1749,9 +1749,9 @@ allTests(Test::TestHelper* helper, bool) } { - IceUtil::Optional p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opIntOneOptionalDict(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opIntOneOptionalDict(p1, p3); test(!p2 && !p3); IntOneOptionalDict ss; @@ -1782,9 +1782,9 @@ allTests(Test::TestHelper* helper, bool) { if(supportsCppStringView) { - IceUtil::Optional > p1; - IceUtil::Optional p3; - IceUtil::Optional p2 = initial->opCustomIntStringDict(p1, p3); + optional > p1; + optional p3; + optional p2 = initial->opCustomIntStringDict(p1, p3); test(!p2 && !p3); map ss; @@ -1824,7 +1824,7 @@ allTests(Test::TestHelper* helper, bool) { try { - initial->opOptionalException(IceUtil::None, IceUtil::None, IceUtil::None); + initial->opOptionalException(nullopt, nullopt, nullopt); test(false); } catch(const OptionalException& ex) @@ -1864,9 +1864,9 @@ allTests(Test::TestHelper* helper, bool) try { - IceUtil::Optional a; - IceUtil::Optional b; - IceUtil::Optional o; + optional a; + optional b; + optional o; initial->opDerivedException(a, b, o); test(false); } @@ -1887,9 +1887,9 @@ allTests(Test::TestHelper* helper, bool) try { - IceUtil::Optional a = 30; - IceUtil::Optional b = string("test2"); - IceUtil::Optional o = make_shared(53); + optional a = 30; + optional b = string("test2"); + optional o = make_shared(53); initial->opDerivedException(a, b, o); test(false); } @@ -1910,9 +1910,9 @@ allTests(Test::TestHelper* helper, bool) try { - IceUtil::Optional a; - IceUtil::Optional b; - IceUtil::Optional o; + optional a; + optional b; + optional o; initial->opRequiredException(a, b, o); test(false); } @@ -1931,9 +1931,9 @@ allTests(Test::TestHelper* helper, bool) try { - IceUtil::Optional a = 30; - IceUtil::Optional b = string("test2"); - IceUtil::Optional o = make_shared(53); + optional a = 30; + optional b = string("test2"); + optional o = make_shared(53); initial->opRequiredException(a, b, o); test(false); } @@ -1960,8 +1960,8 @@ allTests(Test::TestHelper* helper, bool) test(initial->opMG1()); { - IceUtil::Optional p1, p2, p3; - p3 = initial->opMStruct2(IceUtil::None, p2); + optional p1, p2, p3; + p3 = initial->opMStruct2(nullopt, p2); test(!p2 && !p3); p1 = Test::SmallStruct(); @@ -1969,8 +1969,8 @@ allTests(Test::TestHelper* helper, bool) test(p2 == p1 && p3 == p1); } { - IceUtil::Optional p1, p2, p3; - p3 = initial->opMSeq2(IceUtil::None, p2); + optional p1, p2, p3; + p3 = initial->opMSeq2(nullopt, p2); test(!p2 && !p3); Test::StringSeq seq; @@ -1980,8 +1980,8 @@ allTests(Test::TestHelper* helper, bool) test(p2 == p1 && p3 == p1); } { - IceUtil::Optional p1, p2, p3; - p3 = initial->opMDict2(IceUtil::None, p2); + optional p1, p2, p3; + p3 = initial->opMDict2(nullopt, p2); test(!p2 && !p3); Test::StringIntDict dict; @@ -1991,8 +1991,8 @@ allTests(Test::TestHelper* helper, bool) test(p2 == p1 && p3 == p1); } { - IceUtil::Optional p1, p2, p3; - p3 = initial->opMG2(IceUtil::None, p2); + optional p1, p2, p3; + p3 = initial->opMG2(nullopt, p2); test(!p2 && !p3); p1 = make_shared(); diff --git a/cpp/test/Ice/optional/TestAMDI.cpp b/cpp/test/Ice/optional/TestAMDI.cpp index aac3f53b04e..04c72b4649a 100644 --- a/cpp/test/Ice/optional/TestAMDI.cpp +++ b/cpp/test/Ice/optional/TestAMDI.cpp @@ -36,7 +36,7 @@ InitialI::pingPongAsync(::std::shared_ptr<::Ice::Value> obj, } void -InitialI::opOptionalExceptionAsync(Ice::optional a, Ice::optional<::std::string> b, Ice::optional<::std::shared_ptr<::Test::OneOptional>> o, +InitialI::opOptionalExceptionAsync(optional a, optional<::std::string> b, optional<::std::shared_ptr<::Test::OneOptional>> o, ::std::function, ::std::function ex, const Ice::Current&) { @@ -44,7 +44,7 @@ InitialI::opOptionalExceptionAsync(Ice::optional a, Ice::optional<::std::st } void -InitialI::opDerivedExceptionAsync(Ice::optional a, Ice::optional<::std::string> b, Ice::optional<::std::shared_ptr<::Test::OneOptional>> o, +InitialI::opDerivedExceptionAsync(optional a, optional<::std::string> b, optional<::std::shared_ptr<::Test::OneOptional>> o, ::std::function, ::std::function ex, const Ice::Current&) { @@ -52,7 +52,7 @@ InitialI::opDerivedExceptionAsync(Ice::optional a, Ice::optional<::std::str } void -InitialI::opRequiredExceptionAsync(Ice::optional a, Ice::optional<::std::string> b, Ice::optional<::std::shared_ptr<::Test::OneOptional>> o, +InitialI::opRequiredExceptionAsync(optional a, optional<::std::string> b, optional<::std::shared_ptr<::Test::OneOptional>> o, ::std::function, ::std::function ex, const Ice::Current&) { @@ -73,264 +73,264 @@ InitialI::opRequiredExceptionAsync(Ice::optional a, Ice::optional<::std::st } void -InitialI::opByteAsync(Ice::optional<::Ice::Byte> p1, - ::std::function&, const Ice::optional<::Ice::Byte>&)> response, +InitialI::opByteAsync(optional<::Ice::Byte> p1, + ::std::function&, const optional<::Ice::Byte>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opBoolAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opBoolAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opShortAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opShortAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opIntAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opIntAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opLongAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opLongAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opFloatAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opFloatAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opDoubleAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opDoubleAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opStringAsync(Ice::optional<::std::string> p1, - ::std::function&, const Ice::optional<::std::string>&)> response, +InitialI::opStringAsync(optional<::std::string> p1, + ::std::function&, const optional<::std::string>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opCustomStringAsync(Ice::optional p1, - ::std::function&, const Ice::optional&)> response, +InitialI::opCustomStringAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opMyEnumAsync(Ice::optional<::Test::MyEnum> p1, - ::std::function&, const Ice::optional<::Test::MyEnum>&)> response, +InitialI::opMyEnumAsync(optional<::Test::MyEnum> p1, + ::std::function&, const optional<::Test::MyEnum>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opSmallStructAsync(Ice::optional<::Test::SmallStruct> p1, - ::std::function&, const Ice::optional<::Test::SmallStruct>&)> response, +InitialI::opSmallStructAsync(optional<::Test::SmallStruct> p1, + ::std::function&, const optional<::Test::SmallStruct>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opFixedStructAsync(Ice::optional<::Test::FixedStruct> p1, - ::std::function&, const Ice::optional<::Test::FixedStruct>&)> response, +InitialI::opFixedStructAsync(optional<::Test::FixedStruct> p1, + ::std::function&, const optional<::Test::FixedStruct>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opVarStructAsync(Ice::optional<::Test::VarStruct> p1, - ::std::function&, const Ice::optional<::Test::VarStruct>&)> response, +InitialI::opVarStructAsync(optional<::Test::VarStruct> p1, + ::std::function&, const optional<::Test::VarStruct>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opOneOptionalAsync(Ice::optional<::std::shared_ptr<::Test::OneOptional>> p1, - ::std::function>&, const Ice::optional<::std::shared_ptr<::Test::OneOptional>>&)> response, +InitialI::opOneOptionalAsync(optional<::std::shared_ptr<::Test::OneOptional>> p1, + ::std::function>&, const optional<::std::shared_ptr<::Test::OneOptional>>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opMyInterfaceProxyAsync(Ice::optional<::std::shared_ptr> p1, - ::std::function>&, const Ice::optional<::std::shared_ptr>&)> response, +InitialI::opMyInterfaceProxyAsync(optional<::std::shared_ptr> p1, + ::std::function>&, const optional<::std::shared_ptr>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opByteSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opByteSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opBoolSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opBoolSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opShortSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opShortSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opIntSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opIntSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opLongSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opLongSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opFloatSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opFloatSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opDoubleSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opDoubleSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opStringSeqAsync(Ice::optional<::Test::StringSeq> p1, - ::std::function&, const Ice::optional<::Test::StringSeq>&)> response, +InitialI::opStringSeqAsync(optional<::Test::StringSeq> p1, + ::std::function&, const optional<::Test::StringSeq>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opSmallStructSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opSmallStructSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opSmallStructListAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opSmallStructListAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opFixedStructSeqAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opFixedStructSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opFixedStructListAsync(Ice::optional<::std::pair> p1, - ::std::function>&, const Ice::optional<::std::pair>&)> response, +InitialI::opFixedStructListAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opVarStructSeqAsync(Ice::optional<::Test::VarStructSeq> p1, - ::std::function&, const Ice::optional<::Test::VarStructSeq>&)> response, +InitialI::opVarStructSeqAsync(optional<::Test::VarStructSeq> p1, + ::std::function&, const optional<::Test::VarStructSeq>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opSerializableAsync(Ice::optional<::Test::Serializable> p1, - ::std::function&, const Ice::optional<::Test::Serializable>&)> response, +InitialI::opSerializableAsync(optional<::Test::Serializable> p1, + ::std::function&, const optional<::Test::Serializable>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opIntIntDictAsync(Ice::optional<::Test::IntIntDict> p1, - ::std::function&, const Ice::optional<::Test::IntIntDict>&)> response, +InitialI::opIntIntDictAsync(optional<::Test::IntIntDict> p1, + ::std::function&, const optional<::Test::IntIntDict>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opStringIntDictAsync(Ice::optional<::Test::StringIntDict> p1, - ::std::function&, const Ice::optional<::Test::StringIntDict>&)> response, +InitialI::opStringIntDictAsync(optional<::Test::StringIntDict> p1, + ::std::function&, const optional<::Test::StringIntDict>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opIntOneOptionalDictAsync(Ice::optional<::Test::IntOneOptionalDict> p1, - ::std::function&, const Ice::optional<::Test::IntOneOptionalDict>&)> response, +InitialI::opIntOneOptionalDictAsync(optional<::Test::IntOneOptionalDict> p1, + ::std::function&, const optional<::Test::IntOneOptionalDict>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); } void -InitialI::opCustomIntStringDictAsync(Ice::optional<::std::map< int, ::Util::string_view>> p1, - ::std::function>&, const Ice::optional<::std::map< int, ::Util::string_view>>&)> response, +InitialI::opCustomIntStringDictAsync(optional<::std::map< int, ::Util::string_view>> p1, + ::std::function>&, const optional<::std::map< int, ::Util::string_view>>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); @@ -345,7 +345,7 @@ InitialI::opClassAndUnknownOptionalAsync(::std::shared_ptr<::Test::A>, } void -InitialI::sendOptionalClassAsync(bool, Ice::optional<::std::shared_ptr<::Test::OneOptional>>, +InitialI::sendOptionalClassAsync(bool, optional<::std::shared_ptr<::Test::OneOptional>>, ::std::function response, ::std::function, const Ice::Current&) { @@ -354,7 +354,7 @@ InitialI::sendOptionalClassAsync(bool, Ice::optional<::std::shared_ptr<::Test::O void InitialI::returnOptionalClassAsync(bool, - ::std::function>&)> response, + ::std::function>&)> response, ::std::function, const Ice::Current&) { response(make_shared(53)); @@ -384,7 +384,7 @@ InitialI::opMStruct1Async(function respo } void -InitialI::opMStruct2Async(Ice::optional p1, +InitialI::opMStruct2Async(optional p1, function response, function, const Ice::Current& current) @@ -401,7 +401,7 @@ InitialI::opMSeq1Async(function response, } void -InitialI::opMSeq2Async(Ice::optional p1, +InitialI::opMSeq2Async(optional p1, function response, function, const Ice::Current& current) @@ -418,7 +418,7 @@ InitialI::opMDict1Async(function response, } void -InitialI::opMDict2Async(Ice::optional p1, +InitialI::opMDict2Async(optional p1, function response, function, const Ice::Current& current) @@ -435,7 +435,7 @@ InitialI::opMG1Async(function response, } void -InitialI::opMG2Async(Ice::optional p1, +InitialI::opMG2Async(optional p1, function response, function, const Ice::Current& current) diff --git a/cpp/test/Ice/optional/TestAMDI.h b/cpp/test/Ice/optional/TestAMDI.h index 4881e480d93..0169bab34d3 100644 --- a/cpp/test/Ice/optional/TestAMDI.h +++ b/cpp/test/Ice/optional/TestAMDI.h @@ -20,160 +20,160 @@ class InitialI : public Test::Initial ::std::function&)>, ::std::function, const Ice::Current&) override; - virtual void opOptionalExceptionAsync(Ice::optional, Ice::optional<::std::string>, Ice::optional<::std::shared_ptr<::Test::OneOptional>>, + virtual void opOptionalExceptionAsync(std::optional, std::optional<::std::string>, std::optional<::std::shared_ptr<::Test::OneOptional>>, ::std::function, ::std::function, const Ice::Current&) override; - virtual void opDerivedExceptionAsync(Ice::optional, Ice::optional<::std::string>, Ice::optional<::std::shared_ptr<::Test::OneOptional>>, + virtual void opDerivedExceptionAsync(std::optional, std::optional<::std::string>, std::optional<::std::shared_ptr<::Test::OneOptional>>, ::std::function, ::std::function, const Ice::Current&) override; - virtual void opRequiredExceptionAsync(Ice::optional, Ice::optional<::std::string>, Ice::optional<::std::shared_ptr<::Test::OneOptional>>, + virtual void opRequiredExceptionAsync(std::optional, std::optional<::std::string>, std::optional<::std::shared_ptr<::Test::OneOptional>>, ::std::function, ::std::function, const Ice::Current&) override; - virtual void opByteAsync(Ice::optional<::Ice::Byte>, - ::std::function&, const Ice::optional<::Ice::Byte>&)>, + virtual void opByteAsync(std::optional<::Ice::Byte>, + ::std::function&, const std::optional<::Ice::Byte>&)>, ::std::function, const Ice::Current&) override; - virtual void opBoolAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opBoolAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opShortAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opShortAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opIntAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opIntAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opLongAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opLongAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opFloatAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opFloatAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opDoubleAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opDoubleAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opStringAsync(Ice::optional<::std::string>, - ::std::function&, const Ice::optional<::std::string>&)>, + virtual void opStringAsync(std::optional<::std::string>, + ::std::function&, const std::optional<::std::string>&)>, ::std::function, const Ice::Current&) override; - virtual void opCustomStringAsync(Ice::optional, - ::std::function&, const Ice::optional&)>, + virtual void opCustomStringAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; - virtual void opMyEnumAsync(Ice::optional<::Test::MyEnum>, - ::std::function&, const Ice::optional<::Test::MyEnum>&)>, + virtual void opMyEnumAsync(std::optional<::Test::MyEnum>, + ::std::function&, const std::optional<::Test::MyEnum>&)>, ::std::function, const Ice::Current&) override; - virtual void opSmallStructAsync(Ice::optional<::Test::SmallStruct>, - ::std::function&, const Ice::optional<::Test::SmallStruct>&)>, + virtual void opSmallStructAsync(std::optional<::Test::SmallStruct>, + ::std::function&, const std::optional<::Test::SmallStruct>&)>, ::std::function, const Ice::Current&) override; - virtual void opFixedStructAsync(Ice::optional<::Test::FixedStruct>, - ::std::function&, const Ice::optional<::Test::FixedStruct>&)>, + virtual void opFixedStructAsync(std::optional<::Test::FixedStruct>, + ::std::function&, const std::optional<::Test::FixedStruct>&)>, ::std::function, const Ice::Current&) override; - virtual void opVarStructAsync(Ice::optional<::Test::VarStruct>, - ::std::function&, const Ice::optional<::Test::VarStruct>&)>, + virtual void opVarStructAsync(std::optional<::Test::VarStruct>, + ::std::function&, const std::optional<::Test::VarStruct>&)>, ::std::function, const Ice::Current&) override; - virtual void opOneOptionalAsync(Ice::optional<::std::shared_ptr<::Test::OneOptional>>, - ::std::function>&, const Ice::optional<::std::shared_ptr<::Test::OneOptional>>&)>, + virtual void opOneOptionalAsync(std::optional<::std::shared_ptr<::Test::OneOptional>>, + ::std::function>&, const std::optional<::std::shared_ptr<::Test::OneOptional>>&)>, ::std::function, const Ice::Current&) override; - virtual void opMyInterfaceProxyAsync(Ice::optional<::std::shared_ptr>, - ::std::function>&, const Ice::optional<::std::shared_ptr>&)>, + virtual void opMyInterfaceProxyAsync(std::optional<::std::shared_ptr>, + ::std::function>&, const std::optional<::std::shared_ptr>&)>, ::std::function, const Ice::Current&) override; - virtual void opByteSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opByteSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opBoolSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opBoolSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opShortSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opShortSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opIntSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opIntSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opLongSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opLongSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opFloatSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opFloatSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opDoubleSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opDoubleSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opStringSeqAsync(Ice::optional<::Test::StringSeq>, - ::std::function&, const Ice::optional<::Test::StringSeq>&)>, + virtual void opStringSeqAsync(std::optional<::Test::StringSeq>, + ::std::function&, const std::optional<::Test::StringSeq>&)>, ::std::function, const Ice::Current&) override; - virtual void opSmallStructSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opSmallStructSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opSmallStructListAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opSmallStructListAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opFixedStructSeqAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opFixedStructSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opFixedStructListAsync(Ice::optional<::std::pair>, - ::std::function>&, const Ice::optional<::std::pair>&)>, + virtual void opFixedStructListAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; - virtual void opVarStructSeqAsync(Ice::optional<::Test::VarStructSeq>, - ::std::function&, const Ice::optional<::Test::VarStructSeq>&)>, + virtual void opVarStructSeqAsync(std::optional<::Test::VarStructSeq>, + ::std::function&, const std::optional<::Test::VarStructSeq>&)>, ::std::function, const Ice::Current&) override; - virtual void opSerializableAsync(Ice::optional<::Test::Serializable>, - ::std::function&, const Ice::optional<::Test::Serializable>&)>, + virtual void opSerializableAsync(std::optional<::Test::Serializable>, + ::std::function&, const std::optional<::Test::Serializable>&)>, ::std::function, const Ice::Current&) override; - virtual void opIntIntDictAsync(Ice::optional<::Test::IntIntDict>, - ::std::function&, const Ice::optional<::Test::IntIntDict>&)>, + virtual void opIntIntDictAsync(std::optional<::Test::IntIntDict>, + ::std::function&, const std::optional<::Test::IntIntDict>&)>, ::std::function, const Ice::Current&) override; - virtual void opStringIntDictAsync(Ice::optional<::Test::StringIntDict>, - ::std::function&, const Ice::optional<::Test::StringIntDict>&)>, + virtual void opStringIntDictAsync(std::optional<::Test::StringIntDict>, + ::std::function&, const std::optional<::Test::StringIntDict>&)>, ::std::function, const Ice::Current&) override; - virtual void opIntOneOptionalDictAsync(Ice::optional<::Test::IntOneOptionalDict>, - ::std::function&, const Ice::optional<::Test::IntOneOptionalDict>&)>, + virtual void opIntOneOptionalDictAsync(std::optional<::Test::IntOneOptionalDict>, + ::std::function&, const std::optional<::Test::IntOneOptionalDict>&)>, ::std::function, const Ice::Current&) override; - virtual void opCustomIntStringDictAsync(Ice::optional<::std::map< int, ::Util::string_view>>, - ::std::function>&, const Ice::optional<::std::map< int, ::Util::string_view>>&)>, + virtual void opCustomIntStringDictAsync(std::optional<::std::map< int, ::Util::string_view>>, + ::std::function>&, const std::optional<::std::map< int, ::Util::string_view>>&)>, ::std::function, const Ice::Current&) override; virtual void opClassAndUnknownOptionalAsync(::std::shared_ptr<::Test::A>, ::std::function, ::std::function, const Ice::Current&) override; - virtual void sendOptionalClassAsync(bool, Ice::optional<::std::shared_ptr<::Test::OneOptional>>, + virtual void sendOptionalClassAsync(bool, std::optional<::std::shared_ptr<::Test::OneOptional>>, ::std::function, ::std::function, const Ice::Current&) override; virtual void returnOptionalClassAsync(bool, - ::std::function>&)>, + ::std::function>&)>, ::std::function, const Ice::Current&) override; virtual void opGAsync(::std::shared_ptr<::Test::G>, @@ -187,7 +187,7 @@ class InitialI : public Test::Initial ::std::function, const Ice::Current&) override; - virtual void opMStruct2Async(Ice::optional, + virtual void opMStruct2Async(std::optional, ::std::function, ::std::function, const Ice::Current&) override; @@ -196,7 +196,7 @@ class InitialI : public Test::Initial ::std::function, const Ice::Current&) override; - virtual void opMSeq2Async(Ice::optional, + virtual void opMSeq2Async(std::optional, ::std::function, ::std::function, const Ice::Current&) override; @@ -205,7 +205,7 @@ class InitialI : public Test::Initial ::std::function, const Ice::Current&) override; - virtual void opMDict2Async(Ice::optional, + virtual void opMDict2Async(std::optional, ::std::function, ::std::function, const Ice::Current&) override; @@ -214,7 +214,7 @@ class InitialI : public Test::Initial ::std::function, const Ice::Current&) override; - virtual void opMG2Async(Ice::optional, + virtual void opMG2Async(std::optional, ::std::function, ::std::function, const Ice::Current&) override; diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index d6cbba94847..48483a015a8 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -33,9 +33,9 @@ InitialI::pingPong(shared_ptr obj, const Current& current) } void -InitialI::opOptionalException(Optional a, - Optional b, - Optional o, +InitialI::opOptionalException(optional a, + optional b, + optional o, const Ice::Current&) { OptionalException ex; @@ -46,9 +46,9 @@ InitialI::opOptionalException(Optional a, } void -InitialI::opDerivedException(Optional a, - Optional b, - Optional o, +InitialI::opDerivedException(optional a, + optional b, + optional o, const Ice::Current&) { DerivedException ex; @@ -63,9 +63,9 @@ InitialI::opDerivedException(Optional a, } void -InitialI::opRequiredException(Optional a, - Optional b, - Optional o, +InitialI::opRequiredException(optional a, + optional b, + optional o, const Ice::Current&) { RequiredException ex; @@ -83,64 +83,64 @@ InitialI::opRequiredException(Optional a, throw ex; } -Optional -InitialI::opByte(Optional p1, Optional& p3, const Current&) +optional +InitialI::opByte(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opBool(Optional p1, Optional& p3, const Current&) +optional +InitialI::opBool(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opShort(Optional p1, Optional& p3, const Current&) +optional +InitialI::opShort(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opInt(Optional p1, Optional& p3, const Current&) +optional +InitialI::opInt(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opLong(Optional p1, Optional& p3, const Current&) +optional +InitialI::opLong(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opFloat(Optional p1, Optional& p3, const Current&) +optional +InitialI::opFloat(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opDouble(Optional p1, Optional& p3, const Current&) +optional +InitialI::opDouble(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opString(Optional p1, Optional& p3, const Current&) +optional +InitialI::opString(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opCustomString(Optional p1, Optional& p3, const Current&) +optional +InitialI::opCustomString(optional p1, optional& p3, const Current&) { if(p1) { @@ -149,50 +149,50 @@ InitialI::opCustomString(Optional p1, Optional& p3, c return p3; } -Optional -InitialI::opMyEnum(Optional p1, Optional& p3, const Current&) +optional +InitialI::opMyEnum(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opSmallStruct(Optional p1, Optional& p3, const Current&) +optional +InitialI::opSmallStruct(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opFixedStruct(Optional p1, Optional& p3, const Current&) +optional +InitialI::opFixedStruct(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opVarStruct(Optional p1, Optional& p3, const Current&) +optional +InitialI::opVarStruct(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opOneOptional(Optional p1, Optional& p3, const Current&) +optional +InitialI::opOneOptional(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opMyInterfaceProxy(Optional p1, Optional& p3, const Current&) +optional +InitialI::opMyInterfaceProxy(optional p1, optional& p3, const Current&) { p3 = p1; return p1; } -Optional -InitialI::opByteSeq(Optional > p1, Optional& p3, +optional +InitialI::opByteSeq(optional > p1, optional& p3, const Current&) { if(p1) @@ -202,8 +202,8 @@ InitialI::opByteSeq(Optional > p1, Opti return p3; } -Optional -InitialI::opBoolSeq(Optional > p1, Optional& p3, const Current&) +optional +InitialI::opBoolSeq(optional > p1, optional& p3, const Current&) { if(p1) { @@ -212,8 +212,8 @@ InitialI::opBoolSeq(Optional > p1, Optional -InitialI::opShortSeq(Optional > p1, Optional& p3, +optional +InitialI::opShortSeq(optional > p1, optional& p3, const Current&) { if(p1) @@ -223,8 +223,8 @@ InitialI::opShortSeq(Optional > p1, Optional -InitialI::opIntSeq(Optional > p1, Optional& p3, const Current&) +optional +InitialI::opIntSeq(optional > p1, optional& p3, const Current&) { if(p1) { @@ -233,8 +233,8 @@ InitialI::opIntSeq(Optional > p1, Optional -InitialI::opLongSeq(Optional > p1, Optional& p3, const Current&) +optional +InitialI::opLongSeq(optional > p1, optional& p3, const Current&) { if(p1) { @@ -243,8 +243,8 @@ InitialI::opLongSeq(Optional > p1, Optional -InitialI::opFloatSeq(Optional > p1, Optional& p3, +optional +InitialI::opFloatSeq(optional > p1, optional& p3, const Current&) { if(p1) @@ -254,8 +254,8 @@ InitialI::opFloatSeq(Optional > p1, Optional -InitialI::opDoubleSeq(Optional > p1, Optional& p3, +optional +InitialI::opDoubleSeq(optional > p1, optional& p3, const Current&) { if(p1) @@ -265,9 +265,9 @@ InitialI::opDoubleSeq(Optional > p1, Optional return p3; } -Ice::optional -InitialI::opStringSeq(Ice::optional p1, - Ice::optional& p3, const Current&) +optional +InitialI::opStringSeq(optional p1, + optional& p3, const Current&) { if(p1) { @@ -276,9 +276,9 @@ InitialI::opStringSeq(Ice::optional p1, return p3; } -Optional -InitialI::opSmallStructSeq(Optional > p1, - Optional& p3, const Current&) +optional +InitialI::opSmallStructSeq(optional > p1, + optional& p3, const Current&) { if(p1) { @@ -287,9 +287,9 @@ InitialI::opSmallStructSeq(Optional return p3; } -Optional -InitialI::opSmallStructList(Optional > p1, - Optional& p3, const Current&) +optional +InitialI::opSmallStructList(optional > p1, + optional& p3, const Current&) { if(p1) { @@ -298,9 +298,9 @@ InitialI::opSmallStructList(Optional -InitialI::opFixedStructSeq(Optional > p1, - Optional& p3, const Current&) +optional +InitialI::opFixedStructSeq(optional > p1, + optional& p3, const Current&) { if(p1) { @@ -309,9 +309,9 @@ InitialI::opFixedStructSeq(Optional return p3; } -Optional -InitialI::opFixedStructList(Optional > p1, - Optional& p3, const Current&) +optional +InitialI::opFixedStructList(optional > p1, + optional& p3, const Current&) { if(p1) { @@ -320,9 +320,9 @@ InitialI::opFixedStructList(Optional -InitialI::opVarStructSeq(Ice::optional p1, - Ice::optional& p3, const Current&) +optional +InitialI::opVarStructSeq(optional p1, + optional& p3, const Current&) { if(p1) { @@ -331,37 +331,37 @@ InitialI::opVarStructSeq(Ice::optional p1, return p3; } -Optional -InitialI::opSerializable(Optional p1, Optional& p3, const Current&) +optional +InitialI::opSerializable(optional p1, optional& p3, const Current&) { p3 = p1; return p3; } -Optional -InitialI::opIntIntDict(Optional p1, Optional& p3, const Current&) +optional +InitialI::opIntIntDict(optional p1, optional& p3, const Current&) { p3 = p1; return p3; } -Optional -InitialI::opStringIntDict(Optional p1, Optional& p3, const Current&) +optional +InitialI::opStringIntDict(optional p1, optional& p3, const Current&) { p3 = p1; return p3; } -Optional -InitialI::opIntOneOptionalDict(Optional p1, Optional& p3, const Current&) +optional +InitialI::opIntOneOptionalDict(optional p1, optional& p3, const Current&) { p3 = p1; return p3; } -Optional -InitialI::opCustomIntStringDict(Optional > p1, - Optional& p3, const Current&) +optional +InitialI::opCustomIntStringDict(optional > p1, + optional& p3, const Current&) { if(p1) { @@ -381,12 +381,12 @@ InitialI::opClassAndUnknownOptional(APtr, const Ice::Current&) } void -InitialI::sendOptionalClass(bool, Optional, const Ice::Current&) +InitialI::sendOptionalClass(bool, optional, const Ice::Current&) { } void -InitialI::returnOptionalClass(bool, Optional& o, const Ice::Current&) +InitialI::returnOptionalClass(bool, optional& o, const Ice::Current&) { o = make_shared(53); } @@ -409,7 +409,7 @@ InitialI::opMStruct1(const Ice::Current& current) } InitialI::OpMStruct2MarshaledResult -InitialI::opMStruct2(IceUtil::Optional p1, const Ice::Current& current) +InitialI::opMStruct2(optional p1, const Ice::Current& current) { return OpMStruct2MarshaledResult(p1, p1, current); } @@ -421,7 +421,7 @@ InitialI::opMSeq1(const Ice::Current& current) } InitialI::OpMSeq2MarshaledResult -InitialI::opMSeq2(IceUtil::Optional p1, const Ice::Current& current) +InitialI::opMSeq2(optional p1, const Ice::Current& current) { return OpMSeq2MarshaledResult(p1, p1, current); } @@ -433,7 +433,7 @@ InitialI::opMDict1(const Ice::Current& current) } InitialI::OpMDict2MarshaledResult -InitialI::opMDict2(IceUtil::Optional p1, const Ice::Current& current) +InitialI::opMDict2(optional p1, const Ice::Current& current) { return OpMDict2MarshaledResult(p1, p1, current); } @@ -445,7 +445,7 @@ InitialI::opMG1(const Ice::Current& current) } InitialI::OpMG2MarshaledResult -InitialI::opMG2(IceUtil::Optional p1, const Ice::Current& current) +InitialI::opMG2(optional p1, const Ice::Current& current) { return OpMG2MarshaledResult(p1, p1, current); } diff --git a/cpp/test/Ice/optional/TestI.h b/cpp/test/Ice/optional/TestI.h index a0a4bb37ffa..a41599af9f8 100644 --- a/cpp/test/Ice/optional/TestI.h +++ b/cpp/test/Ice/optional/TestI.h @@ -16,169 +16,169 @@ class InitialI : public Test::Initial virtual void shutdown(const Ice::Current&); virtual PingPongMarshaledResult pingPong(Ice::ValuePtr, const Ice::Current&); - virtual void opOptionalException(IceUtil::Optional< ::Ice::Int>, - IceUtil::Optional< ::std::string>, - IceUtil::Optional, + virtual void opOptionalException(std::optional<::Ice::Int>, + std::optional<::std::string>, + std::optional, const Ice::Current&); - virtual void opDerivedException(IceUtil::Optional< ::Ice::Int>, - IceUtil::Optional< ::std::string>, - IceUtil::Optional, + virtual void opDerivedException(std::optional<::Ice::Int>, + std::optional<::std::string>, + std::optional, const Ice::Current&); - virtual void opRequiredException(IceUtil::Optional< ::Ice::Int>, - IceUtil::Optional< ::std::string>, - IceUtil::Optional, + virtual void opRequiredException(std::optional<::Ice::Int>, + std::optional<::std::string>, + std::optional, const Ice::Current&); - virtual IceUtil::Optional< ::Ice::Byte> opByte(IceUtil::Optional< ::Ice::Byte>, - IceUtil::Optional< ::Ice::Byte>&, + virtual std::optional<::Ice::Byte> opByte(std::optional<::Ice::Byte>, + std::optional<::Ice::Byte>&, const ::Ice::Current&); - virtual IceUtil::Optional opBool(IceUtil::Optional, IceUtil::Optional&, + virtual std::optional opBool(std::optional, std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Ice::Short> opShort(IceUtil::Optional< ::Ice::Short>, - IceUtil::Optional< ::Ice::Short>&, + virtual std::optional<::Ice::Short> opShort(std::optional<::Ice::Short>, + std::optional<::Ice::Short>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Ice::Int> opInt(IceUtil::Optional< ::Ice::Int>, - IceUtil::Optional< ::Ice::Int>&, + virtual std::optional<::Ice::Int> opInt(std::optional<::Ice::Int>, + std::optional<::Ice::Int>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Ice::Long> opLong(IceUtil::Optional< ::Ice::Long>, - IceUtil::Optional< ::Ice::Long>&, + virtual std::optional<::Ice::Long> opLong(std::optional<::Ice::Long>, + std::optional<::Ice::Long>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Ice::Float> opFloat(IceUtil::Optional< ::Ice::Float>, - IceUtil::Optional< ::Ice::Float>&, + virtual std::optional<::Ice::Float> opFloat(std::optional<::Ice::Float>, + std::optional<::Ice::Float>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Ice::Double> opDouble(IceUtil::Optional< ::Ice::Double>, - IceUtil::Optional< ::Ice::Double>&, + virtual std::optional<::Ice::Double> opDouble(std::optional<::Ice::Double>, + std::optional<::Ice::Double>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::std::string> opString(IceUtil::Optional< ::std::string>, - IceUtil::Optional< ::std::string>&, + virtual std::optional<::std::string> opString(std::optional<::std::string>, + std::optional<::std::string>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::std::string> opCustomString(IceUtil::Optional< Util::string_view>, - IceUtil::Optional< ::std::string>&, + virtual std::optional<::std::string> opCustomString(std::optional, + std::optional<::std::string>&, const ::Ice::Current&); - virtual IceUtil::Optional< Test::MyEnum> opMyEnum(IceUtil::Optional, - IceUtil::Optional&, + virtual std::optional opMyEnum(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional opSmallStruct(IceUtil::Optional, - IceUtil::Optional&, + virtual std::optional opSmallStruct(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional opFixedStruct(IceUtil::Optional, - IceUtil::Optional&, + virtual std::optional opFixedStruct(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional opVarStruct(IceUtil::Optional, - IceUtil::Optional&, + virtual std::optional opVarStruct(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional opOneOptional(IceUtil::Optional< Test::OneOptionalPtr>, - IceUtil::Optional< Test::OneOptionalPtr>&, + virtual std::optional opOneOptional(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional opMyInterfaceProxy(IceUtil::Optional< Test::MyInterfacePrxPtr>, - IceUtil::Optional< Test::MyInterfacePrxPtr>&, + virtual std::optional opMyInterfaceProxy(std::optional, + std::optional&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::ByteSeq> opByteSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::ByteSeq>&, + virtual std::optional<::Test::ByteSeq> opByteSeq( + std::optional<::std::pair >, + std::optional<::Test::ByteSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::BoolSeq> opBoolSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::BoolSeq>&, + virtual std::optional<::Test::BoolSeq> opBoolSeq( + std::optional<::std::pair >, + std::optional<::Test::BoolSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::ShortSeq> opShortSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::ShortSeq>&, + virtual std::optional<::Test::ShortSeq> opShortSeq( + std::optional<::std::pair >, + std::optional<::Test::ShortSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::IntSeq> opIntSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::IntSeq>&, + virtual std::optional<::Test::IntSeq> opIntSeq( + std::optional<::std::pair >, + std::optional<::Test::IntSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::LongSeq> opLongSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::LongSeq>&, + virtual std::optional<::Test::LongSeq> opLongSeq( + std::optional<::std::pair >, + std::optional<::Test::LongSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::FloatSeq> opFloatSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::FloatSeq>&, + virtual std::optional<::Test::FloatSeq> opFloatSeq( + std::optional<::std::pair >, + std::optional<::Test::FloatSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::DoubleSeq> opDoubleSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::DoubleSeq>&, + virtual std::optional<::Test::DoubleSeq> opDoubleSeq( + std::optional<::std::pair >, + std::optional<::Test::DoubleSeq>&, const ::Ice::Current&); - virtual Ice::optional<::Test::StringSeq> opStringSeq( - Ice::optional<::Test::StringSeq>, - Ice::optional<::Test::StringSeq>&, const ::Ice::Current&) ; + virtual std::optional<::Test::StringSeq> opStringSeq( + std::optional<::Test::StringSeq>, + std::optional<::Test::StringSeq>&, const ::Ice::Current&) ; - virtual IceUtil::Optional< ::Test::SmallStructSeq> opSmallStructSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::SmallStructSeq>&, const ::Ice::Current&); + virtual std::optional<::Test::SmallStructSeq> opSmallStructSeq( + std::optional<::std::pair >, + std::optional<::Test::SmallStructSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::SmallStructList> opSmallStructList( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::SmallStructList>&, const ::Ice::Current&); + virtual std::optional<::Test::SmallStructList> opSmallStructList( + std::optional<::std::pair >, + std::optional<::Test::SmallStructList>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::FixedStructSeq> opFixedStructSeq( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::FixedStructSeq>&, const ::Ice::Current&); + virtual std::optional<::Test::FixedStructSeq> opFixedStructSeq( + std::optional<::std::pair >, + std::optional<::Test::FixedStructSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::FixedStructList> opFixedStructList( - IceUtil::Optional< ::std::pair >, - IceUtil::Optional< ::Test::FixedStructList>&, const ::Ice::Current&); + virtual std::optional<::Test::FixedStructList> opFixedStructList( + std::optional<::std::pair >, + std::optional<::Test::FixedStructList>&, const ::Ice::Current&); - virtual Ice::optional<::Test::VarStructSeq> opVarStructSeq( - Ice::optional<::Test::VarStructSeq>, Ice::optional<::Test::VarStructSeq>&, + virtual std::optional<::Test::VarStructSeq> opVarStructSeq( + std::optional<::Test::VarStructSeq>, std::optional<::Test::VarStructSeq>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::Serializable> opSerializable( - IceUtil::Optional< ::Test::Serializable>, - IceUtil::Optional< ::Test::Serializable>&, + virtual std::optional<::Test::Serializable> opSerializable( + std::optional<::Test::Serializable>, + std::optional<::Test::Serializable>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::IntIntDict> opIntIntDict( - IceUtil::Optional< ::Test::IntIntDict>, - IceUtil::Optional< ::Test::IntIntDict>&, + virtual std::optional<::Test::IntIntDict> opIntIntDict( + std::optional<::Test::IntIntDict>, + std::optional<::Test::IntIntDict>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::StringIntDict> opStringIntDict( - IceUtil::Optional< ::Test::StringIntDict>, - IceUtil::Optional< ::Test::StringIntDict>&, + virtual std::optional<::Test::StringIntDict> opStringIntDict( + std::optional<::Test::StringIntDict>, + std::optional<::Test::StringIntDict>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::IntOneOptionalDict> opIntOneOptionalDict( - IceUtil::Optional< ::Test::IntOneOptionalDict>, - IceUtil::Optional< ::Test::IntOneOptionalDict>&, + virtual std::optional<::Test::IntOneOptionalDict> opIntOneOptionalDict( + std::optional<::Test::IntOneOptionalDict>, + std::optional<::Test::IntOneOptionalDict>&, const ::Ice::Current&); - virtual IceUtil::Optional< ::Test::IntStringDict> opCustomIntStringDict( - IceUtil::Optional >, - IceUtil::Optional< ::Test::IntStringDict>&, + virtual std::optional<::Test::IntStringDict> opCustomIntStringDict( + std::optional >, + std::optional<::Test::IntStringDict>&, const ::Ice::Current&); virtual void opClassAndUnknownOptional(Test::APtr, const Ice::Current&); - virtual void sendOptionalClass(bool, IceUtil::Optional, const Ice::Current&); + virtual void sendOptionalClass(bool, std::optional, const Ice::Current&); - virtual void returnOptionalClass(bool, IceUtil::Optional&, const Ice::Current&); + virtual void returnOptionalClass(bool, std::optional&, const Ice::Current&); virtual ::Test::GPtr opG(::Test::GPtr g, const Ice::Current&); @@ -186,19 +186,19 @@ class InitialI : public Test::Initial virtual OpMStruct1MarshaledResult opMStruct1(const Ice::Current&); - virtual OpMStruct2MarshaledResult opMStruct2(IceUtil::Optional, const Ice::Current&); + virtual OpMStruct2MarshaledResult opMStruct2(std::optional, const Ice::Current&); virtual OpMSeq1MarshaledResult opMSeq1(const Ice::Current&); - virtual OpMSeq2MarshaledResult opMSeq2(IceUtil::Optional, const Ice::Current&); + virtual OpMSeq2MarshaledResult opMSeq2(std::optional, const Ice::Current&); virtual OpMDict1MarshaledResult opMDict1(const Ice::Current&); - virtual OpMDict2MarshaledResult opMDict2(IceUtil::Optional, const Ice::Current&); + virtual OpMDict2MarshaledResult opMDict2(std::optional, const Ice::Current&); virtual OpMG1MarshaledResult opMG1(const Ice::Current&); - virtual OpMG2MarshaledResult opMG2(IceUtil::Optional, const Ice::Current&); + virtual OpMG2MarshaledResult opMG2(std::optional, const Ice::Current&); virtual bool supportsRequiredParams(const Ice::Current&); diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index b9a1d797934..92cb4e45e1d 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -738,18 +738,18 @@ allTests(Test::TestHelper* helper) test(Ice::targetLess(compObj->ice_compress(false), compObj->ice_compress(true))); test(Ice::targetGreaterEqual(compObj->ice_compress(true), compObj->ice_compress(false))); - test(compObj->ice_getCompress() == Ice::nullopt); - test(compObj->ice_compress(true)->ice_getCompress() == Ice::optional(true)); - test(compObj->ice_compress(false)->ice_getCompress() == Ice::optional(false)); + test(compObj->ice_getCompress() == nullopt); + test(compObj->ice_compress(true)->ice_getCompress() == optional(true)); + test(compObj->ice_compress(false)->ice_getCompress() == optional(false)); test(Ice::targetEqualTo(compObj->ice_timeout(20), compObj->ice_timeout(20))); test(Ice::targetNotEqualTo(compObj->ice_timeout(10), compObj->ice_timeout(20))); test(Ice::targetLess(compObj->ice_timeout(10), compObj->ice_timeout(20))); test(Ice::targetGreaterEqual(compObj->ice_timeout(20), compObj->ice_timeout(10))); - test(compObj->ice_getTimeout() == Ice::nullopt); - test(compObj->ice_timeout(10)->ice_getTimeout() == Ice::optional(10)); - test(compObj->ice_timeout(20)->ice_getTimeout() == Ice::optional(20)); + test(compObj->ice_getTimeout() == nullopt); + test(compObj->ice_timeout(10)->ice_getTimeout() == optional(10)); + test(compObj->ice_timeout(20)->ice_getTimeout() == optional(20)); auto loc1 = Ice::uncheckedCast(communicator->stringToProxy("loc1:default -p 10000")); auto loc2 = Ice::uncheckedCast(communicator->stringToProxy("loc2:default -p 10000")); diff --git a/cpp/test/IceBridge/simple/AllTests.cpp b/cpp/test/IceBridge/simple/AllTests.cpp index a3e19d5c8a9..c9ca1c6e154 100644 --- a/cpp/test/IceBridge/simple/AllTests.cpp +++ b/cpp/test/IceBridge/simple/AllTests.cpp @@ -223,7 +223,7 @@ allTests(Test::TestHelper* helper) test(cl->getHeartbeatCount() == 0); // No heartbeats enabled by default auto p = cl->ice_connectionId("heartbeat"); - p->ice_getConnection()->setACM(1, Ice::nullopt, Ice::ACMHeartbeat::HeartbeatAlways); + p->ice_getConnection()->setACM(1, nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto p2 = cl->ice_connectionId("heartbeat2"); atomic_int counter = 0; diff --git a/cpp/test/IceBridge/simple/TestI.cpp b/cpp/test/IceBridge/simple/TestI.cpp index 2998a960d06..b8ce6b835c3 100644 --- a/cpp/test/IceBridge/simple/TestI.cpp +++ b/cpp/test/IceBridge/simple/TestI.cpp @@ -142,7 +142,7 @@ void MyClassI::enableHeartbeats(const Ice::Current& current) { checkConnection(current.con); - current.con->setACM(1, Ice::nullopt, Ice::ACMHeartbeat::HeartbeatAlways); + current.con->setACM(1, nullopt, Ice::ACMHeartbeat::HeartbeatAlways); } void diff --git a/cpp/test/IceGrid/activation/AllTests.cpp b/cpp/test/IceGrid/activation/AllTests.cpp index 70b293ac1a2..811133dc482 100644 --- a/cpp/test/IceGrid/activation/AllTests.cpp +++ b/cpp/test/IceGrid/activation/AllTests.cpp @@ -101,7 +101,7 @@ allTests(Test::TestHelper* helper) shared_ptr adminSession = registry->createAdminSession("foo", "bar"); adminSession->ice_getConnection()->setACM(registry->getACMTimeout(), - IceUtil::None, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); shared_ptr admin = adminSession->getAdmin(); diff --git a/cpp/test/IceGrid/allocation/AllTests.cpp b/cpp/test/IceGrid/allocation/AllTests.cpp index aa4033a9652..90213fbf565 100644 --- a/cpp/test/IceGrid/allocation/AllTests.cpp +++ b/cpp/test/IceGrid/allocation/AllTests.cpp @@ -273,7 +273,7 @@ allTests(Test::TestHelper* helper) test(registry); auto session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - Ice::nullopt, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto admin = session->getAdmin(); diff --git a/cpp/test/IceGrid/deployer/AllTests.cpp b/cpp/test/IceGrid/deployer/AllTests.cpp index 82f87b3f18c..7b83e76f1b2 100644 --- a/cpp/test/IceGrid/deployer/AllTests.cpp +++ b/cpp/test/IceGrid/deployer/AllTests.cpp @@ -373,7 +373,7 @@ allTests(Test::TestHelper* helper) shared_ptr session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - IceUtil::None, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); shared_ptr admin = session->getAdmin(); @@ -735,7 +735,7 @@ allTestsWithTarget(Test::TestHelper* helper) test(registry); shared_ptr session = registry->createAdminSession("foo", "bar"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::ACMHeartbeat::HeartbeatOnIdle); + session->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); shared_ptr admin = session->getAdmin(); test(admin); diff --git a/cpp/test/IceGrid/distribution/AllTests.cpp b/cpp/test/IceGrid/distribution/AllTests.cpp index 0607b53a8f1..a1492b10c61 100644 --- a/cpp/test/IceGrid/distribution/AllTests.cpp +++ b/cpp/test/IceGrid/distribution/AllTests.cpp @@ -24,7 +24,7 @@ allTests(Test::TestHelper* helper) shared_ptr session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - IceUtil::None, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); shared_ptr admin = session->getAdmin(); diff --git a/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp b/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp index 6b3ed5b67e6..7b1ee1d0d20 100644 --- a/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp +++ b/cpp/test/IceGrid/noRestartUpdate/AllTests.cpp @@ -145,7 +145,7 @@ allTests(Test::TestHelper* helper) auto session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - Ice::nullopt, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto admin = session->getAdmin(); diff --git a/cpp/test/IceGrid/replicaGroup/AllTests.cpp b/cpp/test/IceGrid/replicaGroup/AllTests.cpp index 45b68bbb36e..8afa6192e29 100644 --- a/cpp/test/IceGrid/replicaGroup/AllTests.cpp +++ b/cpp/test/IceGrid/replicaGroup/AllTests.cpp @@ -113,7 +113,7 @@ allTests(Test::TestHelper* helper) auto session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - IceUtil::None, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto admin = session->getAdmin(); diff --git a/cpp/test/IceGrid/replication/AllTests.cpp b/cpp/test/IceGrid/replication/AllTests.cpp index 64d0e5923ba..34660a3ac96 100644 --- a/cpp/test/IceGrid/replication/AllTests.cpp +++ b/cpp/test/IceGrid/replication/AllTests.cpp @@ -254,7 +254,7 @@ allTests(Test::TestHelper* helper) auto adminSession = registry->createAdminSession("foo", "bar"); adminSession->ice_getConnection()->setACM(registry->getACMTimeout(), - Ice::nullopt, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto admin = adminSession->getAdmin(); diff --git a/cpp/test/IceGrid/session/AllTests.cpp b/cpp/test/IceGrid/session/AllTests.cpp index dad5fbd4428..74b0e91f1b5 100644 --- a/cpp/test/IceGrid/session/AllTests.cpp +++ b/cpp/test/IceGrid/session/AllTests.cpp @@ -473,7 +473,7 @@ allTests(TestHelper* helper) communicator->getDefaultLocator()->ice_getIdentity().category + "/Registry")); auto session = registry->createAdminSession("admin3", "test3"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatAlways); + session->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatAlways); auto admin = session->getAdmin(); test(admin); @@ -1141,8 +1141,8 @@ allTests(TestHelper* helper) auto session1 = registry->createAdminSession("admin1", "test1"); auto session2 = registry->createAdminSession("admin2", "test2"); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); - session2->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session2->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto admin1 = session1->getAdmin(); auto admin2 = session2->getAdmin(); @@ -1397,7 +1397,7 @@ allTests(TestHelper* helper) auto session1 = registry->createAdminSession("admin1", "test1"); auto admin1 = session1->getAdmin(); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapter(""); auto appObs1 = make_shared("appObs1.2"); @@ -1493,7 +1493,7 @@ allTests(TestHelper* helper) auto session1 = Ice::uncheckedCast(registry->createAdminSession("admin1", "test1")); auto admin1 = session1->getAdmin(); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapter(""); auto adptObs1 = make_shared("adptObs1"); @@ -1577,7 +1577,7 @@ allTests(TestHelper* helper) auto session1 = Ice::uncheckedCast(registry->createAdminSession("admin1", "test1")); auto admin1 = session1->getAdmin(); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapter(""); auto objectObs1 = make_shared("objectObs1"); @@ -1629,7 +1629,7 @@ allTests(TestHelper* helper) cout << "testing node observer... " << flush; auto session1 = registry->createAdminSession("admin1", "test1"); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapter(""); auto appObs1 = make_shared("appObs1.3"); @@ -1779,7 +1779,7 @@ allTests(TestHelper* helper) cout << "testing registry observer... " << flush; auto session1 = registry->createAdminSession("admin1", "test1"); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapter(""); auto appObs1 = make_shared("appObs1.4"); @@ -1820,7 +1820,7 @@ allTests(TestHelper* helper) cout << "testing observer with direct proxy... " << flush; auto session1 = registry->createAdminSession("admin1", "test1"); - session1->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); + session1->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); auto adpt1 = communicator->createObjectAdapterWithEndpoints("", "tcp"); auto nodeObs1 = make_shared("nodeObs1"); diff --git a/cpp/test/IceGrid/simple/AllTests.cpp b/cpp/test/IceGrid/simple/AllTests.cpp index b45a463da4d..ef2810bd0fe 100644 --- a/cpp/test/IceGrid/simple/AllTests.cpp +++ b/cpp/test/IceGrid/simple/AllTests.cpp @@ -305,7 +305,7 @@ allTestsWithDeploy(Test::TestHelper* helper) IceGrid::AdminSessionPrxPtr session = registry->createAdminSession("foo", "bar"); - session->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::ACMHeartbeat::HeartbeatAlways); + session->ice_getConnection()->setACM(registry->getACMTimeout(), nullopt, Ice::ACMHeartbeat::HeartbeatAlways); IceGrid::AdminPrxPtr admin = session->getAdmin(); test(admin); diff --git a/cpp/test/IceGrid/update/AllTests.cpp b/cpp/test/IceGrid/update/AllTests.cpp index e9858ac1fa5..f5af7fc38f5 100644 --- a/cpp/test/IceGrid/update/AllTests.cpp +++ b/cpp/test/IceGrid/update/AllTests.cpp @@ -67,7 +67,7 @@ allTests(Test::TestHelper* helper) shared_ptr session = registry->createAdminSession("foo", "bar"); session->ice_getConnection()->setACM(registry->getACMTimeout(), - IceUtil::None, + nullopt, Ice::ACMHeartbeat::HeartbeatAlways); shared_ptr admin = session->getAdmin(); diff --git a/matlab/src/Connection.cpp b/matlab/src/Connection.cpp index c99cfd0871e..93cf330522c 100644 --- a/matlab/src/Connection.cpp +++ b/matlab/src/Connection.cpp @@ -313,9 +313,9 @@ Ice_Connection_heartbeatAsync(void* self, void** future) mxArray* Ice_Connection_setACM(void* self, mxArray* t, mxArray* c, mxArray* h) { - Ice::optional timeout; - Ice::optional close; - Ice::optional heartbeat; + optional timeout; + optional close; + optional heartbeat; try { diff --git a/php/src/Connection.cpp b/php/src/Connection.cpp index 996191f305a..29dbc78d73c 100644 --- a/php/src/Connection.cpp +++ b/php/src/Connection.cpp @@ -200,9 +200,9 @@ ZEND_METHOD(Ice_Connection, setACM) RETURN_NULL(); } - IceUtil::Optional timeout; - IceUtil::Optional close; - IceUtil::Optional heartbeat; + optional timeout; + optional close; + optional heartbeat; if(!isUnset(t)) { diff --git a/php/src/Proxy.cpp b/php/src/Proxy.cpp index eb223ee29e8..37389d1848a 100644 --- a/php/src/Proxy.cpp +++ b/php/src/Proxy.cpp @@ -1263,7 +1263,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getTimeout) try { - IceUtil::Optional timeout = _this->proxy->ice_getTimeout(); + optional timeout = _this->proxy->ice_getTimeout(); if(timeout) { ZVAL_LONG(return_value, static_cast(*timeout)); diff --git a/python/modules/IcePy/Connection.cpp b/python/modules/IcePy/Connection.cpp index e7f8146c65d..c48f2476da6 100644 --- a/python/modules/IcePy/Connection.cpp +++ b/python/modules/IcePy/Connection.cpp @@ -637,9 +637,9 @@ connectionSetACM(ConnectionObject* self, PyObject* args) { assert(self->connection); - IceUtil::Optional timeout; - IceUtil::Optional close; - IceUtil::Optional heartbeat; + optional timeout; + optional close; + optional heartbeat; PyObject* acmCloseType = lookupType("Ice.ACMClose"); PyObject* acmHeartbeatType = lookupType("Ice.ACMHeartbeat"); diff --git a/python/modules/IcePy/Proxy.cpp b/python/modules/IcePy/Proxy.cpp index 4e87dedf474..71fe52cfd90 100644 --- a/python/modules/IcePy/Proxy.cpp +++ b/python/modules/IcePy/Proxy.cpp @@ -1487,7 +1487,7 @@ proxyIceGetCompress(ProxyObject* self, PyObject* /*args*/) PyObject* b; try { - IceUtil::Optional compress = (*self->proxy)->ice_getCompress(); + optional compress = (*self->proxy)->ice_getCompress(); if(compress) { b = *compress ? getTrue() : getFalse(); @@ -1549,7 +1549,7 @@ proxyIceGetTimeout(ProxyObject* self, PyObject* /*args*/) try { - IceUtil::Optional timeout = (*self->proxy)->ice_getTimeout(); + optional timeout = (*self->proxy)->ice_getTimeout(); if(timeout) { return PyLong_FromLong(*timeout); diff --git a/ruby/src/IceRuby/Connection.cpp b/ruby/src/IceRuby/Connection.cpp index 309c1d4d5ee..3e44241fc5d 100644 --- a/ruby/src/IceRuby/Connection.cpp +++ b/ruby/src/IceRuby/Connection.cpp @@ -109,9 +109,9 @@ IceRuby_Connection_setACM(VALUE self, VALUE t, VALUE c, VALUE h) Ice::ConnectionPtr* p = reinterpret_cast(DATA_PTR(self)); assert(p); - IceUtil::Optional timeout; - IceUtil::Optional close; - IceUtil::Optional heartbeat; + optional timeout; + optional close; + optional heartbeat; if(t != Unset) { diff --git a/ruby/src/IceRuby/Proxy.cpp b/ruby/src/IceRuby/Proxy.cpp index 438eda09218..e3692eb73a0 100644 --- a/ruby/src/IceRuby/Proxy.cpp +++ b/ruby/src/IceRuby/Proxy.cpp @@ -822,7 +822,7 @@ IceRuby_ObjectPrx_ice_getCompress(VALUE self) ICE_RUBY_TRY { shared_ptr p = getProxy(self); - IceUtil::Optional c = p->ice_getCompress(); + optional c = p->ice_getCompress(); if(c) { return *c ? Qtrue : Qfalse; @@ -864,7 +864,7 @@ IceRuby_ObjectPrx_ice_getTimeout(VALUE self) ICE_RUBY_TRY { shared_ptr p = getProxy(self); - IceUtil::Optional t = p->ice_getTimeout(); + optional t = p->ice_getTimeout(); if(t) { return INT2FIX(*t); diff --git a/swift/src/IceImpl/Connection.mm b/swift/src/IceImpl/Connection.mm index ef756ac2861..c6dce4be7f4 100644 --- a/swift/src/IceImpl/Connection.mm +++ b/swift/src/IceImpl/Connection.mm @@ -201,9 +201,9 @@ -(void) heartbeatAsync:(void (^)(NSError*))exception -(void) setACM:(NSNumber* _Nullable)timeout close:(NSNumber* _Nullable)close heartbeat:(NSNumber* _Nullable)heartbeat { - Ice::optional opTimeout; - Ice::optional opClose; - Ice::optional opHeartbeat; + std::optional opTimeout; + std::optional opClose; + std::optional opHeartbeat; if(timeout != nil) {