diff --git a/CHANGELOG.md b/CHANGELOG.md index 70dd792f01..f8137079c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ ### Bug fixes: * Fixed Java compilation issue for enum set literals. ### Removed: - * The LIME generator was removed. + * The LIME generator was removed. + * Temporarily restored the `gluecodium::optional` type alias. ## 13.1.1 Release date: 2022-08-08 diff --git a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl.cpp b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl.cpp index a2fedea093..801d6cf5c4 100644 --- a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl.cpp +++ b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl.cpp @@ -21,9 +21,9 @@ #include "unit/test/Foo.h" namespace unit::test { -::custom::common::Return< std::shared_ptr, std::error_code > -Foo::make_foo(const std::optional< double >& parameter) +std::shared_ptr +Foo::make_foo(const ::custom::common::optional< double >& parameter) { - return {std::shared_ptr{}}; + return nullptr; } } // namespace unit::test diff --git a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl_default.cpp b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl_default.cpp index fe4ba2a0c1..9faa31e965 100644 --- a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl_default.cpp +++ b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/cpp/FooImpl_default.cpp @@ -20,13 +20,10 @@ #include "unit/test/Foo.h" -#include "unit/test/Bar.h" -#include - namespace unit::test { -::gluecodium::Return< std::shared_ptr, std::error_code > -Foo::make_foo(const ::std::optional< double >& parameter) +std::shared_ptr +Foo::make_foo(const ::gluecodium::optional< double >& parameter) { - return {std::shared_ptr{}}; + return nullptr; } } // namespace unit::test diff --git a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/lime/foo.lime b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/lime/foo.lime index e54942d877..46cc42dd99 100644 --- a/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/lime/foo.lime +++ b/cmake/tests/unit/gluecodium_generate/cpp-internal-namespace/lime/foo.lime @@ -18,9 +18,5 @@ package unit.test class Foo { - constructor make_foo(parameter: Double?) throws Buz + constructor make_foo(parameter: Double?) } - -enum Bar { ONE, TWO } - -exception Buz(Bar) diff --git a/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl.cpp b/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl.cpp index 46907a1c28..08bdb6ab15 100644 --- a/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl.cpp +++ b/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl.cpp @@ -22,7 +22,7 @@ namespace custom::common::unit::test { std::shared_ptr -Foo::make_foo(const ::std::optional< double >& parameter) +Foo::make_foo(const ::gluecodium::optional< double >& parameter) { return nullptr; } diff --git a/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl_default.cpp b/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl_default.cpp index 5651c10a3c..9faa31e965 100644 --- a/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl_default.cpp +++ b/cmake/tests/unit/gluecodium_generate/cpp-namespace/cpp/FooImpl_default.cpp @@ -22,7 +22,7 @@ namespace unit::test { std::shared_ptr -Foo::make_foo(const ::std::optional< double >& parameter) +Foo::make_foo(const ::gluecodium::optional< double >& parameter) { return nullptr; } diff --git a/functional-tests/functional/input/src/cpp/Blobs.cpp b/functional-tests/functional/input/src/cpp/Blobs.cpp index 606d227168..3449e64512 100644 --- a/functional-tests/functional/input/src/cpp/Blobs.cpp +++ b/functional-tests/functional/input/src/cpp/Blobs.cpp @@ -90,7 +90,7 @@ BlobNulls::get_breaking_null() { return {}; } -std::optional>> +lorem_ipsum::test::optional>> BlobNulls::get_valid_null() { return {}; } diff --git a/functional-tests/functional/input/src/cpp/Dates.cpp b/functional-tests/functional/input/src/cpp/Dates.cpp index 36442e8afb..db1e0d9e87 100644 --- a/functional-tests/functional/input/src/cpp/Dates.cpp +++ b/functional-tests/functional/input/src/cpp/Dates.cpp @@ -35,8 +35,8 @@ Dates::increase_date( const system_clock::time_point& input ) return input + hours(24) + hours(1) + minutes(1) + seconds(1); } -std::optional< system_clock::time_point > -Dates::increase_date_maybe( const std::optional< system_clock::time_point >& input ) +lorem_ipsum::test::optional< system_clock::time_point > +Dates::increase_date_maybe( const lorem_ipsum::test::optional< system_clock::time_point >& input ) { return input ? *input + hours(24) + hours(1) + minutes(1) + seconds(1) : input; } @@ -69,8 +69,8 @@ DatesSteady::increase_date(const steady_clock::time_point& input) { return input + hours(24) + hours(1) + minutes(1) + seconds(1); } -std::optional -DatesSteady::increase_date_maybe(const std::optional& input) { +lorem_ipsum::test::optional +DatesSteady::increase_date_maybe(const lorem_ipsum::test::optional& input) { return input ? *input + hours(24) + hours(1) + minutes(1) + seconds(1) : input; } diff --git a/functional-tests/functional/input/src/cpp/Durations.cpp b/functional-tests/functional/input/src/cpp/Durations.cpp index 8164720b9b..8167b4200e 100644 --- a/functional-tests/functional/input/src/cpp/Durations.cpp +++ b/functional-tests/functional/input/src/cpp/Durations.cpp @@ -32,8 +32,8 @@ DurationSeconds::increase_duration(const seconds input) { return input + seconds(1); } -std::optional -DurationSeconds::increase_duration_maybe(const std::optional& input) { +lorem_ipsum::test::optional +DurationSeconds::increase_duration_maybe(const lorem_ipsum::test::optional& input) { return input ? *input + seconds(1) : input; } @@ -47,8 +47,8 @@ DurationMilliseconds::increase_duration(const milliseconds input) { return input + seconds(1); } -std::optional -DurationMilliseconds::increase_duration_maybe(const std::optional& input) { +lorem_ipsum::test::optional +DurationMilliseconds::increase_duration_maybe(const lorem_ipsum::test::optional& input) { return input ? *input + seconds(1) : input; } diff --git a/functional-tests/functional/input/src/cpp/Lambdas.cpp b/functional-tests/functional/input/src/cpp/Lambdas.cpp index dc3c0043cc..797d3ca6be 100644 --- a/functional-tests/functional/input/src/cpp/Lambdas.cpp +++ b/functional-tests/functional/input/src/cpp/Lambdas.cpp @@ -78,18 +78,18 @@ Lambdas::concatenate_in_struct(const std::string& string1, return concatenator.concatenator(string1, string2); } -std::optional -Lambdas::get_concatenator_or_null(const std::optional& delimiter) +lorem_ipsum::test::optional +Lambdas::get_concatenator_or_null(const lorem_ipsum::test::optional& delimiter) { if (!delimiter) return {}; return {[delimiter](const std::string& string1, const std::string& string2){ return string1 + *delimiter + string2; }}; } -std::optional +lorem_ipsum::test::optional Lambdas::concatenate_or_not(const std::string& string1, const std::string& string2, - const std::optional& concatenator) + const lorem_ipsum::test::optional& concatenator) { if (!concatenator) return {}; return (*concatenator)(string1, string2); @@ -121,8 +121,8 @@ Lambdas::reset_real_concatenator() Lambdas::NullableConfuser Lambdas::get_nullable_confuser() { - return [](const std::optional& value) -> - std::optional + return [](const lorem_ipsum::test::optional& value) -> + lorem_ipsum::test::optional { if (value) { return { [value] { return *value; } }; @@ -132,9 +132,9 @@ Lambdas::get_nullable_confuser() }; } -std::optional +lorem_ipsum::test::optional Lambdas::apply_nullable_confuser(const Lambdas::NullableConfuser& confuser, - const std::optional& value) + const lorem_ipsum::test::optional& value) { return confuser(value); } diff --git a/functional-tests/functional/input/src/cpp/Locales.cpp b/functional-tests/functional/input/src/cpp/Locales.cpp index aab9373065..416f7ae31a 100644 --- a/functional-tests/functional/input/src/cpp/Locales.cpp +++ b/functional-tests/functional/input/src/cpp/Locales.cpp @@ -42,8 +42,8 @@ Locales::locale_round_trip_strip_tag(const Locale& input) { return Locale(input.language_code, input.country_code, input.script_code); } -std::optional -Locales::locale_round_trip_nullable(const std::optional& input) { +optional +Locales::locale_round_trip_nullable(const optional& input) { return input; } diff --git a/functional-tests/functional/input/src/cpp/NullableCollections.cpp b/functional-tests/functional/input/src/cpp/NullableCollections.cpp index bf94e4130a..3e38a65dac 100644 --- a/functional-tests/functional/input/src/cpp/NullableCollections.cpp +++ b/functional-tests/functional/input/src/cpp/NullableCollections.cpp @@ -25,20 +25,18 @@ namespace test { using namespace lorem_ipsum::test; -std::optional> -UseNullableCollections::nullable_list_round_trip(const std::optional>& input) { +optional> +UseNullableCollections::nullable_list_round_trip(const optional>& input) { return input; } -std::optional> -UseNullableCollections::nullable_set_round_trip(const std::optional>& input) { +optional> +UseNullableCollections::nullable_set_round_trip(const optional>& input) { return input; } -std::optional> -UseNullableCollections::nullable_map_round_trip( - const std::optional>& input -) { +optional> +UseNullableCollections::nullable_map_round_trip(const optional>& input) { return input; } @@ -46,5 +44,4 @@ NullableCollections UseNullableCollections::nullable_collections_round_trip(const NullableCollections& input) { return input; } - } diff --git a/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.cpp b/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.cpp index 6a92e3de92..8060b8eb67 100644 --- a/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.cpp +++ b/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.cpp @@ -43,150 +43,150 @@ NullableInterfaceImpl::method_with_nullable_ints_struct( const NullableIntsStruc return input; } -std::optional< ::std::string > -NullableInterfaceImpl::method_with_string( const std::optional< ::std::string >& input ) +optional< ::std::string > +NullableInterfaceImpl::method_with_string( const optional< ::std::string >& input ) { return input; } -std::optional< bool > -NullableInterfaceImpl::method_with_boolean( const std::optional< bool >& input ) +optional< bool > +NullableInterfaceImpl::method_with_boolean( const optional< bool >& input ) { return input; } -std::optional< double > -NullableInterfaceImpl::method_with_double( const std::optional< double >& input ) +optional< double > +NullableInterfaceImpl::method_with_double( const optional< double >& input ) { return input; } -std::optional< int64_t > -NullableInterfaceImpl::method_with_int( const std::optional< int64_t >& input ) +optional< int64_t > +NullableInterfaceImpl::method_with_int( const optional< int64_t >& input ) { return input; } -std::optional -NullableInterfaceImpl::method_with_uint(const std::optional& input) { return input; } +optional +NullableInterfaceImpl::method_with_uint(const optional& input) { return input; } -std::optional< NullableInterface::SomeStruct > -NullableInterfaceImpl::method_with_some_struct( const std::optional< NullableInterface::SomeStruct >& input ) +optional< NullableInterface::SomeStruct > +NullableInterfaceImpl::method_with_some_struct( const optional< NullableInterface::SomeStruct >& input ) { return input; } -std::optional< NullableInterface::SomeEnum > -NullableInterfaceImpl::method_with_some_enum( const std::optional< NullableInterface::SomeEnum >& input ) +optional< NullableInterface::SomeEnum > +NullableInterfaceImpl::method_with_some_enum( const optional< NullableInterface::SomeEnum >& input ) { return input; } -std::optional< NullableInterface::SomeArray > +optional< NullableInterface::SomeArray > NullableInterfaceImpl::method_with_some_array( - const std::optional< NullableInterface::SomeArray >& input ) + const optional< NullableInterface::SomeArray >& input ) { return input; } -std::optional< ::std::vector< ::std::string > > +optional< ::std::vector< ::std::string > > NullableInterfaceImpl::method_with_inline_array( - const std::optional< ::std::vector< ::std::string > >& input ) + const optional< ::std::vector< ::std::string > >& input ) { return input; } -std::optional< NullableInterface::SomeMap > -NullableInterfaceImpl::method_with_some_map( const std::optional< NullableInterface::SomeMap >& input ) +optional< NullableInterface::SomeMap > +NullableInterfaceImpl::method_with_some_map( const optional< NullableInterface::SomeMap >& input ) { return input; } -std::optional< ::std::string > +optional< ::std::string > NullableInterfaceImpl::get_string_attribute( ) const { return m_string_value; } void -NullableInterfaceImpl::set_string_attribute( const std::optional< ::std::string >& value ) +NullableInterfaceImpl::set_string_attribute( const optional< ::std::string >& value ) { m_string_value = value; } -std::optional< bool > +optional< bool > NullableInterfaceImpl::is_bool_attribute( ) const { return m_bool_value; } void -NullableInterfaceImpl::set_bool_attribute( const std::optional< bool >& value ) +NullableInterfaceImpl::set_bool_attribute( const optional< bool >& value ) { m_bool_value = value; } -std::optional< double > +optional< double > NullableInterfaceImpl::get_double_attribute( ) const { return m_double_value; } void -NullableInterfaceImpl::set_double_attribute( const std::optional< double >& value ) +NullableInterfaceImpl::set_double_attribute( const optional< double >& value ) { m_double_value = value; } -std::optional< int64_t > +optional< int64_t > NullableInterfaceImpl::get_int_attribute( ) const { return m_int_value; } void -NullableInterfaceImpl::set_int_attribute( const std::optional< int64_t >& value ) +NullableInterfaceImpl::set_int_attribute( const optional< int64_t >& value ) { m_int_value = value; } -std::optional< NullableInterface::SomeStruct > +optional< NullableInterface::SomeStruct > NullableInterfaceImpl::get_struct_attribute( ) const { return m_struct_value; } void -NullableInterfaceImpl::set_struct_attribute( const std::optional< NullableInterface::SomeStruct >& value ) +NullableInterfaceImpl::set_struct_attribute( const optional< NullableInterface::SomeStruct >& value ) { m_struct_value = value; } -std::optional< NullableInterface::SomeEnum > +optional< NullableInterface::SomeEnum > NullableInterfaceImpl::get_enum_attribute( ) const { return m_enum_value; } void -NullableInterfaceImpl::set_enum_attribute( const std::optional< NullableInterface::SomeEnum >& value ) +NullableInterfaceImpl::set_enum_attribute( const optional< NullableInterface::SomeEnum >& value ) { m_enum_value = value; } -std::optional< NullableInterface::SomeArray > +optional< NullableInterface::SomeArray > NullableInterfaceImpl::get_array_attribute( ) const { return m_array_value; } void -NullableInterfaceImpl::set_array_attribute( const std::optional< NullableInterface::SomeArray >& value ) +NullableInterfaceImpl::set_array_attribute( const optional< NullableInterface::SomeArray >& value ) { m_array_value = value; } -std::optional< ::std::vector< ::std::string > > +optional< ::std::vector< ::std::string > > NullableInterfaceImpl::get_inline_array_attribute( ) const { return m_array_value; @@ -194,35 +194,35 @@ NullableInterfaceImpl::get_inline_array_attribute( ) const void NullableInterfaceImpl::set_inline_array_attribute( - const std::optional< ::std::vector< ::std::string > >& value ) + const optional< ::std::vector< ::std::string > >& value ) { m_array_value = value; } -std::optional< NullableInterface::SomeMap > +optional< NullableInterface::SomeMap > NullableInterfaceImpl::get_map_attribute( ) const { return m_map_value; } void -NullableInterfaceImpl::set_map_attribute( const std::optional< NullableInterface::SomeMap >& value ) +NullableInterfaceImpl::set_map_attribute( const optional< NullableInterface::SomeMap >& value ) { m_map_value = value; } -std::optional< double > +optional< double > NullableInterface::nullable_listener_method_round_trip( const std::shared_ptr< ::test::NullableListener >& listener, - const std::optional< double >& input ) + const optional< double >& input ) { return listener->method_with_double( input ); } -std::optional< std::vector< ::std::string > > +optional< std::vector< ::std::string > > NullableInterface::nullable_listener_attribute_round_trip( const std::shared_ptr< ::test::NullableListener >& listener, - const std::optional< ::std::vector< ::std::string > >& input ) + const optional< ::std::vector< ::std::string > >& input ) { listener->set_array_attribute( input ); return listener->get_array_attribute( ); diff --git a/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.h b/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.h index 0325fd93e9..0d8d4930ba 100644 --- a/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.h +++ b/functional-tests/functional/input/src/cpp/NullableInterfaceImpl.h @@ -26,7 +26,7 @@ namespace test { template< typename T > -using Optional = std::optional< T >; +using Optional = lorem_ipsum::test::optional< T >; class NullableInterfaceImpl : public NullableInterface { diff --git a/functional-tests/functional/input/src/cpp/SetType.cpp b/functional-tests/functional/input/src/cpp/SetType.cpp index 70fd9e1440..3a94567277 100644 --- a/functional-tests/functional/input/src/cpp/SetType.cpp +++ b/functional-tests/functional/input/src/cpp/SetType.cpp @@ -86,8 +86,8 @@ SetType::enum_set_round_trip( const SetType::EnumSet& input ) return input; } -std::optional< SetType::IntSet > -SetType::nullable_int_set_round_trip( const std::optional< SetType::IntSet >& input ) +lorem_ipsum::test::optional< SetType::IntSet > +SetType::nullable_int_set_round_trip( const lorem_ipsum::test::optional< SetType::IntSet >& input ) { return input; } diff --git a/functional-tests/functional/input/src/cpp/WeakListeners.cpp b/functional-tests/functional/input/src/cpp/WeakListeners.cpp index b1977b0edc..25c148f5e4 100644 --- a/functional-tests/functional/input/src/cpp/WeakListeners.cpp +++ b/functional-tests/functional/input/src/cpp/WeakListeners.cpp @@ -65,7 +65,7 @@ WeaklingNotifier::push_notifications(const std::shared_ptr& whom } } -std::optional +lorem_ipsum::test::optional WeaklingNotifier::push_notification_maybe(const std::shared_ptr& whom) { return whom->get_weak_listener()->notify_maybe(); } diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeGenerator.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeGenerator.kt index ac97c2bf9a..1a283ab715 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeGenerator.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeGenerator.kt @@ -33,7 +33,6 @@ import com.here.gluecodium.generator.common.OptimizedListsCollector import com.here.gluecodium.generator.common.templates.TemplateEngine import com.here.gluecodium.generator.cpp.CppFullNameResolver import com.here.gluecodium.generator.cpp.CppIncludeResolver -import com.here.gluecodium.generator.cpp.CppLibraryIncludes import com.here.gluecodium.generator.cpp.CppNameCache import com.here.gluecodium.generator.cpp.CppNameResolver import com.here.gluecodium.generator.cpp.CppNameRules @@ -156,7 +155,7 @@ internal class CBridgeGenerator( val implIncludes = genericTypes.flatMap { implIncludeCollector.collectImports(it) } + CBridgeImplIncludeResolver.BASE_HANDLE_IMPL_INCLUDE + - CppLibraryIncludes.OPTIONAL + cppIncludeResolver.optionalInclude templateData["includes"] = listOf(Include.createInternalInclude(CBRIDGE_COLLECTIONS_HEADER)) + implIncludes.distinct().sorted() val implFileContent = diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeImplIncludeResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeImplIncludeResolver.kt index f6a7294252..184e5441d5 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeImplIncludeResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cbridge/CBridgeImplIncludeResolver.kt @@ -81,7 +81,7 @@ internal class CBridgeImplIncludeResolver(private val cppIncludeResolver: CppInc } private fun resolveStructIncludes(limeStruct: LimeStruct) = - resolveContainerIncludes(limeStruct) + listOf(CppLibraryIncludes.OPTIONAL) + resolveContainerIncludes(limeStruct) + listOf(cppIncludeResolver.optionalInclude) private fun resolveContainerIncludes(limeContainer: LimeContainer) = cppIncludeResolver.resolveElementImports(limeContainer) + @@ -117,7 +117,7 @@ internal class CBridgeImplIncludeResolver(private val cppIncludeResolver: CppInc CppLibraryIncludes.NEW, BASE_HANDLE_IMPL_INCLUDE, CACHED_PROXY_BASE_INCLUDE, - CppLibraryIncludes.OPTIONAL + cppIncludeResolver.optionalInclude ) companion object { diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppGenerator.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppGenerator.kt index 0f2fc51c69..a6d9d4d4b3 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppGenerator.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppGenerator.kt @@ -294,6 +294,7 @@ internal class CppGenerator : Generator { "DurationHash", "Hash", "Locale", + "Optional", "Return", "TimePointHash", "TypeRepository", diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludeResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludeResolver.kt index bf0d040d90..0150fedea3 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludeResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludeResolver.kt @@ -53,6 +53,7 @@ internal class CppIncludeResolver( val hashInclude = cppIncludesCache.createInternalNamespaceInclude("Hash.h") val typeRepositoryInclude = cppIncludesCache.createInternalNamespaceInclude("TypeRepository.h") + val optionalInclude = cppIncludesCache.createInternalNamespaceInclude("Optional.h") private val returnInclude = cppIncludesCache.createInternalNamespaceInclude("Return.h") private val timePointHashInclude = cppIncludesCache.createInternalNamespaceInclude("TimePointHash.h") @@ -111,7 +112,7 @@ internal class CppIncludeResolver( listOfNotNull(CppLibraryIncludes.MEMORY.takeIf { limeTypeRef.attributes.have(OPTIMIZED) }) + when { limeTypeRef.type.actualType is LimeContainerWithInheritance -> listOf(CppLibraryIncludes.MEMORY) - limeTypeRef.isNullable -> listOf(CppLibraryIncludes.OPTIONAL) + limeTypeRef.isNullable -> listOf(optionalInclude) else -> emptyList() } diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludesCache.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludesCache.kt index f6982acacc..edf8134a86 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludesCache.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppIncludesCache.kt @@ -32,6 +32,7 @@ internal class CppIncludesCache( ) { private val resolvedIncludes = mutableMapOf>() + val optionalInclude = createInternalNamespaceInclude("Optional.h") val typeRepositoryInclude = createInternalNamespaceInclude("TypeRepository.h") fun createInternalNamespaceInclude(fileName: String) = diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppLibraryIncludes.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppLibraryIncludes.kt index 74f393764a..f27a234c29 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppLibraryIncludes.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppLibraryIncludes.kt @@ -36,7 +36,6 @@ object CppLibraryIncludes { val CHRONO = Include.createSystemInclude("chrono") val SET = Include.createSystemInclude("unordered_set") val FUNCTIONAL = Include.createSystemInclude("functional") - val OPTIONAL = Include.createSystemInclude("optional") val TYPE_TRAITS = Include.createSystemInclude("type_traits") val UTILITY = Include.createSystemInclude("utility") diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppNameResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppNameResolver.kt index d422d3d73a..72ed5372af 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppNameResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/cpp/CppNameResolver.kt @@ -71,6 +71,7 @@ internal class CppNameResolver( ) : ReferenceMapBasedResolver(limeReferenceMap), NameResolver { private val hashTypeName = (listOf("") + internalNamespace + "hash").joinToString("::") + private val optionalTypeName = (listOf("") + internalNamespace + "optional").joinToString("::") private val localeTypeName = (listOf("") + internalNamespace + "Locale").joinToString("::") private val signatureResolver = CppSignatureResolver(limeReferenceMap, nameCache.nameRules) @@ -120,7 +121,7 @@ internal class CppNameResolver( val typeName = resolveTypeName(limeTypeRef.type, isFullName = true, limeTypeRef.attributes) return when { limeTypeRef.isNullable && limeTypeRef.type.actualType !is LimeContainerWithInheritance -> - "std::optional< $typeName >" + "$optionalTypeName< $typeName >" else -> typeName } } diff --git a/gluecodium/src/main/java/com/here/gluecodium/generator/ffi/FfiCppIncludeResolver.kt b/gluecodium/src/main/java/com/here/gluecodium/generator/ffi/FfiCppIncludeResolver.kt index 3d88515e06..92bc409ec2 100644 --- a/gluecodium/src/main/java/com/here/gluecodium/generator/ffi/FfiCppIncludeResolver.kt +++ b/gluecodium/src/main/java/com/here/gluecodium/generator/ffi/FfiCppIncludeResolver.kt @@ -67,7 +67,7 @@ internal class FfiCppIncludeResolver( private fun getTypeRefIncludes(limeTypeRef: LimeTypeRef): List = getTypeIncludes(limeTypeRef.type.actualType) + - if (limeTypeRef.isNullable) listOf(CppLibraryIncludes.OPTIONAL) else emptyList() + if (limeTypeRef.isNullable) listOf(cppIncludesCache.optionalInclude) else emptyList() private fun getTypeIncludes(limeType: LimeType) = when (limeType) { diff --git a/gluecodium/src/main/resources/templates/cbridge/CBridgeCppProxy.mustache b/gluecodium/src/main/resources/templates/cbridge/CBridgeCppProxy.mustache index 2489487f5d..d949fb00bd 100644 --- a/gluecodium/src/main/resources/templates/cbridge/CBridgeCppProxy.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/CBridgeCppProxy.mustache @@ -86,7 +86,7 @@ _baseRef {{resolveName}}_create_proxy({{resolveName}}_FunctionTable functionTabl _baseRef {{resolveName}}_create_optional_proxy({{resolveName}}_FunctionTable functionTable) { auto proxy = {{resolveName}}Proxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<{{resolveName this "C++"}}>({{!! + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) {{>common/InternalNamespace}}optional<{{resolveName this "C++"}}>({{!! }}::std::bind(&{{resolveName}}Proxy::operator(), proxy{{!! }}{{#functions.0.parameters}}, ::std::placeholders::_{{iter.index}}{{/functions.0.parameters}}))) : 0; } diff --git a/gluecodium/src/main/resources/templates/cbridge/CBridgeStructImpl.mustache b/gluecodium/src/main/resources/templates/cbridge/CBridgeStructImpl.mustache index 4760946311..fe0c801631 100644 --- a/gluecodium/src/main/resources/templates/cbridge/CBridgeStructImpl.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/CBridgeStructImpl.mustache @@ -44,12 +44,12 @@ _baseRef }}{{#filter fields predicate="shouldRetain"}}{{#this}}{{resolveName typeRef}} {{resolveName}}{{#if iter.hasNext}}, {{/if}}{{/this}}{{/filter}}) { {{#unlessPredicate "hasImmutableFields"}}{{!! -}} auto _struct = new ( ::std::nothrow ) std::optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) );{{/unlessPredicate}} +}} auto _struct = new ( ::std::nothrow ) {{>common/InternalNamespace}}optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) );{{/unlessPredicate}} {{#set cppStruct="(*_struct)" structElement=this}}{{#fields}}{{#ifPredicate "shouldRetain"}} {{>setCppFieldValue}} {{/ifPredicate}}{{/fields}}{{/set}} {{#ifPredicate "hasImmutableFields"}}{{!! -}} auto _struct = new ( ::std::nothrow ) std::optional<{{resolveName "C++"}}>( {{!! +}} auto _struct = new ( ::std::nothrow ) {{>common/InternalNamespace}}optional<{{resolveName "C++"}}>( {{!! }}{{resolveName "C++"}}( {{>immutableFieldsInit}} ) );{{/ifPredicate}} return reinterpret_cast<_baseRef>( _struct ); } @@ -57,11 +57,11 @@ _baseRef _baseRef {{resolveName}}_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ) ); } void {{resolveName}}_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ); } {{#set structElement=this}} diff --git a/gluecodium/src/main/resources/templates/cbridge/ListFunctionImplementations.mustache b/gluecodium/src/main/resources/templates/cbridge/ListFunctionImplementations.mustache index 19c086fe8d..009945c3dd 100644 --- a/gluecodium/src/main/resources/templates/cbridge/ListFunctionImplementations.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/ListFunctionImplementations.mustache @@ -56,13 +56,13 @@ void {{resolveName}}_append( _baseRef handle, {{resolveName elementType}} item ) } _baseRef {{resolveName}}_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) {{>common/InternalNamespace}}optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); } void {{resolveName}}_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ); } _baseRef {{resolveName}}_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ) ); } diff --git a/gluecodium/src/main/resources/templates/cbridge/MapFunctionImplementations.mustache b/gluecodium/src/main/resources/templates/cbridge/MapFunctionImplementations.mustache index b4601cf38e..d4dc53741f 100644 --- a/gluecodium/src/main/resources/templates/cbridge/MapFunctionImplementations.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/MapFunctionImplementations.mustache @@ -59,15 +59,15 @@ void {{resolveName}}_iterator_increment(_baseRef iterator_handle) { } _baseRef {{resolveName}}_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) {{>common/InternalNamespace}}optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); } void {{resolveName}}_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ); } _baseRef {{resolveName}}_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ) ); }{{!! }}{{+ConvertToCpp}}{{!! diff --git a/gluecodium/src/main/resources/templates/cbridge/SetFunctionImplementations.mustache b/gluecodium/src/main/resources/templates/cbridge/SetFunctionImplementations.mustache index e1f38cff2c..20ac6aefe8 100644 --- a/gluecodium/src/main/resources/templates/cbridge/SetFunctionImplementations.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/SetFunctionImplementations.mustache @@ -52,15 +52,15 @@ void {{resolveName}}_iterator_increment(_baseRef iterator_handle) { } _baseRef {{resolveName}}_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) {{>common/InternalNamespace}}optional<{{resolveName "C++"}}>( {{resolveName "C++"}}( ) ) ); } void {{resolveName}}_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ); } _baseRef {{resolveName}}_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<{{>common/InternalNamespace}}optional<{{resolveName "C++"}}>*>( handle ) ); }{{!! }}{{+ConvertToCpp}}{{!! diff --git a/gluecodium/src/main/resources/templates/cbridge/common/BaseHandleImpl.mustache b/gluecodium/src/main/resources/templates/cbridge/common/BaseHandleImpl.mustache index 8316900daf..e168272371 100644 --- a/gluecodium/src/main/resources/templates/cbridge/common/BaseHandleImpl.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/common/BaseHandleImpl.mustache @@ -41,14 +41,13 @@ #pragma once #include "cbridge/include/BaseHandle.h" +#include "{{>common/InternalInclude}}Optional.h" #include #include #include #include -#include #include -#include template < typename T > inline static T* @@ -185,41 +184,41 @@ seconds_double_to_duration(double seconds_double) { } template < class T > -struct Conversion< std::optional< T > > +struct Conversion< {{>common/InternalNamespace}}optional< T > > { static _baseRef - toBaseRef( std::optional< T > ptr ) + toBaseRef( {{>common/InternalNamespace}}optional< T > ptr ) { return !ptr ? 0 : reinterpret_cast< _baseRef >( - new std::optional< T >( ::std::move( ptr ) ) ); + new {{>common/InternalNamespace}}optional< T >( ::std::move( ptr ) ) ); } static _baseRef - referenceBaseRef( const std::optional< T >& t ) + referenceBaseRef( const {{>common/InternalNamespace}}optional< T >& t ) { return reinterpret_cast< _baseRef >( &t ); } - static std::optional< T > + static {{>common/InternalNamespace}}optional< T > toCpp( _baseRef ref ) { if ( ref == 0 ) { return {}; } - return *reinterpret_cast< std::optional< T >* >( ref ); + return *reinterpret_cast< {{>common/InternalNamespace}}optional< T >* >( ref ); } - static std::optional< T > + static {{>common/InternalNamespace}}optional< T > toCppReturn( _baseRef ref ) { if ( ref == 0 ) { return {}; } - auto ptr_ptr = reinterpret_cast< std::optional< T >* >( ref ); - std::optional< T > ptr( ::std::move( *ptr_ptr ) ); + auto ptr_ptr = reinterpret_cast< {{>common/InternalNamespace}}optional< T >* >( ref ); + {{>common/InternalNamespace}}optional< T > ptr( ::std::move( *ptr_ptr ) ); delete ptr_ptr; return ptr; } @@ -260,39 +259,39 @@ struct Conversion> { }; template -struct Conversion>> { +struct Conversion<{{>common/InternalNamespace}}optional>> { static _baseRef - toBaseRef(std::optional> ptr) { + toBaseRef({{>common/InternalNamespace}}optional> ptr) { if (!ptr) return 0; return reinterpret_cast<_baseRef>( - new std::optional(duration_to_seconds_double(ptr->time_since_epoch())) + new {{>common/InternalNamespace}}optional(duration_to_seconds_double(ptr->time_since_epoch())) ); } static _baseRef - referenceBaseRef(const std::optional>& ptr) { + referenceBaseRef(const {{>common/InternalNamespace}}optional>& ptr) { return toBaseRef(ptr); } - static std::optional> + static {{>common/InternalNamespace}}optional> toCpp(_baseRef ref) { if (ref == 0) return {}; - auto optional_double = *reinterpret_cast*>(ref); + auto optional_double = *reinterpret_cast<{{>common/InternalNamespace}}optional*>(ref); if (!optional_double) return {}; - return std::optional>( + return {{>common/InternalNamespace}}optional>( std::chrono::time_point( seconds_double_to_duration(*optional_double) ) ); } - static std::optional> + static {{>common/InternalNamespace}}optional> toCppReturn(_baseRef ref) { if (ref == 0) return {}; - auto optional_ptr = reinterpret_cast*>(ref); + auto optional_ptr = reinterpret_cast<{{>common/InternalNamespace}}optional*>(ref); auto result = !*optional_ptr - ? std::optional>{} - : std::optional>( + ? {{>common/InternalNamespace}}optional>{} + : {{>common/InternalNamespace}}optional>( std::chrono::time_point( seconds_double_to_duration(**optional_ptr) ) @@ -332,37 +331,37 @@ struct Conversion> }; template -struct Conversion>> { +struct Conversion<{{>common/InternalNamespace}}optional>> { static _baseRef - toBaseRef(std::optional> ptr) { + toBaseRef({{>common/InternalNamespace}}optional> ptr) { if (!ptr) return 0; return reinterpret_cast<_baseRef>( - new std::optional(duration_to_seconds_double(*ptr)) + new {{>common/InternalNamespace}}optional(duration_to_seconds_double(*ptr)) ); } static _baseRef - referenceBaseRef(const std::optional>& ptr) { + referenceBaseRef(const {{>common/InternalNamespace}}optional>& ptr) { return toBaseRef(ptr); } - static std::optional> + static {{>common/InternalNamespace}}optional> toCpp(_baseRef ref) { if (ref == 0) return {}; - auto optional_double = *reinterpret_cast*>(ref); + auto optional_double = *reinterpret_cast<{{>common/InternalNamespace}}optional*>(ref); if (!optional_double) return {}; - return std::optional>( + return {{>common/InternalNamespace}}optional>( seconds_double_to_duration(*optional_double) ); } - static std::optional> + static {{>common/InternalNamespace}}optional> toCppReturn(_baseRef ref) { if (ref == 0) return {}; - auto optional_ptr = reinterpret_cast*>(ref); + auto optional_ptr = reinterpret_cast<{{>common/InternalNamespace}}optional*>(ref); auto result = !*optional_ptr - ? std::optional>{} - : std::optional>( + ? {{>common/InternalNamespace}}optional>{} + : {{>common/InternalNamespace}}optional>( seconds_double_to_duration(**optional_ptr) ); delete optional_ptr; diff --git a/gluecodium/src/main/resources/templates/cbridge/common/BuiltinHandle.mustache b/gluecodium/src/main/resources/templates/cbridge/common/BuiltinHandle.mustache index da85e64c2d..732399402a 100644 --- a/gluecodium/src/main/resources/templates/cbridge/common/BuiltinHandle.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/common/BuiltinHandle.mustache @@ -43,20 +43,19 @@ #include #include -#include #define DEFINE_HANDLE_METHODS( T ) \ _baseRef T##_create_handle( T t ) \ { \ - return reinterpret_cast< _baseRef >( new ( ::std::nothrow ) std::optional< T >( t ) ); \ + return reinterpret_cast< _baseRef >( new ( ::std::nothrow ) {{>common/InternalNamespace}}optional< T >( t ) ); \ } \ void T##_release_handle( _baseRef handle ) \ { \ - delete reinterpret_cast< std::optional< T >* >( handle ); \ + delete reinterpret_cast< {{>common/InternalNamespace}}optional< T >* >( handle ); \ } \ T T##_value_get( _baseRef handle ) \ { \ - return **reinterpret_cast< std::optional< T >* >( handle ); \ + return **reinterpret_cast< {{>common/InternalNamespace}}optional< T >* >( handle ); \ } DEFINE_HANDLE_METHODS( bool ); diff --git a/gluecodium/src/main/resources/templates/cbridge/common/ByteArrayHandle.mustache b/gluecodium/src/main/resources/templates/cbridge/common/ByteArrayHandle.mustache index 08ff690b2d..d4f42227f4 100644 --- a/gluecodium/src/main/resources/templates/cbridge/common/ByteArrayHandle.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/common/ByteArrayHandle.mustache @@ -38,12 +38,11 @@ // // ------------------------------------------------------------------------------------------------- +#include "{{>common/InternalInclude}}/Optional.h" #include "cbridge/include/ByteArrayHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" - #include #include -#include #include _baseRef @@ -83,26 +82,26 @@ _baseRef byteArray_create_optional_handle( ) { return reinterpret_cast< _baseRef >( - new ( ::std::nothrow ) std::optional< ::std::shared_ptr< ::std::vector< uint8_t > > >( + new ( ::std::nothrow ) {{>common/InternalNamespace}}optional< ::std::shared_ptr< ::std::vector< uint8_t > > >( ::std::shared_ptr< ::std::vector< uint8_t > >( new ( ::std::nothrow ) ::std::vector< uint8_t >{} ) ) ); } void byteArray_release_optional_handle( _baseRef handle ) { - delete reinterpret_cast< std::optional <::std::shared_ptr< ::std::vector< uint8_t > > >* >(handle); + delete reinterpret_cast< {{>common/InternalNamespace}}optional <::std::shared_ptr< ::std::vector< uint8_t > > >* >(handle); } _baseRef byteArray_unwrap_optional_handle( _baseRef handle ) { return reinterpret_cast< _baseRef >( - &**reinterpret_cast< std::optional< ::std::shared_ptr< ::std::vector< uint8_t > > >* >( handle ) ); + &**reinterpret_cast< {{>common/InternalNamespace}}optional< ::std::shared_ptr< ::std::vector< uint8_t > > >* >( handle ) ); } void byteArray_assign_optional( _baseRef handle, const uint8_t* data, const size_t size ) { - ( **get_pointer< std::optional< ::std::shared_ptr< ::std::vector< uint8_t > > > >( handle ) ) + ( **get_pointer< {{>common/InternalNamespace}}optional< ::std::shared_ptr< ::std::vector< uint8_t > > > >( handle ) ) ->assign( data, data + size ); } diff --git a/gluecodium/src/main/resources/templates/cbridge/common/LocaleHandle.mustache b/gluecodium/src/main/resources/templates/cbridge/common/LocaleHandle.mustache index 19fe7ac3a3..26140201e0 100644 --- a/gluecodium/src/main/resources/templates/cbridge/common/LocaleHandle.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/common/LocaleHandle.mustache @@ -41,9 +41,9 @@ #include "cbridge/include/LocaleHandle.h" #include "{{>common/InternalInclude}}/Locale.h" +#include "{{>common/InternalInclude}}/Optional.h" #include "cbridge_internal/include/BaseHandleImpl.h" #include -#include #include _baseRef @@ -54,9 +54,9 @@ locale_create_handle(_baseRef language_code_handle, { return reinterpret_cast<_baseRef>( new (::std::nothrow) {{>common/InternalNamespace}}Locale( - Conversion>::toCpp(language_code_handle), - Conversion>::toCpp(country_code_handle), - Conversion>::toCpp(script_code_handle), + Conversion<{{>common/InternalNamespace}}optional>::toCpp(language_code_handle), + Conversion<{{>common/InternalNamespace}}optional>::toCpp(country_code_handle), + Conversion<{{>common/InternalNamespace}}optional>::toCpp(script_code_handle), Conversion::toCpp(language_tag_handle) ) ); @@ -71,7 +71,7 @@ locale_release_handle(_baseRef handle) _baseRef locale_get_language_code(_baseRef handle) { - return Conversion>::toBaseRef( + return Conversion<{{>common/InternalNamespace}}optional>::toBaseRef( get_pointer<{{>common/InternalNamespace}}Locale>(handle)->language_code ); } @@ -79,7 +79,7 @@ locale_get_language_code(_baseRef handle) _baseRef locale_get_country_code(_baseRef handle) { - return Conversion>::toBaseRef( + return Conversion<{{>common/InternalNamespace}}optional>::toBaseRef( get_pointer<{{>common/InternalNamespace}}Locale>(handle)->country_code ); } @@ -87,7 +87,7 @@ locale_get_country_code(_baseRef handle) _baseRef locale_get_script_code(_baseRef handle) { - return Conversion>::toBaseRef( + return Conversion<{{>common/InternalNamespace}}optional>::toBaseRef( get_pointer<{{>common/InternalNamespace}}Locale>(handle)->script_code ); } @@ -95,7 +95,7 @@ locale_get_script_code(_baseRef handle) _baseRef locale_get_language_tag(_baseRef handle) { - return Conversion>::toBaseRef( + return Conversion<{{>common/InternalNamespace}}optional>::toBaseRef( get_pointer<{{>common/InternalNamespace}}Locale>(handle)->language_tag ); } @@ -104,7 +104,7 @@ _baseRef locale_create_optional_handle(_baseRef locale_handle) { return reinterpret_cast<_baseRef>( - new (::std::nothrow) std::optional<{{>common/InternalNamespace}}Locale>( + new (::std::nothrow) {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>( *get_pointer<{{>common/InternalNamespace}}Locale>(locale_handle) ) ); @@ -113,13 +113,13 @@ locale_create_optional_handle(_baseRef locale_handle) void locale_release_optional_handle(_baseRef handle) { - delete reinterpret_castcommon/InternalNamespace}}Locale>*>(handle); + delete reinterpret_cast<{{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>*>(handle); } _baseRef locale_unwrap_optional_handle(_baseRef handle) { return reinterpret_cast<_baseRef>( - &**reinterpret_castcommon/InternalNamespace}}Locale>*>(handle) + &**reinterpret_cast<{{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>*>(handle) ); } diff --git a/gluecodium/src/main/resources/templates/cbridge/common/StringHandle.mustache b/gluecodium/src/main/resources/templates/cbridge/common/StringHandle.mustache index cc368cc15a..649c52384d 100644 --- a/gluecodium/src/main/resources/templates/cbridge/common/StringHandle.mustache +++ b/gluecodium/src/main/resources/templates/cbridge/common/StringHandle.mustache @@ -38,10 +38,10 @@ // // ------------------------------------------------------------------------------------------------- +#include "{{>common/InternalInclude}}/Optional.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" #include -#include #include #include @@ -91,17 +91,17 @@ _baseRef std_string_create_optional_handle( const char* c_str ) { return reinterpret_cast< _baseRef >( - new ( ::std::nothrow ) std::optional( ::std::string( c_str ) ) ); + new ( ::std::nothrow ) {{>common/InternalNamespace}}optional( ::std::string( c_str ) ) ); } void std_string_release_optional_handle( _baseRef handle ) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast<{{>common/InternalNamespace}}optional*>(handle); } _baseRef std_string_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast< _baseRef >( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast< _baseRef >( &**reinterpret_cast<{{>common/InternalNamespace}}optional*>( handle ) ); } diff --git a/gluecodium/src/main/resources/templates/cpp/common/Hash.mustache b/gluecodium/src/main/resources/templates/cpp/common/Hash.mustache index c610e7ddf3..d50f190e44 100644 --- a/gluecodium/src/main/resources/templates/cpp/common/Hash.mustache +++ b/gluecodium/src/main/resources/templates/cpp/common/Hash.mustache @@ -25,7 +25,6 @@ #include #include #include -#include #include {{#internalNamespace}} @@ -108,15 +107,6 @@ struct hash } }; -template -struct hash> -{ - size_t operator( )( const std::optional& t ) const noexcept - { - return t.has_value( ) ? hash( )( *t ) : 0; - } -}; - {{#internalNamespace}} } {{/internalNamespace}} diff --git a/gluecodium/src/main/resources/templates/cpp/common/Locale.mustache b/gluecodium/src/main/resources/templates/cpp/common/Locale.mustache index d0b079e377..0d2128bd44 100644 --- a/gluecodium/src/main/resources/templates/cpp/common/Locale.mustache +++ b/gluecodium/src/main/resources/templates/cpp/common/Locale.mustache @@ -42,7 +42,7 @@ #include "{{exportFileName}}.h" #include "Hash.h" -#include +#include "Optional.h" #include {{#internalNamespace}} @@ -54,15 +54,15 @@ namespace {{.}} { */ struct {{>cpp/CppExportMacro}}Locale { Locale(); - explicit Locale(std::optional language_tag); - Locale(std::optional language_code, std::optional country_code); - Locale(std::optional language_code, - std::optional country_code, - std::optional script_code); - Locale(std::optional language_code, - std::optional country_code, - std::optional script_code, - std::optional language_tag); + explicit Locale(optional language_tag); + Locale(optional language_code, optional country_code); + Locale(optional language_code, + optional country_code, + optional script_code); + Locale(optional language_code, + optional country_code, + optional script_code, + optional language_tag); explicit Locale(std::string language_tag); Locale(std::string language_code, std::string country_code); Locale(std::string language_code, @@ -74,13 +74,13 @@ struct {{>cpp/CppExportMacro}}Locale { std::string language_tag); /// ISO 639-1 language code (2-letter) - std::optional language_code; + optional language_code; /// ISO 3166-1 alpha-2 country code (2-letter) - std::optional country_code; + optional country_code; /// ISO 15924 script code (4-letter) - std::optional script_code; + optional script_code; /// BCP 47 language tag - std::optional language_tag; + optional language_tag; bool operator==(const Locale& rhs) const; bool operator!=(const Locale& rhs) const; diff --git a/gluecodium/src/main/resources/templates/cpp/common/LocaleImpl.mustache b/gluecodium/src/main/resources/templates/cpp/common/LocaleImpl.mustache index 7c03998110..89c485d9cc 100644 --- a/gluecodium/src/main/resources/templates/cpp/common/LocaleImpl.mustache +++ b/gluecodium/src/main/resources/templates/cpp/common/LocaleImpl.mustache @@ -46,50 +46,50 @@ namespace {{.}} { Locale::Locale() {} -Locale::Locale(std::optional language_tag) : language_tag(std::move(language_tag)) {} +Locale::Locale(optional language_tag) : language_tag(std::move(language_tag)) {} -Locale::Locale(std::optional language_code, std::optional country_code) +Locale::Locale(optional language_code, optional country_code) : language_code(std::move(language_code)), country_code(std::move(country_code)) {} -Locale::Locale(std::optional language_code, - std::optional country_code, - std::optional script_code) +Locale::Locale(optional language_code, + optional country_code, + optional script_code) : language_code(std::move(language_code)), country_code(std::move(country_code)), script_code(std::move(script_code)) {} -Locale::Locale(std::optional language_code, - std::optional country_code, - std::optional script_code, - std::optional language_tag) +Locale::Locale(optional language_code, + optional country_code, + optional script_code, + optional language_tag) : language_code(std::move(language_code)), country_code(std::move(country_code)), script_code(std::move(script_code)), language_tag(std::move(language_tag)) {} Locale::Locale(std::string language_tag) - : language_tag(std::optional(std::move(language_tag))) {} + : language_tag(optional(std::move(language_tag))) {} Locale::Locale(std::string language_code, std::string country_code) - : language_code(std::optional(std::move(language_code))), - country_code(std::optional(std::move(country_code))) {} + : language_code(optional(std::move(language_code))), + country_code(optional(std::move(country_code))) {} Locale::Locale(std::string language_code, std::string country_code, std::string script_code) - : language_code(std::optional(std::move(language_code))), - country_code(std::optional(std::move(country_code))), - script_code(std::optional(std::move(script_code))) {} + : language_code(optional(std::move(language_code))), + country_code(optional(std::move(country_code))), + script_code(optional(std::move(script_code))) {} Locale::Locale(std::string language_code, std::string country_code, std::string script_code, std::string language_tag) - : language_code(std::optional(std::move(language_code))), - country_code(std::optional(std::move(country_code))), - script_code(std::optional(std::move(script_code))), - language_tag(std::optional(std::move(language_tag))) {} + : language_code(optional(std::move(language_code))), + country_code(optional(std::move(country_code))), + script_code(optional(std::move(script_code))), + language_tag(optional(std::move(language_tag))) {} bool Locale::operator==(const Locale& rhs) const @@ -118,10 +118,10 @@ Locale::operator!=(const Locale& rhs) const std::size_t hash::operator()(const Locale& t) const noexcept { size_t hash_value = 43; - hash_value = (hash_value ^ hash>()(t.language_code)) << 1; - hash_value = (hash_value ^ hash>()(t.country_code)) << 1; - hash_value = (hash_value ^ hash>()(t.script_code)) << 1; - hash_value = (hash_value ^ hash>()(t.language_tag)) << 1; + hash_value = (hash_value ^ hash>()(t.language_code)) << 1; + hash_value = (hash_value ^ hash>()(t.country_code)) << 1; + hash_value = (hash_value ^ hash>()(t.script_code)) << 1; + hash_value = (hash_value ^ hash>()(t.language_tag)) << 1; return hash_value; } diff --git a/gluecodium/src/main/resources/templates/cpp/common/Optional.mustache b/gluecodium/src/main/resources/templates/cpp/common/Optional.mustache new file mode 100644 index 0000000000..b42dd14f55 --- /dev/null +++ b/gluecodium/src/main/resources/templates/cpp/common/Optional.mustache @@ -0,0 +1,97 @@ +{{!! + ! + ! Copyright (C) 2016-2019 HERE Europe B.V. + ! + ! Licensed under the Apache License, Version 2.0 (the "License"); + ! you may not use this file except in compliance with the License. + ! You may obtain a copy of the License at + ! + ! http://www.apache.org/licenses/LICENSE-2.0 + ! + ! Unless required by applicable law or agreed to in writing, software + ! distributed under the License is distributed on an "AS IS" BASIS, + ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ! See the License for the specific language governing permissions and + ! limitations under the License. + ! + ! SPDX-License-Identifier: Apache-2.0 + ! License-Filename: LICENSE + ! + !}} +// ------------------------------------------------------------------------------------------------- +// Copyright (C) 2016-2019 HERE Europe B.V. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 +// License-Filename: LICENSE +// +// ------------------------------------------------------------------------------------------------- + +#pragma once +#include "Hash.h" + +/* + * This header is used to define the optional type used by Gluecodium. If nothing else is defined + * it will use std::optional. To use custom optional implementation, GLUECODIUM_OPTIONAL_HEADER and + * GLUECODIUM_OPTIONAL_TYPE need to be defined. The optional will be used in the internal namespace. + * + * For example, to use optional from experimental define the following macros + * + * #define GLUECODIUM_OPTIONAL_HEADER + * #define GLUECODIUM_OPTIONAL_TYPE std::experimental::optional + * #define GLUECODIUM_OPTIONAL_HELPER_TYPES auto nullopt = std::experimental::nullopt; \ + * auto in_place = std::experimental::in_place; + * + * GLUECODIUM_OPTIONAL_HELPER_TYPES is just a convenience macro to have these available in the same + * namespace as the optional type. These are not necessary for Gluecodium to use the optional type + * itself. + */ + +#if (defined(GLUECODIUM_OPTIONAL_HEADER) && !defined(GLUECODIUM_OPTIONAL_TYPE)) || \ + (!defined(GLUECODIUM_OPTIONAL_HEADER) && defined(GLUECODIUM_OPTIONAL_TYPE)) +# error "Either both GLUECODIUM_OPTIONAL_HEADER and GLUECODIUM_OPTIONAL_TYPE or neither of them must be defined" +#endif + +#if !defined(GLUECODIUM_OPTIONAL_HEADER) && !defined(GLUECODIUM_OPTIONAL_TYPE) +# define GLUECODIUM_OPTIONAL_HEADER +# define GLUECODIUM_OPTIONAL_TYPE std::optional +# define GLUECODIUM_OPTIONAL_HELPER_TYPES using std::nullopt; \ + using std::in_place; \ + using std::bad_optional_access; +#endif // !defined(GLUECODIUM_OPTIONAL_HEADER) && !defined(GLUECODIUM_OPTIONAL_TYPE) + +#include GLUECODIUM_OPTIONAL_HEADER + +{{#internalNamespace}} +namespace {{.}} { +{{/internalNamespace}} +template +using optional = GLUECODIUM_OPTIONAL_TYPE; +#ifdef GLUECODIUM_OPTIONAL_HELPER_TYPES +GLUECODIUM_OPTIONAL_HELPER_TYPES +#endif + +template +struct hash<{{>common/InternalNamespace}}optional> +{ + size_t + operator()(const {{>common/InternalNamespace}}optional& optional_value) const noexcept + { + return static_cast( optional_value ) ? {{>common/InternalNamespace}}hash( )( *optional_value ) : 0; + } +}; + +{{#internalNamespace}} +} +{{/internalNamespace}} diff --git a/gluecodium/src/main/resources/templates/ffi/FfiConversionBase.mustache b/gluecodium/src/main/resources/templates/ffi/FfiConversionBase.mustache index d256693ed0..f35c6a030d 100644 --- a/gluecodium/src/main/resources/templates/ffi/FfiConversionBase.mustache +++ b/gluecodium/src/main/resources/templates/ffi/FfiConversionBase.mustache @@ -23,12 +23,12 @@ #pragma once #include "OpaqueHandle.h" +#include "{{>common/InternalInclude}}Optional.h" #include #include #include #include #include -#include #include {{#internalNamespace}} @@ -93,19 +93,19 @@ struct Conversion, typename std::enable_if -struct Conversion, typename std::enable_if>::value>::type> { +struct Conversion<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional, typename std::enable_if>::value>::type> { static FfiOpaqueHandle - toFfi(std::optional t) { + toFfi({{#internalNamespace}}{{.}}::{{/internalNamespace}}optional t) { return t - ? reinterpret_cast(new (std::nothrow) std::optional(std::move(t))) + ? reinterpret_cast(new (std::nothrow) {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional(std::move(t))) : 0; } - static std::optional + static {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional toCpp(const FfiOpaqueHandle& handle) { return handle - ? *reinterpret_cast*>(handle) - : std::optional{}; + ? *reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional*>(handle) + : {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional{}; } }; @@ -153,27 +153,27 @@ struct Conversion< template struct Conversion< - std::optional>, - typename std::enable_if>>::value>::type + {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>, + typename std::enable_if>>::value>::type > { static FfiOpaqueHandle - toFfi(std::optional> t) { + toFfi({{#internalNamespace}}{{.}}::{{/internalNamespace}}optional> t) { return t ? reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional( Conversion>::toFfi(*t) ) ) : 0; } - static std::optional> + static {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional> toCpp(const FfiOpaqueHandle& handle) { return handle - ? std::optional>( + ? {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>( Conversion>::toCpp( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional*>(handle) ) - ) : std::optional>{}; + ) : {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>{}; } }; @@ -208,27 +208,27 @@ struct Conversion, typename std::enable_if struct Conversion< - std::optional>, - typename std::enable_if>>::value>::type + {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>, + typename std::enable_if>>::value>::type > { static FfiOpaqueHandle - toFfi(std::optional> t) { + toFfi({{#internalNamespace}}{{.}}::{{/internalNamespace}}optional> t) { return t ? reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional( Conversion>::toFfi(*t) ) ) : 0; } - static std::optional> + static {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional> toCpp(const FfiOpaqueHandle& handle) { return handle - ? std::optional>( + ? {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>( Conversion>::toCpp( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional*>(handle) ) - ) : std::optional>{}; + ) : {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional>{}; } }; diff --git a/gluecodium/src/main/resources/templates/ffi/FfiLocaleHandleImpl.mustache b/gluecodium/src/main/resources/templates/ffi/FfiLocaleHandleImpl.mustache index 3eeb46dd11..5ed0a4676b 100644 --- a/gluecodium/src/main/resources/templates/ffi/FfiLocaleHandleImpl.mustache +++ b/gluecodium/src/main/resources/templates/ffi/FfiLocaleHandleImpl.mustache @@ -23,8 +23,8 @@ #include "LocaleHandle.h" #include "{{>common/InternalInclude}}Locale.h" +#include "{{>common/InternalInclude}}Optional.h" #include -#include #include #ifdef __cplusplus @@ -37,17 +37,17 @@ FfiOpaqueHandle const char* script_code, const char* language_tag) { auto language_code_optional = language_code != nullptr - ? std::optional(std::string(language_code)) - : std::optional(); + ? {{>common/InternalNamespace}}optional(std::string(language_code)) + : {{>common/InternalNamespace}}optional(); auto country_code_optional = country_code != nullptr - ? std::optional(std::string(country_code)) - : std::optional(); + ? {{>common/InternalNamespace}}optional(std::string(country_code)) + : {{>common/InternalNamespace}}optional(); auto script_code_optional = script_code != nullptr - ? std::optional(std::string(script_code)) - : std::optional(); + ? {{>common/InternalNamespace}}optional(std::string(script_code)) + : {{>common/InternalNamespace}}optional(); auto language_tag_optional = language_tag != nullptr - ? std::optional(std::string(language_tag)) - : std::optional(); + ? {{>common/InternalNamespace}}optional(std::string(language_tag)) + : {{>common/InternalNamespace}}optional(); return reinterpret_cast( new (std::nothrow) {{>common/InternalNamespace}}Locale(language_code_optional, country_code_optional, diff --git a/gluecodium/src/main/resources/templates/ffi/FfiNullableHandlesImpl.mustache b/gluecodium/src/main/resources/templates/ffi/FfiNullableHandlesImpl.mustache index 99ca066c8d..560bf28eb1 100644 --- a/gluecodium/src/main/resources/templates/ffi/FfiNullableHandlesImpl.mustache +++ b/gluecodium/src/main/resources/templates/ffi/FfiNullableHandlesImpl.mustache @@ -24,10 +24,10 @@ #include "ConversionBase.h" #include "{{>common/InternalInclude}}Locale.h" +#include "{{>common/InternalInclude}}Optional.h" #include #include #include -#include #include #include @@ -40,7 +40,7 @@ FfiOpaqueHandle {{libraryName}}_{{resolveName toString ""}}_create_handle_nullable({{resolveName}} value) { return reinterpret_cast( - new (std::nothrow) std::optional<{{resolveName "C++"}}>( + new (std::nothrow) {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName "C++"}}>( {{#unless isNumericType}}{{#isNotEq toString "Boolean"}}{{!! }}{{>ffi/FfiInternal}}::Conversion<{{resolveName "C++"}}>::toCpp{{/isNotEq}}{{/unless}}(value) ) @@ -50,7 +50,7 @@ FfiOpaqueHandle void {{libraryName}}_{{resolveName toString ""}}_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName "C++"}}>*>(handle); } {{resolveName}} @@ -58,7 +58,7 @@ void { return {{#unless isNumericType}}{{#isNotEq toString "Boolean"}}{{!! }}{{>ffi/FfiInternal}}::Conversion<{{resolveName "C++"}}>::toFfi{{/isNotEq}}{{/unless}}( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName "C++"}}>*>(handle) ); } {{/builtInTypes}} diff --git a/gluecodium/src/main/resources/templates/ffi/FfiNullableImpl.mustache b/gluecodium/src/main/resources/templates/ffi/FfiNullableImpl.mustache index 0bdea7a2c9..ed5923b9b0 100644 --- a/gluecodium/src/main/resources/templates/ffi/FfiNullableImpl.mustache +++ b/gluecodium/src/main/resources/templates/ffi/FfiNullableImpl.mustache @@ -22,7 +22,7 @@ FfiOpaqueHandle {{libraryName}}_{{internalPrefix}}{{resolveName type}}_create_handle_nullable({{handleType}} value) { return reinterpret_cast( - new (std::nothrow) std::optional<{{resolveName type "C++"}}>( + new (std::nothrow) {{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName type "C++"}}>( {{#instanceOf type "LimeStruct"}}{{#if type.external.cpp}} *reinterpret_cast<{{resolveName type "C++"}}*>(value) {{/if}}{{#unless type.external.cpp}} @@ -37,7 +37,7 @@ FfiOpaqueHandle void {{libraryName}}_{{internalPrefix}}{{resolveName type}}_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName type "C++"}}>*>(handle); } {{handleType}} @@ -45,15 +45,15 @@ void { {{#instanceOf type "LimeStruct"}}{{#if type.external.cpp}} return reinterpret_cast(new (std::nothrow) {{resolveName type "C++"}}( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName type "C++"}}>*>(handle) )); {{/if}}{{#unless type.external.cpp}} return {{>ffi/FfiInternal}}::Conversion<{{resolveName type "C++"}}>::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName type "C++"}}>*>(handle) ); {{/unless}}{{/instanceOf}}{{#notInstanceOf type "LimeStruct"}} return {{>ffi/FfiInternal}}::Conversion<{{resolveName type "C++"}}>::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast<{{#internalNamespace}}{{.}}::{{/internalNamespace}}optional<{{resolveName type "C++"}}>*>(handle) ); {{/notInstanceOf}} } diff --git a/gluecodium/src/main/resources/templates/jni/EnumConversionHeader.mustache b/gluecodium/src/main/resources/templates/jni/EnumConversionHeader.mustache index f1523da4d2..a62d7a8a1f 100644 --- a/gluecodium/src/main/resources/templates/jni/EnumConversionHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/EnumConversionHeader.mustache @@ -26,7 +26,7 @@ {{>common/Include}} {{/includes}} #include "JniReference.h" -#include +#include "{{>common/InternalInclude}}Optional.h" {{#internalNamespace}} namespace {{.}} @@ -36,9 +36,9 @@ namespace jni { {{#enum}} JNIEXPORT {{resolveName "C++ FQN"}} convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, {{resolveName "C++ FQN"}}*); -JNIEXPORT std::optional<{{resolveName "C++ FQN"}}> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<{{resolveName "C++ FQN"}}>*); +JNIEXPORT {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const {{resolveName "C++ FQN"}} _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<{{resolveName "C++ FQN"}}> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> _ninput); {{/enum}} } {{#internalNamespace}} diff --git a/gluecodium/src/main/resources/templates/jni/EnumConversionImplementation.mustache b/gluecodium/src/main/resources/templates/jni/EnumConversionImplementation.mustache index 494d1b7b3e..3ac9864bf0 100644 --- a/gluecodium/src/main/resources/templates/jni/EnumConversionImplementation.mustache +++ b/gluecodium/src/main/resources/templates/jni/EnumConversionImplementation.mustache @@ -61,12 +61,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput{{#if extern {{/unlessPredicate}} } -std::optional<{{resolveName "C++ FQN"}}> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<{{resolveName "C++ FQN"}}>*) +{{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>*) { return _jinput - ? std::optional<{{resolveName "C++ FQN"}}>(convert_from_jni(_jenv, _jinput, ({{resolveName "C++ FQN"}}*)nullptr)) - : std::optional<{{resolveName "C++ FQN"}}>{}; + ? {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>(convert_from_jni(_jenv, _jinput, ({{resolveName "C++ FQN"}}*)nullptr)) + : {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>{}; } REGISTER_JNI_CLASS_CACHE("{{resolveName this "" "ref"}}", {{resolveName this "mangled" "ref"}}, {{resolveName "C++ FQN"}}) @@ -94,7 +94,7 @@ convert_to_jni(JNIEnv* _jenv, const {{resolveName "C++ FQN"}} _ninput) } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<{{resolveName "C++ FQN"}}> _ninput) +convert_to_jni(JNIEnv* _jenv, const {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/main/resources/templates/jni/InstanceConversionHeader.mustache b/gluecodium/src/main/resources/templates/jni/InstanceConversionHeader.mustache index 9b829b9745..823d370594 100644 --- a/gluecodium/src/main/resources/templates/jni/InstanceConversionHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/InstanceConversionHeader.mustache @@ -29,8 +29,8 @@ #include "JniCallJavaMethod.h" {{/ifPredicate}} #include "JniReference.h" +#include "{{>common/InternalInclude}}Optional.h" #include -#include {{#ifPredicate model "hasOverloadedLambda"}} #include #include diff --git a/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionHeader.mustache b/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionHeader.mustache index 3e012364cd..4ac36b6428 100644 --- a/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionHeader.mustache @@ -18,15 +18,15 @@ ! License-Filename: LICENSE ! !}} -JNIEXPORT std::optional<{{resolveName "C++ FQN"}}> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, std::optional<{{resolveName "C++ FQN"}}>*); -JNIEXPORT JniReference {{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::optional<{{resolveName "C++ FQN"}}>& _ninput); +JNIEXPORT optional<{{resolveName "C++ FQN"}}> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, optional<{{resolveName "C++ FQN"}}>*); +JNIEXPORT JniReference {{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const optional<{{resolveName "C++ FQN"}}>& _ninput); // Functions to create ArrayLists from C++ vectors and vice versa, for overloaded lambdas. JNIEXPORT JniReference {{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::vector<{{resolveName "C++ FQN"}}>& _ninput); -JNIEXPORT JniReference {{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput); +JNIEXPORT JniReference {{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const optional>& _ninput); JNIEXPORT std::vector<{{resolveName "C++ FQN"}}> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::vector<{{resolveName "C++ FQN"}}>*); -JNIEXPORT std::optional> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::optional>*); +JNIEXPORT optional> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, optional>*); // Templated functions to create HashMaps from C++ unordered_maps and vice versa, for overloaded lambdas as values. @@ -48,7 +48,7 @@ JniReference template JniReference -{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) { +{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? {{resolveName "mangled"}}_convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -94,13 +94,13 @@ std::unordered_map } template -std::optional> +optional> {{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _jMap, - std::optional>*) + optional>*) { return _jMap - ? std::optional>( + ? optional>( {{resolveName "mangled"}}_convert_from_jni(_env, _jMap, (std::unordered_map*)nullptr) - ) : std::optional>{}; + ) : optional>{}; } diff --git a/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionImpl.mustache b/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionImpl.mustache index 080ff4a6f7..775eb8d18f 100644 --- a/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionImpl.mustache +++ b/gluecodium/src/main/resources/templates/jni/LambdaOverloadedConversionImpl.mustache @@ -18,15 +18,15 @@ ! License-Filename: LICENSE ! !}} -std::optional<{{resolveName "C++ FQN"}}> -{{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, std::optional<{{resolveName "C++ FQN"}}>*) { +optional<{{resolveName "C++ FQN"}}> +{{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, optional<{{resolveName "C++ FQN"}}>*) { return _jobj - ? std::optional<{{resolveName "C++ FQN"}}>({{resolveName "mangled"}}_convert_from_jni(_env, _jobj, ({{resolveName "C++ FQN"}}*)nullptr)) - : std::optional<{{resolveName "C++ FQN"}}>{}; + ? optional<{{resolveName "C++ FQN"}}>({{resolveName "mangled"}}_convert_from_jni(_env, _jobj, ({{resolveName "C++ FQN"}}*)nullptr)) + : optional<{{resolveName "C++ FQN"}}>{}; } JniReference -{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::optional<{{resolveName "C++ FQN"}}>& _ninput) { +{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const optional<{{resolveName "C++ FQN"}}>& _ninput) { return _ninput ? {{resolveName "mangled"}}_convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -45,7 +45,7 @@ JniReference } JniReference -{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) { +{{resolveName "mangled"}}_convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? {{resolveName "mangled"}}_convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -70,9 +70,9 @@ std::vector<{{resolveName "C++ FQN"}}> return _nresult; } -std::optional> -{{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::optional>*) { +optional> +{{resolveName "mangled"}}_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, optional>*) { return _arrayList - ? std::optional>({{resolveName "mangled"}}_convert_from_jni(_env, _arrayList, (std::vector<{{resolveName "C++ FQN"}}>*)nullptr)) - : std::optional>{}; + ? optional>({{resolveName "mangled"}}_convert_from_jni(_env, _arrayList, (std::vector<{{resolveName "C++ FQN"}}>*)nullptr)) + : optional>{}; } diff --git a/gluecodium/src/main/resources/templates/jni/StructConversionHeader.mustache b/gluecodium/src/main/resources/templates/jni/StructConversionHeader.mustache index 63ca0fdc4d..16dbf2ed47 100644 --- a/gluecodium/src/main/resources/templates/jni/StructConversionHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/StructConversionHeader.mustache @@ -26,7 +26,7 @@ {{>common/Include}} {{/includes}} #include "JniReference.h" -#include +#include "{{>common/InternalInclude}}Optional.h" {{#internalNamespace}} namespace {{.}} @@ -36,13 +36,13 @@ namespace jni { {{#struct}} JNIEXPORT {{resolveName "C++ FQN"}} convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, {{resolveName "C++ FQN"}}*); -JNIEXPORT std::optional<{{resolveName "C++ FQN"}}> convert_from_jni({{!! -}}JNIEnv* _jenv, const JniReference& _jinput, std::optional<{{resolveName "C++ FQN"}}>*); +JNIEXPORT {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> convert_from_jni({{!! +}}JNIEnv* _jenv, const JniReference& _jinput, {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const {{resolveName "C++ FQN"}}& _ninput); {{#if external.java.converter constructors}} JNIEXPORT JniReference convert_to_jni_internal(JNIEnv* _jenv, const {{resolveName "C++ FQN"}}& _ninput); {{/if}} -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<{{resolveName "C++ FQN"}}> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> _ninput); {{/struct}} } {{#internalNamespace}} diff --git a/gluecodium/src/main/resources/templates/jni/StructConversionImplementation.mustache b/gluecodium/src/main/resources/templates/jni/StructConversionImplementation.mustache index b4f5dccb59..85ff014600 100644 --- a/gluecodium/src/main/resources/templates/jni/StructConversionImplementation.mustache +++ b/gluecodium/src/main/resources/templates/jni/StructConversionImplementation.mustache @@ -86,12 +86,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput{{!! }}{{#unlessPredicate struct "hasImmutableFields"}}return _nout;{{/unlessPredicate}} } -std::optional<{{resolveName "C++ FQN"}}> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<{{resolveName "C++ FQN"}}>*) +{{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>*) { return _jinput - ? std::optional<{{resolveName "C++ FQN"}}>(convert_from_jni(_jenv, _jinput, ({{resolveName "C++ FQN"}}*)nullptr)) - : std::optional<{{resolveName "C++ FQN"}}>{}; + ? {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>(convert_from_jni(_jenv, _jinput, ({{resolveName "C++ FQN"}}*)nullptr)) + : {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}>{}; } REGISTER_JNI_CLASS_CACHE("{{resolveName this "" "ref"}}", {{resolveName this "mangled" "ref"}}, {{resolveName "C++ FQN"}}) @@ -116,7 +116,7 @@ convert_to_jni_internal(JNIEnv* _jenv, const {{resolveName "C++ FQN"}}& _ninput) {{/if}} JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<{{resolveName "C++ FQN"}}> _ninput) +convert_to_jni(JNIEnv* _jenv, const {{>common/InternalNamespace}}optional<{{resolveName "C++ FQN"}}> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/main/resources/templates/jni/utils/ArrayConversionUtilsHeader.mustache b/gluecodium/src/main/resources/templates/jni/utils/ArrayConversionUtilsHeader.mustache index 7b641607b0..124e5c893c 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/ArrayConversionUtilsHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/ArrayConversionUtilsHeader.mustache @@ -29,8 +29,8 @@ #include "JniCppConversionUtils.h" #include "JniReference.h" +#include "{{>common/InternalInclude}}Optional.h" #include -#include #include #include #include @@ -49,10 +49,10 @@ std::unordered_map< K, V, Hash > convert_from_jni( JNIEnv* _env, const JniReference& _jMap, std::unordered_map< K, V, Hash >* ); template -std::optional> +optional> convert_from_jni(JNIEnv* _env, const JniReference& _jMap, - std::optional>*); + optional>*); template < typename K, typename V, typename Hash > JniReference @@ -60,7 +60,7 @@ convert_to_jni( JNIEnv* _env, const std::unordered_map< K, V, Hash >& _ninput ); template JniReference -convert_to_jni(JNIEnv* _env, const std::optional>& _ninput); +convert_to_jni(JNIEnv* _env, const optional>& _ninput); // Forward declare set conversion routines @@ -74,17 +74,17 @@ convert_to_jni(JNIEnv* _env, const std::unordered_set& _ninput); template JniReference -convert_to_jni(JNIEnv* _env, const std::optional>& _ninput); +convert_to_jni(JNIEnv* _env, const optional>& _ninput); template std::unordered_set convert_from_jni( JNIEnv* _env, const JniReference& jSet, std::unordered_set* ); template -std::optional> +optional> convert_from_jni(JNIEnv* _env, const JniReference& jSet, - std::optional>*); + optional>*); // Templated functions to create ArrayLists from C++ vectors and vice versa @@ -107,7 +107,7 @@ convert_to_jni( JNIEnv* _env, const std::vector< T >& _ninput ) template JniReference -convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) +convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -139,14 +139,14 @@ convert_from_jni( JNIEnv* _env, const JniReference& _arrayList, std::ve } template -std::optional> +optional> convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, - std::optional>*) + optional>*) { return _arrayList - ? std::optional>(convert_from_jni(_env, _arrayList, (std::vector*)nullptr)) - : std::optional>{}; + ? optional>(convert_from_jni(_env, _arrayList, (std::vector*)nullptr)) + : optional>{}; } template @@ -181,7 +181,7 @@ convert_to_jni( JNIEnv* _env, const std::unordered_map< K, V, Hash >& _ninput ) template JniReference -convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) +convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -230,14 +230,14 @@ convert_from_jni( JNIEnv* _env, const JniReference& _jMap, ::std::unord } template -std::optional> +optional> convert_from_jni(JNIEnv* _env, const JniReference& _jMap, - std::optional>*) + optional>*) { return _jMap - ? std::optional>(convert_from_jni(_env, _jMap, (std::unordered_map*)nullptr)) - : std::optional>{}; + ? optional>(convert_from_jni(_env, _jMap, (std::unordered_map*)nullptr)) + : optional>{}; } // Templated functions to create HashSet from C++ unordered_set and vice versa @@ -282,7 +282,7 @@ convert_to_jni(JNIEnv* _env, const std::unordered_set& _ninput) template JniReference -convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) +convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? convert_to_jni(_env, *_ninput) : JniReference{}; } @@ -317,14 +317,14 @@ convert_from_jni( JNIEnv* _env, const JniReference& jSet, std::unordere } template -std::optional> +optional> convert_from_jni(JNIEnv* _env, const JniReference& jSet, - std::optional>*) + optional>*) { return jSet - ? std::optional>(convert_from_jni(_env, jSet, (std::unordered_set*)nullptr)) - : std::optional>{}; + ? optional>(convert_from_jni(_env, jSet, (std::unordered_set*)nullptr)) + : optional>{}; } diff --git a/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsHeader.mustache b/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsHeader.mustache index 5dc06c4050..ddbc6f2b5e 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsHeader.mustache @@ -23,9 +23,9 @@ #pragma once #include "JniReference.h" +#include "{{>common/InternalInclude}}Optional.h" #include -#include {{#internalNamespace}} namespace {{.}} @@ -63,40 +63,40 @@ JNIEXPORT uint64_t convert_from_jni( JNIEnv* env, const JniReference& j // Boxing/unboxing conversion functions for nullable types -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); } {{#internalNamespace}} diff --git a/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsImplementation.mustache b/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsImplementation.mustache index a5d39d8582..3ce7270d8a 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsImplementation.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/BoxingConversionUtilsImplementation.mustache @@ -237,201 +237,201 @@ convert_from_jni( JNIEnv* env, const JniReference& jvalue, uint64_t* ) } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, {{>common/InternalNamespace}}optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "booleanValue", "()Z" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "floatValue", "()F" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "doubleValue", "()D" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "byteValue", "()B" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "shortValue", "()S" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "intValue", "()I" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( unboxedValue ); + return {{>common/InternalNamespace}}optional( unboxedValue ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "shortValue", "()S" ); - return std::optional( static_cast( unboxedValue ) ); + return {{>common/InternalNamespace}}optional( static_cast( unboxedValue ) ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "intValue", "()I" ); - return std::optional( static_cast( unboxedValue ) ); + return {{>common/InternalNamespace}}optional( static_cast( unboxedValue ) ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( static_cast( unboxedValue ) ); + return {{>common/InternalNamespace}}optional( static_cast( unboxedValue ) ); } -std::optional +{{>common/InternalNamespace}}optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( static_cast( unboxedValue ) ); + return {{>common/InternalNamespace}}optional( static_cast( unboxedValue ) ); } } diff --git a/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsHeader.mustache b/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsHeader.mustache index cf5dbffdae..6966e79d60 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsHeader.mustache @@ -27,11 +27,11 @@ #include "JniCppConversionUtils.h" #include "JniReference.h" #include "{{>common/InternalInclude}}Locale.h" +#include "{{>common/InternalInclude}}Optional.h" #include #include #include -#include #include {{#internalNamespace}} @@ -73,65 +73,65 @@ JNIEXPORT double get_field_value( JNIEXPORT ::std::string get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, ::std::string* ); -JNIEXPORT std::optional< bool > get_field_value( JNIEnv* env, +JNIEXPORT {{>common/InternalNamespace}}optional< bool > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< bool >* ); -JNIEXPORT std::optional< int8_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< bool >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< int8_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int8_t >* ); -JNIEXPORT std::optional< int16_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< int8_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< int16_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int16_t >* ); -JNIEXPORT std::optional< int32_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< int16_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< int32_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int32_t >* ); -JNIEXPORT std::optional< int64_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< int32_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< int64_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int64_t >* ); -JNIEXPORT std::optional< uint8_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< int64_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< uint8_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint8_t >* ); -JNIEXPORT std::optional< uint16_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< uint8_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< uint16_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint16_t >* ); -JNIEXPORT std::optional< uint32_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< uint16_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< uint32_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint32_t >* ); -JNIEXPORT std::optional< uint64_t > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< uint32_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< uint64_t > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint64_t >* ); -JNIEXPORT std::optional< float > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< uint64_t >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< float > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< float >* ); -JNIEXPORT std::optional< double > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< float >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< double > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< double >* ); -JNIEXPORT std::optional< ::std::string > get_field_value( JNIEnv* env, + {{>common/InternalNamespace}}optional< double >* ); +JNIEXPORT {{>common/InternalNamespace}}optional< ::std::string > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< ::std::string >* ); + {{>common/InternalNamespace}}optional< ::std::string >* ); JNIEXPORT ::std::shared_ptr< ::std::vector< uint8_t > > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, ::std::shared_ptr< ::std::vector< uint8_t > >* ); -JNIEXPORT std::optional< ::std::shared_ptr< ::std::vector< uint8_t > > > get_field_value( +JNIEXPORT {{>common/InternalNamespace}}optional< ::std::shared_ptr< ::std::vector< uint8_t > > > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< ::std::shared_ptr< ::std::vector< uint8_t > > >* ); + {{>common/InternalNamespace}}optional< ::std::shared_ptr< ::std::vector< uint8_t > > >* ); template std::chrono::time_point @@ -144,15 +144,15 @@ get_field_value( } template -std::optional> +{{>common/InternalNamespace}}optional> get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional>* + {{>common/InternalNamespace}}optional>* ) { auto fieldValue = get_object_field_value(env, object, fieldName, "Ljava/util/Date;"); return {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_from_jni( - env, fieldValue, (std::optional>*)nullptr + env, fieldValue, ({{>common/InternalNamespace}}optional>*)nullptr ); } @@ -161,11 +161,11 @@ JNIEXPORT {{>common/InternalNamespace}}Locale get_field_value( const JniReference< jobject >& object, const char* fieldName, {{>common/InternalNamespace}}Locale* ); -JNIEXPORT std::optional< {{>common/InternalNamespace}}Locale > get_field_value( +JNIEXPORT {{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale > get_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< {{>common/InternalNamespace}}Locale >* ); + {{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale >* ); // -------------------- JNI object field setters -------------------------------------------------- @@ -205,51 +205,51 @@ JNIEXPORT void set_field_value( JNIEnv* env, JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< bool > value ); + {{>common/InternalNamespace}}optional< bool > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int8_t > value ); + {{>common/InternalNamespace}}optional< int8_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int16_t > value ); + {{>common/InternalNamespace}}optional< int16_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int32_t > value ); + {{>common/InternalNamespace}}optional< int32_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< int64_t > value ); + {{>common/InternalNamespace}}optional< int64_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint8_t > value ); + {{>common/InternalNamespace}}optional< uint8_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint16_t > value ); + {{>common/InternalNamespace}}optional< uint16_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint32_t > value ); + {{>common/InternalNamespace}}optional< uint32_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< uint64_t > value ); + {{>common/InternalNamespace}}optional< uint64_t > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< float > value ); + {{>common/InternalNamespace}}optional< float > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< double > value ); + {{>common/InternalNamespace}}optional< double > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference< jobject >& object, const char* fieldName, - std::optional< ::std::string > value ); + {{>common/InternalNamespace}}optional< ::std::string > value ); JNIEXPORT void set_field_value( JNIEnv* env, const JniReference& object, @@ -258,7 +258,7 @@ JNIEXPORT void set_field_value( JNIEnv* env, JNIEXPORT void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional< std::shared_ptr< ::std::vector< uint8_t > > > fieldValue ); + {{>common/InternalNamespace}}optional< std::shared_ptr< ::std::vector< uint8_t > > > fieldValue ); template void @@ -274,7 +274,7 @@ template void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - const std::optional>& fieldValue + const {{>common/InternalNamespace}}optional>& fieldValue ) { auto fieldId = env->GetFieldID(get_object_class(env, object).get(), fieldName, "Ljava/util/Date;"); auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni(env, fieldValue); @@ -288,7 +288,7 @@ JNIEXPORT void set_field_value( JNIEnv* env, JNIEXPORT void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional< {{>common/InternalNamespace}}Locale > fieldValue ); + {{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale > fieldValue ); JNIEXPORT void set_object_field_value( JNIEnv* env, const JniReference& object, @@ -311,16 +311,16 @@ JNIEXPORT ::std::chrono::duration get_field_value( } template -JNIEXPORT std::optional<::std::chrono::duration> get_field_value( +JNIEXPORT {{>common/InternalNamespace}}optional<::std::chrono::duration> get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional<::std::chrono::duration>* ) { + {{>common/InternalNamespace}}optional<::std::chrono::duration>* ) { auto fieldValue = get_object_field_value(env, object, fieldName, "L{{durationPackage}}/Duration;"); return {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_from_jni( - env, fieldValue, (std::optional<::std::chrono::duration>*)nullptr); + env, fieldValue, ({{>common/InternalNamespace}}optional<::std::chrono::duration>*)nullptr); } template @@ -340,7 +340,7 @@ JNIEXPORT void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional<::std::chrono::duration> fieldValue ) { + {{>common/InternalNamespace}}optional<::std::chrono::duration> fieldValue ) { auto fieldId = env->GetFieldID(get_object_class(env, object).get(), fieldName, "L{{durationPackage}}/Duration;"); auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni(env, fieldValue); diff --git a/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsImplementation.mustache b/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsImplementation.mustache index d559cacf62..40ce29a2f6 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsImplementation.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/FieldAccessMethodsImplementation.mustache @@ -165,136 +165,136 @@ get_field_value( JNIEnv* env, return {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_from_jni( env, fieldValue, (std::string*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Boolean;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Byte;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Short;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Integer;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Long;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Short;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Integer;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Long;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Long;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Float;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/Double;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } -std::optional +{{>common/InternalNamespace}}optional get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional* ) + {{>common/InternalNamespace}}optional* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/lang/String;" ); - return convert_from_jni( env, fieldValue, (std::optional*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional*)nullptr ); } std::shared_ptr> @@ -309,16 +309,16 @@ get_field_value( JNIEnv* env, return convert_from_jni( env, fieldValue, (std::shared_ptr>*)nullptr ); } -std::optional>> +{{>common/InternalNamespace}}optional>> get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional>>* ) + {{>common/InternalNamespace}}optional>>* ) { auto fieldId = env->GetFieldID( get_object_class(env, object).get(), fieldName, "[B" ); auto fieldValue = make_local_ref( env, static_cast( env->GetObjectField( object.get(), fieldId ) ) ); - return convert_from_jni( env, fieldValue, (std::optional>>*)nullptr ); + return convert_from_jni( env, fieldValue, ({{>common/InternalNamespace}}optional>>*)nullptr ); } {{>common/InternalNamespace}}Locale @@ -333,16 +333,16 @@ get_field_value( JNIEnv* env, env, fieldValue, ({{>common/InternalNamespace}}Locale*)nullptr ); } -std::optional< {{>common/InternalNamespace}}Locale > +{{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale > get_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional< {{>common/InternalNamespace}}Locale >* ) + {{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale >* ) { auto fieldValue = get_object_field_value( env, object, fieldName, "Ljava/util/Locale;" ); return {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_from_jni( - env, fieldValue, (std::optional< {{>common/InternalNamespace}}Locale >*)nullptr ); + env, fieldValue, ({{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale >*)nullptr ); } JniReference @@ -483,7 +483,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Boolean;", jValue ); @@ -493,7 +493,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Float;", jValue ); @@ -503,7 +503,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Double;", jValue ); @@ -513,7 +513,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Byte;", jValue ); @@ -523,7 +523,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Short;", jValue ); @@ -533,7 +533,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Integer;", jValue ); @@ -543,7 +543,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Long;", jValue ); @@ -553,11 +553,11 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto nValue = fieldValue - ? std::optional( static_cast( *fieldValue ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( static_cast( *fieldValue ) ) + : {{>common/InternalNamespace}}optional{}; auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, nValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Short;", jValue ); } @@ -566,11 +566,11 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto nValue = fieldValue - ? std::optional( static_cast( *fieldValue ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( static_cast( *fieldValue ) ) + : {{>common/InternalNamespace}}optional{}; auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, nValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Integer;", jValue ); } @@ -579,11 +579,11 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto nValue = fieldValue - ? std::optional( static_cast( *fieldValue ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( static_cast( *fieldValue ) ) + : {{>common/InternalNamespace}}optional{}; auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, nValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Long;", jValue ); } @@ -592,11 +592,11 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto nValue = fieldValue - ? std::optional( static_cast( *fieldValue ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( static_cast( *fieldValue ) ) + : {{>common/InternalNamespace}}optional{}; auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, nValue ); set_object_field_value( env, object, fieldName, "Ljava/lang/Long;", jValue ); } @@ -605,7 +605,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional fieldValue ) + {{>common/InternalNamespace}}optional fieldValue ) { auto fieldId = env->GetFieldID( get_object_class(env, object).get(), fieldName, "Ljava/lang/String;" ); auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); @@ -627,7 +627,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional>> fieldValue ) + {{>common/InternalNamespace}}optional>> fieldValue ) { auto fieldId = env->GetFieldID( get_object_class(env, object).get(), fieldName, "[B" ); auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); @@ -649,7 +649,7 @@ void set_field_value( JNIEnv* env, const JniReference& object, const char* fieldName, - std::optional< {{>common/InternalNamespace}}Locale > fieldValue ) + {{>common/InternalNamespace}}optional< {{>common/InternalNamespace}}Locale > fieldValue ) { auto fieldId = env->GetFieldID( get_object_class(env, object).get(), fieldName, "Ljava/util/Locale;" ); auto jValue = {{>common/InternalNamespace}}jni::{{>jni/JniConversionPrefix}}convert_to_jni( env, fieldValue ); diff --git a/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsHeader.mustache b/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsHeader.mustache index c9c559c420..36a374b92b 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsHeader.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsHeader.mustache @@ -28,13 +28,13 @@ #include "JniClassCache.h" #include "JniReference.h" #include "{{>common/InternalInclude}}Locale.h" +#include "{{>common/InternalInclude}}Optional.h" #include #include #include #include #include -#include #include #include @@ -52,19 +52,19 @@ namespace jni */ JNIEXPORT std::string convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::string* ); JNIEXPORT std::string convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::string* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); +JNIEXPORT {{>common/InternalNamespace}}optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ); /** * Converts a jbyteArray to a byte buffer */ JNIEXPORT std::shared_ptr< ::std::vector< uint8_t > > convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::shared_ptr< ::std::vector< uint8_t > >* ); -JNIEXPORT std::optional > > convert_from_jni( +JNIEXPORT {{>common/InternalNamespace}}optional > > convert_from_jni( JNIEnv* env, const JniReference& jvalue, - std::optional< std::shared_ptr< ::std::vector< uint8_t > > >* ); + {{>common/InternalNamespace}}optional< std::shared_ptr< ::std::vector< uint8_t > > >* ); /** * Converts a Java Date object to an std::chrono::time_point. @@ -88,17 +88,17 @@ convert_from_jni(JNIEnv* env, const JniReference& jvalue, std::chrono:: } template -std::optional> +{{>common/InternalNamespace}}optional> convert_from_jni( JNIEnv* env, const JniReference& jvalue, - std::optional>* + {{>common/InternalNamespace}}optional>* ) { return jvalue - ? std::optional>( + ? {{>common/InternalNamespace}}optional>( convert_from_jni(env, jvalue, (std::chrono::time_point*)nullptr) ) - : std::optional>{}; + : {{>common/InternalNamespace}}optional>{}; } /** @@ -138,16 +138,16 @@ convert_from_jni(JNIEnv* env, const JniReference& jvalue, std::chrono:: } template -std::optional> +{{>common/InternalNamespace}}optional> convert_from_jni( JNIEnv* env, const JniReference& jvalue, - std::optional>* + {{>common/InternalNamespace}}optional>* ) { return jvalue - ? std::optional>( + ? {{>common/InternalNamespace}}optional>( convert_from_jni( env, jvalue, (std::chrono::duration*)nullptr)) - : std::optional>{}; + : {{>common/InternalNamespace}}optional>{}; } /** @@ -155,9 +155,9 @@ convert_from_jni( */ JNIEXPORT {{>common/InternalNamespace}}Locale convert_from_jni( JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}Locale*); -JNIEXPORT std::optional<{{>common/InternalNamespace}}Locale> convert_from_jni( +JNIEXPORT {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale> convert_from_jni( JNIEnv* env, const JniReference& jvalue, - std::optional<{{>common/InternalNamespace}}Locale>*); + {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>*); // -------------------- C++ to JNI conversion functions -------------------------------------------- @@ -165,14 +165,14 @@ JNIEXPORT std::optional<{{>common/InternalNamespace}}Locale> convert_from_jni( * Converts an std::string to a JNI jstring */ JNIEXPORT JniReference convert_to_jni( JNIEnv* env, const std::string& nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, const std::optional& nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, const {{>common/InternalNamespace}}optional& nvalue ); /** * Converts a byte buffer to a jbyteArray */ JNIEXPORT JniReference convert_to_jni( JNIEnv* env, const std::shared_ptr< ::std::vector< uint8_t > >& nvalue ); JNIEXPORT JniReference convert_to_jni( - JNIEnv* env, const std::optional< std::shared_ptr< ::std::vector< uint8_t > > >& nvalue ); + JNIEnv* env, const {{>common/InternalNamespace}}optional< std::shared_ptr< ::std::vector< uint8_t > > >& nvalue ); /** * Converts an std::chrono::time_point to a Java Date object. @@ -189,7 +189,7 @@ convert_to_jni(JNIEnv* env, const std::chrono::time_point& nval template JniReference -convert_to_jni(JNIEnv* env, const std::optional>& nvalue) { +convert_to_jni(JNIEnv* env, const {{>common/InternalNamespace}}optional>& nvalue) { return nvalue ? convert_to_jni(env, *nvalue) : JniReference{}; } @@ -214,30 +214,30 @@ convert_to_jni(JNIEnv* env, const std::chrono::duration& nvalue) { */ JNIEXPORT JniReference convert_to_jni(JNIEnv* env, const {{>common/InternalNamespace}}Locale& nvalue); JNIEXPORT JniReference convert_to_jni( - JNIEnv* env, const std::optional<{{>common/InternalNamespace}}Locale>& nvalue); + JNIEnv* env, const {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>& nvalue); template JNIEXPORT JniReference convert_to_jni( - JNIEnv* env, const std::optional>& nvalue ) { + JNIEnv* env, const {{>common/InternalNamespace}}optional>& nvalue ) { return nvalue ? convert_to_jni(env, *nvalue) : JniReference{}; } -// -------------------- std::optional> conversion functions ----------------------------- +// -------------------- optional> conversion functions ----------------------------- template -std::optional> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional>*) +optional> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, optional>*) { return _jinput ? convert_from_jni(_jenv, _jinput, (std::function*)nullptr) - : std::optional>{}; + : optional>{}; } template JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional> _ninput) +convert_to_jni(JNIEnv* _jenv, const optional> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsImplementation.mustache b/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsImplementation.mustache index b053be896c..c276abe435 100644 --- a/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsImplementation.mustache +++ b/gluecodium/src/main/resources/templates/jni/utils/JniCppConversionUtilsImplementation.mustache @@ -21,7 +21,7 @@ {{>java/CopyrightHeader}} #include "JniCppConversionUtils.h" -#include +#include "{{>common/InternalInclude}}Optional.h" {{#internalNamespace}} namespace {{.}} @@ -67,20 +67,20 @@ convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::string* return convert_string_from_jni( env, jvalue.get( ) ); } -std::optional -convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::optional* ) +{{>common/InternalNamespace}}optional +convert_from_jni( JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { return jvalue - ? std::optional( convert_string_from_jni( env, static_cast( jvalue.get( ) ) ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( convert_string_from_jni( env, static_cast( jvalue.get( ) ) ) ) + : {{>common/InternalNamespace}}optional{}; } -std::optional -convert_from_jni( JNIEnv* env, const JniReference& jvalue, std::optional* ) +{{>common/InternalNamespace}}optional +convert_from_jni( JNIEnv* env, const JniReference& jvalue, {{>common/InternalNamespace}}optional* ) { return jvalue - ? std::optional( convert_string_from_jni( env, jvalue.get( ) ) ) - : std::optional{}; + ? {{>common/InternalNamespace}}optional( convert_string_from_jni( env, jvalue.get( ) ) ) + : {{>common/InternalNamespace}}optional{}; } std::shared_ptr< std::vector< uint8_t > > @@ -101,15 +101,15 @@ convert_from_jni( JNIEnv* env, const JniReference& jvalue, return nresult; } -std::optional< std::shared_ptr< std::vector< uint8_t > > > +{{>common/InternalNamespace}}optional< std::shared_ptr< std::vector< uint8_t > > > convert_from_jni( JNIEnv* env, const JniReference& jvalue, - std::optional< std::shared_ptr< std::vector< uint8_t > > >* ) + {{>common/InternalNamespace}}optional< std::shared_ptr< std::vector< uint8_t > > >* ) { return jvalue - ? std::optional< std::shared_ptr< std::vector< uint8_t > > >( + ? {{>common/InternalNamespace}}optional< std::shared_ptr< std::vector< uint8_t > > >( convert_from_jni( env, jvalue, (std::shared_ptr< std::vector< uint8_t > >*)nullptr ) ) - : std::optional< std::shared_ptr< std::vector< uint8_t > > >{}; + : {{>common/InternalNamespace}}optional< std::shared_ptr< std::vector< uint8_t > > >{}; } {{>common/InternalNamespace}}Locale @@ -133,14 +133,14 @@ convert_from_jni(JNIEnv* env, const JniReference& jvalue, {{>common/Int ); } -std::optional<{{>common/InternalNamespace}}Locale> +{{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale> convert_from_jni(JNIEnv* env, const JniReference& jvalue, - std::optional<{{>common/InternalNamespace}}Locale>*) + {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>*) { return jvalue - ? std::optional<{{>common/InternalNamespace}}Locale>( + ? {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>( convert_from_jni(env, jvalue, ({{>common/InternalNamespace}}Locale*)nullptr)) - : std::optional<{{>common/InternalNamespace}}Locale>{}; + : {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>{}; } // -------------------- C++ to JNI conversion functions -------------------------------------------- @@ -152,7 +152,7 @@ convert_to_jni( JNIEnv* env, const std::string& nvalue ) } JniReference -convert_to_jni( JNIEnv* env, const std::optional& nvalue ) +convert_to_jni( JNIEnv* env, const {{>common/InternalNamespace}}optional& nvalue ) { return nvalue ? make_local_ref(env, env->NewStringUTF( nvalue->c_str( ) )) @@ -176,7 +176,7 @@ convert_to_jni( JNIEnv* env, const std::shared_ptr< std::vector< uint8_t > >& nv } JniReference< jbyteArray > -convert_to_jni( JNIEnv* env, const std::optional< std::shared_ptr< std::vector< uint8_t > > >& nvalue ) +convert_to_jni( JNIEnv* env, const {{>common/InternalNamespace}}optional< std::shared_ptr< std::vector< uint8_t > > >& nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference< jbyteArray >{}; } @@ -217,7 +217,7 @@ convert_to_jni(JNIEnv* env, const {{>common/InternalNamespace}}Locale& nvalue) { } JniReference -convert_to_jni(JNIEnv* env, const std::optional<{{>common/InternalNamespace}}Locale>& nvalue) { +convert_to_jni(JNIEnv* env, const {{>common/InternalNamespace}}optional<{{>common/InternalNamespace}}Locale>& nvalue) { return nvalue ? convert_to_jni(env, *nvalue) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.cpp b/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.cpp index d3cfcca132..88c36ed639 100644 --- a/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.cpp +++ b/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.cpp @@ -185,180 +185,180 @@ convert_from_jni( JNIEnv* env, const JniReference& jvalue, uint64_t* ) return unbox_long_value( env, jvalue ); } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } JniReference -convert_to_jni( JNIEnv* env, std::optional nvalue ) +convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ) { return nvalue ? convert_to_jni( env, *nvalue ) : JniReference{}; } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "booleanValue", "()Z" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "floatValue", "()F" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "doubleValue", "()D" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "byteValue", "()B" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "shortValue", "()S" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "intValue", "()I" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( unboxedValue ); + return ::gluecodium::optional( unboxedValue ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "shortValue", "()S" ); - return std::optional( static_cast( unboxedValue ) ); + return ::gluecodium::optional( static_cast( unboxedValue ) ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "intValue", "()I" ); - return std::optional( static_cast( unboxedValue ) ); + return ::gluecodium::optional( static_cast( unboxedValue ) ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( static_cast( unboxedValue ) ); + return ::gluecodium::optional( static_cast( unboxedValue ) ); } -std::optional +::gluecodium::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ) + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ) { if ( !jvalue ) { return {}; } auto unboxedValue = call_java_method( env, jvalue, "longValue", "()J" ); - return std::optional( static_cast( unboxedValue ) ); + return ::gluecodium::optional( static_cast( unboxedValue ) ); } } } diff --git a/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.h b/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.h index de8a46c457..cd1a564bbb 100644 --- a/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.h +++ b/gluecodium/src/test/resources/smoke/basic_types/output/android/jni/BoxingConversionUtils.h @@ -3,8 +3,8 @@ */ #pragma once #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni @@ -34,38 +34,38 @@ JNIEXPORT uint16_t convert_from_jni( JNIEnv* env, const JniReference& j JNIEXPORT uint32_t convert_from_jni( JNIEnv* env, const JniReference& jvalue, uint32_t* ); JNIEXPORT uint64_t convert_from_jni( JNIEnv* env, const JniReference& jvalue, uint64_t* ); // Boxing/unboxing conversion functions for nullable types -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT JniReference convert_to_jni( JNIEnv* env, std::optional nvalue ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); -JNIEXPORT std::optional convert_from_jni( - JNIEnv* env, const JniReference& jvalue, std::optional* ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT JniReference convert_to_jni( JNIEnv* env, ::gluecodium::optional nvalue ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); +JNIEXPORT ::gluecodium::optional convert_from_jni( + JNIEnv* env, const JniReference& jvalue, ::gluecodium::optional* ); } } diff --git a/gluecodium/src/test/resources/smoke/basic_types/output/cpp/include/smoke/CppRefReturnType.h b/gluecodium/src/test/resources/smoke/basic_types/output/cpp/include/smoke/CppRefReturnType.h index 345be7ba48..40c1641b9e 100644 --- a/gluecodium/src/test/resources/smoke/basic_types/output/cpp/include/smoke/CppRefReturnType.h +++ b/gluecodium/src/test/resources/smoke/basic_types/output/cpp/include/smoke/CppRefReturnType.h @@ -4,10 +4,10 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/Return.h" #include #include -#include #include #include namespace smoke { @@ -35,7 +35,7 @@ class _GLUECODIUM_CPP_EXPORT CppRefReturnType { * \return @NotNull */ static const ::std::shared_ptr< ::smoke::CppRefReturnType >& class_ref( ); - static const std::optional< ::std::string >& nullable_ref( ); + static const ::gluecodium::optional< ::std::string >& nullable_ref( ); static ::std::error_code throwing_enum_with_void( ); static ::gluecodium::Return< const ::std::string&, ::std::error_code > throwing_enum_with_string( ); static ::gluecodium::Return< void, ::smoke::CppRefReturnType::SomeStruct > throwing_struct_with_void( ); diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/Comments.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/Comments.h index aeb401b2d1..46769af61c 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/Comments.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/Comments.h @@ -4,10 +4,10 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/Return.h" #include #include -#include #include #include namespace smoke { @@ -52,7 +52,7 @@ class _GLUECODIUM_CPP_EXPORT Comments { /** * Can be `null` */ - std::optional< ::std::string > nullable_field = std::optional< ::std::string >(); + ::gluecodium::optional< ::std::string > nullable_field = ::gluecodium::optional< ::std::string >(); /** * This is how easy it is to construct. */ @@ -69,7 +69,7 @@ class _GLUECODIUM_CPP_EXPORT Comments { * remains to be seen * \param nullable_field Can be `null` */ - SomeStruct( ::smoke::Comments::Usefulness some_field, std::optional< ::std::string > nullable_field ); + SomeStruct( ::smoke::Comments::Usefulness some_field, ::gluecodium::optional< ::std::string > nullable_field ); /** * This is some struct method that does nothing. */ diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/MapScene.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/MapScene.h index 1193c7ce2c..13d364a5dc 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/MapScene.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/MapScene.h @@ -4,23 +4,22 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" - +#include "gluecodium/Optional.h" #include #include -#include #include namespace smoke { /** - * Referencing some type ::smoke::MapScene::load_scene(const int32_t, const std::optional< ::smoke::MapScene::LoadSceneCallback >&). + * Referencing some type ::smoke::MapScene::load_scene(const int32_t, const ::gluecodium::optional< ::smoke::MapScene::LoadSceneCallback >&). */ class _GLUECODIUM_CPP_EXPORT MapScene { public: MapScene(); virtual ~MapScene() = 0; public: - using LoadSceneCallback = ::std::function&)>; + using LoadSceneCallback = ::std::function&)>; public: - virtual void load_scene( const int32_t map_scheme, const std::optional< ::smoke::MapScene::LoadSceneCallback >& callback ) = 0; - virtual void load_scene( const ::std::string& configuration_file, const std::optional< ::smoke::MapScene::LoadSceneCallback >& callback ) = 0; + virtual void load_scene( const int32_t map_scheme, const ::gluecodium::optional< ::smoke::MapScene::LoadSceneCallback >& callback ) = 0; + virtual void load_scene( const ::std::string& configuration_file, const ::gluecodium::optional< ::smoke::MapScene::LoadSceneCallback >& callback ) = 0; }; } diff --git a/gluecodium/src/test/resources/smoke/constants/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/constants/output/cbridge/src/GenericCollections.cpp index 20fef39b06..ad45adbf16 100644 --- a/gluecodium/src/test/resources/smoke/constants/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/constants/output/cbridge/src/GenericCollections.cpp @@ -3,10 +3,10 @@ #include "cbridge/include/GenericCollections.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" -#include #include #include #include @@ -32,13 +32,13 @@ void foobar_ArrayOf__String_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::string >>::toCpp(handle).push_back(Conversion<::std::string>::toCpp(item)); } _baseRef foobar_ArrayOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); } void foobar_ArrayOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ); } _baseRef foobar_ArrayOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::std::string >() ); @@ -70,13 +70,13 @@ _baseRef foobar_MapOf__String_To__String_iterator_value(_baseRef iterator_handle return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__String_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::std::string >>( ::std::unordered_map< ::std::string, ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>( ::std::unordered_map< ::std::string, ::std::string >( ) ) ); } void foobar_MapOf__String_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>*>( handle ); } _baseRef foobar_MapOf__String_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>*>( handle ) ); } _baseRef foobar_MapOf_foobar_ArrayOf__String_To_foobar_SetOf__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >() ); @@ -108,13 +108,13 @@ _baseRef foobar_MapOf_foobar_ArrayOf__String_To_foobar_SetOf__String_iterator_va return Conversion<::std::unordered_set< ::std::string >>::toBaseRef(value); } _baseRef foobar_MapOf_foobar_ArrayOf__String_To_foobar_SetOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>( ::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>( ::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >( ) ) ); } void foobar_MapOf_foobar_ArrayOf__String_To_foobar_SetOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>*>( handle ); } _baseRef foobar_MapOf_foobar_ArrayOf__String_To_foobar_SetOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::vector< ::std::string >, ::std::unordered_set< ::std::string >, ::gluecodium::hash< ::std::vector< ::std::string > > >>*>( handle ) ); } _baseRef foobar_SetOf__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::string >() ); @@ -142,11 +142,11 @@ _baseRef foobar_SetOf__String_iterator_get(_baseRef iterator_handle) { return Conversion<::std::string>::referenceBaseRef(value); } _baseRef foobar_SetOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::string >>( ::std::unordered_set< ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::string >>( ::std::unordered_set< ::std::string >( ) ) ); } void foobar_SetOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::string >>*>( handle ); } _baseRef foobar_SetOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::string >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/constructors/output/dart/ffi/ffi_smoke_Constructors.cpp b/gluecodium/src/test/resources/smoke/constructors/output/dart/ffi/ffi_smoke_Constructors.cpp index 94a2485420..9eccb73aac 100644 --- a/gluecodium/src/test/resources/smoke/constructors/output/dart/ffi/ffi_smoke_Constructors.cpp +++ b/gluecodium/src/test/resources/smoke/constructors/output/dart/ffi/ffi_smoke_Constructors.cpp @@ -123,7 +123,7 @@ FfiOpaqueHandle library_smoke_Constructors_ErrorEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -131,13 +131,13 @@ library_smoke_Constructors_ErrorEnum_create_handle_nullable(uint32_t value) void library_smoke_Constructors_ErrorEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Constructors_ErrorEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_Dates.cpp b/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_Dates.cpp index 7ed04aed10..268bf0a015 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_Dates.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_Dates.cpp @@ -26,9 +26,9 @@ Java_com_example_smoke_Dates_dateMethod(JNIEnv* _jenv, jobject _jinstance, jobje jobject Java_com_example_smoke_Dates_nullableDateMethod(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::std::chrono::system_clock::time_point > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::chrono::system_clock::time_point > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::std::chrono::system_clock::time_point >*)nullptr); + (::gluecodium::optional< ::std::chrono::system_clock::time_point >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, diff --git a/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_DatesSteady.cpp b/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_DatesSteady.cpp index 4c63bdd5df..54bc99936b 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_DatesSteady.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/android/jni/com_example_smoke_DatesSteady.cpp @@ -26,9 +26,9 @@ Java_com_example_smoke_DatesSteady_dateMethod(JNIEnv* _jenv, jobject _jinstance, jobject Java_com_example_smoke_DatesSteady_nullableDateMethod(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::smoke::DatesSteady::MonotonicDate > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::smoke::DatesSteady::MonotonicDate >*)nullptr); + (::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, diff --git a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/GenericCollections.cpp index fcd435ca04..18d32c13dc 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/GenericCollections.cpp @@ -3,14 +3,13 @@ #include "cbridge/include/GenericCollections.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" - +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include "smoke/DatesSteady.h" #include -#include #include #include #include @@ -36,13 +35,13 @@ void foobar_ArrayOf__Date_append( _baseRef handle, double item ) Conversion<::std::vector< ::std::chrono::system_clock::time_point >>::toCpp(handle).push_back(Conversion<::std::chrono::system_clock::time_point>::toCpp(item)); } _baseRef foobar_ArrayOf__Date_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::chrono::system_clock::time_point >>( ::std::vector< ::std::chrono::system_clock::time_point >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>( ::std::vector< ::std::chrono::system_clock::time_point >( ) ) ); } void foobar_ArrayOf__Date_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>*>( handle ); } _baseRef foobar_ArrayOf__Date_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>*>( handle ) ); } _baseRef foobar_ArrayOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< std::chrono::steady_clock::time_point >( ) ); @@ -64,13 +63,13 @@ void foobar_ArrayOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_append( Conversion<::std::vector< std::chrono::steady_clock::time_point >>::toCpp(handle).push_back(Conversion::toCpp(item)); } _baseRef foobar_ArrayOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< std::chrono::steady_clock::time_point >>( ::std::vector< std::chrono::steady_clock::time_point >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< std::chrono::steady_clock::time_point >>( ::std::vector< std::chrono::steady_clock::time_point >( ) ) ); } void foobar_ArrayOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< std::chrono::steady_clock::time_point >>*>( handle ); } _baseRef foobar_ArrayOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< std::chrono::steady_clock::time_point >>*>( handle ) ); } _baseRef foobar_MapOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >() ); @@ -102,13 +101,13 @@ _baseRef foobar_MapOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_To__St return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >>( ::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >>( ::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >( ) ) ); } void foobar_MapOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >>*>( handle ); } _baseRef foobar_MapOf__Date_std_2_2chrono_2_2steady_1clock_2_2time_1point_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< std::chrono::steady_clock::time_point, ::std::string, ::gluecodium::hash< std::chrono::steady_clock::time_point > >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__Date_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >() ); @@ -140,13 +139,13 @@ double foobar_MapOf__String_To__Date_iterator_value(_baseRef iterator_handle) { return Conversion<::std::chrono::system_clock::time_point>::toBaseRef(value); } _baseRef foobar_MapOf__String_To__Date_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >>( ::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >>( ::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >( ) ) ); } void foobar_MapOf__String_To__Date_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >>*>( handle ); } _baseRef foobar_MapOf__String_To__Date_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >>*>( handle ) ); } _baseRef foobar_SetOf__Date_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >() ); @@ -174,11 +173,11 @@ double foobar_SetOf__Date_iterator_get(_baseRef iterator_handle) { return Conversion<::std::chrono::system_clock::time_point>::referenceBaseRef(value); } _baseRef foobar_SetOf__Date_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >>( ::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >>( ::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >( ) ) ); } void foobar_SetOf__Date_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >>*>( handle ); } _baseRef foobar_SetOf__Date_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_Dates.cpp b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_Dates.cpp index b269a394d6..46c15403fd 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_Dates.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_Dates.cpp @@ -4,13 +4,13 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedSetHash.h" #include "smoke/Dates.h" #include #include #include -#include #include void smoke_Dates_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::Dates >>(handle); @@ -37,7 +37,7 @@ double smoke_Dates_dateMethod(_baseRef _instance, double input) { return Conversion<::std::chrono::system_clock::time_point>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Dates >>(_instance)->get()->date_method(Conversion<::std::chrono::system_clock::time_point>::toCpp(input))); } _baseRef smoke_Dates_nullableDateMethod(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Dates >>(_instance)->get()->nullable_date_method(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Dates >>(_instance)->get()->nullable_date_method(Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toCpp(input))); } double smoke_Dates_dateProperty_get(_baseRef _instance) { return Conversion<::std::chrono::system_clock::time_point>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Dates >>(_instance)->get()->get_date_property()); @@ -56,7 +56,7 @@ smoke_Dates_DateStruct_create_handle( double dateField, _baseRef nullableDateFie { ::smoke::Dates::DateStruct* _struct = new ( ::std::nothrow ) ::smoke::Dates::DateStruct(); _struct->date_field = Conversion<::std::chrono::system_clock::time_point>::toCpp( dateField ); - _struct->nullable_date_field = Conversion>::toCpp( nullableDateField ); + _struct->nullable_date_field = Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toCpp( nullableDateField ); return reinterpret_cast<_baseRef>( _struct ); } void @@ -67,18 +67,18 @@ smoke_Dates_DateStruct_release_handle( _baseRef handle ) _baseRef smoke_Dates_DateStruct_create_optional_handle(double dateField, _baseRef nullableDateField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Dates::DateStruct>( ::smoke::Dates::DateStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Dates::DateStruct>( ::smoke::Dates::DateStruct( ) ); (*_struct)->date_field = Conversion<::std::chrono::system_clock::time_point>::toCpp( dateField ); - (*_struct)->nullable_date_field = Conversion>::toCpp( nullableDateField ); + (*_struct)->nullable_date_field = Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toCpp( nullableDateField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Dates_DateStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Dates::DateStruct>*>( handle ) ); } void smoke_Dates_DateStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Dates::DateStruct>*>( handle ); } double smoke_Dates_DateStruct_dateField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -86,5 +86,5 @@ double smoke_Dates_DateStruct_dateField_get(_baseRef handle) { } _baseRef smoke_Dates_DateStruct_nullableDateField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->nullable_date_field); + return Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toBaseRef(struct_pointer->nullable_date_field); } diff --git a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_DatesSteady.cpp b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_DatesSteady.cpp index baa28af281..a283e049a1 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_DatesSteady.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/cbridge/src/smoke/cbridge_DatesSteady.cpp @@ -4,11 +4,11 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/VectorHash.h" #include "smoke/DatesSteady.h" #include #include -#include #include void smoke_DatesSteady_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::DatesSteady >>(handle); @@ -35,7 +35,7 @@ double smoke_DatesSteady_dateMethod(_baseRef _instance, double input) { return Conversion::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DatesSteady >>(_instance)->get()->date_method(Conversion::toCpp(input))); } _baseRef smoke_DatesSteady_nullableDateMethod(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DatesSteady >>(_instance)->get()->nullable_date_method(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< std::chrono::steady_clock::time_point >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DatesSteady >>(_instance)->get()->nullable_date_method(Conversion<::gluecodium::optional< std::chrono::steady_clock::time_point >>::toCpp(input))); } _baseRef smoke_DatesSteady_dateListMethod(_baseRef _instance, _baseRef input) { return Conversion<::std::vector< std::chrono::steady_clock::time_point >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DatesSteady >>(_instance)->get()->date_list_method(Conversion<::std::vector< std::chrono::steady_clock::time_point >>::toCpp(input))); @@ -45,7 +45,7 @@ smoke_DatesSteady_DateStruct_create_handle( double dateField, _baseRef nullableD { ::smoke::DatesSteady::DateStruct* _struct = new ( ::std::nothrow ) ::smoke::DatesSteady::DateStruct(); _struct->date_field = Conversion::toCpp( dateField ); - _struct->nullable_date_field = Conversion>::toCpp( nullableDateField ); + _struct->nullable_date_field = Conversion<::gluecodium::optional< std::chrono::steady_clock::time_point >>::toCpp( nullableDateField ); return reinterpret_cast<_baseRef>( _struct ); } void @@ -56,18 +56,18 @@ smoke_DatesSteady_DateStruct_release_handle( _baseRef handle ) _baseRef smoke_DatesSteady_DateStruct_create_optional_handle(double dateField, _baseRef nullableDateField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::DatesSteady::DateStruct>( ::smoke::DatesSteady::DateStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::DatesSteady::DateStruct>( ::smoke::DatesSteady::DateStruct( ) ); (*_struct)->date_field = Conversion::toCpp( dateField ); - (*_struct)->nullable_date_field = Conversion>::toCpp( nullableDateField ); + (*_struct)->nullable_date_field = Conversion<::gluecodium::optional< std::chrono::steady_clock::time_point >>::toCpp( nullableDateField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_DatesSteady_DateStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::DatesSteady::DateStruct>*>( handle ) ); } void smoke_DatesSteady_DateStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::DatesSteady::DateStruct>*>( handle ); } double smoke_DatesSteady_DateStruct_dateField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -75,5 +75,5 @@ double smoke_DatesSteady_DateStruct_dateField_get(_baseRef handle) { } _baseRef smoke_DatesSteady_DateStruct_nullableDateField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->nullable_date_field); + return Conversion<::gluecodium::optional< std::chrono::steady_clock::time_point >>::toBaseRef(struct_pointer->nullable_date_field); } diff --git a/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/Dates.h b/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/Dates.h index a8ed569f84..fa068d8a00 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/Dates.h +++ b/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/Dates.h @@ -4,13 +4,12 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" - +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -26,14 +25,14 @@ class _GLUECODIUM_CPP_EXPORT Dates { using DateMap = ::std::unordered_map< ::std::string, ::std::chrono::system_clock::time_point >; struct _GLUECODIUM_CPP_EXPORT DateStruct { ::std::chrono::system_clock::time_point date_field; - std::optional< ::std::chrono::system_clock::time_point > nullable_date_field = std::optional< ::std::chrono::system_clock::time_point >(); + ::gluecodium::optional< ::std::chrono::system_clock::time_point > nullable_date_field = ::gluecodium::optional< ::std::chrono::system_clock::time_point >(); DateStruct( ); explicit DateStruct( ::std::chrono::system_clock::time_point date_field ); - DateStruct( ::std::chrono::system_clock::time_point date_field, std::optional< ::std::chrono::system_clock::time_point > nullable_date_field ); + DateStruct( ::std::chrono::system_clock::time_point date_field, ::gluecodium::optional< ::std::chrono::system_clock::time_point > nullable_date_field ); }; public: virtual ::std::chrono::system_clock::time_point date_method( const ::std::chrono::system_clock::time_point& input ) = 0; - virtual std::optional< ::std::chrono::system_clock::time_point > nullable_date_method( const std::optional< ::std::chrono::system_clock::time_point >& input ) = 0; + virtual ::gluecodium::optional< ::std::chrono::system_clock::time_point > nullable_date_method( const ::gluecodium::optional< ::std::chrono::system_clock::time_point >& input ) = 0; virtual ::std::chrono::system_clock::time_point get_date_property( ) const = 0; virtual void set_date_property( const ::std::chrono::system_clock::time_point& value ) = 0; virtual ::std::unordered_set< ::std::chrono::system_clock::time_point, ::gluecodium::hash< ::std::chrono::system_clock::time_point > > get_date_set( ) const = 0; diff --git a/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/DatesSteady.h b/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/DatesSteady.h index 268a454788..6ba8f7bac9 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/DatesSteady.h +++ b/gluecodium/src/test/resources/smoke/dates/output/cpp/include/smoke/DatesSteady.h @@ -4,12 +4,11 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" - +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -24,14 +23,14 @@ class _GLUECODIUM_CPP_EXPORT DatesSteady { using DateMap = ::std::unordered_map< ::smoke::DatesSteady::MonotonicDate, ::std::string, ::gluecodium::hash< ::smoke::DatesSteady::MonotonicDate > >; struct _GLUECODIUM_CPP_EXPORT DateStruct { ::smoke::DatesSteady::MonotonicDate date_field; - std::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_field = std::optional< ::smoke::DatesSteady::MonotonicDate >(); + ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_field = ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate >(); DateStruct( ); explicit DateStruct( ::smoke::DatesSteady::MonotonicDate date_field ); - DateStruct( ::smoke::DatesSteady::MonotonicDate date_field, std::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_field ); + DateStruct( ::smoke::DatesSteady::MonotonicDate date_field, ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_field ); }; public: virtual ::smoke::DatesSteady::MonotonicDate date_method( const ::smoke::DatesSteady::MonotonicDate& input ) = 0; - virtual std::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_method( const std::optional< ::smoke::DatesSteady::MonotonicDate >& input ) = 0; + virtual ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate > nullable_date_method( const ::gluecodium::optional< ::smoke::DatesSteady::MonotonicDate >& input ) = 0; virtual ::smoke::DatesSteady::DateList date_list_method( const ::smoke::DatesSteady::DateList& input ) = 0; }; } diff --git a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/GenericTypesConversion.cpp b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/GenericTypesConversion.cpp index ffd54884be..7344cf2d91 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/GenericTypesConversion.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/GenericTypesConversion.cpp @@ -57,7 +57,7 @@ FfiOpaqueHandle library_foobar_ListOf_Date_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -65,13 +65,13 @@ library_foobar_ListOf_Date_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_Date_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_Date_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -117,7 +117,7 @@ FfiOpaqueHandle library_foobar_ListOf_Date_std_2chrono_2steady_1clock_2time_1point_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -125,13 +125,13 @@ library_foobar_ListOf_Date_std_2chrono_2steady_1clock_2time_1point_create_handle void library_foobar_ListOf_Date_std_2chrono_2steady_1clock_2time_1point_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_Date_std_2chrono_2steady_1clock_2time_1point_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -184,7 +184,7 @@ FfiOpaqueHandle library_foobar_MapOf_Date_std_2chrono_2steady_1clock_2time_1point_to_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -192,13 +192,13 @@ library_foobar_MapOf_Date_std_2chrono_2steady_1clock_2time_1point_to_String_crea void library_foobar_MapOf_Date_std_2chrono_2steady_1clock_2time_1point_to_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Date_std_2chrono_2steady_1clock_2time_1point_to_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -251,7 +251,7 @@ FfiOpaqueHandle library_foobar_MapOf_String_to_Date_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -259,13 +259,13 @@ library_foobar_MapOf_String_to_Date_create_handle_nullable(FfiOpaqueHandle value void library_foobar_MapOf_String_to_Date_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_String_to_Date_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -311,7 +311,7 @@ FfiOpaqueHandle library_foobar_SetOf_Date_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -319,13 +319,13 @@ library_foobar_SetOf_Date_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_Date_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_Date_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_Dates.cpp b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_Dates.cpp index d96c5f689f..331cc2f2e6 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_Dates.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_Dates.cpp @@ -3,13 +3,12 @@ #include "InstanceCache.h" #include "FinalizerData.h" #include "IsolateContext.h" - +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedSetHash.h" #include "smoke/Dates.h" #include #include -#include #include #include #include @@ -28,9 +27,9 @@ library_smoke_Dates_dateMethod__Date(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle library_smoke_Dates_nullableDateMethod__Date_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).nullable_date_method( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } @@ -90,7 +89,7 @@ FfiOpaqueHandle library_smoke_Dates_DateStruct_create_handle(uint64_t dateField, FfiOpaqueHandle nullableDateField) { auto _result = new (std::nothrow) smoke::Dates::DateStruct(); _result->date_field = gluecodium::ffi::Conversion::toCpp(dateField); - _result->nullable_date_field = gluecodium::ffi::Conversion>::toCpp(nullableDateField); + _result->nullable_date_field = gluecodium::ffi::Conversion>::toCpp(nullableDateField); return reinterpret_cast(_result); } void @@ -105,7 +104,7 @@ library_smoke_Dates_DateStruct_get_field_dateField(FfiOpaqueHandle handle) { } FfiOpaqueHandle library_smoke_Dates_DateStruct_get_field_nullableDateField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->nullable_date_field ); } @@ -113,7 +112,7 @@ FfiOpaqueHandle library_smoke_Dates_DateStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -121,13 +120,13 @@ library_smoke_Dates_DateStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Dates_DateStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Dates_DateStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_DatesSteady.cpp b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_DatesSteady.cpp index 8100530d89..be583c0999 100644 --- a/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_DatesSteady.cpp +++ b/gluecodium/src/test/resources/smoke/dates/output/dart/ffi/ffi_smoke_DatesSteady.cpp @@ -3,13 +3,12 @@ #include "InstanceCache.h" #include "FinalizerData.h" #include "IsolateContext.h" - +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/VectorHash.h" #include "smoke/DatesSteady.h" #include #include -#include #include #include #include @@ -28,9 +27,9 @@ library_smoke_DatesSteady_dateMethod__Date(FfiOpaqueHandle _self, int32_t _isola FfiOpaqueHandle library_smoke_DatesSteady_nullableDateMethod__Date_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).nullable_date_method( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } @@ -71,7 +70,7 @@ FfiOpaqueHandle library_smoke_DatesSteady_DateStruct_create_handle(uint64_t dateField, FfiOpaqueHandle nullableDateField) { auto _result = new (std::nothrow) smoke::DatesSteady::DateStruct(); _result->date_field = gluecodium::ffi::Conversion::toCpp(dateField); - _result->nullable_date_field = gluecodium::ffi::Conversion>::toCpp(nullableDateField); + _result->nullable_date_field = gluecodium::ffi::Conversion>::toCpp(nullableDateField); return reinterpret_cast(_result); } void @@ -86,7 +85,7 @@ library_smoke_DatesSteady_DateStruct_get_field_dateField(FfiOpaqueHandle handle) } FfiOpaqueHandle library_smoke_DatesSteady_DateStruct_get_field_nullableDateField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->nullable_date_field ); } @@ -94,7 +93,7 @@ FfiOpaqueHandle library_smoke_DatesSteady_DateStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -102,13 +101,13 @@ library_smoke_DatesSteady_DateStruct_create_handle_nullable(FfiOpaqueHandle valu void library_smoke_DatesSteady_DateStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_DatesSteady_DateStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/defaults/output/cpp/include/smoke/DefaultValues.h b/gluecodium/src/test/resources/smoke/defaults/output/cpp/include/smoke/DefaultValues.h index 8589b284fa..57ac05b5e0 100644 --- a/gluecodium/src/test/resources/smoke/defaults/output/cpp/include/smoke/DefaultValues.h +++ b/gluecodium/src/test/resources/smoke/defaults/output/cpp/include/smoke/DefaultValues.h @@ -4,12 +4,12 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include #include -#include #include #include #include @@ -37,13 +37,13 @@ class _GLUECODIUM_CPP_EXPORT DefaultValues { StructWithDefaults( int32_t int_field, uint32_t uint_field, float float_field, double double_field, bool bool_field, ::std::string string_field ); }; struct _GLUECODIUM_CPP_EXPORT NullableStructWithDefaults { - std::optional< int32_t > int_field = std::optional< int32_t >(); - std::optional< uint32_t > uint_field = std::optional< uint32_t >(); - std::optional< float > float_field = std::optional< float >(); - std::optional< bool > bool_field = std::optional< bool >(); - std::optional< ::std::string > string_field = std::optional< ::std::string >(); + ::gluecodium::optional< int32_t > int_field = ::gluecodium::optional< int32_t >(); + ::gluecodium::optional< uint32_t > uint_field = ::gluecodium::optional< uint32_t >(); + ::gluecodium::optional< float > float_field = ::gluecodium::optional< float >(); + ::gluecodium::optional< bool > bool_field = ::gluecodium::optional< bool >(); + ::gluecodium::optional< ::std::string > string_field = ::gluecodium::optional< ::std::string >(); NullableStructWithDefaults( ); - NullableStructWithDefaults( std::optional< int32_t > int_field, std::optional< uint32_t > uint_field, std::optional< float > float_field, std::optional< bool > bool_field, std::optional< ::std::string > string_field ); + NullableStructWithDefaults( ::gluecodium::optional< int32_t > int_field, ::gluecodium::optional< uint32_t > uint_field, ::gluecodium::optional< float > float_field, ::gluecodium::optional< bool > bool_field, ::gluecodium::optional< ::std::string > string_field ); }; struct _GLUECODIUM_CPP_EXPORT StructWithSpecialDefaults { float float_nan_field = std::numeric_limits::quiet_NaN(); diff --git a/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaults.h b/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaults.h index 04bdc8012a..52f6736155 100644 --- a/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaults.h +++ b/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaults.h @@ -8,8 +8,8 @@ #include "fire/Enum3.h" #include "fire/Enum4.h" #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "smoke/EnumWrapper.h" -#include namespace smoke { class _GLUECODIUM_CPP_EXPORT EnumDefaults { public: @@ -23,10 +23,10 @@ class _GLUECODIUM_CPP_EXPORT EnumDefaults { explicit SimpleEnum( ::fire::Enum1 enum_field ); }; struct _GLUECODIUM_CPP_EXPORT NullableEnum { - std::optional< ::fire::Enum2 > enum_field1 = std::optional< ::fire::Enum2 >(); - std::optional< ::fire::Enum2 > enum_field1 = ::fire::Enum2::DISABLED; + ::gluecodium::optional< ::fire::Enum2 > enum_field1 = ::gluecodium::optional< ::fire::Enum2 >(); + ::gluecodium::optional< ::fire::Enum2 > enum_field1 = ::fire::Enum2::DISABLED; NullableEnum( ); - NullableEnum( std::optional< ::fire::Enum2 > enum_field1, std::optional< ::fire::Enum2 > enum_field1 ); + NullableEnum( ::gluecodium::optional< ::fire::Enum2 > enum_field1, ::gluecodium::optional< ::fire::Enum2 > enum_field1 ); }; struct _GLUECODIUM_CPP_EXPORT AliasEnum { ::smoke::EnumDefaults::EnumAlias enum_field = ::fire::Enum3::DISABLED; diff --git a/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaultsExternal.h b/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaultsExternal.h index dee8b1fac9..31c227f272 100644 --- a/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaultsExternal.h +++ b/gluecodium/src/test/resources/smoke/defaults_const/output/cpp/include/smoke/EnumDefaultsExternal.h @@ -8,8 +8,8 @@ #include "foo/AlienEnum3.h" #include "foo/AlienEnum4.h" #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "smoke/EnumWrapper.h" -#include namespace smoke { class _GLUECODIUM_CPP_EXPORT EnumDefaultsExternal { public: @@ -23,10 +23,10 @@ class _GLUECODIUM_CPP_EXPORT EnumDefaultsExternal { explicit SimpleEnum( foo::AlienEnum1 enum_field ); }; struct _GLUECODIUM_CPP_EXPORT NullableEnum { - std::optional< foo::AlienEnum2 > enum_field1 = std::optional< foo::AlienEnum2 >(); - std::optional< foo::AlienEnum2 > enum_field1 = foo::AlienEnum2::DISABLED; + ::gluecodium::optional< foo::AlienEnum2 > enum_field1 = ::gluecodium::optional< foo::AlienEnum2 >(); + ::gluecodium::optional< foo::AlienEnum2 > enum_field1 = foo::AlienEnum2::DISABLED; NullableEnum( ); - NullableEnum( std::optional< foo::AlienEnum2 > enum_field1, std::optional< foo::AlienEnum2 > enum_field1 ); + NullableEnum( ::gluecodium::optional< foo::AlienEnum2 > enum_field1, ::gluecodium::optional< foo::AlienEnum2 > enum_field1 ); }; struct _GLUECODIUM_CPP_EXPORT AliasEnum { ::smoke::EnumDefaultsExternal::EnumAlias enum_field = foo::AlienEnum3::DISABLED; diff --git a/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationMilliseconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationMilliseconds.cpp index f9d5bc8684..5d2eb8b3db 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationMilliseconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationMilliseconds.cpp @@ -26,9 +26,9 @@ Java_com_example_smoke_DurationMilliseconds_durationFunction(JNIEnv* _jenv, jobj jobject Java_com_example_smoke_DurationMilliseconds_nullableDurationFunction(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< std::chrono::milliseconds > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< std::chrono::milliseconds > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< std::chrono::milliseconds >*)nullptr); + (::gluecodium::optional< std::chrono::milliseconds >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, diff --git a/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationSeconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationSeconds.cpp index ff8903d0cb..48c6ce4556 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationSeconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/android/jni/com_example_smoke_DurationSeconds.cpp @@ -26,9 +26,9 @@ Java_com_example_smoke_DurationSeconds_durationFunction(JNIEnv* _jenv, jobject _ jobject Java_com_example_smoke_DurationSeconds_nullableDurationFunction(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::std::chrono::seconds > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::chrono::seconds > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::std::chrono::seconds >*)nullptr); + (::gluecodium::optional< ::std::chrono::seconds >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, diff --git a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/GenericCollections.cpp index 6eaa1d7454..a465c242af 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/GenericCollections.cpp @@ -4,11 +4,11 @@ #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" #include "gluecodium/DurationHash.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -34,13 +34,13 @@ void foobar_ArrayOf__Duration_append( _baseRef handle, double item ) Conversion<::std::vector< ::std::chrono::seconds >>::toCpp(handle).push_back(Conversion<::std::chrono::seconds>::toCpp(item)); } _baseRef foobar_ArrayOf__Duration_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::chrono::seconds >>( ::std::vector< ::std::chrono::seconds >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::chrono::seconds >>( ::std::vector< ::std::chrono::seconds >( ) ) ); } void foobar_ArrayOf__Duration_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::seconds >>*>( handle ); } _baseRef foobar_ArrayOf__Duration_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::seconds >>*>( handle ) ); } _baseRef foobar_ArrayOf__Duration_std_2_2chrono_2_2milliseconds_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< std::chrono::milliseconds >( ) ); @@ -62,13 +62,13 @@ void foobar_ArrayOf__Duration_std_2_2chrono_2_2milliseconds_append( _baseRef han Conversion<::std::vector< std::chrono::milliseconds >>::toCpp(handle).push_back(Conversion::toCpp(item)); } _baseRef foobar_ArrayOf__Duration_std_2_2chrono_2_2milliseconds_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< std::chrono::milliseconds >>( ::std::vector< std::chrono::milliseconds >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< std::chrono::milliseconds >>( ::std::vector< std::chrono::milliseconds >( ) ) ); } void foobar_ArrayOf__Duration_std_2_2chrono_2_2milliseconds_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< std::chrono::milliseconds >>*>( handle ); } _baseRef foobar_ArrayOf__Duration_std_2_2chrono_2_2milliseconds_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< std::chrono::milliseconds >>*>( handle ) ); } _baseRef foobar_MapOf__Duration_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >() ); @@ -100,13 +100,13 @@ _baseRef foobar_MapOf__Duration_To__String_iterator_value(_baseRef iterator_hand return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__Duration_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >>( ::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >>( ::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >( ) ) ); } void foobar_MapOf__Duration_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >>*>( handle ); } _baseRef foobar_MapOf__Duration_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::chrono::seconds, ::std::string, ::gluecodium::hash< ::std::chrono::seconds > >>*>( handle ) ); } _baseRef foobar_MapOf__Duration_std_2_2chrono_2_2milliseconds_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >() ); @@ -138,13 +138,13 @@ _baseRef foobar_MapOf__Duration_std_2_2chrono_2_2milliseconds_To__String_iterato return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__Duration_std_2_2chrono_2_2milliseconds_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >>( ::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >>( ::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >( ) ) ); } void foobar_MapOf__Duration_std_2_2chrono_2_2milliseconds_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >>*>( handle ); } _baseRef foobar_MapOf__Duration_std_2_2chrono_2_2milliseconds_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< std::chrono::milliseconds, ::std::string, ::gluecodium::hash< std::chrono::milliseconds > >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__Duration_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::std::chrono::seconds >() ); @@ -176,13 +176,13 @@ double foobar_MapOf__String_To__Duration_iterator_value(_baseRef iterator_handle return Conversion<::std::chrono::seconds>::toBaseRef(value); } _baseRef foobar_MapOf__String_To__Duration_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::std::chrono::seconds >>( ::std::unordered_map< ::std::string, ::std::chrono::seconds >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::seconds >>( ::std::unordered_map< ::std::string, ::std::chrono::seconds >( ) ) ); } void foobar_MapOf__String_To__Duration_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::seconds >>*>( handle ); } _baseRef foobar_MapOf__String_To__Duration_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::chrono::seconds >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__Duration_std_2_2chrono_2_2milliseconds_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, std::chrono::milliseconds >() ); @@ -214,13 +214,13 @@ double foobar_MapOf__String_To__Duration_std_2_2chrono_2_2milliseconds_iterator_ return Conversion::toBaseRef(value); } _baseRef foobar_MapOf__String_To__Duration_std_2_2chrono_2_2milliseconds_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, std::chrono::milliseconds >>( ::std::unordered_map< ::std::string, std::chrono::milliseconds >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, std::chrono::milliseconds >>( ::std::unordered_map< ::std::string, std::chrono::milliseconds >( ) ) ); } void foobar_MapOf__String_To__Duration_std_2_2chrono_2_2milliseconds_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, std::chrono::milliseconds >>*>( handle ); } _baseRef foobar_MapOf__String_To__Duration_std_2_2chrono_2_2milliseconds_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, std::chrono::milliseconds >>*>( handle ) ); } _baseRef foobar_SetOf__Duration_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >() ); @@ -248,13 +248,13 @@ double foobar_SetOf__Duration_iterator_get(_baseRef iterator_handle) { return Conversion<::std::chrono::seconds>::referenceBaseRef(value); } _baseRef foobar_SetOf__Duration_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >>( ::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >>( ::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >( ) ) ); } void foobar_SetOf__Duration_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >>*>( handle ); } _baseRef foobar_SetOf__Duration_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::chrono::seconds, ::gluecodium::hash< ::std::chrono::seconds > >>*>( handle ) ); } _baseRef foobar_SetOf__Duration_std_2_2chrono_2_2milliseconds_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >() ); @@ -282,11 +282,11 @@ double foobar_SetOf__Duration_std_2_2chrono_2_2milliseconds_iterator_get(_baseRe return Conversion::referenceBaseRef(value); } _baseRef foobar_SetOf__Duration_std_2_2chrono_2_2milliseconds_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >>( ::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >>( ::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >( ) ) ); } void foobar_SetOf__Duration_std_2_2chrono_2_2milliseconds_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >>*>( handle ); } _baseRef foobar_SetOf__Duration_std_2_2chrono_2_2milliseconds_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< std::chrono::milliseconds, ::gluecodium::hash< std::chrono::milliseconds > >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationMilliseconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationMilliseconds.cpp index d8f80be178..8fcfe4b8bd 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationMilliseconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationMilliseconds.cpp @@ -5,11 +5,11 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "gluecodium/DurationHash.h" +#include "gluecodium/Optional.h" #include "smoke/DurationMilliseconds.h" #include #include #include -#include void smoke_DurationMilliseconds_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::DurationMilliseconds >>(handle); } @@ -35,7 +35,7 @@ double smoke_DurationMilliseconds_durationFunction(_baseRef _instance, double in return Conversion::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationMilliseconds >>(_instance)->get()->duration_function(Conversion::toCpp(input))); } _baseRef smoke_DurationMilliseconds_nullableDurationFunction(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationMilliseconds >>(_instance)->get()->nullable_duration_function(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< std::chrono::milliseconds >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationMilliseconds >>(_instance)->get()->nullable_duration_function(Conversion<::gluecodium::optional< std::chrono::milliseconds >>::toCpp(input))); } double smoke_DurationMilliseconds_durationProperty_get(_baseRef _instance) { return Conversion::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationMilliseconds >>(_instance)->get()->get_duration_property()); @@ -58,17 +58,17 @@ smoke_DurationMilliseconds_DurationStruct_release_handle( _baseRef handle ) _baseRef smoke_DurationMilliseconds_DurationStruct_create_optional_handle(double durationField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::DurationMilliseconds::DurationStruct>( ::smoke::DurationMilliseconds::DurationStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::DurationMilliseconds::DurationStruct>( ::smoke::DurationMilliseconds::DurationStruct( ) ); (*_struct)->duration_field = Conversion::toCpp( durationField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_DurationMilliseconds_DurationStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::DurationMilliseconds::DurationStruct>*>( handle ) ); } void smoke_DurationMilliseconds_DurationStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::DurationMilliseconds::DurationStruct>*>( handle ); } double smoke_DurationMilliseconds_DurationStruct_durationField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationSeconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationSeconds.cpp index 09e5abc7f1..7086c8538b 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationSeconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/cbridge/src/smoke/cbridge_DurationSeconds.cpp @@ -5,11 +5,11 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "gluecodium/DurationHash.h" +#include "gluecodium/Optional.h" #include "smoke/DurationSeconds.h" #include #include #include -#include void smoke_DurationSeconds_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::DurationSeconds >>(handle); } @@ -35,7 +35,7 @@ double smoke_DurationSeconds_durationFunction(_baseRef _instance, double input) return Conversion<::std::chrono::seconds>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationSeconds >>(_instance)->get()->duration_function(Conversion<::std::chrono::seconds>::toCpp(input))); } _baseRef smoke_DurationSeconds_nullableDurationFunction(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationSeconds >>(_instance)->get()->nullable_duration_function(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::chrono::seconds >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationSeconds >>(_instance)->get()->nullable_duration_function(Conversion<::gluecodium::optional< ::std::chrono::seconds >>::toCpp(input))); } double smoke_DurationSeconds_durationProperty_get(_baseRef _instance) { return Conversion<::std::chrono::seconds>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::DurationSeconds >>(_instance)->get()->get_duration_property()); @@ -58,17 +58,17 @@ smoke_DurationSeconds_DurationStruct_release_handle( _baseRef handle ) _baseRef smoke_DurationSeconds_DurationStruct_create_optional_handle(double durationField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::DurationSeconds::DurationStruct>( ::smoke::DurationSeconds::DurationStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::DurationSeconds::DurationStruct>( ::smoke::DurationSeconds::DurationStruct( ) ); (*_struct)->duration_field = Conversion<::std::chrono::seconds>::toCpp( durationField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_DurationSeconds_DurationStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::DurationSeconds::DurationStruct>*>( handle ) ); } void smoke_DurationSeconds_DurationStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::DurationSeconds::DurationStruct>*>( handle ); } double smoke_DurationSeconds_DurationStruct_durationField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationMilliseconds.h b/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationMilliseconds.h index 75b8478cc8..52dc934789 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationMilliseconds.h +++ b/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationMilliseconds.h @@ -5,11 +5,11 @@ #pragma once #include "gluecodium/DurationHash.h" #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -32,7 +32,7 @@ class _GLUECODIUM_CPP_EXPORT DurationMilliseconds { }; public: virtual std::chrono::milliseconds duration_function( const std::chrono::milliseconds input ) = 0; - virtual std::optional< std::chrono::milliseconds > nullable_duration_function( const std::optional< std::chrono::milliseconds >& input ) = 0; + virtual ::gluecodium::optional< std::chrono::milliseconds > nullable_duration_function( const ::gluecodium::optional< std::chrono::milliseconds >& input ) = 0; virtual std::chrono::milliseconds get_duration_property( ) const = 0; virtual void set_duration_property( const std::chrono::milliseconds value ) = 0; }; diff --git a/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationSeconds.h b/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationSeconds.h index c21d4f5d12..795a9edbeb 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationSeconds.h +++ b/gluecodium/src/test/resources/smoke/durations/output/cpp/include/smoke/DurationSeconds.h @@ -5,11 +5,11 @@ #pragma once #include "gluecodium/DurationHash.h" #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -32,7 +32,7 @@ class _GLUECODIUM_CPP_EXPORT DurationSeconds { }; public: virtual ::std::chrono::seconds duration_function( const ::std::chrono::seconds input ) = 0; - virtual std::optional< ::std::chrono::seconds > nullable_duration_function( const std::optional< ::std::chrono::seconds >& input ) = 0; + virtual ::gluecodium::optional< ::std::chrono::seconds > nullable_duration_function( const ::gluecodium::optional< ::std::chrono::seconds >& input ) = 0; virtual ::std::chrono::seconds get_duration_property( ) const = 0; virtual void set_duration_property( const ::std::chrono::seconds value ) = 0; }; diff --git a/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationMilliseconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationMilliseconds.cpp index 9e3e0a3e7f..8060e073e4 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationMilliseconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationMilliseconds.cpp @@ -4,10 +4,10 @@ #include "FinalizerData.h" #include "IsolateContext.h" #include "gluecodium/DurationHash.h" +#include "gluecodium/Optional.h" #include "smoke/DurationMilliseconds.h" #include #include -#include #include #include #ifdef __cplusplus @@ -25,9 +25,9 @@ library_smoke_DurationMilliseconds_durationFunction__Duration(FfiOpaqueHandle _s FfiOpaqueHandle library_smoke_DurationMilliseconds_nullableDurationFunction__Duration_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).nullable_duration_function( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } @@ -89,7 +89,7 @@ FfiOpaqueHandle library_smoke_DurationMilliseconds_DurationStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -97,13 +97,13 @@ library_smoke_DurationMilliseconds_DurationStruct_create_handle_nullable(FfiOpaq void library_smoke_DurationMilliseconds_DurationStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_DurationMilliseconds_DurationStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationSeconds.cpp b/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationSeconds.cpp index 4284ffa158..e140a36c62 100644 --- a/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationSeconds.cpp +++ b/gluecodium/src/test/resources/smoke/durations/output/dart/ffi/ffi_smoke_DurationSeconds.cpp @@ -4,10 +4,10 @@ #include "FinalizerData.h" #include "IsolateContext.h" #include "gluecodium/DurationHash.h" +#include "gluecodium/Optional.h" #include "smoke/DurationSeconds.h" #include #include -#include #include #include #ifdef __cplusplus @@ -25,9 +25,9 @@ library_smoke_DurationSeconds_durationFunction__Duration(FfiOpaqueHandle _self, FfiOpaqueHandle library_smoke_DurationSeconds_nullableDurationFunction__Duration_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).nullable_duration_function( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } @@ -89,7 +89,7 @@ FfiOpaqueHandle library_smoke_DurationSeconds_DurationStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -97,13 +97,13 @@ library_smoke_DurationSeconds_DurationStruct_create_handle_nullable(FfiOpaqueHan void library_smoke_DurationSeconds_DurationStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_DurationSeconds_DurationStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumWithAlias__Conversion.cpp b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumWithAlias__Conversion.cpp index 423436a0f6..dea1baf4db 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumWithAlias__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumWithAlias__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::E return ::smoke::EnumWithAlias( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::EnumWithAlias> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::EnumWithAlias>*) +::gluecodium::optional<::smoke::EnumWithAlias> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::EnumWithAlias>*) { return _jinput - ? std::optional<::smoke::EnumWithAlias>(convert_from_jni(_jenv, _jinput, (::smoke::EnumWithAlias*)nullptr)) - : std::optional<::smoke::EnumWithAlias>{}; + ? ::gluecodium::optional<::smoke::EnumWithAlias>(convert_from_jni(_jenv, _jinput, (::smoke::EnumWithAlias*)nullptr)) + : ::gluecodium::optional<::smoke::EnumWithAlias>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/EnumWithAlias", com_example_smoke_EnumWithAlias, ::smoke::EnumWithAlias) JniReference @@ -43,7 +43,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::EnumWithAlias _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::EnumWithAlias> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::EnumWithAlias> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumsInTypeCollection_TCEnum__Conversion.h b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumsInTypeCollection_TCEnum__Conversion.h index 7dd87688c9..c8dbb0269d 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumsInTypeCollection_TCEnum__Conversion.h +++ b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_EnumsInTypeCollection_TCEnum__Conversion.h @@ -4,15 +4,14 @@ #pragma once #include "smoke/EnumsInTypeCollection.h" #include "JniReference.h" -#include - +#include "gluecodium/Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::smoke::EnumsInTypeCollection::TCEnum convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::EnumsInTypeCollection::TCEnum*); -JNIEXPORT std::optional<::smoke::EnumsInTypeCollection::TCEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::EnumsInTypeCollection::TCEnum>*); +JNIEXPORT ::gluecodium::optional<::smoke::EnumsInTypeCollection::TCEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::EnumsInTypeCollection::TCEnum>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::smoke::EnumsInTypeCollection::TCEnum _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::EnumsInTypeCollection::TCEnum> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::EnumsInTypeCollection::TCEnum> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.cpp b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.cpp index 5d1b204d79..7599b55336 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::E return ::smoke::Enums::SimpleEnum( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::Enums::SimpleEnum> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Enums::SimpleEnum>*) +::gluecodium::optional<::smoke::Enums::SimpleEnum> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Enums::SimpleEnum>*) { return _jinput - ? std::optional<::smoke::Enums::SimpleEnum>(convert_from_jni(_jenv, _jinput, (::smoke::Enums::SimpleEnum*)nullptr)) - : std::optional<::smoke::Enums::SimpleEnum>{}; + ? ::gluecodium::optional<::smoke::Enums::SimpleEnum>(convert_from_jni(_jenv, _jinput, (::smoke::Enums::SimpleEnum*)nullptr)) + : ::gluecodium::optional<::smoke::Enums::SimpleEnum>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Enums$SimpleEnum", com_example_smoke_Enums_00024SimpleEnum, ::smoke::Enums::SimpleEnum) JniReference @@ -40,7 +40,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Enums::SimpleEnum _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Enums::SimpleEnum> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Enums::SimpleEnum> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.h b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.h index aace555ccb..cf33812aa5 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.h +++ b/gluecodium/src/test/resources/smoke/enums/output/android/jni/com_example_smoke_Enums_SimpleEnum__Conversion.h @@ -4,15 +4,14 @@ #pragma once #include "smoke/Enums.h" #include "JniReference.h" -#include - +#include "gluecodium/Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::smoke::Enums::SimpleEnum convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::Enums::SimpleEnum*); -JNIEXPORT std::optional<::smoke::Enums::SimpleEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Enums::SimpleEnum>*); +JNIEXPORT ::gluecodium::optional<::smoke::Enums::SimpleEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Enums::SimpleEnum>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::smoke::Enums::SimpleEnum _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Enums::SimpleEnum> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Enums::SimpleEnum> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/enums/output/cbridge/src/smoke/cbridge_Enums.cpp b/gluecodium/src/test/resources/smoke/enums/output/cbridge/src/smoke/cbridge_Enums.cpp index 50fbb7ac1e..9337b30dbd 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/cbridge/src/smoke/cbridge_Enums.cpp +++ b/gluecodium/src/test/resources/smoke/enums/output/cbridge/src/smoke/cbridge_Enums.cpp @@ -5,10 +5,10 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "smoke/Enums.h" #include #include -#include #include void smoke_Enums_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::Enums >>(handle); @@ -59,7 +59,7 @@ smoke_Enums_ErrorStruct_release_handle( _baseRef handle ) _baseRef smoke_Enums_ErrorStruct_create_optional_handle(uint32_t type, _baseRef message) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Enums::ErrorStruct>( ::smoke::Enums::ErrorStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Enums::ErrorStruct>( ::smoke::Enums::ErrorStruct( ) ); (*_struct)->type = static_cast<::smoke::Enums::InternalErrorCode>( type ); (*_struct)->message = Conversion<::std::string>::toCpp( message ); return reinterpret_cast<_baseRef>( _struct ); @@ -67,10 +67,10 @@ smoke_Enums_ErrorStruct_create_optional_handle(uint32_t type, _baseRef message) _baseRef smoke_Enums_ErrorStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Enums::ErrorStruct>*>( handle ) ); } void smoke_Enums_ErrorStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Enums::ErrorStruct>*>( handle ); } uint32_t smoke_Enums_ErrorStruct_type_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/enums/output/dart/ffi/ffi_smoke_Enums.cpp b/gluecodium/src/test/resources/smoke/enums/output/dart/ffi/ffi_smoke_Enums.cpp index 28b0fef48e..a4ae12002e 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/dart/ffi/ffi_smoke_Enums.cpp +++ b/gluecodium/src/test/resources/smoke/enums/output/dart/ffi/ffi_smoke_Enums.cpp @@ -99,7 +99,7 @@ FfiOpaqueHandle library_smoke_Enums_ErrorStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -107,20 +107,20 @@ library_smoke_Enums_ErrorStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Enums_ErrorStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Enums_ErrorStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Enums_SimpleEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -128,20 +128,20 @@ library_smoke_Enums_SimpleEnum_create_handle_nullable(uint32_t value) void library_smoke_Enums_SimpleEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Enums_SimpleEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Enums_InternalErrorCode_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -149,13 +149,13 @@ library_smoke_Enums_InternalErrorCode_create_handle_nullable(uint32_t value) void library_smoke_Enums_InternalErrorCode_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Enums_InternalErrorCode_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/equatable/output/cbridge/src/smoke/cbridge_EquatableClass.cpp b/gluecodium/src/test/resources/smoke/equatable/output/cbridge/src/smoke/cbridge_EquatableClass.cpp index 770207a8b2..afa0b2276a 100644 --- a/gluecodium/src/test/resources/smoke/equatable/output/cbridge/src/smoke/cbridge_EquatableClass.cpp +++ b/gluecodium/src/test/resources/smoke/equatable/output/cbridge/src/smoke/cbridge_EquatableClass.cpp @@ -5,12 +5,12 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "smoke/EquatableClass.h" #include "smoke/PointerEquatableClass.h" #include #include #include -#include #include void smoke_EquatableClass_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::EquatableClass >>(handle); @@ -57,7 +57,7 @@ smoke_EquatableClass_EquatableStruct_release_handle( _baseRef handle ) _baseRef smoke_EquatableClass_EquatableStruct_create_optional_handle(int32_t intField, _baseRef stringField, _baseRef nestedEquatableInstance, _baseRef nestedPointerEquatableInstance) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::EquatableClass::EquatableStruct>( ::smoke::EquatableClass::EquatableStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::EquatableClass::EquatableStruct>( ::smoke::EquatableClass::EquatableStruct( ) ); (*_struct)->int_field = intField; (*_struct)->string_field = Conversion<::std::string>::toCpp( stringField ); (*_struct)->nested_equatable_instance = Conversion<::std::shared_ptr< ::smoke::EquatableClass >>::toCpp( nestedEquatableInstance ); @@ -67,10 +67,10 @@ smoke_EquatableClass_EquatableStruct_create_optional_handle(int32_t intField, _b _baseRef smoke_EquatableClass_EquatableStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::EquatableClass::EquatableStruct>*>( handle ) ); } void smoke_EquatableClass_EquatableStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::EquatableClass::EquatableStruct>*>( handle ); } int32_t smoke_EquatableClass_EquatableStruct_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/equatable/output/cpp/include/smoke/Equatable.h b/gluecodium/src/test/resources/smoke/equatable/output/cpp/include/smoke/Equatable.h index 16d4716cee..3c6f79e862 100644 --- a/gluecodium/src/test/resources/smoke/equatable/output/cpp/include/smoke/Equatable.h +++ b/gluecodium/src/test/resources/smoke/equatable/output/cpp/include/smoke/Equatable.h @@ -5,10 +5,10 @@ #pragma once #include "gluecodium/ExportGluecodiumCpp.h" #include "gluecodium/Hash.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include -#include #include #include #include @@ -43,17 +43,17 @@ struct _GLUECODIUM_CPP_EXPORT Equatable { bool operator!=( const EquatableStruct& rhs ) const; }; struct _GLUECODIUM_CPP_EXPORT EquatableNullableStruct { - std::optional< bool > bool_field = std::optional< bool >(); - std::optional< int32_t > int_field = std::optional< int32_t >(); - std::optional< uint16_t > uint_field = std::optional< uint16_t >(); - std::optional< float > float_field = std::optional< float >(); - std::optional< ::std::string > string_field = std::optional< ::std::string >(); - std::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field = std::optional< ::smoke::Equatable::NestedEquatableStruct >(); - std::optional< ::smoke::Equatable::SomeEnum > enum_field = std::optional< ::smoke::Equatable::SomeEnum >(); - std::optional< ::std::vector< ::std::string > > array_field = std::optional< ::std::vector< ::std::string > >(); - std::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field = std::optional< ::smoke::Equatable::ErrorCodeToMessageMap >(); + ::gluecodium::optional< bool > bool_field = ::gluecodium::optional< bool >(); + ::gluecodium::optional< int32_t > int_field = ::gluecodium::optional< int32_t >(); + ::gluecodium::optional< uint16_t > uint_field = ::gluecodium::optional< uint16_t >(); + ::gluecodium::optional< float > float_field = ::gluecodium::optional< float >(); + ::gluecodium::optional< ::std::string > string_field = ::gluecodium::optional< ::std::string >(); + ::gluecodium::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field = ::gluecodium::optional< ::smoke::Equatable::NestedEquatableStruct >(); + ::gluecodium::optional< ::smoke::Equatable::SomeEnum > enum_field = ::gluecodium::optional< ::smoke::Equatable::SomeEnum >(); + ::gluecodium::optional< ::std::vector< ::std::string > > array_field = ::gluecodium::optional< ::std::vector< ::std::string > >(); + ::gluecodium::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field = ::gluecodium::optional< ::smoke::Equatable::ErrorCodeToMessageMap >(); EquatableNullableStruct( ); - EquatableNullableStruct( std::optional< bool > bool_field, std::optional< int32_t > int_field, std::optional< uint16_t > uint_field, std::optional< float > float_field, std::optional< ::std::string > string_field, std::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field, std::optional< ::smoke::Equatable::SomeEnum > enum_field, std::optional< ::std::vector< ::std::string > > array_field, std::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field ); + EquatableNullableStruct( ::gluecodium::optional< bool > bool_field, ::gluecodium::optional< int32_t > int_field, ::gluecodium::optional< uint16_t > uint_field, ::gluecodium::optional< float > float_field, ::gluecodium::optional< ::std::string > string_field, ::gluecodium::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field, ::gluecodium::optional< ::smoke::Equatable::SomeEnum > enum_field, ::gluecodium::optional< ::std::vector< ::std::string > > array_field, ::gluecodium::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field ); bool operator==( const EquatableNullableStruct& rhs ) const; bool operator!=( const EquatableNullableStruct& rhs ) const; }; diff --git a/gluecodium/src/test/resources/smoke/equatable/output/cpp/src/smoke/Equatable.cpp b/gluecodium/src/test/resources/smoke/equatable/output/cpp/src/smoke/Equatable.cpp index 0bfa364fa1..1c787449f0 100644 --- a/gluecodium/src/test/resources/smoke/equatable/output/cpp/src/smoke/Equatable.cpp +++ b/gluecodium/src/test/resources/smoke/equatable/output/cpp/src/smoke/Equatable.cpp @@ -33,7 +33,7 @@ bool Equatable::EquatableStruct::operator!=( const EquatableStruct& rhs ) const Equatable::EquatableNullableStruct::EquatableNullableStruct( ) { } -Equatable::EquatableNullableStruct::EquatableNullableStruct( std::optional< bool > bool_field, std::optional< int32_t > int_field, std::optional< uint16_t > uint_field, std::optional< float > float_field, std::optional< ::std::string > string_field, std::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field, std::optional< ::smoke::Equatable::SomeEnum > enum_field, std::optional< ::std::vector< ::std::string > > array_field, std::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field ) +Equatable::EquatableNullableStruct::EquatableNullableStruct( ::gluecodium::optional< bool > bool_field, ::gluecodium::optional< int32_t > int_field, ::gluecodium::optional< uint16_t > uint_field, ::gluecodium::optional< float > float_field, ::gluecodium::optional< ::std::string > string_field, ::gluecodium::optional< ::smoke::Equatable::NestedEquatableStruct > struct_field, ::gluecodium::optional< ::smoke::Equatable::SomeEnum > enum_field, ::gluecodium::optional< ::std::vector< ::std::string > > array_field, ::gluecodium::optional< ::smoke::Equatable::ErrorCodeToMessageMap > map_field ) : bool_field( std::move( bool_field ) ), int_field( std::move( int_field ) ), uint_field( std::move( uint_field ) ), float_field( std::move( float_field ) ), string_field( std::move( string_field ) ), struct_field( std::move( struct_field ) ), enum_field( std::move( enum_field ) ), array_field( std::move( array_field ) ), map_field( std::move( map_field ) ) { } diff --git a/gluecodium/src/test/resources/smoke/equatable/output/dart/ffi/ffi_smoke_Equatable.cpp b/gluecodium/src/test/resources/smoke/equatable/output/dart/ffi/ffi_smoke_Equatable.cpp index 88091b0b9d..7ee49580ec 100644 --- a/gluecodium/src/test/resources/smoke/equatable/output/dart/ffi/ffi_smoke_Equatable.cpp +++ b/gluecodium/src/test/resources/smoke/equatable/output/dart/ffi/ffi_smoke_Equatable.cpp @@ -1,10 +1,10 @@ #include "ffi_smoke_Equatable.h" #include "ConversionBase.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Equatable.h" #include -#include #include #include #include @@ -27,7 +27,7 @@ FfiOpaqueHandle library_smoke_Equatable_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -35,13 +35,13 @@ library_smoke_Equatable_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Equatable_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Equatable_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -127,7 +127,7 @@ FfiOpaqueHandle library_smoke_Equatable_EquatableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -135,27 +135,27 @@ library_smoke_Equatable_EquatableStruct_create_handle_nullable(FfiOpaqueHandle v void library_smoke_Equatable_EquatableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Equatable_EquatableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_create_handle(FfiOpaqueHandle boolField, FfiOpaqueHandle intField, FfiOpaqueHandle uintField, FfiOpaqueHandle floatField, FfiOpaqueHandle stringField, FfiOpaqueHandle structField, FfiOpaqueHandle enumField, FfiOpaqueHandle arrayField, FfiOpaqueHandle mapField) { auto _result = new (std::nothrow) smoke::Equatable::EquatableNullableStruct(); - _result->bool_field = gluecodium::ffi::Conversion>::toCpp(boolField); - _result->int_field = gluecodium::ffi::Conversion>::toCpp(intField); - _result->uint_field = gluecodium::ffi::Conversion>::toCpp(uintField); - _result->float_field = gluecodium::ffi::Conversion>::toCpp(floatField); - _result->string_field = gluecodium::ffi::Conversion>::toCpp(stringField); - _result->struct_field = gluecodium::ffi::Conversion>::toCpp(structField); - _result->enum_field = gluecodium::ffi::Conversion>::toCpp(enumField); - _result->array_field = gluecodium::ffi::Conversion>>::toCpp(arrayField); - _result->map_field = gluecodium::ffi::Conversion>>::toCpp(mapField); + _result->bool_field = gluecodium::ffi::Conversion>::toCpp(boolField); + _result->int_field = gluecodium::ffi::Conversion>::toCpp(intField); + _result->uint_field = gluecodium::ffi::Conversion>::toCpp(uintField); + _result->float_field = gluecodium::ffi::Conversion>::toCpp(floatField); + _result->string_field = gluecodium::ffi::Conversion>::toCpp(stringField); + _result->struct_field = gluecodium::ffi::Conversion>::toCpp(structField); + _result->enum_field = gluecodium::ffi::Conversion>::toCpp(enumField); + _result->array_field = gluecodium::ffi::Conversion>>::toCpp(arrayField); + _result->map_field = gluecodium::ffi::Conversion>>::toCpp(mapField); return reinterpret_cast(_result); } void @@ -164,55 +164,55 @@ library_smoke_Equatable_EquatableNullableStruct_release_handle(FfiOpaqueHandle h } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_boolField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->bool_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_intField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->int_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_uintField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->uint_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_floatField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->float_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_stringField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->string_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_structField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->struct_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_enumField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->enum_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_arrayField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( reinterpret_cast(handle)->array_field ); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_field_mapField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( reinterpret_cast(handle)->map_field ); } @@ -220,7 +220,7 @@ FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -228,13 +228,13 @@ library_smoke_Equatable_EquatableNullableStruct_create_handle_nullable(FfiOpaque void library_smoke_Equatable_EquatableNullableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Equatable_EquatableNullableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -257,7 +257,7 @@ FfiOpaqueHandle library_smoke_Equatable_NestedEquatableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -265,20 +265,20 @@ library_smoke_Equatable_NestedEquatableStruct_create_handle_nullable(FfiOpaqueHa void library_smoke_Equatable_NestedEquatableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Equatable_NestedEquatableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Equatable_SomeEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -286,13 +286,13 @@ library_smoke_Equatable_SomeEnum_create_handle_nullable(uint32_t value) void library_smoke_Equatable_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Equatable_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_Errors.cpp b/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_Errors.cpp index c13c3deb24..0af8a9177b 100644 --- a/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_Errors.cpp +++ b/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_Errors.cpp @@ -177,7 +177,7 @@ FfiOpaqueHandle library_smoke_Errors_InternalErrorCode_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -185,20 +185,20 @@ library_smoke_Errors_InternalErrorCode_create_handle_nullable(uint32_t value) void library_smoke_Errors_InternalErrorCode_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Errors_InternalErrorCode_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Errors_ExternalErrors_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -206,13 +206,13 @@ library_smoke_Errors_ExternalErrors_create_handle_nullable(uint32_t value) void library_smoke_Errors_ExternalErrors_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Errors_ExternalErrors_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_ErrorsInterface.cpp b/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_ErrorsInterface.cpp index 43a8dbf325..fc3a6e86e8 100644 --- a/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_ErrorsInterface.cpp +++ b/gluecodium/src/test/resources/smoke/errors/output/dart/ffi/ffi_smoke_ErrorsInterface.cpp @@ -266,7 +266,7 @@ FfiOpaqueHandle library_smoke_ErrorsInterface_InternalError_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -274,20 +274,20 @@ library_smoke_ErrorsInterface_InternalError_create_handle_nullable(uint32_t valu void library_smoke_ErrorsInterface_InternalError_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ErrorsInterface_InternalError_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_ErrorsInterface_ExternalErrors_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -295,13 +295,13 @@ library_smoke_ErrorsInterface_ExternalErrors_create_handle_nullable(uint32_t val void library_smoke_ErrorsInterface_ExternalErrors_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ErrorsInterface_ExternalErrors_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Class__Conversion.h b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Class__Conversion.h index a4a9ad6c80..9469551b24 100644 --- a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Class__Conversion.h +++ b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Class__Conversion.h @@ -6,9 +6,8 @@ #include "com_example_package_Types_Enum__Conversion.h" #include "com_example_package_Types_Struct__Conversion.h" #include "JniReference.h" - +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Enum__Conversion.h b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Enum__Conversion.h index 57f079540f..4a316e8b99 100644 --- a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Enum__Conversion.h +++ b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Enum__Conversion.h @@ -4,14 +4,14 @@ #pragma once #include "package/Types.h" #include "JniReference.h" -#include +#include "gluecodium\Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::package::Types::Enum convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::package::Types::Enum*); -JNIEXPORT std::optional<::package::Types::Enum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::package::Types::Enum>*); +JNIEXPORT ::gluecodium::optional<::package::Types::Enum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::package::Types::Enum>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::package::Types::Enum _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::package::Types::Enum> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::package::Types::Enum> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Struct__Conversion.h b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Struct__Conversion.h index 4a8e130f65..733eeaed5b 100644 --- a/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Struct__Conversion.h +++ b/gluecodium/src/test/resources/smoke/escaped_names/output/android/jni/com_example_package_Types_Struct__Conversion.h @@ -5,14 +5,14 @@ #include "package/Types.h" #include "com_example_package_Types_Enum__Conversion.h" #include "JniReference.h" -#include +#include "gluecodium\Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::package::Types::Struct convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::package::Types::Struct*); -JNIEXPORT std::optional<::package::Types::Struct> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::package::Types::Struct>*); +JNIEXPORT ::gluecodium::optional<::package::Types::Struct> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::package::Types::Struct>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::package::Types::Struct& _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::package::Types::Struct> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::package::Types::Struct> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_Foo__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_Foo__Conversion.cpp index 3d7569ee3f..6b2820fded 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_Foo__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_Foo__Conversion.cpp @@ -36,12 +36,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput_ext, ::smok _nout.field = n_field; return _nout; } -std::optional<::smoke::JavaExternalCtor> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::JavaExternalCtor>*) +::gluecodium::optional<::smoke::JavaExternalCtor> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::JavaExternalCtor>*) { return _jinput - ? std::optional<::smoke::JavaExternalCtor>(convert_from_jni(_jenv, _jinput, (::smoke::JavaExternalCtor*)nullptr)) - : std::optional<::smoke::JavaExternalCtor>{}; + ? ::gluecodium::optional<::smoke::JavaExternalCtor>(convert_from_jni(_jenv, _jinput, (::smoke::JavaExternalCtor*)nullptr)) + : ::gluecodium::optional<::smoke::JavaExternalCtor>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/JavaExternalCtor", com_example_smoke_JavaExternalCtor, ::smoke::JavaExternalCtor) JniReference @@ -69,7 +69,7 @@ convert_to_jni_internal(JNIEnv* _jenv, const ::smoke::JavaExternalCtor& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::JavaExternalCtor> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::JavaExternalCtor> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_DurationExternal__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_DurationExternal__Conversion.cpp index 5576859e71..3796d8022d 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_DurationExternal__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_DurationExternal__Conversion.cpp @@ -20,12 +20,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::chron (uint64_t*)nullptr ); return std::chrono::duration>(std::move(n_value)); } -std::optional>> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional>>*) +::gluecodium::optional>> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional>>*) { return _jinput - ? std::optional>>(convert_from_jni(_jenv, _jinput, (std::chrono::duration>*)nullptr)) - : std::optional>>{}; + ? ::gluecodium::optional>>(convert_from_jni(_jenv, _jinput, (std::chrono::duration>*)nullptr)) + : ::gluecodium::optional>>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/DurationExternal", com_example_smoke_DurationExternal, std::chrono::duration>) JniReference @@ -37,7 +37,7 @@ convert_to_jni(JNIEnv* _jenv, const std::chrono::duration -convert_to_jni(JNIEnv* _jenv, const std::optional>> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional>> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_ExternalEnum__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_ExternalEnum__Conversion.cpp index dd337e8029..ff865467e0 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_ExternalEnum__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_ExternalEnum__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::E return ::smoke::Enums::External_Enum( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::Enums::External_Enum> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Enums::External_Enum>*) +::gluecodium::optional<::smoke::Enums::External_Enum> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Enums::External_Enum>*) { return _jinput - ? std::optional<::smoke::Enums::External_Enum>(convert_from_jni(_jenv, _jinput, (::smoke::Enums::External_Enum*)nullptr)) - : std::optional<::smoke::Enums::External_Enum>{}; + ? ::gluecodium::optional<::smoke::Enums::External_Enum>(convert_from_jni(_jenv, _jinput, (::smoke::Enums::External_Enum*)nullptr)) + : ::gluecodium::optional<::smoke::Enums::External_Enum>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Enums$ExternalEnum", com_example_smoke_Enums_00024ExternalEnum, ::smoke::Enums::External_Enum) JniReference @@ -40,7 +40,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Enums::External_Enum _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Enums::External_Enum> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Enums::External_Enum> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_VeryExternalEnum__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_VeryExternalEnum__Conversion.cpp index 21922362b7..49a75fb6c1 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_VeryExternalEnum__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Enums_VeryExternalEnum__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::fire::So return ::fire::SomeVeryExternalEnum( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::fire::SomeVeryExternalEnum> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::fire::SomeVeryExternalEnum>*) +::gluecodium::optional<::fire::SomeVeryExternalEnum> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::fire::SomeVeryExternalEnum>*) { return _jinput - ? std::optional<::fire::SomeVeryExternalEnum>(convert_from_jni(_jenv, _jinput, (::fire::SomeVeryExternalEnum*)nullptr)) - : std::optional<::fire::SomeVeryExternalEnum>{}; + ? ::gluecodium::optional<::fire::SomeVeryExternalEnum>(convert_from_jni(_jenv, _jinput, (::fire::SomeVeryExternalEnum*)nullptr)) + : ::gluecodium::optional<::fire::SomeVeryExternalEnum>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Enums$VeryExternalEnum", com_example_smoke_Enums_00024VeryExternalEnum, ::fire::SomeVeryExternalEnum) JniReference @@ -40,7 +40,7 @@ convert_to_jni(JNIEnv* _jenv, const ::fire::SomeVeryExternalEnum _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::fire::SomeVeryExternalEnum> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::fire::SomeVeryExternalEnum> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalClass__Conversion.h b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalClass__Conversion.h index 6aae2475c5..23928079e8 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalClass__Conversion.h +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalClass__Conversion.h @@ -4,8 +4,8 @@ #pragma once #include "foo/Bar.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalInterface__Conversion.h b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalInterface__Conversion.h index 16f76b4694..59751e3d39 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalInterface__Conversion.h +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_ExternalInterface__Conversion.h @@ -4,8 +4,8 @@ #pragma once #include "foo/Bar.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_JavaExternalTypesStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_JavaExternalTypesStruct__Conversion.cpp index 236518bce5..5a470524f2 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_JavaExternalTypesStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_JavaExternalTypesStruct__Conversion.cpp @@ -35,12 +35,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::J (::smoke::Season*)nullptr ); return ::smoke::JavaExternalTypesStruct(std::move(n_currency), std::move(n_time_zone), std::move(n_month), std::move(n_color), std::move(n_season)); } -std::optional<::smoke::JavaExternalTypesStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::JavaExternalTypesStruct>*) +::gluecodium::optional<::smoke::JavaExternalTypesStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::JavaExternalTypesStruct>*) { return _jinput - ? std::optional<::smoke::JavaExternalTypesStruct>(convert_from_jni(_jenv, _jinput, (::smoke::JavaExternalTypesStruct*)nullptr)) - : std::optional<::smoke::JavaExternalTypesStruct>{}; + ? ::gluecodium::optional<::smoke::JavaExternalTypesStruct>(convert_from_jni(_jenv, _jinput, (::smoke::JavaExternalTypesStruct*)nullptr)) + : ::gluecodium::optional<::smoke::JavaExternalTypesStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/JavaExternalTypesStruct", com_example_smoke_JavaExternalTypesStruct, ::smoke::JavaExternalTypesStruct) JniReference @@ -61,7 +61,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::JavaExternalTypesStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::JavaExternalTypesStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::JavaExternalTypesStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Structs_ExternalStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Structs_ExternalStruct__Conversion.cpp index 62d4744663..c536d1a18f 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Structs_ExternalStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/com_example_smoke_Structs_ExternalStruct__Conversion.cpp @@ -38,12 +38,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.set_some_struct(n_externalStructField); return _nout; } -std::optional<::smoke::Structs::ExternalStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::ExternalStruct>*) +::gluecodium::optional<::smoke::Structs::ExternalStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::ExternalStruct>*) { return _jinput - ? std::optional<::smoke::Structs::ExternalStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::ExternalStruct*)nullptr)) - : std::optional<::smoke::Structs::ExternalStruct>{}; + ? ::gluecodium::optional<::smoke::Structs::ExternalStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::ExternalStruct*)nullptr)) + : ::gluecodium::optional<::smoke::Structs::ExternalStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Structs$ExternalStruct", com_example_smoke_Structs_00024ExternalStruct, ::smoke::Structs::ExternalStruct) JniReference @@ -60,7 +60,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::ExternalStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::ExternalStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::ExternalStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_Integer__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_Integer__Conversion.cpp index 2b85c6ae33..b35eacd974 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_Integer__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_Integer__Conversion.cpp @@ -54,12 +54,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput_ext, ::smok _nout.alpha = n_alpha; return _nout; } -std::optional<::smoke::SystemColor> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::SystemColor>*) +::gluecodium::optional<::smoke::SystemColor> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::SystemColor>*) { return _jinput - ? std::optional<::smoke::SystemColor>(convert_from_jni(_jenv, _jinput, (::smoke::SystemColor*)nullptr)) - : std::optional<::smoke::SystemColor>{}; + ? ::gluecodium::optional<::smoke::SystemColor>(convert_from_jni(_jenv, _jinput, (::smoke::SystemColor*)nullptr)) + : ::gluecodium::optional<::smoke::SystemColor>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/SystemColor", com_example_smoke_SystemColor, ::smoke::SystemColor) JniReference @@ -82,7 +82,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::SystemColor& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::SystemColor> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::SystemColor> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_String__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_String__Conversion.cpp index 5a4c75fc3c..679a769778 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_String__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_lang_String__Conversion.cpp @@ -29,12 +29,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput_ext, ::smok return ::smoke::Season( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::Season> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Season>*) +::gluecodium::optional<::smoke::Season> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Season>*) { return _jinput - ? std::optional<::smoke::Season>(convert_from_jni(_jenv, _jinput, (::smoke::Season*)nullptr)) - : std::optional<::smoke::Season>{}; + ? ::gluecodium::optional<::smoke::Season>(convert_from_jni(_jenv, _jinput, (::smoke::Season*)nullptr)) + : ::gluecodium::optional<::smoke::Season>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Season", com_example_smoke_Season, ::smoke::Season) JniReference @@ -69,7 +69,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Season _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Season> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Season> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_time_Month__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_time_Month__Conversion.cpp index ddb80ab07b..14912fccf3 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_time_Month__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_time_Month__Conversion.cpp @@ -24,12 +24,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::M return {}; } } -std::optional<::smoke::Month> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Month>*) +::gluecodium::optional<::smoke::Month> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Month>*) { return _jinput - ? std::optional<::smoke::Month>(convert_from_jni(_jenv, _jinput, (::smoke::Month*)nullptr)) - : std::optional<::smoke::Month>{}; + ? ::gluecodium::optional<::smoke::Month>(convert_from_jni(_jenv, _jinput, (::smoke::Month*)nullptr)) + : ::gluecodium::optional<::smoke::Month>{}; } REGISTER_JNI_CLASS_CACHE("java/time/Month", java_time_Month, ::smoke::Month) JniReference @@ -52,7 +52,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Month _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Month> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Month> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_Currency__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_Currency__Conversion.cpp index 79212216fa..3392f3a84c 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_Currency__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_Currency__Conversion.cpp @@ -18,12 +18,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::C auto n_numeric_code = call_java_method(_jenv, _jinput, "getNumericCode", "()I"); return ::smoke::Currency(std::move(n_currency_code), std::move(n_numeric_code)); } -std::optional<::smoke::Currency> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Currency>*) +::gluecodium::optional<::smoke::Currency> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Currency>*) { return _jinput - ? std::optional<::smoke::Currency>(convert_from_jni(_jenv, _jinput, (::smoke::Currency*)nullptr)) - : std::optional<::smoke::Currency>{}; + ? ::gluecodium::optional<::smoke::Currency>(convert_from_jni(_jenv, _jinput, (::smoke::Currency*)nullptr)) + : ::gluecodium::optional<::smoke::Currency>{}; } REGISTER_JNI_CLASS_CACHE("java/util/Currency", java_util_Currency, ::smoke::Currency) JniReference @@ -36,7 +36,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Currency& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Currency> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Currency> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_SimpleTimeZone__Conversion.cpp b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_SimpleTimeZone__Conversion.cpp index 0ff7325176..d20c02d160 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_SimpleTimeZone__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/android/jni/java_util_SimpleTimeZone__Conversion.cpp @@ -18,12 +18,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::T _nout.raw_offset = n_raw_offset; return _nout; } -std::optional<::smoke::TimeZone> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::TimeZone>*) +::gluecodium::optional<::smoke::TimeZone> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::TimeZone>*) { return _jinput - ? std::optional<::smoke::TimeZone>(convert_from_jni(_jenv, _jinput, (::smoke::TimeZone*)nullptr)) - : std::optional<::smoke::TimeZone>{}; + ? ::gluecodium::optional<::smoke::TimeZone>(convert_from_jni(_jenv, _jinput, (::smoke::TimeZone*)nullptr)) + : ::gluecodium::optional<::smoke::TimeZone>{}; } REGISTER_JNI_CLASS_CACHE("java/util/SimpleTimeZone", java_util_SimpleTimeZone, ::smoke::TimeZone) JniReference @@ -35,7 +35,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::TimeZone& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::TimeZone> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::TimeZone> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_DurationExternal.cpp b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_DurationExternal.cpp index 7ffe1892ac..6855350303 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_DurationExternal.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_DurationExternal.cpp @@ -3,10 +3,10 @@ #include "cbridge/include/smoke/cbridge_DurationExternal.h" #include "cbridge_internal/include/BaseHandleImpl.h" #include "core/duration.h" +#include "gluecodium/Optional.h" #include #include #include -#include _baseRef smoke_DurationExternal_create_handle( uint64_t value ) { @@ -23,16 +23,16 @@ _baseRef smoke_DurationExternal_create_optional_handle(uint64_t value) { auto _value = value; - auto _struct = new ( ::std::nothrow ) std::optional>>( std::chrono::duration>( _value ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional>>( std::chrono::duration>( _value ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_DurationExternal_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional>>*>( handle ) ); } void smoke_DurationExternal_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>>*>( handle ); + delete reinterpret_cast<::gluecodium::optional>>*>( handle ); } uint64_t smoke_DurationExternal_value_get(_baseRef handle) { auto struct_pointer = get_pointer>>(handle); diff --git a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalClass.cpp b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalClass.cpp index 4730454719..3da8254f5e 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalClass.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalClass.cpp @@ -6,10 +6,10 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "foo/Bar.h" +#include "gluecodium/Optional.h" #include #include #include -#include #include void smoke_ExternalClass_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::fire::Baz >>(handle); @@ -53,17 +53,17 @@ smoke_ExternalClass_SomeStruct_release_handle( _baseRef handle ) _baseRef smoke_ExternalClass_SomeStruct_create_optional_handle(_baseRef someField) { - auto _struct = new ( ::std::nothrow ) std::optional<::fire::Baz::some_Struct>( ::fire::Baz::some_Struct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::fire::Baz::some_Struct>( ::fire::Baz::some_Struct( ) ); (*_struct)->some_Field = Conversion<::std::string>::toCpp( someField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ExternalClass_SomeStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::fire::Baz::some_Struct>*>( handle ) ); } void smoke_ExternalClass_SomeStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::fire::Baz::some_Struct>*>( handle ); } _baseRef smoke_ExternalClass_SomeStruct_someField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalInterface.cpp b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalInterface.cpp index cf00184e79..e0ee7faf59 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalInterface.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalInterface.cpp @@ -7,11 +7,11 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "foo/Bar.h" +#include "gluecodium/Optional.h" #include "gluecodium/TypeRepository.h" #include #include #include -#include #include void smoke_ExternalInterface_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::ExternalInterface >>(handle); @@ -98,17 +98,17 @@ smoke_ExternalInterface_SomeStruct_release_handle( _baseRef handle ) _baseRef smoke_ExternalInterface_SomeStruct_create_optional_handle(_baseRef someField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::ExternalInterface::some_Struct>( ::smoke::ExternalInterface::some_Struct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::ExternalInterface::some_Struct>( ::smoke::ExternalInterface::some_Struct( ) ); (*_struct)->some_Field = Conversion<::std::string>::toCpp( someField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ExternalInterface_SomeStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::ExternalInterface::some_Struct>*>( handle ) ); } void smoke_ExternalInterface_SomeStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::ExternalInterface::some_Struct>*>( handle ); } _baseRef smoke_ExternalInterface_SomeStruct_someField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalTypeInTypesCollection.cpp b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalTypeInTypesCollection.cpp index 3586524709..25c366f5c5 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalTypeInTypesCollection.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_ExternalTypeInTypesCollection.cpp @@ -2,12 +2,12 @@ // #include "cbridge/include/smoke/cbridge_ExternalTypeInTypesCollection.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "include/ExternalTypeInTypesCollection.h" #include "smoke/ExternalTypeInTypesCollection.h" #include #include #include -#include _baseRef smoke_ExternalTypeInTypesCollection_IntStruct_create_handle( int32_t intField ) { @@ -23,17 +23,17 @@ smoke_ExternalTypeInTypesCollection_IntStruct_release_handle( _baseRef handle ) _baseRef smoke_ExternalTypeInTypesCollection_IntStruct_create_optional_handle(int32_t intField) { - auto _struct = new ( ::std::nothrow ) std::optional<::external::IntStruct>( ::external::IntStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::external::IntStruct>( ::external::IntStruct( ) ); (*_struct)->int_field = intField; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ExternalTypeInTypesCollection_IntStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::external::IntStruct>*>( handle ) ); } void smoke_ExternalTypeInTypesCollection_IntStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::external::IntStruct>*>( handle ); } int32_t smoke_ExternalTypeInTypesCollection_IntStruct_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_Structs.cpp b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_Structs.cpp index 9750cac66f..646471acd0 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_Structs.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/cbridge/src/smoke/cbridge_Structs.cpp @@ -7,13 +7,13 @@ #include "cbridge_internal/include/WrapperCache.h" #include "foo/Bar.h" #include "foo/Bazz.h" +#include "gluecodium/Optional.h" #include "gluecodium/VectorHash.h" #include "non/Sense.h" #include "smoke/Structs.h" #include #include #include -#include #include #include void smoke_Structs_release_handle(_baseRef handle) { @@ -61,7 +61,7 @@ smoke_Structs_ExternalStruct_release_handle( _baseRef handle ) _baseRef smoke_Structs_ExternalStruct_create_optional_handle(_baseRef stringField, _baseRef externalStringField, _baseRef externalArrayField, _baseRef externalStructField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::ExternalStruct>( ::smoke::Structs::ExternalStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::ExternalStruct>( ::smoke::Structs::ExternalStruct( ) ); (*_struct)->stringField = Conversion<::std::string>::toCpp( stringField ); (*_struct)->set_some_string( Conversion<::std::string>::toCpp( externalStringField ) ); (*_struct)->set_some_array( Conversion<::std::vector< int8_t >>::toCpp( externalArrayField ) ); @@ -71,10 +71,10 @@ smoke_Structs_ExternalStruct_create_optional_handle(_baseRef stringField, _baseR _baseRef smoke_Structs_ExternalStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::ExternalStruct>*>( handle ) ); } void smoke_Structs_ExternalStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::ExternalStruct>*>( handle ); } _baseRef smoke_Structs_ExternalStruct_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -107,17 +107,17 @@ smoke_Structs_AnotherExternalStruct_release_handle( _baseRef handle ) _baseRef smoke_Structs_AnotherExternalStruct_create_optional_handle(int8_t intField) { - auto _struct = new ( ::std::nothrow ) std::optional<::fire::SomeVeryExternalStruct>( ::fire::SomeVeryExternalStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::fire::SomeVeryExternalStruct>( ::fire::SomeVeryExternalStruct( ) ); (*_struct)->intField = intField; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_AnotherExternalStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::fire::SomeVeryExternalStruct>*>( handle ) ); } void smoke_Structs_AnotherExternalStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::fire::SomeVeryExternalStruct>*>( handle ); } int8_t smoke_Structs_AnotherExternalStruct_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_DurationExternal.cpp b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_DurationExternal.cpp index 22ea064481..bbb00de490 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_DurationExternal.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_DurationExternal.cpp @@ -26,7 +26,7 @@ FfiOpaqueHandle library_smoke_DurationExternal_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( *reinterpret_cast>*>(value) ) ); @@ -34,13 +34,13 @@ library_smoke_DurationExternal_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_DurationExternal_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_smoke_DurationExternal_get_value_nullable(FfiOpaqueHandle handle) { return reinterpret_cast(new (std::nothrow) std::chrono::duration>( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) )); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Enums.cpp b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Enums.cpp index e2f8e6338f..490bb15f2c 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Enums.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Enums.cpp @@ -46,7 +46,7 @@ FfiOpaqueHandle library_smoke_Enums_ExternalEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -54,20 +54,20 @@ library_smoke_Enums_ExternalEnum_create_handle_nullable(uint32_t value) void library_smoke_Enums_ExternalEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Enums_ExternalEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Enums_VeryExternalEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -75,13 +75,13 @@ library_smoke_Enums_VeryExternalEnum_create_handle_nullable(uint32_t value) void library_smoke_Enums_VeryExternalEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Enums_VeryExternalEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalClass.cpp b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalClass.cpp index 1c022f87b8..e003a694b8 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalClass.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalClass.cpp @@ -70,7 +70,7 @@ FfiOpaqueHandle library_smoke_ExternalClass_SomeStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -78,20 +78,20 @@ library_smoke_ExternalClass_SomeStruct_create_handle_nullable(FfiOpaqueHandle va void library_smoke_ExternalClass_SomeStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_ExternalClass_SomeStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_ExternalClass_SomeEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -99,13 +99,13 @@ library_smoke_ExternalClass_SomeEnum_create_handle_nullable(uint32_t value) void library_smoke_ExternalClass_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ExternalClass_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalInterface.cpp b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalInterface.cpp index c70d068d83..6834b6d3d7 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalInterface.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_ExternalInterface.cpp @@ -137,7 +137,7 @@ FfiOpaqueHandle library_smoke_ExternalInterface_SomeStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -145,20 +145,20 @@ library_smoke_ExternalInterface_SomeStruct_create_handle_nullable(FfiOpaqueHandl void library_smoke_ExternalInterface_SomeStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_ExternalInterface_SomeStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_ExternalInterface_SomeEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -166,13 +166,13 @@ library_smoke_ExternalInterface_SomeEnum_create_handle_nullable(uint32_t value) void library_smoke_ExternalInterface_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ExternalInterface_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Structs.cpp b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Structs.cpp index b32afe24c5..dd89fa549d 100644 --- a/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Structs.cpp +++ b/gluecodium/src/test/resources/smoke/external_types/output/dart/ffi/ffi_smoke_Structs.cpp @@ -96,7 +96,7 @@ FfiOpaqueHandle library_smoke_Structs_ExternalStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( *reinterpret_cast(value) ) ); @@ -104,13 +104,13 @@ library_smoke_Structs_ExternalStruct_create_handle_nullable(FfiOpaqueHandle valu void library_smoke_Structs_ExternalStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_ExternalStruct_get_value_nullable(FfiOpaqueHandle handle) { return reinterpret_cast(new (std::nothrow) smoke::Structs::ExternalStruct( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) )); } FfiOpaqueHandle @@ -133,7 +133,7 @@ FfiOpaqueHandle library_smoke_Structs_AnotherExternalStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( *reinterpret_cast(value) ) ); @@ -141,13 +141,13 @@ library_smoke_Structs_AnotherExternalStruct_create_handle_nullable(FfiOpaqueHand void library_smoke_Structs_AnotherExternalStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_AnotherExternalStruct_get_value_nullable(FfiOpaqueHandle handle) { return reinterpret_cast(new (std::nothrow) fire::SomeVeryExternalStruct( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) )); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/field_constructors/output/android/jni/com_example_smoke_ImmutableStructWithClash__Conversion.cpp b/gluecodium/src/test/resources/smoke/field_constructors/output/android/jni/com_example_smoke_ImmutableStructWithClash__Conversion.cpp index d676bad9f9..ef7d01df4f 100644 --- a/gluecodium/src/test/resources/smoke/field_constructors/output/android/jni/com_example_smoke_ImmutableStructWithClash__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/field_constructors/output/android/jni/com_example_smoke_ImmutableStructWithClash__Conversion.cpp @@ -30,12 +30,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::I (bool*)nullptr ); return ::smoke::ImmutableStructWithClash(std::move(n_bool_field), std::move(n_int_field), std::move(n_string_field)); } -std::optional<::smoke::ImmutableStructWithClash> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::ImmutableStructWithClash>*) +::gluecodium::optional<::smoke::ImmutableStructWithClash> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::ImmutableStructWithClash>*) { return _jinput - ? std::optional<::smoke::ImmutableStructWithClash>(convert_from_jni(_jenv, _jinput, (::smoke::ImmutableStructWithClash*)nullptr)) - : std::optional<::smoke::ImmutableStructWithClash>{}; + ? ::gluecodium::optional<::smoke::ImmutableStructWithClash>(convert_from_jni(_jenv, _jinput, (::smoke::ImmutableStructWithClash*)nullptr)) + : ::gluecodium::optional<::smoke::ImmutableStructWithClash>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/ImmutableStructWithClash", com_example_smoke_ImmutableStructWithClash, ::smoke::ImmutableStructWithClash) JniReference @@ -49,7 +49,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::ImmutableStructWithClash& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::ImmutableStructWithClash> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::ImmutableStructWithClash> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/field_constructors/output/cbridge/src/smoke/cbridge_ImmutableStructWithClash.cpp b/gluecodium/src/test/resources/smoke/field_constructors/output/cbridge/src/smoke/cbridge_ImmutableStructWithClash.cpp index 7d7db81a61..6696e20286 100644 --- a/gluecodium/src/test/resources/smoke/field_constructors/output/cbridge/src/smoke/cbridge_ImmutableStructWithClash.cpp +++ b/gluecodium/src/test/resources/smoke/field_constructors/output/cbridge/src/smoke/cbridge_ImmutableStructWithClash.cpp @@ -3,11 +3,11 @@ #include "cbridge/include/smoke/cbridge_ImmutableStructWithClash.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/ImmutableStructWithClash.h" #include #include #include -#include #include _baseRef smoke_ImmutableStructWithClash_create_handle( _baseRef stringField, int32_t intField, bool boolField ) @@ -29,16 +29,16 @@ smoke_ImmutableStructWithClash_create_optional_handle(_baseRef stringField, int3 auto _stringField = Conversion<::std::string>::toCpp( stringField ); auto _intField = intField; auto _boolField = boolField; - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::ImmutableStructWithClash>( ::smoke::ImmutableStructWithClash( _boolField, _intField, _stringField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::ImmutableStructWithClash>( ::smoke::ImmutableStructWithClash( _boolField, _intField, _stringField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ImmutableStructWithClash_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::ImmutableStructWithClash>*>( handle ) ); } void smoke_ImmutableStructWithClash_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::ImmutableStructWithClash>*>( handle ); } _baseRef smoke_ImmutableStructWithClash_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/field_constructors/output/dart/ffi/ffi_smoke_ImmutableStructWithClash.cpp b/gluecodium/src/test/resources/smoke/field_constructors/output/dart/ffi/ffi_smoke_ImmutableStructWithClash.cpp index 52fa26b4dd..c5408bf77f 100644 --- a/gluecodium/src/test/resources/smoke/field_constructors/output/dart/ffi/ffi_smoke_ImmutableStructWithClash.cpp +++ b/gluecodium/src/test/resources/smoke/field_constructors/output/dart/ffi/ffi_smoke_ImmutableStructWithClash.cpp @@ -40,7 +40,7 @@ FfiOpaqueHandle library_smoke_ImmutableStructWithClash_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -48,13 +48,13 @@ library_smoke_ImmutableStructWithClash_create_handle_nullable(FfiOpaqueHandle va void library_smoke_ImmutableStructWithClash_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_ImmutableStructWithClash_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_GenericTypesWithBasicTypes_StructWithGenerics__Conversion.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_GenericTypesWithBasicTypes_StructWithGenerics__Conversion.cpp index 8bebb935d7..09fd81f8df 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_GenericTypesWithBasicTypes_StructWithGenerics__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_GenericTypesWithBasicTypes_StructWithGenerics__Conversion.cpp @@ -31,12 +31,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::G _nout.numbers_set = n_numbers_set; return _nout; } -std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>*) +::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>*) { return _jinput - ? std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>(convert_from_jni(_jenv, _jinput, (::smoke::GenericTypesWithBasicTypes::StructWithGenerics*)nullptr)) - : std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>{}; + ? ::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>(convert_from_jni(_jenv, _jinput, (::smoke::GenericTypesWithBasicTypes::StructWithGenerics*)nullptr)) + : ::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/GenericTypesWithBasicTypes$StructWithGenerics", com_example_smoke_GenericTypesWithBasicTypes_00024StructWithGenerics, ::smoke::GenericTypesWithBasicTypes::StructWithGenerics) JniReference @@ -53,7 +53,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::GenericTypesWithBasicTypes::StructW return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_UseOptimizedListStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_UseOptimizedListStruct__Conversion.cpp index f9dd82a67a..8999a1664c 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_UseOptimizedListStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/android/jni/com_example_smoke_UseOptimizedListStruct__Conversion.cpp @@ -21,12 +21,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::U auto& n_classes = **reinterpret_cast >>*>(classes_handle); return ::smoke::UseOptimizedListStruct(std::move(n_structs), std::move(n_classes)); } -std::optional<::smoke::UseOptimizedListStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::UseOptimizedListStruct>*) +::gluecodium::optional<::smoke::UseOptimizedListStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::UseOptimizedListStruct>*) { return _jinput - ? std::optional<::smoke::UseOptimizedListStruct>(convert_from_jni(_jenv, _jinput, (::smoke::UseOptimizedListStruct*)nullptr)) - : std::optional<::smoke::UseOptimizedListStruct>{}; + ? ::gluecodium::optional<::smoke::UseOptimizedListStruct>(convert_from_jni(_jenv, _jinput, (::smoke::UseOptimizedListStruct*)nullptr)) + : ::gluecodium::optional<::smoke::UseOptimizedListStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/UseOptimizedListStruct", com_example_smoke_UseOptimizedListStruct, ::smoke::UseOptimizedListStruct) JniReference @@ -41,7 +41,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::UseOptimizedListStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::UseOptimizedListStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::UseOptimizedListStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/GenericCollections.cpp index 8a6d3245be..00e257352e 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/GenericCollections.cpp @@ -1,25 +1,25 @@ // // -#include "cbridge/include/GenericCollections.h" -#include "alien/FooEnum.h" -#include "alien/FooStruct.h" -#include "cbridge/include/StringHandle.h" -#include "cbridge_internal/include/BaseHandleImpl.h" -#include "gluecodium/Hash.h" -#include "gluecodium/UnorderedMapHash.h" -#include "gluecodium/UnorderedSetHash.h" -#include "gluecodium/VectorHash.h" -#include "smoke/AnotherDummyClass.h" -#include "smoke/AuxStruct.h" -#include "smoke/DummyClass.h" -#include "smoke/DummyInterface.h" -#include "smoke/GenericTypesWithCompoundTypes.h" -#include "smoke/UnreasonablyLazyClass.h" -#include "smoke/VeryBigStruct.h" -#include "smoke/YetAnotherDummyClass.h" +#include "cbridge\include\GenericCollections.h" +#include "alien\FooEnum.h" +#include "alien\FooStruct.h" +#include "cbridge\include\StringHandle.h" +#include "cbridge_internal\include\BaseHandleImpl.h" +#include "gluecodium\Hash.h" +#include "gluecodium\Optional.h" +#include "gluecodium\UnorderedMapHash.h" +#include "gluecodium\UnorderedSetHash.h" +#include "gluecodium\VectorHash.h" +#include "smoke\AnotherDummyClass.h" +#include "smoke\AuxStruct.h" +#include "smoke\DummyClass.h" +#include "smoke\DummyInterface.h" +#include "smoke\GenericTypesWithCompoundTypes.h" +#include "smoke\UnreasonablyLazyClass.h" +#include "smoke\VeryBigStruct.h" +#include "smoke\YetAnotherDummyClass.h" #include #include -#include #include #include #include @@ -45,13 +45,13 @@ void foobar_ArrayOf__Float_append( _baseRef handle, float item ) Conversion<::std::vector< float >>::toCpp(handle).push_back( item ); } _baseRef foobar_ArrayOf__Float_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< float >>( ::std::vector< float >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< float >>( ::std::vector< float >( ) ) ); } void foobar_ArrayOf__Float_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< float >>*>( handle ); } _baseRef foobar_ArrayOf__Float_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< float >>*>( handle ) ); } _baseRef foobar_ArrayOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< int32_t >( ) ); @@ -73,13 +73,13 @@ void foobar_ArrayOf__Int_append( _baseRef handle, int32_t item ) Conversion<::std::vector< int32_t >>::toCpp(handle).push_back( item ); } _baseRef foobar_ArrayOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< int32_t >>( ::std::vector< int32_t >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< int32_t >>( ::std::vector< int32_t >( ) ) ); } void foobar_ArrayOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< int32_t >>*>( handle ); } _baseRef foobar_ArrayOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< int32_t >>*>( handle ) ); } _baseRef foobar_ArrayOf__String_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::string >( ) ); @@ -101,13 +101,13 @@ void foobar_ArrayOf__String_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::string >>::toCpp(handle).push_back(Conversion<::std::string>::toCpp(item)); } _baseRef foobar_ArrayOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); } void foobar_ArrayOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ); } _baseRef foobar_ArrayOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ) ); } _baseRef foobar_ArrayOf__UByte_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< uint8_t >( ) ); @@ -129,13 +129,13 @@ void foobar_ArrayOf__UByte_append( _baseRef handle, uint8_t item ) Conversion<::std::vector< uint8_t >>::toCpp(handle).push_back( item ); } _baseRef foobar_ArrayOf__UByte_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< uint8_t >>( ::std::vector< uint8_t >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< uint8_t >>( ::std::vector< uint8_t >( ) ) ); } void foobar_ArrayOf__UByte_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< uint8_t >>*>( handle ); } _baseRef foobar_ArrayOf__UByte_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< uint8_t >>*>( handle ) ); } _baseRef foobar_ArrayOf_foobar_ArrayOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::vector< int32_t > >( ) ); @@ -157,13 +157,13 @@ void foobar_ArrayOf_foobar_ArrayOf__Int_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::vector< int32_t > >>::toCpp(handle).push_back(Conversion<::std::vector< int32_t >>::toCpp(item)); } _baseRef foobar_ArrayOf_foobar_ArrayOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::vector< int32_t > >>( ::std::vector< ::std::vector< int32_t > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::vector< int32_t > >>( ::std::vector< ::std::vector< int32_t > >( ) ) ); } void foobar_ArrayOf_foobar_ArrayOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::vector< int32_t > >>*>( handle ); } _baseRef foobar_ArrayOf_foobar_ArrayOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::vector< int32_t > >>*>( handle ) ); } _baseRef foobar_ArrayOf_foobar_MapOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::unordered_map< int32_t, bool > >( ) ); @@ -185,13 +185,13 @@ void foobar_ArrayOf_foobar_MapOf__Int_To__Boolean_append( _baseRef handle, _base Conversion<::std::vector< ::std::unordered_map< int32_t, bool > >>::toCpp(handle).push_back(Conversion<::std::unordered_map< int32_t, bool >>::toCpp(item)); } _baseRef foobar_ArrayOf_foobar_MapOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::unordered_map< int32_t, bool > >>( ::std::vector< ::std::unordered_map< int32_t, bool > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::unordered_map< int32_t, bool > >>( ::std::vector< ::std::unordered_map< int32_t, bool > >( ) ) ); } void foobar_ArrayOf_foobar_MapOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::unordered_map< int32_t, bool > >>*>( handle ); } _baseRef foobar_ArrayOf_foobar_MapOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::unordered_map< int32_t, bool > >>*>( handle ) ); } _baseRef foobar_ArrayOf_foobar_SetOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::unordered_set< int32_t > >( ) ); @@ -213,13 +213,13 @@ void foobar_ArrayOf_foobar_SetOf__Int_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::unordered_set< int32_t > >>::toCpp(handle).push_back(Conversion<::std::unordered_set< int32_t >>::toCpp(item)); } _baseRef foobar_ArrayOf_foobar_SetOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::unordered_set< int32_t > >>( ::std::vector< ::std::unordered_set< int32_t > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::unordered_set< int32_t > >>( ::std::vector< ::std::unordered_set< int32_t > >( ) ) ); } void foobar_ArrayOf_foobar_SetOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::unordered_set< int32_t > >>*>( handle ); } _baseRef foobar_ArrayOf_foobar_SetOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::unordered_set< int32_t > >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_AnotherDummyClass_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >( ) ); @@ -241,13 +241,13 @@ void foobar_ArrayOf_smoke_AnotherDummyClass_append( _baseRef handle, _baseRef it Conversion<::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >>::toCpp(handle).push_back(Conversion<::std::shared_ptr< ::smoke::AnotherDummyClass >>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_AnotherDummyClass_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >( ) ) ); } void foobar_ArrayOf_smoke_AnotherDummyClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_AnotherDummyClass_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::AnotherDummyClass > >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_AuxStruct_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::smoke::AuxStruct >( ) ); @@ -269,13 +269,13 @@ void foobar_ArrayOf_smoke_AuxStruct_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::smoke::AuxStruct >>::toCpp(handle).push_back(Conversion<::smoke::AuxStruct>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_AuxStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::smoke::AuxStruct >>( ::std::vector< ::smoke::AuxStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::smoke::AuxStruct >>( ::std::vector< ::smoke::AuxStruct >( ) ) ); } void foobar_ArrayOf_smoke_AuxStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::AuxStruct >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_AuxStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::AuxStruct >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_DummyClass_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >( ) ); @@ -297,13 +297,13 @@ void foobar_ArrayOf_smoke_DummyClass_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >>::toCpp(handle).push_back(Conversion<::std::shared_ptr< ::smoke::DummyClass >>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_DummyClass_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >( ) ) ); } void foobar_ArrayOf_smoke_DummyClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_DummyClass_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyClass > >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_DummyInterface_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >( ) ); @@ -325,13 +325,13 @@ void foobar_ArrayOf_smoke_DummyInterface_append( _baseRef handle, _baseRef item Conversion<::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >>::toCpp(handle).push_back(Conversion<::std::shared_ptr< ::smoke::DummyInterface >>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_DummyInterface_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >>( ::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >>( ::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >( ) ) ); } void foobar_ArrayOf_smoke_DummyInterface_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_DummyInterface_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::DummyInterface > >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >( ) ); @@ -353,13 +353,13 @@ void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_append( _bas Conversion<::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>::toCpp(handle).push_back(Conversion<::smoke::GenericTypesWithCompoundTypes::BasicStruct>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>( ::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>( ::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >( ) ) ); } void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::alien::FooEnum >( ) ); @@ -381,13 +381,13 @@ void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_append( _ba Conversion<::std::vector< ::alien::FooEnum >>::toCpp(handle).push_back( static_cast<::alien::FooEnum>( item ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::alien::FooEnum >>( ::std::vector< ::alien::FooEnum >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::alien::FooEnum >>( ::std::vector< ::alien::FooEnum >( ) ) ); } void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::alien::FooEnum >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::alien::FooEnum >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::alien::FooStruct >( ) ); @@ -409,13 +409,13 @@ void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_append( _ Conversion<::std::vector< ::alien::FooStruct >>::toCpp(handle).push_back(Conversion<::alien::FooStruct>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::alien::FooStruct >>( ::std::vector< ::alien::FooStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::alien::FooStruct >>( ::std::vector< ::alien::FooStruct >( ) ) ); } void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::alien::FooStruct >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::alien::FooStruct >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >( ) ); @@ -437,13 +437,13 @@ void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_append( _baseRe Conversion<::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>::toCpp(handle).push_back( static_cast<::smoke::GenericTypesWithCompoundTypes::SomeEnum>( item ) ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>( ::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>( ::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >( ) ) ); } void foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_UnreasonablyLazyClass_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >( ) ); @@ -465,13 +465,13 @@ void foobar_ArrayOf_smoke_UnreasonablyLazyClass_append( _baseRef handle, _baseRe Conversion<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>::toCpp(handle).push_back(Conversion<::std::shared_ptr< ::smoke::UnreasonablyLazyClass >>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_UnreasonablyLazyClass_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >( ) ) ); } void foobar_ArrayOf_smoke_UnreasonablyLazyClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_UnreasonablyLazyClass_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_VeryBigStruct_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::smoke::VeryBigStruct >( ) ); @@ -493,13 +493,13 @@ void foobar_ArrayOf_smoke_VeryBigStruct_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::smoke::VeryBigStruct >>::toCpp(handle).push_back(Conversion<::smoke::VeryBigStruct>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_VeryBigStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::smoke::VeryBigStruct >>( ::std::vector< ::smoke::VeryBigStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::smoke::VeryBigStruct >>( ::std::vector< ::smoke::VeryBigStruct >( ) ) ); } void foobar_ArrayOf_smoke_VeryBigStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::VeryBigStruct >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_VeryBigStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::smoke::VeryBigStruct >>*>( handle ) ); } _baseRef foobar_ArrayOf_smoke_YetAnotherDummyClass_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >( ) ); @@ -521,13 +521,13 @@ void foobar_ArrayOf_smoke_YetAnotherDummyClass_append( _baseRef handle, _baseRef Conversion<::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >>::toCpp(handle).push_back(Conversion<::std::shared_ptr< ::smoke::YetAnotherDummyClass >>::toCpp(item)); } _baseRef foobar_ArrayOf_smoke_YetAnotherDummyClass_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >>( ::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >( ) ) ); } void foobar_ArrayOf_smoke_YetAnotherDummyClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >>*>( handle ); } _baseRef foobar_ArrayOf_smoke_YetAnotherDummyClass_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::shared_ptr< ::smoke::YetAnotherDummyClass > >>*>( handle ) ); } _baseRef foobar_MapOf__Float_To__Double_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< float, double >() ); @@ -559,13 +559,13 @@ double foobar_MapOf__Float_To__Double_iterator_value(_baseRef iterator_handle) { return value; } _baseRef foobar_MapOf__Float_To__Double_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< float, double >>( ::std::unordered_map< float, double >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< float, double >>( ::std::unordered_map< float, double >( ) ) ); } void foobar_MapOf__Float_To__Double_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< float, double >>*>( handle ); } _baseRef foobar_MapOf__Float_To__Double_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< float, double >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, bool >() ); @@ -597,13 +597,13 @@ bool foobar_MapOf__Int_To__Boolean_iterator_value(_baseRef iterator_handle) { return value; } _baseRef foobar_MapOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, bool >>( ::std::unordered_map< int32_t, bool >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, bool >>( ::std::unordered_map< int32_t, bool >( ) ) ); } void foobar_MapOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, bool >>*>( handle ); } _baseRef foobar_MapOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, bool >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_foobar_ArrayOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::std::vector< int32_t > >() ); @@ -635,13 +635,13 @@ _baseRef foobar_MapOf__Int_To_foobar_ArrayOf__Int_iterator_value(_baseRef iterat return Conversion<::std::vector< int32_t >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_foobar_ArrayOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::std::vector< int32_t > >>( ::std::unordered_map< int32_t, ::std::vector< int32_t > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::std::vector< int32_t > >>( ::std::unordered_map< int32_t, ::std::vector< int32_t > >( ) ) ); } void foobar_MapOf__Int_To_foobar_ArrayOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::vector< int32_t > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_foobar_ArrayOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::vector< int32_t > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_foobar_MapOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >() ); @@ -673,13 +673,13 @@ _baseRef foobar_MapOf__Int_To_foobar_MapOf__Int_To__Boolean_iterator_value(_base return Conversion<::std::unordered_map< int32_t, bool >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_foobar_MapOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >>( ::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >>( ::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >( ) ) ); } void foobar_MapOf__Int_To_foobar_MapOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_foobar_MapOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_map< int32_t, bool > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_foobar_SetOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >() ); @@ -711,13 +711,13 @@ _baseRef foobar_MapOf__Int_To_foobar_SetOf__Int_iterator_value(_baseRef iterator return Conversion<::std::unordered_set< int32_t >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_foobar_SetOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >>( ::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >>( ::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >( ) ) ); } void foobar_MapOf__Int_To_foobar_SetOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_foobar_SetOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::unordered_set< int32_t > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_smoke_DummyClass_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >() ); @@ -749,13 +749,13 @@ _baseRef foobar_MapOf__Int_To_smoke_DummyClass_iterator_value(_baseRef iterator_ return Conversion<::std::shared_ptr< ::smoke::DummyClass >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_smoke_DummyClass_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >>( ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >>( ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >( ) ) ); } void foobar_MapOf__Int_To_smoke_DummyClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_smoke_DummyClass_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyClass > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_smoke_DummyInterface_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >() ); @@ -787,13 +787,13 @@ _baseRef foobar_MapOf__Int_To_smoke_DummyInterface_iterator_value(_baseRef itera return Conversion<::std::shared_ptr< ::smoke::DummyInterface >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_smoke_DummyInterface_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >>( ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >>( ::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >( ) ) ); } void foobar_MapOf__Int_To_smoke_DummyInterface_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_smoke_DummyInterface_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::std::shared_ptr< ::smoke::DummyInterface > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::alien::FooEnum >() ); @@ -825,13 +825,13 @@ uint32_t foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_ExternalEnum_i return static_cast(value); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::alien::FooEnum >>( ::std::unordered_map< int32_t, ::alien::FooEnum >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::alien::FooEnum >>( ::std::unordered_map< int32_t, ::alien::FooEnum >( ) ) ); } void foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::alien::FooEnum >>*>( handle ); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_ExternalEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::alien::FooEnum >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >() ); @@ -863,13 +863,13 @@ uint32_t foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_SomeEnum_itera return static_cast(value); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>( ::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>( ::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >( ) ) ); } void foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>*>( handle ); } _baseRef foobar_MapOf__Int_To_smoke_GenericTypesWithCompoundTypes_SomeEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::smoke::GenericTypesWithCompoundTypes::SomeEnum >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::std::string >() ); @@ -901,13 +901,13 @@ _baseRef foobar_MapOf__String_To__String_iterator_value(_baseRef iterator_handle return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__String_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::std::string >>( ::std::unordered_map< ::std::string, ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>( ::std::unordered_map< ::std::string, ::std::string >( ) ) ); } void foobar_MapOf__String_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>*>( handle ); } _baseRef foobar_MapOf__String_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::std::string >>*>( handle ) ); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >() ); @@ -939,13 +939,13 @@ _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_BasicStruct return Conversion<::smoke::GenericTypesWithCompoundTypes::BasicStruct>::toBaseRef(value); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>( ::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>( ::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >( ) ) ); } void foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_BasicStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>*>( handle ); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_BasicStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::smoke::GenericTypesWithCompoundTypes::BasicStruct >>*>( handle ) ); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::alien::FooStruct >() ); @@ -977,13 +977,13 @@ _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_ExternalStr return Conversion<::alien::FooStruct>::toBaseRef(value); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::alien::FooStruct >>( ::std::unordered_map< ::std::string, ::alien::FooStruct >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::alien::FooStruct >>( ::std::unordered_map< ::std::string, ::alien::FooStruct >( ) ) ); } void foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::alien::FooStruct >>*>( handle ); } _baseRef foobar_MapOf__String_To_smoke_GenericTypesWithCompoundTypes_ExternalStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::alien::FooStruct >>*>( handle ) ); } _baseRef foobar_MapOf__UByte_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< uint8_t, ::std::string >() ); @@ -1015,13 +1015,13 @@ _baseRef foobar_MapOf__UByte_To__String_iterator_value(_baseRef iterator_handle) return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__UByte_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< uint8_t, ::std::string >>( ::std::unordered_map< uint8_t, ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< uint8_t, ::std::string >>( ::std::unordered_map< uint8_t, ::std::string >( ) ) ); } void foobar_MapOf__UByte_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< uint8_t, ::std::string >>*>( handle ); } _baseRef foobar_MapOf__UByte_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< uint8_t, ::std::string >>*>( handle ) ); } _baseRef foobar_MapOf_foobar_ArrayOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >() ); @@ -1053,13 +1053,13 @@ bool foobar_MapOf_foobar_ArrayOf__Int_To__Boolean_iterator_value(_baseRef iterat return value; } _baseRef foobar_MapOf_foobar_ArrayOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>( ::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>( ::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >( ) ) ); } void foobar_MapOf_foobar_ArrayOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ); } _baseRef foobar_MapOf_foobar_ArrayOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::vector< int32_t >, bool, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ) ); } _baseRef foobar_MapOf_foobar_MapOf__Int_To__Boolean_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >() ); @@ -1091,13 +1091,13 @@ bool foobar_MapOf_foobar_MapOf__Int_To__Boolean_To__Boolean_iterator_value(_base return value; } _baseRef foobar_MapOf_foobar_MapOf__Int_To__Boolean_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>( ::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>( ::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >( ) ) ); } void foobar_MapOf_foobar_MapOf__Int_To__Boolean_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ); } _baseRef foobar_MapOf_foobar_MapOf__Int_To__Boolean_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::unordered_map< int32_t, bool >, bool, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ) ); } _baseRef foobar_MapOf_foobar_SetOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >() ); @@ -1129,13 +1129,13 @@ bool foobar_MapOf_foobar_SetOf__Int_To__Boolean_iterator_value(_baseRef iterator return value; } _baseRef foobar_MapOf_foobar_SetOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>( ::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>( ::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >( ) ) ); } void foobar_MapOf_foobar_SetOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ); } _baseRef foobar_MapOf_foobar_SetOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::unordered_set< int32_t >, bool, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ) ); } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >() ); @@ -1167,13 +1167,13 @@ bool foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_To__Boolean_i return value; } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >>( ::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >>( ::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >( ) ) ); } void foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >>*>( handle ); } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::alien::FooEnum, bool, ::gluecodium::hash< ::alien::FooEnum > >>*>( handle ) ); } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >() ); @@ -1205,13 +1205,13 @@ bool foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_To__Boolean_itera return value; } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>( ::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>( ::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >( ) ) ); } void foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>*>( handle ); } _baseRef foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, bool, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>*>( handle ) ); } _baseRef foobar_SetOf__Float_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< float >() ); @@ -1239,13 +1239,13 @@ float foobar_SetOf__Float_iterator_get(_baseRef iterator_handle) { return value; } _baseRef foobar_SetOf__Float_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< float >>( ::std::unordered_set< float >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< float >>( ::std::unordered_set< float >( ) ) ); } void foobar_SetOf__Float_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< float >>*>( handle ); } _baseRef foobar_SetOf__Float_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< float >>*>( handle ) ); } _baseRef foobar_SetOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< int32_t >() ); @@ -1273,13 +1273,13 @@ int32_t foobar_SetOf__Int_iterator_get(_baseRef iterator_handle) { return value; } _baseRef foobar_SetOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< int32_t >>( ::std::unordered_set< int32_t >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< int32_t >>( ::std::unordered_set< int32_t >( ) ) ); } void foobar_SetOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< int32_t >>*>( handle ); } _baseRef foobar_SetOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< int32_t >>*>( handle ) ); } _baseRef foobar_SetOf__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::string >() ); @@ -1307,13 +1307,13 @@ _baseRef foobar_SetOf__String_iterator_get(_baseRef iterator_handle) { return Conversion<::std::string>::referenceBaseRef(value); } _baseRef foobar_SetOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::string >>( ::std::unordered_set< ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::string >>( ::std::unordered_set< ::std::string >( ) ) ); } void foobar_SetOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::string >>*>( handle ); } _baseRef foobar_SetOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::string >>*>( handle ) ); } _baseRef foobar_SetOf__UByte_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< uint8_t >() ); @@ -1341,13 +1341,13 @@ uint8_t foobar_SetOf__UByte_iterator_get(_baseRef iterator_handle) { return value; } _baseRef foobar_SetOf__UByte_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< uint8_t >>( ::std::unordered_set< uint8_t >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< uint8_t >>( ::std::unordered_set< uint8_t >( ) ) ); } void foobar_SetOf__UByte_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< uint8_t >>*>( handle ); } _baseRef foobar_SetOf__UByte_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< uint8_t >>*>( handle ) ); } _baseRef foobar_SetOf_foobar_ArrayOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >() ); @@ -1375,13 +1375,13 @@ _baseRef foobar_SetOf_foobar_ArrayOf__Int_iterator_get(_baseRef iterator_handle) return Conversion<::std::vector< int32_t >>::referenceBaseRef(value); } _baseRef foobar_SetOf_foobar_ArrayOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >>( ::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >>( ::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >( ) ) ); } void foobar_SetOf_foobar_ArrayOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ); } _baseRef foobar_SetOf_foobar_ArrayOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::vector< int32_t >, ::gluecodium::hash< ::std::vector< int32_t > > >>*>( handle ) ); } _baseRef foobar_SetOf_foobar_MapOf__Int_To__Boolean_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >() ); @@ -1409,13 +1409,13 @@ _baseRef foobar_SetOf_foobar_MapOf__Int_To__Boolean_iterator_get(_baseRef iterat return Conversion<::std::unordered_map< int32_t, bool >>::referenceBaseRef(value); } _baseRef foobar_SetOf_foobar_MapOf__Int_To__Boolean_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>( ::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>( ::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >( ) ) ); } void foobar_SetOf_foobar_MapOf__Int_To__Boolean_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ); } _baseRef foobar_SetOf_foobar_MapOf__Int_To__Boolean_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::unordered_map< int32_t, bool >, ::gluecodium::hash< ::std::unordered_map< int32_t, bool > > >>*>( handle ) ); } _baseRef foobar_SetOf_foobar_SetOf__Int_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >() ); @@ -1443,13 +1443,13 @@ _baseRef foobar_SetOf_foobar_SetOf__Int_iterator_get(_baseRef iterator_handle) { return Conversion<::std::unordered_set< int32_t >>::referenceBaseRef(value); } _baseRef foobar_SetOf_foobar_SetOf__Int_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>( ::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>( ::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >( ) ) ); } void foobar_SetOf_foobar_SetOf__Int_release_optional_handle(_baseRef handle) { - delete reinterpret_cast, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ); } _baseRef foobar_SetOf_foobar_SetOf__Int_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::std::unordered_set< int32_t >, ::gluecodium::hash< ::std::unordered_set< int32_t > > >>*>( handle ) ); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >() ); @@ -1477,13 +1477,13 @@ uint32_t foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_iterator_ return static_cast(value); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >>( ::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >>( ::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >( ) ) ); } void foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >>*>( handle ); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::alien::FooEnum, ::gluecodium::hash< ::alien::FooEnum > >>*>( handle ) ); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >() ); @@ -1511,11 +1511,11 @@ uint32_t foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_iterator_get( return static_cast(value); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>( ::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>( ::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >( ) ) ); } void foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>*>( handle ); } _baseRef foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::smoke::GenericTypesWithCompoundTypes::SomeEnum, ::gluecodium::hash< ::smoke::GenericTypesWithCompoundTypes::SomeEnum > >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithBasicTypes.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithBasicTypes.cpp index 2d27e5a83a..15a040d6b6 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithBasicTypes.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithBasicTypes.cpp @@ -5,6 +5,7 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" @@ -12,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +91,7 @@ smoke_GenericTypesWithBasicTypes_StructWithGenerics_release_handle( _baseRef han _baseRef smoke_GenericTypesWithBasicTypes_StructWithGenerics_create_optional_handle(_baseRef numbersList, _baseRef numbersMap, _baseRef numbersSet) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>( ::smoke::GenericTypesWithBasicTypes::StructWithGenerics( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>( ::smoke::GenericTypesWithBasicTypes::StructWithGenerics( ) ); (*_struct)->numbers_list = Conversion<::std::vector< uint8_t >>::toCpp( numbersList ); (*_struct)->numbers_map = Conversion<::std::unordered_map< uint8_t, ::std::string >>::toCpp( numbersMap ); (*_struct)->numbers_set = Conversion<::std::unordered_set< uint8_t >>::toCpp( numbersSet ); @@ -100,10 +100,10 @@ smoke_GenericTypesWithBasicTypes_StructWithGenerics_create_optional_handle(_base _baseRef smoke_GenericTypesWithBasicTypes_StructWithGenerics_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>*>( handle ) ); } void smoke_GenericTypesWithBasicTypes_StructWithGenerics_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::GenericTypesWithBasicTypes::StructWithGenerics>*>( handle ); } _baseRef smoke_GenericTypesWithBasicTypes_StructWithGenerics_numbersList_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithCompoundTypes.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithCompoundTypes.cpp index 7d78655342..61eee83df0 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithCompoundTypes.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_GenericTypesWithCompoundTypes.cpp @@ -8,6 +8,7 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "gluecodium/Hash.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/UnorderedSetHash.h" #include "gluecodium/VectorHash.h" @@ -17,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -82,17 +82,17 @@ smoke_GenericTypesWithCompoundTypes_BasicStruct_release_handle( _baseRef handle _baseRef smoke_GenericTypesWithCompoundTypes_BasicStruct_create_optional_handle(double value) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::GenericTypesWithCompoundTypes::BasicStruct>( ::smoke::GenericTypesWithCompoundTypes::BasicStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::GenericTypesWithCompoundTypes::BasicStruct>( ::smoke::GenericTypesWithCompoundTypes::BasicStruct( ) ); (*_struct)->value = value; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_GenericTypesWithCompoundTypes_BasicStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::GenericTypesWithCompoundTypes::BasicStruct>*>( handle ) ); } void smoke_GenericTypesWithCompoundTypes_BasicStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::GenericTypesWithCompoundTypes::BasicStruct>*>( handle ); } double smoke_GenericTypesWithCompoundTypes_BasicStruct_value_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -113,17 +113,17 @@ smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_handle( _baseRef hand _baseRef smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_optional_handle(_baseRef string) { - auto _struct = new ( ::std::nothrow ) std::optional<::alien::FooStruct>( ::alien::FooStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::alien::FooStruct>( ::alien::FooStruct( ) ); (*_struct)->string = Conversion<::std::string>::toCpp( string ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_GenericTypesWithCompoundTypes_ExternalStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::alien::FooStruct>*>( handle ) ); } void smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::alien::FooStruct>*>( handle ); } _baseRef smoke_GenericTypesWithCompoundTypes_ExternalStruct_string_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct.cpp index 55ca7a4109..7753df8273 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct.cpp @@ -1,14 +1,14 @@ // // -#include "cbridge/include/smoke/cbridge_UseOptimizedListStruct.h" -#include "cbridge_internal/include/BaseHandleImpl.h" -#include "gluecodium/VectorHash.h" -#include "smoke/UnreasonablyLazyClass.h" -#include "smoke/UseOptimizedListStruct.h" -#include "smoke/VeryBigStruct.h" +#include "cbridge\include\smoke\cbridge_UseOptimizedListStruct.h" +#include "cbridge_internal\include\BaseHandleImpl.h" +#include "gluecodium\Optional.h" +#include "gluecodium\VectorHash.h" +#include "smoke\UnreasonablyLazyClass.h" +#include "smoke\UseOptimizedListStruct.h" +#include "smoke\VeryBigStruct.h" #include #include -#include #include _baseRef smoke_UseOptimizedListStruct_create_handle( _baseRef structs, _baseRef classes ) @@ -28,16 +28,16 @@ smoke_UseOptimizedListStruct_create_optional_handle(_baseRef structs, _baseRef c { auto _structs = Conversion<::std::vector< ::std::shared_ptr< ::smoke::VeryBigStruct > >>::toCpp( structs ); auto _classes = Conversion<::std::vector< ::std::shared_ptr< ::smoke::UnreasonablyLazyClass > >>::toCpp( classes ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::UseOptimizedListStruct>( ::smoke::UseOptimizedListStruct( _structs, _classes ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::UseOptimizedListStruct>( ::smoke::UseOptimizedListStruct( _structs, _classes ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_UseOptimizedListStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::UseOptimizedListStruct>*>( handle ) ); } void smoke_UseOptimizedListStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::UseOptimizedListStruct>*>( handle ); } _baseRef smoke_UseOptimizedListStruct_structs_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct_VeryBigStructLazyList.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct_VeryBigStructLazyList.cpp index 69a2dedd35..8d1614737e 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct_VeryBigStructLazyList.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cbridge/src/smoke/cbridge_UseOptimizedListStruct_VeryBigStructLazyList.cpp @@ -3,10 +3,10 @@ #include "cbridge/include/StringHandle.h" #include "cbridge/include/smoke/cbridge_UseOptimizedListStruct_VeryBigStructLazyList.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/VeryBigStruct.h" #include #include -#include #include #ifdef __cplusplus extern "C" { diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/GenericTypesConversion.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/GenericTypesConversion.cpp index 2c8fbd7d2b..a1566ad80f 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/GenericTypesConversion.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/GenericTypesConversion.cpp @@ -67,7 +67,7 @@ FfiOpaqueHandle library_foobar_ListOf_Float_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -75,13 +75,13 @@ library_foobar_ListOf_Float_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_Float_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_Float_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -127,7 +127,7 @@ FfiOpaqueHandle library_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -135,13 +135,13 @@ library_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -187,7 +187,7 @@ FfiOpaqueHandle library_foobar_ListOf_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -195,13 +195,13 @@ library_foobar_ListOf_String_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -247,7 +247,7 @@ FfiOpaqueHandle library_foobar_ListOf_UByte_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -255,13 +255,13 @@ library_foobar_ListOf_UByte_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_UByte_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_UByte_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -307,7 +307,7 @@ FfiOpaqueHandle library_foobar_ListOf_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -315,13 +315,13 @@ library_foobar_ListOf_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle v void library_foobar_ListOf_foobar_ListOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_foobar_ListOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -367,7 +367,7 @@ FfiOpaqueHandle library_foobar_ListOf_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -375,13 +375,13 @@ library_foobar_ListOf_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaq void library_foobar_ListOf_foobar_MapOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_foobar_MapOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -427,7 +427,7 @@ FfiOpaqueHandle library_foobar_ListOf_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -435,13 +435,13 @@ library_foobar_ListOf_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle va void library_foobar_ListOf_foobar_SetOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_foobar_SetOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -487,7 +487,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_AnotherDummyClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -495,13 +495,13 @@ library_foobar_ListOf_smoke_AnotherDummyClass_create_handle_nullable(FfiOpaqueHa void library_foobar_ListOf_smoke_AnotherDummyClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_AnotherDummyClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -547,7 +547,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_DummyClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -555,13 +555,13 @@ library_foobar_ListOf_smoke_DummyClass_create_handle_nullable(FfiOpaqueHandle va void library_foobar_ListOf_smoke_DummyClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_DummyClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -607,7 +607,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_DummyInterface_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -615,13 +615,13 @@ library_foobar_ListOf_smoke_DummyInterface_create_handle_nullable(FfiOpaqueHandl void library_foobar_ListOf_smoke_DummyInterface_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_DummyInterface_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -667,7 +667,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -675,13 +675,13 @@ library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_han void library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_BasicStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -727,7 +727,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -735,13 +735,13 @@ library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_ha void library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -787,7 +787,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -795,13 +795,13 @@ library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_ void library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_ExternalStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -847,7 +847,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -855,13 +855,13 @@ library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle void library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -907,7 +907,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_UnreasonablyLazyClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -915,13 +915,13 @@ library_foobar_ListOf_smoke_UnreasonablyLazyClass_create_handle_nullable(FfiOpaq void library_foobar_ListOf_smoke_UnreasonablyLazyClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_UnreasonablyLazyClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -967,7 +967,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_VeryBigStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -975,13 +975,13 @@ library_foobar_ListOf_smoke_VeryBigStruct_create_handle_nullable(FfiOpaqueHandle void library_foobar_ListOf_smoke_VeryBigStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_VeryBigStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1027,7 +1027,7 @@ FfiOpaqueHandle library_foobar_ListOf_smoke_YetAnotherDummyClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1035,13 +1035,13 @@ library_foobar_ListOf_smoke_YetAnotherDummyClass_create_handle_nullable(FfiOpaqu void library_foobar_ListOf_smoke_YetAnotherDummyClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_smoke_YetAnotherDummyClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1094,7 +1094,7 @@ FfiOpaqueHandle library_foobar_MapOf_Float_to_Double_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1102,13 +1102,13 @@ library_foobar_MapOf_Float_to_Double_create_handle_nullable(FfiOpaqueHandle valu void library_foobar_MapOf_Float_to_Double_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Float_to_Double_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1161,7 +1161,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1169,13 +1169,13 @@ library_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value void library_foobar_MapOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1228,7 +1228,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1236,13 +1236,13 @@ library_foobar_MapOf_Int_to_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHa void library_foobar_MapOf_Int_to_foobar_ListOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_ListOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1295,7 +1295,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1303,13 +1303,13 @@ library_foobar_MapOf_Int_to_foobar_MapOf_Int_to_Boolean_create_handle_nullable(F void library_foobar_MapOf_Int_to_foobar_MapOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_MapOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1362,7 +1362,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1370,13 +1370,13 @@ library_foobar_MapOf_Int_to_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHan void library_foobar_MapOf_Int_to_foobar_SetOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_foobar_SetOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1429,7 +1429,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_DummyClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1437,13 +1437,13 @@ library_foobar_MapOf_Int_to_smoke_DummyClass_create_handle_nullable(FfiOpaqueHan void library_foobar_MapOf_Int_to_smoke_DummyClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_DummyClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1496,7 +1496,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_DummyInterface_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -1504,13 +1504,13 @@ library_foobar_MapOf_Int_to_smoke_DummyInterface_create_handle_nullable(FfiOpaqu void library_foobar_MapOf_Int_to_smoke_DummyInterface_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_DummyInterface_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -1563,7 +1563,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1571,13 +1571,13 @@ library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_ExternalEnum_cre void library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_ExternalEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1630,7 +1630,7 @@ FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1638,13 +1638,13 @@ library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_ void library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Int_to_smoke_GenericTypesWithCompoundTypes_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1697,7 +1697,7 @@ FfiOpaqueHandle library_foobar_MapOf_String_to_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1705,13 +1705,13 @@ library_foobar_MapOf_String_to_String_create_handle_nullable(FfiOpaqueHandle val void library_foobar_MapOf_String_to_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_String_to_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1764,7 +1764,7 @@ FfiOpaqueHandle library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_BasicStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1772,13 +1772,13 @@ library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_BasicStruct_c void library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_BasicStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_BasicStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1831,7 +1831,7 @@ FfiOpaqueHandle library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_ExternalStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1839,13 +1839,13 @@ library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_ExternalStruc void library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_ExternalStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_String_to_smoke_GenericTypesWithCompoundTypes_ExternalStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1898,7 +1898,7 @@ FfiOpaqueHandle library_foobar_MapOf_UByte_to_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -1906,13 +1906,13 @@ library_foobar_MapOf_UByte_to_String_create_handle_nullable(FfiOpaqueHandle valu void library_foobar_MapOf_UByte_to_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_UByte_to_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -1965,7 +1965,7 @@ FfiOpaqueHandle library_foobar_MapOf_foobar_ListOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, bool, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, bool, gluecodium::hash>>>( gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toCpp(value) ) ); @@ -1973,13 +1973,13 @@ library_foobar_MapOf_foobar_ListOf_Int_to_Boolean_create_handle_nullable(FfiOpaq void library_foobar_MapOf_foobar_ListOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_foobar_ListOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toFfi( - **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) + **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2032,7 +2032,7 @@ FfiOpaqueHandle library_foobar_MapOf_foobar_MapOf_Int_to_Boolean_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, bool, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, bool, gluecodium::hash>>>( gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toCpp(value) ) ); @@ -2040,13 +2040,13 @@ library_foobar_MapOf_foobar_MapOf_Int_to_Boolean_to_Boolean_create_handle_nullab void library_foobar_MapOf_foobar_MapOf_Int_to_Boolean_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_foobar_MapOf_Int_to_Boolean_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toFfi( - **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) + **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2099,7 +2099,7 @@ FfiOpaqueHandle library_foobar_MapOf_foobar_SetOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, bool, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, bool, gluecodium::hash>>>( gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toCpp(value) ) ); @@ -2107,13 +2107,13 @@ library_foobar_MapOf_foobar_SetOf_Int_to_Boolean_create_handle_nullable(FfiOpaqu void library_foobar_MapOf_foobar_SetOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, bool, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_foobar_SetOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, bool, gluecodium::hash>>>::toFfi( - **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) + **reinterpret_cast, bool, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2166,7 +2166,7 @@ FfiOpaqueHandle library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -2174,13 +2174,13 @@ library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_to_Boolean void library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -2233,7 +2233,7 @@ FfiOpaqueHandle library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -2241,13 +2241,13 @@ library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_to_Boolean_cre void library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -2293,7 +2293,7 @@ FfiOpaqueHandle library_foobar_SetOf_Float_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -2301,13 +2301,13 @@ library_foobar_SetOf_Float_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_Float_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_Float_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -2353,7 +2353,7 @@ FfiOpaqueHandle library_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -2361,13 +2361,13 @@ library_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -2413,7 +2413,7 @@ FfiOpaqueHandle library_foobar_SetOf_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -2421,13 +2421,13 @@ library_foobar_SetOf_String_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -2473,7 +2473,7 @@ FfiOpaqueHandle library_foobar_SetOf_UByte_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -2481,13 +2481,13 @@ library_foobar_SetOf_UByte_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_UByte_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_UByte_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -2533,7 +2533,7 @@ FfiOpaqueHandle library_foobar_SetOf_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, gluecodium::hash>>>( gluecodium::ffi::Conversion, gluecodium::hash>>>::toCpp(value) ) ); @@ -2541,13 +2541,13 @@ library_foobar_SetOf_foobar_ListOf_Int_create_handle_nullable(FfiOpaqueHandle va void library_foobar_SetOf_foobar_ListOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_foobar_ListOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, gluecodium::hash>>>::toFfi( - **reinterpret_cast, gluecodium::hash>>>*>(handle) + **reinterpret_cast, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2593,7 +2593,7 @@ FfiOpaqueHandle library_foobar_SetOf_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, gluecodium::hash>>>( gluecodium::ffi::Conversion, gluecodium::hash>>>::toCpp(value) ) ); @@ -2601,13 +2601,13 @@ library_foobar_SetOf_foobar_MapOf_Int_to_Boolean_create_handle_nullable(FfiOpaqu void library_foobar_SetOf_foobar_MapOf_Int_to_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_foobar_MapOf_Int_to_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, gluecodium::hash>>>::toFfi( - **reinterpret_cast, gluecodium::hash>>>*>(handle) + **reinterpret_cast, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2653,7 +2653,7 @@ FfiOpaqueHandle library_foobar_SetOf_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional, gluecodium::hash>>>( + new (std::nothrow) gluecodium::optional, gluecodium::hash>>>( gluecodium::ffi::Conversion, gluecodium::hash>>>::toCpp(value) ) ); @@ -2661,13 +2661,13 @@ library_foobar_SetOf_foobar_SetOf_Int_create_handle_nullable(FfiOpaqueHandle val void library_foobar_SetOf_foobar_SetOf_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast, gluecodium::hash>>>*>(handle); + delete reinterpret_cast, gluecodium::hash>>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_foobar_SetOf_Int_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion, gluecodium::hash>>>::toFfi( - **reinterpret_cast, gluecodium::hash>>>*>(handle) + **reinterpret_cast, gluecodium::hash>>>*>(handle) ); } FfiOpaqueHandle @@ -2713,7 +2713,7 @@ FfiOpaqueHandle library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -2721,13 +2721,13 @@ library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_create_han void library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_ExternalEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -2773,7 +2773,7 @@ FfiOpaqueHandle library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -2781,13 +2781,13 @@ library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_create_handle_ void library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_smoke_GenericTypesWithCompoundTypes_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/ffi_smoke_UseOptimizedListStruct.cpp b/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/ffi_smoke_UseOptimizedListStruct.cpp index cf2e362d9d..b179f6ca46 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/ffi_smoke_UseOptimizedListStruct.cpp +++ b/gluecodium/src/test/resources/smoke/generic_types/output/dart/ffi/ffi_smoke_UseOptimizedListStruct.cpp @@ -44,7 +44,7 @@ FfiOpaqueHandle library_smoke_UseOptimizedListStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -52,13 +52,13 @@ library_smoke_UseOptimizedListStruct_create_handle_nullable(FfiOpaqueHandle valu void library_smoke_UseOptimizedListStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_UseOptimizedListStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleClass__Conversion.h b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleClass__Conversion.h index 1ea08ff324..d5277df59f 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleClass__Conversion.h +++ b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleClass__Conversion.h @@ -4,8 +4,8 @@ #pragma once #include "smoke/SimpleClass.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleInterface__Conversion.h b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleInterface__Conversion.h index 85e476a82d..91da93b396 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleInterface__Conversion.h +++ b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_SimpleInterface__Conversion.h @@ -4,8 +4,8 @@ #pragma once #include "smoke/SimpleInterface.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithClass__Conversion.cpp b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithClass__Conversion.cpp index 756d899e9a..84ddef3df3 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithClass__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithClass__Conversion.cpp @@ -21,12 +21,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.class_instance = n_class_instance; return _nout; } -std::optional<::smoke::StructWithClass> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::StructWithClass>*) +::gluecodium::optional<::smoke::StructWithClass> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::StructWithClass>*) { return _jinput - ? std::optional<::smoke::StructWithClass>(convert_from_jni(_jenv, _jinput, (::smoke::StructWithClass*)nullptr)) - : std::optional<::smoke::StructWithClass>{}; + ? ::gluecodium::optional<::smoke::StructWithClass>(convert_from_jni(_jenv, _jinput, (::smoke::StructWithClass*)nullptr)) + : ::gluecodium::optional<::smoke::StructWithClass>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/StructWithClass", com_example_smoke_StructWithClass, ::smoke::StructWithClass) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::StructWithClass& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::StructWithClass> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::StructWithClass> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithInterface__Conversion.cpp b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithInterface__Conversion.cpp index 54107257ec..2ced70b00c 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithInterface__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/android/jni/com_example_smoke_StructWithInterface__Conversion.cpp @@ -21,12 +21,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.interface_instance = n_interface_instance; return _nout; } -std::optional<::smoke::StructWithInterface> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::StructWithInterface>*) +::gluecodium::optional<::smoke::StructWithInterface> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::StructWithInterface>*) { return _jinput - ? std::optional<::smoke::StructWithInterface>(convert_from_jni(_jenv, _jinput, (::smoke::StructWithInterface*)nullptr)) - : std::optional<::smoke::StructWithInterface>{}; + ? ::gluecodium::optional<::smoke::StructWithInterface>(convert_from_jni(_jenv, _jinput, (::smoke::StructWithInterface*)nullptr)) + : ::gluecodium::optional<::smoke::StructWithInterface>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/StructWithInterface", com_example_smoke_StructWithInterface, ::smoke::StructWithInterface) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::StructWithInterface& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::StructWithInterface> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::StructWithInterface> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithClass.cpp b/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithClass.cpp index 1e3e419b50..4c968ca94f 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithClass.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithClass.cpp @@ -2,11 +2,11 @@ // #include "cbridge/include/smoke/cbridge_StructWithClass.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/SimpleClass.h" #include "smoke/StructWithClass.h" #include #include -#include _baseRef smoke_StructWithClass_create_handle( _baseRef classInstance ) { @@ -22,17 +22,17 @@ smoke_StructWithClass_release_handle( _baseRef handle ) _baseRef smoke_StructWithClass_create_optional_handle(_baseRef classInstance) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::StructWithClass>( ::smoke::StructWithClass( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::StructWithClass>( ::smoke::StructWithClass( ) ); (*_struct)->class_instance = Conversion<::std::shared_ptr< ::smoke::SimpleClass >>::toCpp( classInstance ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_StructWithClass_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::StructWithClass>*>( handle ) ); } void smoke_StructWithClass_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::StructWithClass>*>( handle ); } _baseRef smoke_StructWithClass_classInstance_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithInterface.cpp b/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithInterface.cpp index 9bac22223e..ff05c55278 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithInterface.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/cbridge/src/smoke/cbridge_StructWithInterface.cpp @@ -2,11 +2,11 @@ // #include "cbridge/include/smoke/cbridge_StructWithInterface.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/SimpleInterface.h" #include "smoke/StructWithInterface.h" #include #include -#include _baseRef smoke_StructWithInterface_create_handle( _baseRef interfaceInstance ) { @@ -22,17 +22,17 @@ smoke_StructWithInterface_release_handle( _baseRef handle ) _baseRef smoke_StructWithInterface_create_optional_handle(_baseRef interfaceInstance) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::StructWithInterface>( ::smoke::StructWithInterface( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::StructWithInterface>( ::smoke::StructWithInterface( ) ); (*_struct)->interface_instance = Conversion<::std::shared_ptr< ::smoke::SimpleInterface >>::toCpp( interfaceInstance ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_StructWithInterface_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::StructWithInterface>*>( handle ) ); } void smoke_StructWithInterface_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::StructWithInterface>*>( handle ); } _baseRef smoke_StructWithInterface_interfaceInstance_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithClass.cpp b/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithClass.cpp index 5e8da2ba12..e2268482da 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithClass.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithClass.cpp @@ -28,7 +28,7 @@ FfiOpaqueHandle library_smoke_StructWithClass_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -36,13 +36,13 @@ library_smoke_StructWithClass_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_StructWithClass_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_StructWithClass_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithInterface.cpp b/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithInterface.cpp index bae779c24c..234053b6e1 100644 --- a/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithInterface.cpp +++ b/gluecodium/src/test/resources/smoke/instances/output/dart/ffi/ffi_smoke_StructWithInterface.cpp @@ -28,7 +28,7 @@ FfiOpaqueHandle library_smoke_StructWithInterface_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -36,13 +36,13 @@ library_smoke_StructWithInterface_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_StructWithInterface_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_StructWithInterface_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_Lambdas_Confounder__Conversion.h b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_Lambdas_Confounder__Conversion.h index ee1fc38c4e..b95bf5a3cf 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_Lambdas_Confounder__Conversion.h +++ b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_Lambdas_Confounder__Conversion.h @@ -6,8 +6,8 @@ #include #include "com_example_smoke_Lambdas_Producer__Conversion.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.cpp b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.cpp index c7b18d7916..145b853e22 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.cpp @@ -60,14 +60,14 @@ com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _jenv, const ::smoke _jenv, javaClass, reinterpret_cast( pInstanceSharedPointer ) ); return jResult; } -std::optional<::smoke::StandaloneProducer> -com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, std::optional<::smoke::StandaloneProducer>*) { +optional<::smoke::StandaloneProducer> +com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, optional<::smoke::StandaloneProducer>*) { return _jobj - ? std::optional<::smoke::StandaloneProducer>(com_example_smoke_StandaloneProducer_convert_from_jni(_env, _jobj, (::smoke::StandaloneProducer*)nullptr)) - : std::optional<::smoke::StandaloneProducer>{}; + ? optional<::smoke::StandaloneProducer>(com_example_smoke_StandaloneProducer_convert_from_jni(_env, _jobj, (::smoke::StandaloneProducer*)nullptr)) + : optional<::smoke::StandaloneProducer>{}; } JniReference -com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::optional<::smoke::StandaloneProducer>& _ninput) { +com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const optional<::smoke::StandaloneProducer>& _ninput) { return _ninput ? com_example_smoke_StandaloneProducer_convert_to_jni(_env, *_ninput) : JniReference{}; } JniReference @@ -82,7 +82,7 @@ com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::vec return result; } JniReference -com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) { +com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? com_example_smoke_StandaloneProducer_convert_to_jni(_env, *_ninput) : JniReference{}; } std::vector<::smoke::StandaloneProducer> @@ -102,11 +102,11 @@ com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniRef } return _nresult; } -std::optional> -com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::optional>*) { +optional> +com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, optional>*) { return _arrayList - ? std::optional>(com_example_smoke_StandaloneProducer_convert_from_jni(_env, _arrayList, (std::vector<::smoke::StandaloneProducer>*)nullptr)) - : std::optional>{}; + ? optional>(com_example_smoke_StandaloneProducer_convert_from_jni(_env, _arrayList, (std::vector<::smoke::StandaloneProducer>*)nullptr)) + : optional>{}; } } } diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.h b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.h index f6de960363..5796fcd3fe 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.h +++ b/gluecodium/src/test/resources/smoke/lambdas/output/android/jni/com_example_smoke_StandaloneProducer__Conversion.h @@ -6,8 +6,8 @@ #include #include "JniCallJavaMethod.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include #include #include namespace gluecodium @@ -16,13 +16,13 @@ namespace jni { JNIEXPORT ::smoke::StandaloneProducer com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, ::smoke::StandaloneProducer*); JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _jenv, const ::smoke::StandaloneProducer& _ninput); -JNIEXPORT std::optional<::smoke::StandaloneProducer> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, std::optional<::smoke::StandaloneProducer>*); -JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::optional<::smoke::StandaloneProducer>& _ninput); +JNIEXPORT optional<::smoke::StandaloneProducer> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jobj, optional<::smoke::StandaloneProducer>*); +JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const optional<::smoke::StandaloneProducer>& _ninput); // Functions to create ArrayLists from C++ vectors and vice versa, for overloaded lambdas. JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::vector<::smoke::StandaloneProducer>& _ninput); -JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput); +JNIEXPORT JniReference com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const optional>& _ninput); JNIEXPORT std::vector<::smoke::StandaloneProducer> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::vector<::smoke::StandaloneProducer>*); -JNIEXPORT std::optional> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, std::optional>*); +JNIEXPORT optional> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _arrayList, optional>*); // Templated functions to create HashMaps from C++ unordered_maps and vice versa, for overloaded lambdas as values. template JniReference @@ -39,7 +39,7 @@ com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::uno } template JniReference -com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const std::optional>& _ninput) { +com_example_smoke_StandaloneProducer_convert_to_jni(JNIEnv* _env, const optional>& _ninput) { return _ninput ? com_example_smoke_StandaloneProducer_convert_to_jni(_env, *_ninput) : JniReference{}; } template @@ -74,15 +74,15 @@ com_example_smoke_StandaloneProducer_convert_from_jni( return _nresult; } template -std::optional> +optional> com_example_smoke_StandaloneProducer_convert_from_jni(JNIEnv* _env, const JniReference& _jMap, - std::optional>*) + optional>*) { return _jMap - ? std::optional>( + ? optional>( com_example_smoke_StandaloneProducer_convert_from_jni(_env, _jMap, (std::unordered_map*)nullptr) - ) : std::optional>{}; + ) : optional>{}; } } } diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/cbridge/src/smoke/cbridge_Lambdas.cpp b/gluecodium/src/test/resources/smoke/lambdas/output/cbridge/src/smoke/cbridge_Lambdas.cpp index 5de05d9514..702fe47245 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/cbridge/src/smoke/cbridge_Lambdas.cpp +++ b/gluecodium/src/test/resources/smoke/lambdas/output/cbridge/src/smoke/cbridge_Lambdas.cpp @@ -6,6 +6,7 @@ #include "cbridge_internal/include/CachedProxyBase.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Lambdas.h" @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -79,7 +79,7 @@ _baseRef smoke_Lambdas_Producer_create_proxy(smoke_Lambdas_Producer_FunctionTabl } _baseRef smoke_Lambdas_Producer_create_optional_proxy(smoke_Lambdas_Producer_FunctionTable functionTable) { auto proxy = smoke_Lambdas_ProducerProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::Lambdas::Producer>(::std::bind(&smoke_Lambdas_ProducerProxy::operator(), proxy))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::Lambdas::Producer>(::std::bind(&smoke_Lambdas_ProducerProxy::operator(), proxy))) : 0; } const void* smoke_Lambdas_Producer_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_Lambdas_ProducerProxy::get_swift_object(get_pointer<::smoke::Lambdas::Producer>(handle)) : nullptr; @@ -119,7 +119,7 @@ _baseRef smoke_Lambdas_Convoluter_create_proxy(smoke_Lambdas_Convoluter_Function } _baseRef smoke_Lambdas_Convoluter_create_optional_proxy(smoke_Lambdas_Convoluter_FunctionTable functionTable) { auto proxy = smoke_Lambdas_ConvoluterProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::Lambdas::Confuser>(::std::bind(&smoke_Lambdas_ConvoluterProxy::operator(), proxy, ::std::placeholders::_1))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::Lambdas::Confuser>(::std::bind(&smoke_Lambdas_ConvoluterProxy::operator(), proxy, ::std::placeholders::_1))) : 0; } const void* smoke_Lambdas_Convoluter_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_Lambdas_ConvoluterProxy::get_swift_object(get_pointer<::smoke::Lambdas::Confuser>(handle)) : nullptr; @@ -158,7 +158,7 @@ _baseRef smoke_Lambdas_Consumer_create_proxy(smoke_Lambdas_Consumer_FunctionTabl } _baseRef smoke_Lambdas_Consumer_create_optional_proxy(smoke_Lambdas_Consumer_FunctionTable functionTable) { auto proxy = smoke_Lambdas_ConsumerProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::Lambdas::Consumer>(::std::bind(&smoke_Lambdas_ConsumerProxy::operator(), proxy, ::std::placeholders::_1))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::Lambdas::Consumer>(::std::bind(&smoke_Lambdas_ConsumerProxy::operator(), proxy, ::std::placeholders::_1))) : 0; } const void* smoke_Lambdas_Consumer_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_Lambdas_ConsumerProxy::get_swift_object(get_pointer<::smoke::Lambdas::Consumer>(handle)) : nullptr; @@ -198,7 +198,7 @@ _baseRef smoke_Lambdas_Indexer_create_proxy(smoke_Lambdas_Indexer_FunctionTable } _baseRef smoke_Lambdas_Indexer_create_optional_proxy(smoke_Lambdas_Indexer_FunctionTable functionTable) { auto proxy = smoke_Lambdas_IndexerProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::Lambdas::Indexer>(::std::bind(&smoke_Lambdas_IndexerProxy::operator(), proxy, ::std::placeholders::_1, ::std::placeholders::_2))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::Lambdas::Indexer>(::std::bind(&smoke_Lambdas_IndexerProxy::operator(), proxy, ::std::placeholders::_1, ::std::placeholders::_2))) : 0; } const void* smoke_Lambdas_Indexer_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_Lambdas_IndexerProxy::get_swift_object(get_pointer<::smoke::Lambdas::Indexer>(handle)) : nullptr; @@ -212,7 +212,7 @@ _baseRef smoke_Lambdas_NullableConfuser_copy_handle(_baseRef handle) { : 0; } _baseRef smoke_Lambdas_NullableConfuser_call(_baseRef _instance, _baseRef p0) { - return Conversion>::toBaseRef(get_pointer<::smoke::Lambdas::NullableConfuser>(_instance)->operator()(Conversion>::toCpp(p0))); + return Conversion<::gluecodium::optional< ::smoke::Lambdas::Producer >>::toBaseRef(get_pointer<::smoke::Lambdas::NullableConfuser>(_instance)->operator()(Conversion<::gluecodium::optional< ::std::string >>::toCpp(p0))); } class smoke_Lambdas_NullableConfuserProxy : public CachedProxyBase { public: @@ -225,9 +225,9 @@ class smoke_Lambdas_NullableConfuserProxy : public CachedProxyBase operator()(const std::optional< ::std::string >& p0) { - auto _call_result = mFunctions.smoke_Lambdas_NullableConfuser_call(mFunctions.swift_pointer, Conversion>::toBaseRef(p0)); - return Conversion>::toCppReturn(_call_result); + ::gluecodium::optional< ::smoke::Lambdas::Producer > operator()(const ::gluecodium::optional< ::std::string >& p0) { + auto _call_result = mFunctions.smoke_Lambdas_NullableConfuser_call(mFunctions.swift_pointer, Conversion<::gluecodium::optional< ::std::string >>::toBaseRef(p0)); + return Conversion<::gluecodium::optional< ::smoke::Lambdas::Producer >>::toCppReturn(_call_result); } private: smoke_Lambdas_NullableConfuser_FunctionTable mFunctions; @@ -238,7 +238,7 @@ _baseRef smoke_Lambdas_NullableConfuser_create_proxy(smoke_Lambdas_NullableConfu } _baseRef smoke_Lambdas_NullableConfuser_create_optional_proxy(smoke_Lambdas_NullableConfuser_FunctionTable functionTable) { auto proxy = smoke_Lambdas_NullableConfuserProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::Lambdas::NullableConfuser>(::std::bind(&smoke_Lambdas_NullableConfuserProxy::operator(), proxy, ::std::placeholders::_1))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::Lambdas::NullableConfuser>(::std::bind(&smoke_Lambdas_NullableConfuserProxy::operator(), proxy, ::std::placeholders::_1))) : 0; } const void* smoke_Lambdas_NullableConfuser_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_Lambdas_NullableConfuserProxy::get_swift_object(get_pointer<::smoke::Lambdas::NullableConfuser>(handle)) : nullptr; diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/cpp/include/smoke/Lambdas.h b/gluecodium/src/test/resources/smoke/lambdas/output/cpp/include/smoke/Lambdas.h index 594d9f7801..f22707fabf 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/cpp/include/smoke/Lambdas.h +++ b/gluecodium/src/test/resources/smoke/lambdas/output/cpp/include/smoke/Lambdas.h @@ -4,11 +4,11 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include #include -#include #include #include #include @@ -25,7 +25,7 @@ class _GLUECODIUM_CPP_EXPORT Lambdas { using Confuser = ::std::function<::smoke::Lambdas::Producer(const ::std::string&)>; using Consumer = ::std::function; using Indexer = ::std::function; - using NullableConfuser = ::std::function(const std::optional< ::std::string >&)>; + using NullableConfuser = ::std::function<::gluecodium::optional< ::smoke::Lambdas::Producer >(const ::gluecodium::optional< ::std::string >&)>; public: virtual ::smoke::Lambdas::Producer deconfuse( const ::std::string& value, const ::smoke::Lambdas::Confuser& confuser ) = 0; static ::std::unordered_map< int32_t, ::std::string > fuse( const ::std::vector< ::std::string >& items, const ::smoke::Lambdas::Indexer& callback ); diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_Lambdas.cpp b/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_Lambdas.cpp index 37239d5dc3..3d8db0c11e 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_Lambdas.cpp +++ b/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_Lambdas.cpp @@ -5,13 +5,13 @@ #include "CallbacksQueue.h" #include "IsolateContext.h" #include "ProxyCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Lambdas.h" #include #include #include -#include #include #include #include @@ -199,15 +199,15 @@ class smoke_Lambdas_NullableConfuser_Proxy { } smoke_Lambdas_NullableConfuser_Proxy(const smoke_Lambdas_NullableConfuser_Proxy&) = delete; smoke_Lambdas_NullableConfuser_Proxy& operator=(const smoke_Lambdas_NullableConfuser_Proxy&) = delete; - std::optional - operator()(const std::optional& p0) { + gluecodium::optional + operator()(const gluecodium::optional& p0) { FfiOpaqueHandle _result_handle; dispatch([&]() { (*reinterpret_cast(f0))(Dart_HandleFromPersistent_DL(dart_persistent_handle), - gluecodium::ffi::Conversion>::toFfi(p0), + gluecodium::ffi::Conversion>::toFfi(p0), &_result_handle ); }); - auto _result = gluecodium::ffi::Conversion>::toCpp(_result_handle); - delete reinterpret_cast*>(_result_handle); + auto _result = gluecodium::ffi::Conversion>::toCpp(_result_handle); + delete reinterpret_cast*>(_result_handle); return _result; } private: @@ -281,9 +281,9 @@ library_smoke_Lambdas_Indexer_call__String_Float(FfiOpaqueHandle _self, int32_t FfiOpaqueHandle library_smoke_Lambdas_NullableConfuser_call__String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle p0) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( gluecodium::ffi::Conversion::toCpp(_self).operator()( - gluecodium::ffi::Conversion>::toCpp(p0) + gluecodium::ffi::Conversion>::toCpp(p0) ) ); } @@ -337,7 +337,7 @@ FfiOpaqueHandle library_smoke_Lambdas_Producer_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -345,13 +345,13 @@ library_smoke_Lambdas_Producer_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Lambdas_Producer_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Lambdas_Producer_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } // "Private" finalizer, not exposed to be callable from Dart. @@ -380,7 +380,7 @@ FfiOpaqueHandle library_smoke_Lambdas_Confuser_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -388,13 +388,13 @@ library_smoke_Lambdas_Confuser_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Lambdas_Confuser_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Lambdas_Confuser_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } // "Private" finalizer, not exposed to be callable from Dart. @@ -423,7 +423,7 @@ FfiOpaqueHandle library_smoke_Lambdas_Consumer_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -431,13 +431,13 @@ library_smoke_Lambdas_Consumer_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Lambdas_Consumer_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Lambdas_Consumer_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } // "Private" finalizer, not exposed to be callable from Dart. @@ -466,7 +466,7 @@ FfiOpaqueHandle library_smoke_Lambdas_Indexer_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -474,13 +474,13 @@ library_smoke_Lambdas_Indexer_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Lambdas_Indexer_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Lambdas_Indexer_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } // "Private" finalizer, not exposed to be callable from Dart. @@ -509,7 +509,7 @@ FfiOpaqueHandle library_smoke_Lambdas_NullableConfuser_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -517,13 +517,13 @@ library_smoke_Lambdas_NullableConfuser_create_handle_nullable(FfiOpaqueHandle va void library_smoke_Lambdas_NullableConfuser_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Lambdas_NullableConfuser_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_StandaloneProducer.cpp b/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_StandaloneProducer.cpp index 470a25b99b..2327e7ed90 100644 --- a/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_StandaloneProducer.cpp +++ b/gluecodium/src/test/resources/smoke/lambdas/output/dart/ffi/ffi_smoke_StandaloneProducer.cpp @@ -86,7 +86,7 @@ FfiOpaqueHandle library_smoke_StandaloneProducer_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -94,13 +94,13 @@ library_smoke_StandaloneProducer_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_StandaloneProducer_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_StandaloneProducer_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_CalculatorListener__Conversion.h b/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_CalculatorListener__Conversion.h index dfd829aaf5..5e1516173b 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_CalculatorListener__Conversion.h +++ b/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_CalculatorListener__Conversion.h @@ -6,8 +6,8 @@ #include "com_example_smoke_CalculationResult__Conversion.h" #include "com_example_smoke_CalculatorListener_ResultStruct__Conversion.h" #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_ListenerWithNullableImplCppProxy.cpp b/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_ListenerWithNullableImplCppProxy.cpp index 7076d2a8f5..454c96d332 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_ListenerWithNullableImplCppProxy.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/android/jni/com_example_smoke_ListenerWithNullableImplCppProxy.cpp @@ -12,8 +12,8 @@ namespace jni com_example_smoke_ListenerWithNullable_CppProxy::com_example_smoke_ListenerWithNullable_CppProxy( JNIEnv* _jenv, JniReference globalRef, jint _jHashCode ) : CppProxyBase( _jenv, std::move( globalRef ), _jHashCode, "com_example_smoke_ListenerWithNullable" ) { } -std::optional< int8_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_byte( const std::optional< int8_t >& ninput ) { +::gluecodium::optional< int8_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_byte( const ::gluecodium::optional< int8_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithByte", "(Ljava/lang/Byte;)Ljava/lang/Byte;", jniEnv , jinput); @@ -24,10 +24,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_byte( const std::op jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< int8_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< int8_t >*)nullptr ); } -std::optional< uint8_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_byte( const std::optional< uint8_t >& ninput ) { +::gluecodium::optional< uint8_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_byte( const ::gluecodium::optional< uint8_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithUByte", "(Ljava/lang/Short;)Ljava/lang/Short;", jniEnv , jinput); @@ -38,10 +38,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_byte( const std:: jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< uint8_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< uint8_t >*)nullptr ); } -std::optional< int16_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_short( const std::optional< int16_t >& ninput ) { +::gluecodium::optional< int16_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_short( const ::gluecodium::optional< int16_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithShort", "(Ljava/lang/Short;)Ljava/lang/Short;", jniEnv , jinput); @@ -52,10 +52,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_short( const std::o jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< int16_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< int16_t >*)nullptr ); } -std::optional< uint16_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_short( const std::optional< uint16_t >& ninput ) { +::gluecodium::optional< uint16_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_short( const ::gluecodium::optional< uint16_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithUShort", "(Ljava/lang/Integer;)Ljava/lang/Integer;", jniEnv , jinput); @@ -66,10 +66,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_short( const std: jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< uint16_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< uint16_t >*)nullptr ); } -std::optional< int32_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_int( const std::optional< int32_t >& ninput ) { +::gluecodium::optional< int32_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_int( const ::gluecodium::optional< int32_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithInt", "(Ljava/lang/Integer;)Ljava/lang/Integer;", jniEnv , jinput); @@ -80,10 +80,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_int( const std::opt jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< int32_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< int32_t >*)nullptr ); } -std::optional< uint32_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_int( const std::optional< uint32_t >& ninput ) { +::gluecodium::optional< uint32_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_int( const ::gluecodium::optional< uint32_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithUInt", "(Ljava/lang/Long;)Ljava/lang/Long;", jniEnv , jinput); @@ -94,10 +94,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_int( const std::o jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< uint32_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< uint32_t >*)nullptr ); } -std::optional< int64_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_long( const std::optional< int64_t >& ninput ) { +::gluecodium::optional< int64_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_long( const ::gluecodium::optional< int64_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithLong", "(Ljava/lang/Long;)Ljava/lang/Long;", jniEnv , jinput); @@ -108,10 +108,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_long( const std::op jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< int64_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< int64_t >*)nullptr ); } -std::optional< uint64_t > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_long( const std::optional< uint64_t >& ninput ) { +::gluecodium::optional< uint64_t > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_long( const ::gluecodium::optional< uint64_t >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithULong", "(Ljava/lang/Long;)Ljava/lang/Long;", jniEnv , jinput); @@ -122,10 +122,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_u_long( const std:: jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< uint64_t >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< uint64_t >*)nullptr ); } -std::optional< bool > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const std::optional< bool >& ninput ) { +::gluecodium::optional< bool > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const ::gluecodium::optional< bool >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithDouble", "(Ljava/lang/Boolean;)Ljava/lang/Boolean;", jniEnv , jinput); @@ -136,10 +136,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const std:: jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< bool >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< bool >*)nullptr ); } -std::optional< float > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_float( const std::optional< float >& ninput ) { +::gluecodium::optional< float > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_float( const ::gluecodium::optional< float >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithFloat", "(Ljava/lang/Float;)Ljava/lang/Float;", jniEnv , jinput); @@ -150,10 +150,10 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_float( const std::o jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< float >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< float >*)nullptr ); } -std::optional< double > -com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const std::optional< double >& ninput ) { +::gluecodium::optional< double > +com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const ::gluecodium::optional< double >& ninput ) { JNIEnv* jniEnv = getJniEnvironment( ); auto jinput = convert_to_jni( jniEnv, ninput ); auto _result = callJavaMethod( "methodWithDouble", "(Ljava/lang/Double;)Ljava/lang/Double;", jniEnv , jinput); @@ -164,7 +164,7 @@ com_example_smoke_ListenerWithNullable_CppProxy::method_with_double( const std:: jniEnv->FatalError( "Exception was thrown in Java and it was not handled.\n" "See the log for more information about the exception (including Java stack trace)." ); } - return convert_from_jni( jniEnv, _result, (std::optional< double >*)nullptr ); + return convert_from_jni( jniEnv, _result, (::gluecodium::optional< double >*)nullptr ); } } } diff --git a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_CalculatorListener.cpp b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_CalculatorListener.cpp index bc0cc09580..44411a2807 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_CalculatorListener.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_CalculatorListener.cpp @@ -6,6 +6,7 @@ #include "cbridge_internal/include/CachedProxyBase.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/TypeRepository.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" @@ -13,7 +14,6 @@ #include "smoke/CalculatorListener.h" #include #include -#include #include #include #include @@ -125,17 +125,17 @@ smoke_CalculatorListener_ResultStruct_release_handle( _baseRef handle ) _baseRef smoke_CalculatorListener_ResultStruct_create_optional_handle(double result) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::CalculatorListener::ResultStruct>( ::smoke::CalculatorListener::ResultStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::CalculatorListener::ResultStruct>( ::smoke::CalculatorListener::ResultStruct( ) ); (*_struct)->result = result; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_CalculatorListener_ResultStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::CalculatorListener::ResultStruct>*>( handle ) ); } void smoke_CalculatorListener_ResultStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::CalculatorListener::ResultStruct>*>( handle ); } double smoke_CalculatorListener_ResultStruct_result_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenerWithProperties.cpp b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenerWithProperties.cpp index 65ae2be792..2dc98fd010 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenerWithProperties.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenerWithProperties.cpp @@ -7,6 +7,7 @@ #include "cbridge_internal/include/CachedProxyBase.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/TypeRepository.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" @@ -15,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -182,17 +182,17 @@ smoke_ListenerWithProperties_ResultStruct_release_handle( _baseRef handle ) _baseRef smoke_ListenerWithProperties_ResultStruct_create_optional_handle(double result) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::ListenerWithProperties::ResultStruct>( ::smoke::ListenerWithProperties::ResultStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::ListenerWithProperties::ResultStruct>( ::smoke::ListenerWithProperties::ResultStruct( ) ); (*_struct)->result = result; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ListenerWithProperties_ResultStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::ListenerWithProperties::ResultStruct>*>( handle ) ); } void smoke_ListenerWithProperties_ResultStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::ListenerWithProperties::ResultStruct>*>( handle ); } double smoke_ListenerWithProperties_ResultStruct_result_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenersWithReturnValues.cpp b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenersWithReturnValues.cpp index b8977616ff..194aab344d 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenersWithReturnValues.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/cbridge/src/smoke/cbridge_ListenersWithReturnValues.cpp @@ -6,6 +6,7 @@ #include "cbridge_internal/include/CachedProxyBase.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/TypeRepository.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" @@ -13,7 +14,6 @@ #include "smoke/ListenersWithReturnValues.h" #include #include -#include #include #include #include @@ -138,17 +138,17 @@ smoke_ListenersWithReturnValues_ResultStruct_release_handle( _baseRef handle ) _baseRef smoke_ListenersWithReturnValues_ResultStruct_create_optional_handle(double result) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::ListenersWithReturnValues::ResultStruct>( ::smoke::ListenersWithReturnValues::ResultStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::ListenersWithReturnValues::ResultStruct>( ::smoke::ListenersWithReturnValues::ResultStruct( ) ); (*_struct)->result = result; return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_ListenersWithReturnValues_ResultStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::ListenersWithReturnValues::ResultStruct>*>( handle ) ); } void smoke_ListenersWithReturnValues_ResultStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::ListenersWithReturnValues::ResultStruct>*>( handle ); } double smoke_ListenersWithReturnValues_ResultStruct_result_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_CalculatorListener.cpp b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_CalculatorListener.cpp index 56cc975037..d6492ed62f 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_CalculatorListener.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_CalculatorListener.cpp @@ -195,7 +195,7 @@ FfiOpaqueHandle library_smoke_CalculatorListener_ResultStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -203,13 +203,13 @@ library_smoke_CalculatorListener_ResultStruct_create_handle_nullable(FfiOpaqueHa void library_smoke_CalculatorListener_ResultStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_CalculatorListener_ResultStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenerWithProperties.cpp b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenerWithProperties.cpp index f7288191ce..6557464d2e 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenerWithProperties.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenerWithProperties.cpp @@ -329,7 +329,7 @@ FfiOpaqueHandle library_smoke_ListenerWithProperties_ResultStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -337,20 +337,20 @@ library_smoke_ListenerWithProperties_ResultStruct_create_handle_nullable(FfiOpaq void library_smoke_ListenerWithProperties_ResultStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_ListenerWithProperties_ResultStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_ListenerWithProperties_ResultEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -358,13 +358,13 @@ library_smoke_ListenerWithProperties_ResultEnum_create_handle_nullable(uint32_t void library_smoke_ListenerWithProperties_ResultEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ListenerWithProperties_ResultEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenersWithReturnValues.cpp b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenersWithReturnValues.cpp index 3ae318f5f7..2004491131 100644 --- a/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenersWithReturnValues.cpp +++ b/gluecodium/src/test/resources/smoke/listeners/output/dart/ffi/ffi_smoke_ListenersWithReturnValues.cpp @@ -237,7 +237,7 @@ FfiOpaqueHandle library_smoke_ListenersWithReturnValues_ResultStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -245,20 +245,20 @@ library_smoke_ListenersWithReturnValues_ResultStruct_create_handle_nullable(FfiO void library_smoke_ListenersWithReturnValues_ResultStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_ListenersWithReturnValues_ResultStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_ListenersWithReturnValues_ResultEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -266,13 +266,13 @@ library_smoke_ListenersWithReturnValues_ResultEnum_create_handle_nullable(uint32 void library_smoke_ListenersWithReturnValues_ResultEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_ListenersWithReturnValues_ResultEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/GenericCollections.cpp index b56db5966b..1388dfc092 100644 --- a/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/GenericCollections.cpp @@ -1,13 +1,13 @@ // // -#include "cbridge\include\GenericCollections.h" -#include "cbridge\include\StringHandle.h" -#include "cbridge_internal\include\BaseHandleImpl.h" -#include "gluecodium\Locale.h" -#include "gluecodium\UnorderedMapHash.h" -#include "gluecodium\UnorderedSetHash.h" -#include "gluecodium\VectorHash.h" -#include +#include "cbridge/include/GenericCollections.h" +#include "cbridge/include/StringHandle.h" +#include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Locale.h" +#include "gluecodium/Optional.h" +#include "gluecodium/UnorderedMapHash.h" +#include "gluecodium/UnorderedSetHash.h" +#include "gluecodium/VectorHash.h" #include #include #include @@ -33,13 +33,13 @@ void foobar_ArrayOf__Locale_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::gluecodium::Locale >>::toCpp(handle).push_back(Conversion<::gluecodium::Locale>::toCpp(item)); } _baseRef foobar_ArrayOf__Locale_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::gluecodium::Locale >>( ::std::vector< ::gluecodium::Locale >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::gluecodium::Locale >>( ::std::vector< ::gluecodium::Locale >( ) ) ); } void foobar_ArrayOf__Locale_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::gluecodium::Locale >>*>( handle ); } _baseRef foobar_ArrayOf__Locale_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::gluecodium::Locale >>*>( handle ) ); } _baseRef foobar_MapOf__Locale_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >() ); @@ -71,13 +71,13 @@ _baseRef foobar_MapOf__Locale_To__String_iterator_value(_baseRef iterator_handle return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__Locale_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >>( ::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >>( ::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >( ) ) ); } void foobar_MapOf__Locale_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >>*>( handle ); } _baseRef foobar_MapOf__Locale_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::gluecodium::Locale, ::std::string, ::gluecodium::hash< ::gluecodium::Locale > >>*>( handle ) ); } _baseRef foobar_MapOf__String_To__Locale_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< ::std::string, ::gluecodium::Locale >() ); @@ -109,13 +109,13 @@ _baseRef foobar_MapOf__String_To__Locale_iterator_value(_baseRef iterator_handle return Conversion<::gluecodium::Locale>::toBaseRef(value); } _baseRef foobar_MapOf__String_To__Locale_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< ::std::string, ::gluecodium::Locale >>( ::std::unordered_map< ::std::string, ::gluecodium::Locale >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< ::std::string, ::gluecodium::Locale >>( ::std::unordered_map< ::std::string, ::gluecodium::Locale >( ) ) ); } void foobar_MapOf__String_To__Locale_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::gluecodium::Locale >>*>( handle ); } _baseRef foobar_MapOf__String_To__Locale_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< ::std::string, ::gluecodium::Locale >>*>( handle ) ); } _baseRef foobar_SetOf__Locale_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >() ); @@ -143,11 +143,11 @@ _baseRef foobar_SetOf__Locale_iterator_get(_baseRef iterator_handle) { return Conversion<::gluecodium::Locale>::referenceBaseRef(value); } _baseRef foobar_SetOf__Locale_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >>( ::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >>( ::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >( ) ) ); } void foobar_SetOf__Locale_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >>*>( handle ); } _baseRef foobar_SetOf__Locale_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_set< ::gluecodium::Locale, ::gluecodium::hash< ::gluecodium::Locale > >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/smoke/cbridge_Locales.cpp b/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/smoke/cbridge_Locales.cpp index 128410167a..35b4ba7961 100644 --- a/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/smoke/cbridge_Locales.cpp +++ b/gluecodium/src/test/resources/smoke/locales/output/cbridge/src/smoke/cbridge_Locales.cpp @@ -5,10 +5,10 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "gluecodium/Locale.h" +#include "gluecodium/Optional.h" #include "smoke/Locales.h" #include #include -#include void smoke_Locales_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::Locales >>(handle); } @@ -54,17 +54,17 @@ smoke_Locales_LocaleStruct_release_handle( _baseRef handle ) _baseRef smoke_Locales_LocaleStruct_create_optional_handle(_baseRef localeField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Locales::LocaleStruct>( ::smoke::Locales::LocaleStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Locales::LocaleStruct>( ::smoke::Locales::LocaleStruct( ) ); (*_struct)->locale_field = Conversion<::gluecodium::Locale>::toCpp( localeField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Locales_LocaleStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Locales::LocaleStruct>*>( handle ) ); } void smoke_Locales_LocaleStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Locales::LocaleStruct>*>( handle ); } _baseRef smoke_Locales_LocaleStruct_localeField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/locales/output/cpp/include/gluecodium/Locale.h b/gluecodium/src/test/resources/smoke/locales/output/cpp/include/gluecodium/Locale.h index 20686d3899..5fce19dbed 100644 --- a/gluecodium/src/test/resources/smoke/locales/output/cpp/include/gluecodium/Locale.h +++ b/gluecodium/src/test/resources/smoke/locales/output/cpp/include/gluecodium/Locale.h @@ -20,7 +20,7 @@ #pragma once #include "ExportCommonGluecodiumCpp.h" #include "Hash.h" -#include +#include "Optional.h" #include namespace gluecodium { /** @@ -28,15 +28,15 @@ namespace gluecodium { */ struct _GLUECODIUM_CPP_EXPORT Locale { Locale(); - explicit Locale(std::optional language_tag); - Locale(std::optional language_code, std::optional country_code); - Locale(std::optional language_code, - std::optional country_code, - std::optional script_code); - Locale(std::optional language_code, - std::optional country_code, - std::optional script_code, - std::optional language_tag); + explicit Locale(optional language_tag); + Locale(optional language_code, optional country_code); + Locale(optional language_code, + optional country_code, + optional script_code); + Locale(optional language_code, + optional country_code, + optional script_code, + optional language_tag); explicit Locale(std::string language_tag); Locale(std::string language_code, std::string country_code); Locale(std::string language_code, @@ -47,13 +47,13 @@ struct _GLUECODIUM_CPP_EXPORT Locale { std::string script_code, std::string language_tag); /// ISO 639-1 language code (2-letter) - std::optional language_code; + optional language_code; /// ISO 3166-1 alpha-2 country code (2-letter) - std::optional country_code; + optional country_code; /// ISO 15924 script code (4-letter) - std::optional script_code; + optional script_code; /// BCP 47 language tag - std::optional language_tag; + optional language_tag; bool operator==(const Locale& rhs) const; bool operator!=(const Locale& rhs) const; }; diff --git a/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/GenericTypesConversion.cpp b/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/GenericTypesConversion.cpp index 92f9b8984c..f5c5b0b429 100644 --- a/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/GenericTypesConversion.cpp +++ b/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/GenericTypesConversion.cpp @@ -56,7 +56,7 @@ FfiOpaqueHandle library_foobar_ListOf_Locale_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -64,13 +64,13 @@ library_foobar_ListOf_Locale_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_ListOf_Locale_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_ListOf_Locale_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -123,7 +123,7 @@ FfiOpaqueHandle library_foobar_MapOf_Locale_to_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -131,13 +131,13 @@ library_foobar_MapOf_Locale_to_String_create_handle_nullable(FfiOpaqueHandle val void library_foobar_MapOf_Locale_to_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_Locale_to_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle @@ -190,7 +190,7 @@ FfiOpaqueHandle library_foobar_MapOf_String_to_Locale_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>( + new (std::nothrow) gluecodium::optional>( gluecodium::ffi::Conversion>::toCpp(value) ) ); @@ -198,13 +198,13 @@ library_foobar_MapOf_String_to_Locale_create_handle_nullable(FfiOpaqueHandle val void library_foobar_MapOf_String_to_Locale_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>*>(handle); + delete reinterpret_cast>*>(handle); } FfiOpaqueHandle library_foobar_MapOf_String_to_Locale_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>::toFfi( - **reinterpret_cast>*>(handle) + **reinterpret_cast>*>(handle) ); } FfiOpaqueHandle @@ -250,7 +250,7 @@ FfiOpaqueHandle library_foobar_SetOf_Locale_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -258,13 +258,13 @@ library_foobar_SetOf_Locale_create_handle_nullable(FfiOpaqueHandle value) void library_foobar_SetOf_Locale_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_foobar_SetOf_Locale_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/ffi_smoke_Locales.cpp b/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/ffi_smoke_Locales.cpp index 4324ad008f..36ce67fc06 100644 --- a/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/ffi_smoke_Locales.cpp +++ b/gluecodium/src/test/resources/smoke/locales/output/dart/ffi/ffi_smoke_Locales.cpp @@ -78,7 +78,7 @@ FfiOpaqueHandle library_smoke_Locales_LocaleStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -86,13 +86,13 @@ library_smoke_Locales_LocaleStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Locales_LocaleStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Locales_LocaleStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_MethodOverloads.cpp b/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_MethodOverloads.cpp index abb1378c0a..84b8bfaf4e 100644 --- a/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_MethodOverloads.cpp +++ b/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_MethodOverloads.cpp @@ -157,7 +157,7 @@ FfiOpaqueHandle library_smoke_MethodOverloads_Point_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -165,13 +165,13 @@ library_smoke_MethodOverloads_Point_create_handle_nullable(FfiOpaqueHandle value void library_smoke_MethodOverloads_Point_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_MethodOverloads_Point_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_SpecialNamesInterface.cpp b/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_SpecialNamesInterface.cpp index 4a1bb58137..cd95f95a5e 100644 --- a/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_SpecialNamesInterface.cpp +++ b/gluecodium/src/test/resources/smoke/method_overloads/output/dart/ffi/ffi_smoke_SpecialNamesInterface.cpp @@ -153,7 +153,7 @@ FfiOpaqueHandle library_smoke_SpecialNamesInterface_Callback_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -161,13 +161,13 @@ library_smoke_SpecialNamesInterface_Callback_create_handle_nullable(FfiOpaqueHan void library_smoke_SpecialNamesInterface_Callback_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_SpecialNamesInterface_Callback_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_ERROR_CODE_DROID__Conversion.cpp b/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_ERROR_CODE_DROID__Conversion.cpp index 8a181c8c46..efe3a227b0 100644 --- a/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_ERROR_CODE_DROID__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_ERROR_CODE_DROID__Conversion.cpp @@ -13,12 +13,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::namerule return ::namerules::NameRules::ExampleErrorCode( ::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::namerules::NameRules::ExampleErrorCode> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::namerules::NameRules::ExampleErrorCode>*) +::optional<::namerules::NameRules::ExampleErrorCode> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::optional<::namerules::NameRules::ExampleErrorCode>*) { return _jinput - ? std::optional<::namerules::NameRules::ExampleErrorCode>(convert_from_jni(_jenv, _jinput, (::namerules::NameRules::ExampleErrorCode*)nullptr)) - : std::optional<::namerules::NameRules::ExampleErrorCode>{}; + ? ::optional<::namerules::NameRules::ExampleErrorCode>(convert_from_jni(_jenv, _jinput, (::namerules::NameRules::ExampleErrorCode*)nullptr)) + : ::optional<::namerules::NameRules::ExampleErrorCode>{}; } REGISTER_JNI_CLASS_CACHE("com/example/namerules/NAME_RULES_DROID$EXAMPLE_ERROR_CODE_DROID", com_example_namerules_NAME_1RULES_1DROID_00024EXAMPLE_1ERROR_1CODE_1DROID, ::namerules::NameRules::ExampleErrorCode) JniReference @@ -38,7 +38,7 @@ convert_to_jni(JNIEnv* _jenv, const ::namerules::NameRules::ExampleErrorCode _ni return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::namerules::NameRules::ExampleErrorCode> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::optional<::namerules::NameRules::ExampleErrorCode> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_STRUCT_DROID__Conversion.cpp b/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_STRUCT_DROID__Conversion.cpp index 097953fb15..48f087b4b9 100644 --- a/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_STRUCT_DROID__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/name_rules/output/android/jni/com_example_namerules_NAME_RULES_DROID_EXAMPLE_STRUCT_DROID__Conversion.cpp @@ -25,12 +25,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::namerule _nout.m_int_value = n_m_int_value; return _nout; } -std::optional<::namerules::NameRules::ExampleStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::namerules::NameRules::ExampleStruct>*) +::optional<::namerules::NameRules::ExampleStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::optional<::namerules::NameRules::ExampleStruct>*) { return _jinput - ? std::optional<::namerules::NameRules::ExampleStruct>(convert_from_jni(_jenv, _jinput, (::namerules::NameRules::ExampleStruct*)nullptr)) - : std::optional<::namerules::NameRules::ExampleStruct>{}; + ? ::optional<::namerules::NameRules::ExampleStruct>(convert_from_jni(_jenv, _jinput, (::namerules::NameRules::ExampleStruct*)nullptr)) + : ::optional<::namerules::NameRules::ExampleStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/namerules/NAME_RULES_DROID$EXAMPLE_STRUCT_DROID", com_example_namerules_NAME_1RULES_1DROID_00024EXAMPLE_1STRUCT_1DROID, ::namerules::NameRules::ExampleStruct) JniReference @@ -44,7 +44,7 @@ convert_to_jni(JNIEnv* _jenv, const ::namerules::NameRules::ExampleStruct& _ninp return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::namerules::NameRules::ExampleStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::optional<::namerules::NameRules::ExampleStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/name_rules/output/cbridge/src/namerules/cbridge_NameRules.cpp b/gluecodium/src/test/resources/smoke/name_rules/output/cbridge/src/namerules/cbridge_NameRules.cpp index 6e5e31d792..a5086b88db 100644 --- a/gluecodium/src/test/resources/smoke/name_rules/output/cbridge/src/namerules/cbridge_NameRules.cpp +++ b/gluecodium/src/test/resources/smoke/name_rules/output/cbridge/src/namerules/cbridge_NameRules.cpp @@ -1,15 +1,15 @@ // // -#include "cbridge\include\namerules\cbridge_NameRules.h" +#include "cbridge/include/namerules/cbridge_NameRules.h" +#include "Optional.h" #include "VectorHash.h" -#include "cbridge_internal\include\BaseHandleImpl.h" -#include "cbridge_internal\include\TypeInitRepository.h" -#include "cbridge_internal\include\WrapperCache.h" -#include "namerules\NameRules.h" +#include "cbridge_internal/include/BaseHandleImpl.h" +#include "cbridge_internal/include/TypeInitRepository.h" +#include "cbridge_internal/include/WrapperCache.h" +#include "namerules/NameRules.h" #include #include #include -#include #include void namerules_INameRules_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::namerules::NameRules >>(handle); @@ -77,7 +77,7 @@ namerules_INameRules_IExampleStruct_release_handle( _baseRef handle ) _baseRef namerules_INameRules_IExampleStruct_create_optional_handle(double iValue, _baseRef iIntValue) { - auto _struct = new ( ::std::nothrow ) std::optional<::namerules::NameRules::ExampleStruct>( ::namerules::NameRules::ExampleStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::optional<::namerules::NameRules::ExampleStruct>( ::namerules::NameRules::ExampleStruct( ) ); (*_struct)->m_value = iValue; (*_struct)->m_int_value = Conversion<::std::vector< int64_t >>::toCpp( iIntValue ); return reinterpret_cast<_baseRef>( _struct ); @@ -85,10 +85,10 @@ namerules_INameRules_IExampleStruct_create_optional_handle(double iValue, _baseR _baseRef namerules_INameRules_IExampleStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::optional<::namerules::NameRules::ExampleStruct>*>( handle ) ); } void namerules_INameRules_IExampleStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::optional<::namerules::NameRules::ExampleStruct>*>( handle ); } double namerules_INameRules_IExampleStruct_iValue_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/namespace_basic/output/android/jni/com_example_smoke_BasicTypes_SomeStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/namespace_basic/output/android/jni/com_example_smoke_BasicTypes_SomeStruct__Conversion.cpp index 480aed3f30..6cb9795ce3 100644 --- a/gluecodium/src/test/resources/smoke/namespace_basic/output/android/jni/com_example_smoke_BasicTypes_SomeStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/namespace_basic/output/android/jni/com_example_smoke_BasicTypes_SomeStruct__Conversion.cpp @@ -22,12 +22,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::root::sp _nout.some_field = n_some_field; return _nout; } -std::optional<::root::space::smoke::BasicTypes::SomeStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::root::space::smoke::BasicTypes::SomeStruct>*) +::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>*) { return _jinput - ? std::optional<::root::space::smoke::BasicTypes::SomeStruct>(convert_from_jni(_jenv, _jinput, (::root::space::smoke::BasicTypes::SomeStruct*)nullptr)) - : std::optional<::root::space::smoke::BasicTypes::SomeStruct>{}; + ? ::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>(convert_from_jni(_jenv, _jinput, (::root::space::smoke::BasicTypes::SomeStruct*)nullptr)) + : ::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/BasicTypes$SomeStruct", com_example_smoke_BasicTypes_00024SomeStruct, ::root::space::smoke::BasicTypes::SomeStruct) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::root::space::smoke::BasicTypes::SomeStruct return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::root::space::smoke::BasicTypes::SomeStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/namespace_basic/output/cbridge/src/root/space/smoke/cbridge_BasicTypes.cpp b/gluecodium/src/test/resources/smoke/namespace_basic/output/cbridge/src/root/space/smoke/cbridge_BasicTypes.cpp index c184631f21..e0655e0ded 100644 --- a/gluecodium/src/test/resources/smoke/namespace_basic/output/cbridge/src/root/space/smoke/cbridge_BasicTypes.cpp +++ b/gluecodium/src/test/resources/smoke/namespace_basic/output/cbridge/src/root/space/smoke/cbridge_BasicTypes.cpp @@ -3,10 +3,10 @@ #include "cbridge/include/root/space/smoke/cbridge_BasicTypes.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "root/space/smoke/BasicTypes.h" #include #include -#include #include _baseRef smoke_BasicTypes_SomeStruct_create_handle( _baseRef someField ) @@ -23,17 +23,17 @@ smoke_BasicTypes_SomeStruct_release_handle( _baseRef handle ) _baseRef smoke_BasicTypes_SomeStruct_create_optional_handle(_baseRef someField) { - auto _struct = new ( ::std::nothrow ) std::optional<::root::space::smoke::BasicTypes::SomeStruct>( ::root::space::smoke::BasicTypes::SomeStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>( ::root::space::smoke::BasicTypes::SomeStruct( ) ); (*_struct)->some_field = Conversion<::std::string>::toCpp( someField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_BasicTypes_SomeStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>*>( handle ) ); } void smoke_BasicTypes_SomeStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::root::space::smoke::BasicTypes::SomeStruct>*>( handle ); } _baseRef smoke_BasicTypes_SomeStruct_someField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum__Conversion.cpp b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum__Conversion.cpp index c4c96b71c2..68b0c12781 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::L return ::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>*) +::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>*) { return _jinput - ? std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>(convert_from_jni(_jenv, _jinput, (::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum*)nullptr)) - : std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>{}; + ? ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>(convert_from_jni(_jenv, _jinput, (::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum*)nullptr)) + : ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/LevelOne$LevelTwo$LevelThree$LevelFourEnum", com_example_smoke_LevelOne_00024LevelTwo_00024LevelThree_00024LevelFourEnum, ::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum) JniReference @@ -37,7 +37,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::LevelOne::LevelTwo::LevelThree::Lev return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFourEnum> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFour__Conversion.cpp b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFour__Conversion.cpp index 76027822e8..e2932f7c10 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFour__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_LevelOne_LevelTwo_LevelThree_LevelFour__Conversion.cpp @@ -22,12 +22,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::L _nout.string_field = n_string_field; return _nout; } -std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>*) +::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>*) { return _jinput - ? std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>(convert_from_jni(_jenv, _jinput, (::smoke::LevelOne::LevelTwo::LevelThree::LevelFour*)nullptr)) - : std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>{}; + ? ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>(convert_from_jni(_jenv, _jinput, (::smoke::LevelOne::LevelTwo::LevelThree::LevelFour*)nullptr)) + : ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/LevelOne$LevelTwo$LevelThree$LevelFour", com_example_smoke_LevelOne_00024LevelTwo_00024LevelThree_00024LevelFour, ::smoke::LevelOne::LevelTwo::LevelThree::LevelFour) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::LevelOne::LevelTwo::LevelThree::Lev return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerEnum__Conversion.cpp b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerEnum__Conversion.cpp index a5657da70a..c682132855 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerEnum__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerEnum__Conversion.cpp @@ -15,12 +15,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::O return ::smoke::OuterStruct::InnerEnum( ::gluecodium::jni::get_field_value(_jenv, _jinput, "value", (int32_t*)nullptr)); } -std::optional<::smoke::OuterStruct::InnerEnum> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::OuterStruct::InnerEnum>*) +::gluecodium::optional<::smoke::OuterStruct::InnerEnum> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::OuterStruct::InnerEnum>*) { return _jinput - ? std::optional<::smoke::OuterStruct::InnerEnum>(convert_from_jni(_jenv, _jinput, (::smoke::OuterStruct::InnerEnum*)nullptr)) - : std::optional<::smoke::OuterStruct::InnerEnum>{}; + ? ::gluecodium::optional<::smoke::OuterStruct::InnerEnum>(convert_from_jni(_jenv, _jinput, (::smoke::OuterStruct::InnerEnum*)nullptr)) + : ::gluecodium::optional<::smoke::OuterStruct::InnerEnum>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/OuterStruct$InnerEnum", com_example_smoke_OuterStruct_00024InnerEnum, ::smoke::OuterStruct::InnerEnum) JniReference @@ -40,7 +40,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::OuterStruct::InnerEnum _ninput) return make_local_ref(_jenv, _jenv->GetStaticObjectField(javaClass.get(), fieldID)); } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::OuterStruct::InnerEnum> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::OuterStruct::InnerEnum> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerLambda__Conversion.h b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerLambda__Conversion.h index bfb6f9c7e6..4d860d23fc 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerLambda__Conversion.h +++ b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerLambda__Conversion.h @@ -5,8 +5,8 @@ #include "smoke/OuterStruct.h" #include #include "JniReference.h" +#include "gluecodium/Optional.h" #include -#include namespace gluecodium { namespace jni diff --git a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerStruct__Conversion.cpp index f59ca6892a..d8147533a5 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/android/jni/com_example_smoke_OuterStruct_InnerStruct__Conversion.cpp @@ -21,12 +21,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::O _nout.other_field = n_other_field; return _nout; } -std::optional<::smoke::OuterStruct::InnerStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::OuterStruct::InnerStruct>*) +::gluecodium::optional<::smoke::OuterStruct::InnerStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::OuterStruct::InnerStruct>*) { return _jinput - ? std::optional<::smoke::OuterStruct::InnerStruct>(convert_from_jni(_jenv, _jinput, (::smoke::OuterStruct::InnerStruct*)nullptr)) - : std::optional<::smoke::OuterStruct::InnerStruct>{}; + ? ::gluecodium::optional<::smoke::OuterStruct::InnerStruct>(convert_from_jni(_jenv, _jinput, (::smoke::OuterStruct::InnerStruct*)nullptr)) + : ::gluecodium::optional<::smoke::OuterStruct::InnerStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/OuterStruct$InnerStruct", com_example_smoke_OuterStruct_00024InnerStruct, ::smoke::OuterStruct::InnerStruct) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::OuterStruct::InnerStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::OuterStruct::InnerStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::OuterStruct::InnerStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreeLambda.cpp b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreeLambda.cpp index 36c8479799..0bb23ddddc 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreeLambda.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreeLambda.cpp @@ -3,13 +3,13 @@ #include "cbridge/include/smoke/cbridge_FreeLambda.h" #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/CachedProxyBase.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "smoke/FreeEnum.h" #include "smoke/FreeLambda.h" #include #include #include -#include void smoke_FreeLambda_release_handle(_baseRef handle) { delete get_pointer<::smoke::FreeLambda>(handle); } @@ -45,7 +45,7 @@ _baseRef smoke_FreeLambda_create_proxy(smoke_FreeLambda_FunctionTable functionTa } _baseRef smoke_FreeLambda_create_optional_proxy(smoke_FreeLambda_FunctionTable functionTable) { auto proxy = smoke_FreeLambdaProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::FreeLambda>(::std::bind(&smoke_FreeLambdaProxy::operator(), proxy, ::std::placeholders::_1))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::FreeLambda>(::std::bind(&smoke_FreeLambdaProxy::operator(), proxy, ::std::placeholders::_1))) : 0; } const void* smoke_FreeLambda_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_FreeLambdaProxy::get_swift_object(get_pointer<::smoke::FreeLambda>(handle)) : nullptr; diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreePoint.cpp b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreePoint.cpp index 76e106093e..51e16ee1e3 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreePoint.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_FreePoint.cpp @@ -2,10 +2,10 @@ // #include "cbridge/include/smoke/cbridge_FreePoint.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/FreePoint.h" #include #include -#include _baseRef smoke_FreePoint_create_handle( double x, double y ) { @@ -22,7 +22,7 @@ smoke_FreePoint_release_handle( _baseRef handle ) _baseRef smoke_FreePoint_create_optional_handle(double x, double y) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::FreePoint>( ::smoke::FreePoint( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::FreePoint>( ::smoke::FreePoint( ) ); (*_struct)->x = x; (*_struct)->y = y; return reinterpret_cast<_baseRef>( _struct ); @@ -30,10 +30,10 @@ smoke_FreePoint_create_optional_handle(double x, double y) _baseRef smoke_FreePoint_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::FreePoint>*>( handle ) ); } void smoke_FreePoint_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::FreePoint>*>( handle ); } double smoke_FreePoint_x_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_LevelOne.cpp b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_LevelOne.cpp index 3a47203608..5296e44fb8 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_LevelOne.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_LevelOne.cpp @@ -5,12 +5,12 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "smoke/LevelOne.h" #include "smoke/OuterClass.h" #include "smoke/OuterInterface.h" #include #include -#include #include void smoke_LevelOne_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::LevelOne >>(handle); @@ -93,17 +93,17 @@ smoke_LevelOne_LevelTwo_LevelThree_LevelFour_release_handle( _baseRef handle ) _baseRef smoke_LevelOne_LevelTwo_LevelThree_LevelFour_create_optional_handle(_baseRef stringField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>( ::smoke::LevelOne::LevelTwo::LevelThree::LevelFour( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>( ::smoke::LevelOne::LevelTwo::LevelThree::LevelFour( ) ); (*_struct)->string_field = Conversion<::std::string>::toCpp( stringField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_LevelOne_LevelTwo_LevelThree_LevelFour_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>*>( handle ) ); } void smoke_LevelOne_LevelTwo_LevelThree_LevelFour_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::LevelOne::LevelTwo::LevelThree::LevelFour>*>( handle ); } _baseRef smoke_LevelOne_LevelTwo_LevelThree_LevelFour_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_OuterStruct.cpp b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_OuterStruct.cpp index c83a310f78..58de088f03 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_OuterStruct.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/cbridge/src/smoke/cbridge_OuterStruct.cpp @@ -8,6 +8,7 @@ #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" #include "gluecodium/Locale.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/TypeRepository.h" #include "gluecodium/UnorderedMapHash.h" @@ -19,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -39,17 +39,17 @@ smoke_OuterStruct_release_handle( _baseRef handle ) _baseRef smoke_OuterStruct_create_optional_handle(_baseRef field) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::OuterStruct>( ::smoke::OuterStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::OuterStruct>( ::smoke::OuterStruct( ) ); (*_struct)->field = Conversion<::std::string>::toCpp( field ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_OuterStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::OuterStruct>*>( handle ) ); } void smoke_OuterStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::OuterStruct>*>( handle ); } _baseRef smoke_OuterStruct_field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -70,17 +70,17 @@ smoke_OuterStruct_InnerStruct_release_handle( _baseRef handle ) _baseRef smoke_OuterStruct_InnerStruct_create_optional_handle(_baseRef otherField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::OuterStruct::InnerStruct>( ::smoke::OuterStruct::InnerStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::OuterStruct::InnerStruct>( ::smoke::OuterStruct::InnerStruct( ) ); (*_struct)->other_field = Conversion<::std::vector< ::std::chrono::system_clock::time_point >>::toCpp( otherField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_OuterStruct_InnerStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::OuterStruct::InnerStruct>*>( handle ) ); } void smoke_OuterStruct_InnerStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::OuterStruct::InnerStruct>*>( handle ); } _baseRef smoke_OuterStruct_InnerStruct_otherField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -211,7 +211,7 @@ _baseRef smoke_OuterStruct_InnerLambda_create_proxy(smoke_OuterStruct_InnerLambd } _baseRef smoke_OuterStruct_InnerLambda_create_optional_proxy(smoke_OuterStruct_InnerLambda_FunctionTable functionTable) { auto proxy = smoke_OuterStruct_InnerLambdaProxy::get_proxy(::std::move(functionTable)); - return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) std::optional<::smoke::OuterStruct::InnerLambda>(::std::bind(&smoke_OuterStruct_InnerLambdaProxy::operator(), proxy))) : 0; + return proxy ? reinterpret_cast<_baseRef>(new (::std::nothrow) ::gluecodium::optional<::smoke::OuterStruct::InnerLambda>(::std::bind(&smoke_OuterStruct_InnerLambdaProxy::operator(), proxy))) : 0; } const void* smoke_OuterStruct_InnerLambda_get_swift_object_from_cache(_baseRef handle) { return handle ? smoke_OuterStruct_InnerLambdaProxy::get_swift_object(get_pointer<::smoke::OuterStruct::InnerLambda>(handle)) : nullptr; diff --git a/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_LevelOne.cpp b/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_LevelOne.cpp index 1172ba838b..8a1c7d70f1 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_LevelOne.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_LevelOne.cpp @@ -121,7 +121,7 @@ FfiOpaqueHandle library_smoke_LevelOne_LevelTwo_LevelThree_LevelFour_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -129,20 +129,20 @@ library_smoke_LevelOne_LevelTwo_LevelThree_LevelFour_create_handle_nullable(FfiO void library_smoke_LevelOne_LevelTwo_LevelThree_LevelFour_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_LevelOne_LevelTwo_LevelThree_LevelFour_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -150,13 +150,13 @@ library_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum_create_handle_nullable( void library_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_LevelOne_LevelTwo_LevelThree_LevelFourEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_OuterStruct.cpp b/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_OuterStruct.cpp index 794037d35a..5529b75deb 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_OuterStruct.cpp +++ b/gluecodium/src/test/resources/smoke/nesting/output/dart/ffi/ffi_smoke_OuterStruct.cpp @@ -230,7 +230,7 @@ FfiOpaqueHandle library_smoke_OuterStruct_InnerLambda_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -238,13 +238,13 @@ library_smoke_OuterStruct_InnerLambda_create_handle_nullable(FfiOpaqueHandle val void library_smoke_OuterStruct_InnerLambda_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_OuterStruct_InnerLambda_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -294,7 +294,7 @@ FfiOpaqueHandle library_smoke_OuterStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -302,13 +302,13 @@ library_smoke_OuterStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_OuterStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_OuterStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -331,7 +331,7 @@ FfiOpaqueHandle library_smoke_OuterStruct_InnerStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -339,20 +339,20 @@ library_smoke_OuterStruct_InnerStruct_create_handle_nullable(FfiOpaqueHandle val void library_smoke_OuterStruct_InnerStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_OuterStruct_InnerStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_OuterStruct_InnerEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -360,13 +360,13 @@ library_smoke_OuterStruct_InnerEnum_create_handle_nullable(uint32_t value) void library_smoke_OuterStruct_InnerEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_OuterStruct_InnerEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle diff --git a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable.cpp b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable.cpp index a17e28232b..a487114f65 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable.cpp @@ -14,9 +14,9 @@ extern "C" { jstring Java_com_example_smoke_Nullable_methodWithString(JNIEnv* _jenv, jobject _jinstance, jstring jinput) { - std::optional< ::std::string > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::string > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::std::string >*)nullptr); + (::gluecodium::optional< ::std::string >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -29,9 +29,9 @@ Java_com_example_smoke_Nullable_methodWithString(JNIEnv* _jenv, jobject _jinstan jobject Java_com_example_smoke_Nullable_methodWithBoolean(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< bool > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< bool > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< bool >*)nullptr); + (::gluecodium::optional< bool >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -44,9 +44,9 @@ Java_com_example_smoke_Nullable_methodWithBoolean(JNIEnv* _jenv, jobject _jinsta jobject Java_com_example_smoke_Nullable_methodWithDouble(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< double > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< double > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< double >*)nullptr); + (::gluecodium::optional< double >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -59,9 +59,9 @@ Java_com_example_smoke_Nullable_methodWithDouble(JNIEnv* _jenv, jobject _jinstan jobject Java_com_example_smoke_Nullable_methodWithInt(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< int64_t > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< int64_t > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< int64_t >*)nullptr); + (::gluecodium::optional< int64_t >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -74,9 +74,9 @@ Java_com_example_smoke_Nullable_methodWithInt(JNIEnv* _jenv, jobject _jinstance, jobject Java_com_example_smoke_Nullable_methodWithSomeStruct(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::smoke::Nullable::SomeStruct > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeStruct > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::smoke::Nullable::SomeStruct >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeStruct >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -89,9 +89,9 @@ Java_com_example_smoke_Nullable_methodWithSomeStruct(JNIEnv* _jenv, jobject _jin jobject Java_com_example_smoke_Nullable_methodWithSomeEnum(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::smoke::Nullable::SomeEnum > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeEnum > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::smoke::Nullable::SomeEnum >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeEnum >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -104,9 +104,9 @@ Java_com_example_smoke_Nullable_methodWithSomeEnum(JNIEnv* _jenv, jobject _jinst jobject Java_com_example_smoke_Nullable_methodWithSomeArray(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::smoke::Nullable::SomeArray > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeArray > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::smoke::Nullable::SomeArray >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeArray >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -119,9 +119,9 @@ Java_com_example_smoke_Nullable_methodWithSomeArray(JNIEnv* _jenv, jobject _jins jobject Java_com_example_smoke_Nullable_methodWithInlineArray(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::std::vector< ::std::string > > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::vector< ::std::string > > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::std::vector< ::std::string > >*)nullptr); + (::gluecodium::optional< ::std::vector< ::std::string > >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -134,9 +134,9 @@ Java_com_example_smoke_Nullable_methodWithInlineArray(JNIEnv* _jenv, jobject _ji jobject Java_com_example_smoke_Nullable_methodWithSomeMap(JNIEnv* _jenv, jobject _jinstance, jobject jinput) { - std::optional< ::smoke::Nullable::SomeMap > input = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeMap > input = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jinput), - (std::optional< ::smoke::Nullable::SomeMap >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeMap >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -176,9 +176,9 @@ Java_com_example_smoke_Nullable_getStringProperty(JNIEnv* _jenv, jobject _jinsta void Java_com_example_smoke_Nullable_setStringProperty(JNIEnv* _jenv, jobject _jinstance, jstring jvalue) { - std::optional< ::std::string > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::string > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::std::string >*)nullptr); + (::gluecodium::optional< ::std::string >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -202,9 +202,9 @@ Java_com_example_smoke_Nullable_isBoolProperty(JNIEnv* _jenv, jobject _jinstance void Java_com_example_smoke_Nullable_setBoolProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< bool > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< bool > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< bool >*)nullptr); + (::gluecodium::optional< bool >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -228,9 +228,9 @@ Java_com_example_smoke_Nullable_getDoubleProperty(JNIEnv* _jenv, jobject _jinsta void Java_com_example_smoke_Nullable_setDoubleProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< double > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< double > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< double >*)nullptr); + (::gluecodium::optional< double >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -254,9 +254,9 @@ Java_com_example_smoke_Nullable_getIntProperty(JNIEnv* _jenv, jobject _jinstance void Java_com_example_smoke_Nullable_setIntProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< int64_t > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< int64_t > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< int64_t >*)nullptr); + (::gluecodium::optional< int64_t >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -280,9 +280,9 @@ Java_com_example_smoke_Nullable_getStructProperty(JNIEnv* _jenv, jobject _jinsta void Java_com_example_smoke_Nullable_setStructProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< ::smoke::Nullable::SomeStruct > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeStruct > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::smoke::Nullable::SomeStruct >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeStruct >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -306,9 +306,9 @@ Java_com_example_smoke_Nullable_getEnumProperty(JNIEnv* _jenv, jobject _jinstanc void Java_com_example_smoke_Nullable_setEnumProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< ::smoke::Nullable::SomeEnum > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeEnum > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::smoke::Nullable::SomeEnum >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeEnum >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -332,9 +332,9 @@ Java_com_example_smoke_Nullable_getArrayProperty(JNIEnv* _jenv, jobject _jinstan void Java_com_example_smoke_Nullable_setArrayProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< ::smoke::Nullable::SomeArray > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeArray > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::smoke::Nullable::SomeArray >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeArray >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -358,9 +358,9 @@ Java_com_example_smoke_Nullable_getInlineArrayProperty(JNIEnv* _jenv, jobject _j void Java_com_example_smoke_Nullable_setInlineArrayProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< ::std::vector< ::std::string > > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::std::vector< ::std::string > > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::std::vector< ::std::string > >*)nullptr); + (::gluecodium::optional< ::std::vector< ::std::string > >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, @@ -384,9 +384,9 @@ Java_com_example_smoke_Nullable_getMapProperty(JNIEnv* _jenv, jobject _jinstance void Java_com_example_smoke_Nullable_setMapProperty(JNIEnv* _jenv, jobject _jinstance, jobject jvalue) { - std::optional< ::smoke::Nullable::SomeMap > value = ::gluecodium::jni::convert_from_jni(_jenv, + ::gluecodium::optional< ::smoke::Nullable::SomeMap > value = ::gluecodium::jni::convert_from_jni(_jenv, ::gluecodium::jni::make_non_releasing_ref(jvalue), - (std::optional< ::smoke::Nullable::SomeMap >*)nullptr); + (::gluecodium::optional< ::smoke::Nullable::SomeMap >*)nullptr); auto pInstanceSharedPointer = reinterpret_cast*> ( ::gluecodium::jni::get_field_value( _jenv, diff --git a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_NullableCollectionsStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_NullableCollectionsStruct__Conversion.cpp index 4aa6629b5d..58ff3ce222 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_NullableCollectionsStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_NullableCollectionsStruct__Conversion.cpp @@ -14,24 +14,24 @@ ::smoke::NullableCollectionsStruct convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::NullableCollectionsStruct*) { ::smoke::NullableCollectionsStruct _nout{}; - ::std::vector< std::optional< ::std::chrono::system_clock::time_point > > n_dates = convert_from_jni( + ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > > n_dates = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "dates", "Ljava/util/List;"), - (::std::vector< std::optional< ::std::chrono::system_clock::time_point > >*)nullptr ); + (::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >*)nullptr ); _nout.dates = n_dates; - ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > > n_structs = convert_from_jni( + ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > > n_structs = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "structs", "Ljava/util/Map;"), - (::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >*)nullptr ); + (::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >*)nullptr ); _nout.structs = n_structs; return _nout; } -std::optional<::smoke::NullableCollectionsStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::NullableCollectionsStruct>*) +::gluecodium::optional<::smoke::NullableCollectionsStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::NullableCollectionsStruct>*) { return _jinput - ? std::optional<::smoke::NullableCollectionsStruct>(convert_from_jni(_jenv, _jinput, (::smoke::NullableCollectionsStruct*)nullptr)) - : std::optional<::smoke::NullableCollectionsStruct>{}; + ? ::gluecodium::optional<::smoke::NullableCollectionsStruct>(convert_from_jni(_jenv, _jinput, (::smoke::NullableCollectionsStruct*)nullptr)) + : ::gluecodium::optional<::smoke::NullableCollectionsStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/NullableCollectionsStruct", com_example_smoke_NullableCollectionsStruct, ::smoke::NullableCollectionsStruct) JniReference @@ -46,7 +46,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::NullableCollectionsStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::NullableCollectionsStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::NullableCollectionsStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableIntsStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableIntsStruct__Conversion.cpp index 74d9f242cb..7b56dad96e 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableIntsStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableIntsStruct__Conversion.cpp @@ -14,62 +14,62 @@ ::smoke::Nullable::NullableIntsStruct convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::Nullable::NullableIntsStruct*) { ::smoke::Nullable::NullableIntsStruct _nout{}; - std::optional< int8_t > n_int8_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< int8_t > n_int8_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "int8Field", - (std::optional< int8_t >*)nullptr ); + (::gluecodium::optional< int8_t >*)nullptr ); _nout.int8_field = n_int8_field; - std::optional< int16_t > n_int16_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< int16_t > n_int16_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "int16Field", - (std::optional< int16_t >*)nullptr ); + (::gluecodium::optional< int16_t >*)nullptr ); _nout.int16_field = n_int16_field; - std::optional< int32_t > n_int32_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< int32_t > n_int32_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "int32Field", - (std::optional< int32_t >*)nullptr ); + (::gluecodium::optional< int32_t >*)nullptr ); _nout.int32_field = n_int32_field; - std::optional< int64_t > n_int64_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< int64_t > n_int64_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "int64Field", - (std::optional< int64_t >*)nullptr ); + (::gluecodium::optional< int64_t >*)nullptr ); _nout.int64_field = n_int64_field; - std::optional< uint8_t > n_uint8_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< uint8_t > n_uint8_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "uint8Field", - (std::optional< uint8_t >*)nullptr ); + (::gluecodium::optional< uint8_t >*)nullptr ); _nout.uint8_field = n_uint8_field; - std::optional< uint16_t > n_uint16_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< uint16_t > n_uint16_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "uint16Field", - (std::optional< uint16_t >*)nullptr ); + (::gluecodium::optional< uint16_t >*)nullptr ); _nout.uint16_field = n_uint16_field; - std::optional< uint32_t > n_uint32_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< uint32_t > n_uint32_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "uint32Field", - (std::optional< uint32_t >*)nullptr ); + (::gluecodium::optional< uint32_t >*)nullptr ); _nout.uint32_field = n_uint32_field; - std::optional< uint64_t > n_uint64_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< uint64_t > n_uint64_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "uint64Field", - (std::optional< uint64_t >*)nullptr ); + (::gluecodium::optional< uint64_t >*)nullptr ); _nout.uint64_field = n_uint64_field; return _nout; } -std::optional<::smoke::Nullable::NullableIntsStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Nullable::NullableIntsStruct>*) +::gluecodium::optional<::smoke::Nullable::NullableIntsStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>*) { return _jinput - ? std::optional<::smoke::Nullable::NullableIntsStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Nullable::NullableIntsStruct*)nullptr)) - : std::optional<::smoke::Nullable::NullableIntsStruct>{}; + ? ::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Nullable::NullableIntsStruct*)nullptr)) + : ::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Nullable$NullableIntsStruct", com_example_smoke_Nullable_00024NullableIntsStruct, ::smoke::Nullable::NullableIntsStruct) JniReference @@ -88,7 +88,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Nullable::NullableIntsStruct& _ninp return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Nullable::NullableIntsStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Nullable::NullableIntsStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableStruct__Conversion.cpp index feacca272d..2d62aa7c31 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/android/jni/com_example_smoke_Nullable_NullableStruct__Conversion.cpp @@ -14,48 +14,48 @@ ::smoke::Nullable::NullableStruct convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::Nullable::NullableStruct*) { ::smoke::Nullable::NullableStruct _nout{}; - std::optional< ::std::string > n_string_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< ::std::string > n_string_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "stringField", - (std::optional< ::std::string >*)nullptr ); + (::gluecodium::optional< ::std::string >*)nullptr ); _nout.string_field = n_string_field; - std::optional< bool > n_bool_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< bool > n_bool_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "boolField", - (std::optional< bool >*)nullptr ); + (::gluecodium::optional< bool >*)nullptr ); _nout.bool_field = n_bool_field; - std::optional< double > n_double_field = ::gluecodium::jni::get_field_value( + ::gluecodium::optional< double > n_double_field = ::gluecodium::jni::get_field_value( _jenv, _jinput, "doubleField", - (std::optional< double >*)nullptr ); + (::gluecodium::optional< double >*)nullptr ); _nout.double_field = n_double_field; - std::optional< ::smoke::Nullable::SomeStruct > n_struct_field = convert_from_jni( + ::gluecodium::optional< ::smoke::Nullable::SomeStruct > n_struct_field = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "structField", "Lcom/example/smoke/Nullable$SomeStruct;"), - (std::optional< ::smoke::Nullable::SomeStruct >*)nullptr ); + (::gluecodium::optional< ::smoke::Nullable::SomeStruct >*)nullptr ); _nout.struct_field = n_struct_field; - std::optional< ::smoke::Nullable::SomeEnum > n_enum_field = convert_from_jni( + ::gluecodium::optional< ::smoke::Nullable::SomeEnum > n_enum_field = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "enumField", "Lcom/example/smoke/Nullable$SomeEnum;"), - (std::optional< ::smoke::Nullable::SomeEnum >*)nullptr ); + (::gluecodium::optional< ::smoke::Nullable::SomeEnum >*)nullptr ); _nout.enum_field = n_enum_field; - std::optional< ::smoke::Nullable::SomeArray > n_array_field = convert_from_jni( + ::gluecodium::optional< ::smoke::Nullable::SomeArray > n_array_field = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "arrayField", "Ljava/util/List;"), - (std::optional< ::smoke::Nullable::SomeArray >*)nullptr ); + (::gluecodium::optional< ::smoke::Nullable::SomeArray >*)nullptr ); _nout.array_field = n_array_field; - std::optional< ::std::vector< ::std::string > > n_inline_array_field = convert_from_jni( + ::gluecodium::optional< ::std::vector< ::std::string > > n_inline_array_field = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "inlineArrayField", "Ljava/util/List;"), - (std::optional< ::std::vector< ::std::string > >*)nullptr ); + (::gluecodium::optional< ::std::vector< ::std::string > >*)nullptr ); _nout.inline_array_field = n_inline_array_field; - std::optional< ::smoke::Nullable::SomeMap > n_map_field = convert_from_jni( + ::gluecodium::optional< ::smoke::Nullable::SomeMap > n_map_field = convert_from_jni( _jenv, ::gluecodium::jni::get_object_field_value(_jenv, _jinput, "mapField", "Ljava/util/Map;"), - (std::optional< ::smoke::Nullable::SomeMap >*)nullptr ); + (::gluecodium::optional< ::smoke::Nullable::SomeMap >*)nullptr ); _nout.map_field = n_map_field; ::std::shared_ptr< ::smoke::SomeInterface > n_instance_field = convert_from_jni( _jenv, @@ -64,12 +64,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::N _nout.instance_field = n_instance_field; return _nout; } -std::optional<::smoke::Nullable::NullableStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Nullable::NullableStruct>*) +::gluecodium::optional<::smoke::Nullable::NullableStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Nullable::NullableStruct>*) { return _jinput - ? std::optional<::smoke::Nullable::NullableStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Nullable::NullableStruct*)nullptr)) - : std::optional<::smoke::Nullable::NullableStruct>{}; + ? ::gluecodium::optional<::smoke::Nullable::NullableStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Nullable::NullableStruct*)nullptr)) + : ::gluecodium::optional<::smoke::Nullable::NullableStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Nullable$NullableStruct", com_example_smoke_Nullable_00024NullableStruct, ::smoke::Nullable::NullableStruct) JniReference @@ -95,7 +95,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Nullable::NullableStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Nullable::NullableStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Nullable::NullableStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/GenericCollections.cpp b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/GenericCollections.cpp index 1fc563a40a..3d8e5cb5dc 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/GenericCollections.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/GenericCollections.cpp @@ -3,13 +3,13 @@ #include "cbridge/include/GenericCollections.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Nullable.h" #include #include -#include #include #include #include @@ -34,13 +34,13 @@ void foobar_ArrayOf__Date_append( _baseRef handle, double item ) Conversion<::std::vector< ::std::chrono::system_clock::time_point >>::toCpp(handle).push_back(Conversion<::std::chrono::system_clock::time_point>::toCpp(item)); } _baseRef foobar_ArrayOf__Date_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::chrono::system_clock::time_point >>( ::std::vector< ::std::chrono::system_clock::time_point >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>( ::std::vector< ::std::chrono::system_clock::time_point >( ) ) ); } void foobar_ArrayOf__Date_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>*>( handle ); } _baseRef foobar_ArrayOf__Date_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::chrono::system_clock::time_point >>*>( handle ) ); } _baseRef foobar_ArrayOf__String_create_handle() { return reinterpret_cast<_baseRef>( new ::std::vector< ::std::string >( ) ); @@ -62,79 +62,79 @@ void foobar_ArrayOf__String_append( _baseRef handle, _baseRef item ) Conversion<::std::vector< ::std::string >>::toCpp(handle).push_back(Conversion<::std::string>::toCpp(item)); } _baseRef foobar_ArrayOf__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::std::string >>( ::std::vector< ::std::string >( ) ) ); } void foobar_ArrayOf__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ); } _baseRef foobar_ArrayOf__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::std::string >>*>( handle ) ); } _baseRef foobar_ArrayOf_nullable_Date_create_handle() { - return reinterpret_cast<_baseRef>( new ::std::vector< std::optional< ::std::chrono::system_clock::time_point > >( ) ); + return reinterpret_cast<_baseRef>( new ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >( ) ); } _baseRef foobar_ArrayOf_nullable_Date_copy_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( new ::std::vector< std::optional< ::std::chrono::system_clock::time_point > >( *reinterpret_cast<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >*>( handle ) ) ); + return reinterpret_cast<_baseRef>( new ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >( *reinterpret_cast<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >*>( handle ) ) ); } void foobar_ArrayOf_nullable_Date_release_handle(_baseRef handle) { - delete reinterpret_cast<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >*>( handle ); + delete reinterpret_cast<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >*>( handle ); } uint64_t foobar_ArrayOf_nullable_Date_count(_baseRef handle) { - return Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toCpp( handle ).size( ); + return Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toCpp( handle ).size( ); } _baseRef foobar_ArrayOf_nullable_Date_get( _baseRef handle, uint64_t index ) { - return Conversion>::referenceBaseRef(Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toCpp( handle )[index]); + return Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::referenceBaseRef(Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toCpp( handle )[index]); } void foobar_ArrayOf_nullable_Date_append( _baseRef handle, _baseRef item ) { - Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toCpp(handle).push_back(Conversion>::toCpp(item)); + Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toCpp(handle).push_back(Conversion<::gluecodium::optional< ::std::chrono::system_clock::time_point >>::toCpp(item)); } _baseRef foobar_ArrayOf_nullable_Date_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>( ::std::vector< std::optional< ::std::chrono::system_clock::time_point > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>( ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >( ) ) ); } void foobar_ArrayOf_nullable_Date_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>*>( handle ); } _baseRef foobar_ArrayOf_nullable_Date_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>*>( handle ) ); } _baseRef foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_create_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >() ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >() ); } void foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_release_handle(_baseRef handle) { - delete get_pointer<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>(handle); + delete get_pointer<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>(handle); } _baseRef foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator(_baseRef handle) { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator( get_pointer<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>(handle)->begin() ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator( get_pointer<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>(handle)->begin() ) ); } void foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator_release_handle(_baseRef iterator_handle) { - delete reinterpret_cast<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ); + delete reinterpret_cast<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ); } void foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_put(_baseRef handle, int32_t key, _baseRef value) { - (*get_pointer<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>(handle)).emplace(key, Conversion>::toCpp(value)); + (*get_pointer<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>(handle)).emplace(key, Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toCpp(value)); } bool foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator_is_valid(_baseRef handle, _baseRef iterator_handle) { - return *reinterpret_cast<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ) != get_pointer<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>(handle)->end(); + return *reinterpret_cast<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ) != get_pointer<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>(handle)->end(); } void foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator_increment(_baseRef iterator_handle) { - ++*reinterpret_cast<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ); + ++*reinterpret_cast<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ); } int32_t foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator_key(_baseRef iterator_handle) { - auto& key = (*reinterpret_cast<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ))->first; + auto& key = (*reinterpret_cast<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ))->first; return key; } _baseRef foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_iterator_value(_baseRef iterator_handle) { - auto& value = (*reinterpret_cast<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ))->second; - return Conversion>::toBaseRef(value); + auto& value = (*reinterpret_cast<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >::iterator*>( iterator_handle ))->second; + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toBaseRef(value); } _baseRef foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>( ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>( ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >( ) ) ); } void foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast >>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>*>( handle ); } _baseRef foobar_MapOf__Int_To_nullable_smoke_Nullable_SomeStruct_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast >>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>*>( handle ) ); } _baseRef foobar_MapOf__Long_To__String_create_handle() { return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::std::unordered_map< int64_t, ::std::string >() ); @@ -166,11 +166,11 @@ _baseRef foobar_MapOf__Long_To__String_iterator_value(_baseRef iterator_handle) return Conversion<::std::string>::toBaseRef(value); } _baseRef foobar_MapOf__Long_To__String_create_optional_handle() { - return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) std::optional<::std::unordered_map< int64_t, ::std::string >>( ::std::unordered_map< int64_t, ::std::string >( ) ) ); + return reinterpret_cast<_baseRef>( new ( ::std::nothrow ) ::gluecodium::optional<::std::unordered_map< int64_t, ::std::string >>( ::std::unordered_map< int64_t, ::std::string >( ) ) ); } void foobar_MapOf__Long_To__String_release_optional_handle(_baseRef handle) { - delete reinterpret_cast>*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::std::unordered_map< int64_t, ::std::string >>*>( handle ); } _baseRef foobar_MapOf__Long_To__String_unwrap_optional_handle(_baseRef handle) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast>*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::std::unordered_map< int64_t, ::std::string >>*>( handle ) ); } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_Nullable.cpp b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_Nullable.cpp index 19dbf5d3a0..117150ab7f 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_Nullable.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_Nullable.cpp @@ -5,6 +5,7 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Nullable.h" @@ -12,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -38,88 +38,88 @@ void smoke_Nullable_remove_swift_object_from_wrapper_cache(_baseRef handle) { ::gluecodium::get_wrapper_cache().remove_cached_wrapper(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(handle)->get()); } _baseRef smoke_Nullable_methodWithString(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_string(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::string >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_string(Conversion<::gluecodium::optional< ::std::string >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithBoolean(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_boolean(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< bool >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_boolean(Conversion<::gluecodium::optional< bool >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithDouble(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_double(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< double >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_double(Conversion<::gluecodium::optional< double >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithInt(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_int(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< int64_t >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_int(Conversion<::gluecodium::optional< int64_t >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithSomeStruct(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_struct(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_struct(Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithSomeEnum(_baseRef _instance, _baseRef input) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_enum(Conversion>::toCpp(input))); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_enum(Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithSomeArray(_baseRef _instance, _baseRef input) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_array(Conversion >>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_array(Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithInlineArray(_baseRef _instance, _baseRef input) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_inline_array(Conversion >>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_inline_array(Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithSomeMap(_baseRef _instance, _baseRef input) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_map(Conversion >>::toCpp(input))); + return Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_some_map(Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toCpp(input))); } _baseRef smoke_Nullable_methodWithInstance(_baseRef _instance, _baseRef input) { return Conversion<::std::shared_ptr< ::smoke::SomeInterface >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->method_with_instance(Conversion<::std::shared_ptr< ::smoke::SomeInterface >>::toCpp(input))); } _baseRef smoke_Nullable_stringProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_string_property()); + return Conversion<::gluecodium::optional< ::std::string >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_string_property()); } void smoke_Nullable_stringProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_string_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_string_property(Conversion<::gluecodium::optional< ::std::string >>::toCpp(value)); } _baseRef smoke_Nullable_isBoolProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->is_bool_property()); + return Conversion<::gluecodium::optional< bool >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->is_bool_property()); } void smoke_Nullable_isBoolProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_bool_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_bool_property(Conversion<::gluecodium::optional< bool >>::toCpp(value)); } _baseRef smoke_Nullable_doubleProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_double_property()); + return Conversion<::gluecodium::optional< double >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_double_property()); } void smoke_Nullable_doubleProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_double_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_double_property(Conversion<::gluecodium::optional< double >>::toCpp(value)); } _baseRef smoke_Nullable_intProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_int_property()); + return Conversion<::gluecodium::optional< int64_t >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_int_property()); } void smoke_Nullable_intProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_int_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_int_property(Conversion<::gluecodium::optional< int64_t >>::toCpp(value)); } _baseRef smoke_Nullable_structProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_struct_property()); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_struct_property()); } void smoke_Nullable_structProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_struct_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_struct_property(Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toCpp(value)); } _baseRef smoke_Nullable_enumProperty_get(_baseRef _instance) { - return Conversion>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_enum_property()); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_enum_property()); } void smoke_Nullable_enumProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_enum_property(Conversion>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_enum_property(Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toCpp(value)); } _baseRef smoke_Nullable_arrayProperty_get(_baseRef _instance) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_array_property()); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_array_property()); } void smoke_Nullable_arrayProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_array_property(Conversion >>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_array_property(Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp(value)); } _baseRef smoke_Nullable_inlineArrayProperty_get(_baseRef _instance) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_inline_array_property()); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_inline_array_property()); } void smoke_Nullable_inlineArrayProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_inline_array_property(Conversion >>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_inline_array_property(Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp(value)); } _baseRef smoke_Nullable_mapProperty_get(_baseRef _instance) { - return Conversion >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_map_property()); + return Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_map_property()); } void smoke_Nullable_mapProperty_set(_baseRef _instance, _baseRef value) { - return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_map_property(Conversion >>::toCpp(value)); + return get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->set_map_property(Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toCpp(value)); } _baseRef smoke_Nullable_instanceProperty_get(_baseRef _instance) { return Conversion<::std::shared_ptr< ::smoke::SomeInterface >>::toBaseRef(get_pointer<::std::shared_ptr< ::smoke::Nullable >>(_instance)->get()->get_instance_property()); @@ -142,17 +142,17 @@ smoke_Nullable_SomeStruct_release_handle( _baseRef handle ) _baseRef smoke_Nullable_SomeStruct_create_optional_handle(_baseRef stringField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Nullable::SomeStruct>( ::smoke::Nullable::SomeStruct( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Nullable::SomeStruct>( ::smoke::Nullable::SomeStruct( ) ); (*_struct)->string_field = Conversion<::std::string>::toCpp( stringField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Nullable_SomeStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Nullable::SomeStruct>*>( handle ) ); } void smoke_Nullable_SomeStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Nullable::SomeStruct>*>( handle ); } _baseRef smoke_Nullable_SomeStruct_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -162,14 +162,14 @@ _baseRef smoke_Nullable_NullableStruct_create_handle( _baseRef stringField, _baseRef boolField, _baseRef doubleField, _baseRef structField, _baseRef enumField, _baseRef arrayField, _baseRef inlineArrayField, _baseRef mapField, _baseRef instanceField ) { ::smoke::Nullable::NullableStruct* _struct = new ( ::std::nothrow ) ::smoke::Nullable::NullableStruct(); - _struct->string_field = Conversion>::toCpp( stringField ); - _struct->bool_field = Conversion>::toCpp( boolField ); - _struct->double_field = Conversion>::toCpp( doubleField ); - _struct->struct_field = Conversion>::toCpp( structField ); - _struct->enum_field = Conversion>::toCpp( enumField ); - _struct->array_field = Conversion >>::toCpp( arrayField ); - _struct->inline_array_field = Conversion >>::toCpp( inlineArrayField ); - _struct->map_field = Conversion >>::toCpp( mapField ); + _struct->string_field = Conversion<::gluecodium::optional< ::std::string >>::toCpp( stringField ); + _struct->bool_field = Conversion<::gluecodium::optional< bool >>::toCpp( boolField ); + _struct->double_field = Conversion<::gluecodium::optional< double >>::toCpp( doubleField ); + _struct->struct_field = Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toCpp( structField ); + _struct->enum_field = Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toCpp( enumField ); + _struct->array_field = Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp( arrayField ); + _struct->inline_array_field = Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp( inlineArrayField ); + _struct->map_field = Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toCpp( mapField ); _struct->instance_field = Conversion<::std::shared_ptr< ::smoke::SomeInterface >>::toCpp( instanceField ); return reinterpret_cast<_baseRef>( _struct ); } @@ -181,57 +181,57 @@ smoke_Nullable_NullableStruct_release_handle( _baseRef handle ) _baseRef smoke_Nullable_NullableStruct_create_optional_handle(_baseRef stringField, _baseRef boolField, _baseRef doubleField, _baseRef structField, _baseRef enumField, _baseRef arrayField, _baseRef inlineArrayField, _baseRef mapField, _baseRef instanceField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Nullable::NullableStruct>( ::smoke::Nullable::NullableStruct( ) ); - (*_struct)->string_field = Conversion>::toCpp( stringField ); - (*_struct)->bool_field = Conversion>::toCpp( boolField ); - (*_struct)->double_field = Conversion>::toCpp( doubleField ); - (*_struct)->struct_field = Conversion>::toCpp( structField ); - (*_struct)->enum_field = Conversion>::toCpp( enumField ); - (*_struct)->array_field = Conversion >>::toCpp( arrayField ); - (*_struct)->inline_array_field = Conversion >>::toCpp( inlineArrayField ); - (*_struct)->map_field = Conversion >>::toCpp( mapField ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Nullable::NullableStruct>( ::smoke::Nullable::NullableStruct( ) ); + (*_struct)->string_field = Conversion<::gluecodium::optional< ::std::string >>::toCpp( stringField ); + (*_struct)->bool_field = Conversion<::gluecodium::optional< bool >>::toCpp( boolField ); + (*_struct)->double_field = Conversion<::gluecodium::optional< double >>::toCpp( doubleField ); + (*_struct)->struct_field = Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toCpp( structField ); + (*_struct)->enum_field = Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toCpp( enumField ); + (*_struct)->array_field = Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp( arrayField ); + (*_struct)->inline_array_field = Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toCpp( inlineArrayField ); + (*_struct)->map_field = Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toCpp( mapField ); (*_struct)->instance_field = Conversion<::std::shared_ptr< ::smoke::SomeInterface >>::toCpp( instanceField ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Nullable_NullableStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Nullable::NullableStruct>*>( handle ) ); } void smoke_Nullable_NullableStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Nullable::NullableStruct>*>( handle ); } _baseRef smoke_Nullable_NullableStruct_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->string_field); + return Conversion<::gluecodium::optional< ::std::string >>::toBaseRef(struct_pointer->string_field); } _baseRef smoke_Nullable_NullableStruct_boolField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->bool_field); + return Conversion<::gluecodium::optional< bool >>::toBaseRef(struct_pointer->bool_field); } _baseRef smoke_Nullable_NullableStruct_doubleField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->double_field); + return Conversion<::gluecodium::optional< double >>::toBaseRef(struct_pointer->double_field); } _baseRef smoke_Nullable_NullableStruct_structField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->struct_field); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeStruct >>::toBaseRef(struct_pointer->struct_field); } _baseRef smoke_Nullable_NullableStruct_enumField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->enum_field); + return Conversion<::gluecodium::optional< ::smoke::Nullable::SomeEnum >>::toBaseRef(struct_pointer->enum_field); } _baseRef smoke_Nullable_NullableStruct_arrayField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion >>::toBaseRef(struct_pointer->array_field); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(struct_pointer->array_field); } _baseRef smoke_Nullable_NullableStruct_inlineArrayField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion >>::toBaseRef(struct_pointer->inline_array_field); + return Conversion<::gluecodium::optional< ::std::vector< ::std::string > >>::toBaseRef(struct_pointer->inline_array_field); } _baseRef smoke_Nullable_NullableStruct_mapField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion >>::toBaseRef(struct_pointer->map_field); + return Conversion<::gluecodium::optional< ::std::unordered_map< int64_t, ::std::string > >>::toBaseRef(struct_pointer->map_field); } _baseRef smoke_Nullable_NullableStruct_instanceField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -241,14 +241,14 @@ _baseRef smoke_Nullable_NullableIntsStruct_create_handle( _baseRef int8Field, _baseRef int16Field, _baseRef int32Field, _baseRef int64Field, _baseRef uint8Field, _baseRef uint16Field, _baseRef uint32Field, _baseRef uint64Field ) { ::smoke::Nullable::NullableIntsStruct* _struct = new ( ::std::nothrow ) ::smoke::Nullable::NullableIntsStruct(); - _struct->int8_field = Conversion>::toCpp( int8Field ); - _struct->int16_field = Conversion>::toCpp( int16Field ); - _struct->int32_field = Conversion>::toCpp( int32Field ); - _struct->int64_field = Conversion>::toCpp( int64Field ); - _struct->uint8_field = Conversion>::toCpp( uint8Field ); - _struct->uint16_field = Conversion>::toCpp( uint16Field ); - _struct->uint32_field = Conversion>::toCpp( uint32Field ); - _struct->uint64_field = Conversion>::toCpp( uint64Field ); + _struct->int8_field = Conversion<::gluecodium::optional< int8_t >>::toCpp( int8Field ); + _struct->int16_field = Conversion<::gluecodium::optional< int16_t >>::toCpp( int16Field ); + _struct->int32_field = Conversion<::gluecodium::optional< int32_t >>::toCpp( int32Field ); + _struct->int64_field = Conversion<::gluecodium::optional< int64_t >>::toCpp( int64Field ); + _struct->uint8_field = Conversion<::gluecodium::optional< uint8_t >>::toCpp( uint8Field ); + _struct->uint16_field = Conversion<::gluecodium::optional< uint16_t >>::toCpp( uint16Field ); + _struct->uint32_field = Conversion<::gluecodium::optional< uint32_t >>::toCpp( uint32Field ); + _struct->uint64_field = Conversion<::gluecodium::optional< uint64_t >>::toCpp( uint64Field ); return reinterpret_cast<_baseRef>( _struct ); } void @@ -259,54 +259,54 @@ smoke_Nullable_NullableIntsStruct_release_handle( _baseRef handle ) _baseRef smoke_Nullable_NullableIntsStruct_create_optional_handle(_baseRef int8Field, _baseRef int16Field, _baseRef int32Field, _baseRef int64Field, _baseRef uint8Field, _baseRef uint16Field, _baseRef uint32Field, _baseRef uint64Field) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Nullable::NullableIntsStruct>( ::smoke::Nullable::NullableIntsStruct( ) ); - (*_struct)->int8_field = Conversion>::toCpp( int8Field ); - (*_struct)->int16_field = Conversion>::toCpp( int16Field ); - (*_struct)->int32_field = Conversion>::toCpp( int32Field ); - (*_struct)->int64_field = Conversion>::toCpp( int64Field ); - (*_struct)->uint8_field = Conversion>::toCpp( uint8Field ); - (*_struct)->uint16_field = Conversion>::toCpp( uint16Field ); - (*_struct)->uint32_field = Conversion>::toCpp( uint32Field ); - (*_struct)->uint64_field = Conversion>::toCpp( uint64Field ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>( ::smoke::Nullable::NullableIntsStruct( ) ); + (*_struct)->int8_field = Conversion<::gluecodium::optional< int8_t >>::toCpp( int8Field ); + (*_struct)->int16_field = Conversion<::gluecodium::optional< int16_t >>::toCpp( int16Field ); + (*_struct)->int32_field = Conversion<::gluecodium::optional< int32_t >>::toCpp( int32Field ); + (*_struct)->int64_field = Conversion<::gluecodium::optional< int64_t >>::toCpp( int64Field ); + (*_struct)->uint8_field = Conversion<::gluecodium::optional< uint8_t >>::toCpp( uint8Field ); + (*_struct)->uint16_field = Conversion<::gluecodium::optional< uint16_t >>::toCpp( uint16Field ); + (*_struct)->uint32_field = Conversion<::gluecodium::optional< uint32_t >>::toCpp( uint32Field ); + (*_struct)->uint64_field = Conversion<::gluecodium::optional< uint64_t >>::toCpp( uint64Field ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Nullable_NullableIntsStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>*>( handle ) ); } void smoke_Nullable_NullableIntsStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Nullable::NullableIntsStruct>*>( handle ); } _baseRef smoke_Nullable_NullableIntsStruct_int8Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->int8_field); + return Conversion<::gluecodium::optional< int8_t >>::toBaseRef(struct_pointer->int8_field); } _baseRef smoke_Nullable_NullableIntsStruct_int16Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->int16_field); + return Conversion<::gluecodium::optional< int16_t >>::toBaseRef(struct_pointer->int16_field); } _baseRef smoke_Nullable_NullableIntsStruct_int32Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->int32_field); + return Conversion<::gluecodium::optional< int32_t >>::toBaseRef(struct_pointer->int32_field); } _baseRef smoke_Nullable_NullableIntsStruct_int64Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->int64_field); + return Conversion<::gluecodium::optional< int64_t >>::toBaseRef(struct_pointer->int64_field); } _baseRef smoke_Nullable_NullableIntsStruct_uint8Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->uint8_field); + return Conversion<::gluecodium::optional< uint8_t >>::toBaseRef(struct_pointer->uint8_field); } _baseRef smoke_Nullable_NullableIntsStruct_uint16Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->uint16_field); + return Conversion<::gluecodium::optional< uint16_t >>::toBaseRef(struct_pointer->uint16_field); } _baseRef smoke_Nullable_NullableIntsStruct_uint32Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->uint32_field); + return Conversion<::gluecodium::optional< uint32_t >>::toBaseRef(struct_pointer->uint32_field); } _baseRef smoke_Nullable_NullableIntsStruct_uint64Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion>::toBaseRef(struct_pointer->uint64_field); + return Conversion<::gluecodium::optional< uint64_t >>::toBaseRef(struct_pointer->uint64_field); } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_NullableCollectionsStruct.cpp b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_NullableCollectionsStruct.cpp index 5aab307df2..8607107e92 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_NullableCollectionsStruct.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/cbridge/src/smoke/cbridge_NullableCollectionsStruct.cpp @@ -2,6 +2,7 @@ // #include "cbridge/include/smoke/cbridge_NullableCollectionsStruct.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" @@ -11,15 +12,14 @@ #include #include #include -#include #include #include _baseRef smoke_NullableCollectionsStruct_create_handle( _baseRef dates, _baseRef structs ) { ::smoke::NullableCollectionsStruct* _struct = new ( ::std::nothrow ) ::smoke::NullableCollectionsStruct(); - _struct->dates = Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toCpp( dates ); - _struct->structs = Conversion<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>::toCpp( structs ); + _struct->dates = Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toCpp( dates ); + _struct->structs = Conversion<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>::toCpp( structs ); return reinterpret_cast<_baseRef>( _struct ); } void @@ -30,24 +30,24 @@ smoke_NullableCollectionsStruct_release_handle( _baseRef handle ) _baseRef smoke_NullableCollectionsStruct_create_optional_handle(_baseRef dates, _baseRef structs) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::NullableCollectionsStruct>( ::smoke::NullableCollectionsStruct( ) ); - (*_struct)->dates = Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toCpp( dates ); - (*_struct)->structs = Conversion<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>::toCpp( structs ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::NullableCollectionsStruct>( ::smoke::NullableCollectionsStruct( ) ); + (*_struct)->dates = Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toCpp( dates ); + (*_struct)->structs = Conversion<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>::toCpp( structs ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_NullableCollectionsStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::NullableCollectionsStruct>*>( handle ) ); } void smoke_NullableCollectionsStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::NullableCollectionsStruct>*>( handle ); } _baseRef smoke_NullableCollectionsStruct_dates_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion<::std::vector< std::optional< ::std::chrono::system_clock::time_point > >>::toBaseRef(struct_pointer->dates); + return Conversion<::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > >>::toBaseRef(struct_pointer->dates); } _baseRef smoke_NullableCollectionsStruct_structs_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); - return Conversion<::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > >>::toBaseRef(struct_pointer->structs); + return Conversion<::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > >>::toBaseRef(struct_pointer->structs); } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/Nullable.h b/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/Nullable.h index 48273b80bd..fd5aee480a 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/Nullable.h +++ b/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/Nullable.h @@ -4,11 +4,11 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include #include -#include #include #include #include @@ -33,59 +33,59 @@ class _GLUECODIUM_CPP_EXPORT Nullable { explicit SomeStruct( ::std::string string_field ); }; struct _GLUECODIUM_CPP_EXPORT NullableStruct { - std::optional< ::std::string > string_field = std::optional< ::std::string >(); - std::optional< bool > bool_field = std::optional< bool >(); - std::optional< double > double_field = std::optional< double >(); - std::optional< ::smoke::Nullable::SomeStruct > struct_field = std::optional< ::smoke::Nullable::SomeStruct >(); - std::optional< ::smoke::Nullable::SomeEnum > enum_field = std::optional< ::smoke::Nullable::SomeEnum >(); - std::optional< ::smoke::Nullable::SomeArray > array_field = std::optional< ::smoke::Nullable::SomeArray >(); - std::optional< ::std::vector< ::std::string > > inline_array_field = std::optional< ::std::vector< ::std::string > >(); - std::optional< ::smoke::Nullable::SomeMap > map_field = std::optional< ::smoke::Nullable::SomeMap >(); + ::gluecodium::optional< ::std::string > string_field = ::gluecodium::optional< ::std::string >(); + ::gluecodium::optional< bool > bool_field = ::gluecodium::optional< bool >(); + ::gluecodium::optional< double > double_field = ::gluecodium::optional< double >(); + ::gluecodium::optional< ::smoke::Nullable::SomeStruct > struct_field = ::gluecodium::optional< ::smoke::Nullable::SomeStruct >(); + ::gluecodium::optional< ::smoke::Nullable::SomeEnum > enum_field = ::gluecodium::optional< ::smoke::Nullable::SomeEnum >(); + ::gluecodium::optional< ::smoke::Nullable::SomeArray > array_field = ::gluecodium::optional< ::smoke::Nullable::SomeArray >(); + ::gluecodium::optional< ::std::vector< ::std::string > > inline_array_field = ::gluecodium::optional< ::std::vector< ::std::string > >(); + ::gluecodium::optional< ::smoke::Nullable::SomeMap > map_field = ::gluecodium::optional< ::smoke::Nullable::SomeMap >(); ::std::shared_ptr< ::smoke::SomeInterface > instance_field = ::std::shared_ptr< ::smoke::SomeInterface >(); NullableStruct( ); - NullableStruct( std::optional< ::std::string > string_field, std::optional< bool > bool_field, std::optional< double > double_field, std::optional< ::smoke::Nullable::SomeStruct > struct_field, std::optional< ::smoke::Nullable::SomeEnum > enum_field, std::optional< ::smoke::Nullable::SomeArray > array_field, std::optional< ::std::vector< ::std::string > > inline_array_field, std::optional< ::smoke::Nullable::SomeMap > map_field, ::std::shared_ptr< ::smoke::SomeInterface > instance_field ); + NullableStruct( ::gluecodium::optional< ::std::string > string_field, ::gluecodium::optional< bool > bool_field, ::gluecodium::optional< double > double_field, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > struct_field, ::gluecodium::optional< ::smoke::Nullable::SomeEnum > enum_field, ::gluecodium::optional< ::smoke::Nullable::SomeArray > array_field, ::gluecodium::optional< ::std::vector< ::std::string > > inline_array_field, ::gluecodium::optional< ::smoke::Nullable::SomeMap > map_field, ::std::shared_ptr< ::smoke::SomeInterface > instance_field ); }; struct _GLUECODIUM_CPP_EXPORT NullableIntsStruct { - std::optional< int8_t > int8_field = std::optional< int8_t >(); - std::optional< int16_t > int16_field = std::optional< int16_t >(); - std::optional< int32_t > int32_field = std::optional< int32_t >(); - std::optional< int64_t > int64_field = std::optional< int64_t >(); - std::optional< uint8_t > uint8_field = std::optional< uint8_t >(); - std::optional< uint16_t > uint16_field = std::optional< uint16_t >(); - std::optional< uint32_t > uint32_field = std::optional< uint32_t >(); - std::optional< uint64_t > uint64_field = std::optional< uint64_t >(); + ::gluecodium::optional< int8_t > int8_field = ::gluecodium::optional< int8_t >(); + ::gluecodium::optional< int16_t > int16_field = ::gluecodium::optional< int16_t >(); + ::gluecodium::optional< int32_t > int32_field = ::gluecodium::optional< int32_t >(); + ::gluecodium::optional< int64_t > int64_field = ::gluecodium::optional< int64_t >(); + ::gluecodium::optional< uint8_t > uint8_field = ::gluecodium::optional< uint8_t >(); + ::gluecodium::optional< uint16_t > uint16_field = ::gluecodium::optional< uint16_t >(); + ::gluecodium::optional< uint32_t > uint32_field = ::gluecodium::optional< uint32_t >(); + ::gluecodium::optional< uint64_t > uint64_field = ::gluecodium::optional< uint64_t >(); NullableIntsStruct( ); - NullableIntsStruct( std::optional< int8_t > int8_field, std::optional< int16_t > int16_field, std::optional< int32_t > int32_field, std::optional< int64_t > int64_field, std::optional< uint8_t > uint8_field, std::optional< uint16_t > uint16_field, std::optional< uint32_t > uint32_field, std::optional< uint64_t > uint64_field ); + NullableIntsStruct( ::gluecodium::optional< int8_t > int8_field, ::gluecodium::optional< int16_t > int16_field, ::gluecodium::optional< int32_t > int32_field, ::gluecodium::optional< int64_t > int64_field, ::gluecodium::optional< uint8_t > uint8_field, ::gluecodium::optional< uint16_t > uint16_field, ::gluecodium::optional< uint32_t > uint32_field, ::gluecodium::optional< uint64_t > uint64_field ); }; public: - virtual std::optional< ::std::string > method_with_string( const std::optional< ::std::string >& input ) = 0; - virtual std::optional< bool > method_with_boolean( const std::optional< bool >& input ) = 0; - virtual std::optional< double > method_with_double( const std::optional< double >& input ) = 0; - virtual std::optional< int64_t > method_with_int( const std::optional< int64_t >& input ) = 0; - virtual std::optional< ::smoke::Nullable::SomeStruct > method_with_some_struct( const std::optional< ::smoke::Nullable::SomeStruct >& input ) = 0; - virtual std::optional< ::smoke::Nullable::SomeEnum > method_with_some_enum( const std::optional< ::smoke::Nullable::SomeEnum >& input ) = 0; - virtual std::optional< ::smoke::Nullable::SomeArray > method_with_some_array( const std::optional< ::smoke::Nullable::SomeArray >& input ) = 0; - virtual std::optional< ::std::vector< ::std::string > > method_with_inline_array( const std::optional< ::std::vector< ::std::string > >& input ) = 0; - virtual std::optional< ::smoke::Nullable::SomeMap > method_with_some_map( const std::optional< ::smoke::Nullable::SomeMap >& input ) = 0; + virtual ::gluecodium::optional< ::std::string > method_with_string( const ::gluecodium::optional< ::std::string >& input ) = 0; + virtual ::gluecodium::optional< bool > method_with_boolean( const ::gluecodium::optional< bool >& input ) = 0; + virtual ::gluecodium::optional< double > method_with_double( const ::gluecodium::optional< double >& input ) = 0; + virtual ::gluecodium::optional< int64_t > method_with_int( const ::gluecodium::optional< int64_t >& input ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeStruct > method_with_some_struct( const ::gluecodium::optional< ::smoke::Nullable::SomeStruct >& input ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeEnum > method_with_some_enum( const ::gluecodium::optional< ::smoke::Nullable::SomeEnum >& input ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeArray > method_with_some_array( const ::gluecodium::optional< ::smoke::Nullable::SomeArray >& input ) = 0; + virtual ::gluecodium::optional< ::std::vector< ::std::string > > method_with_inline_array( const ::gluecodium::optional< ::std::vector< ::std::string > >& input ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeMap > method_with_some_map( const ::gluecodium::optional< ::smoke::Nullable::SomeMap >& input ) = 0; virtual ::std::shared_ptr< ::smoke::SomeInterface > method_with_instance( const ::std::shared_ptr< ::smoke::SomeInterface >& input ) = 0; - virtual std::optional< ::std::string > get_string_property( ) const = 0; - virtual void set_string_property( const std::optional< ::std::string >& value ) = 0; - virtual std::optional< bool > is_bool_property( ) const = 0; - virtual void set_bool_property( const std::optional< bool >& value ) = 0; - virtual std::optional< double > get_double_property( ) const = 0; - virtual void set_double_property( const std::optional< double >& value ) = 0; - virtual std::optional< int64_t > get_int_property( ) const = 0; - virtual void set_int_property( const std::optional< int64_t >& value ) = 0; - virtual std::optional< ::smoke::Nullable::SomeStruct > get_struct_property( ) const = 0; - virtual void set_struct_property( const std::optional< ::smoke::Nullable::SomeStruct >& value ) = 0; - virtual std::optional< ::smoke::Nullable::SomeEnum > get_enum_property( ) const = 0; - virtual void set_enum_property( const std::optional< ::smoke::Nullable::SomeEnum >& value ) = 0; - virtual std::optional< ::smoke::Nullable::SomeArray > get_array_property( ) const = 0; - virtual void set_array_property( const std::optional< ::smoke::Nullable::SomeArray >& value ) = 0; - virtual std::optional< ::std::vector< ::std::string > > get_inline_array_property( ) const = 0; - virtual void set_inline_array_property( const std::optional< ::std::vector< ::std::string > >& value ) = 0; - virtual std::optional< ::smoke::Nullable::SomeMap > get_map_property( ) const = 0; - virtual void set_map_property( const std::optional< ::smoke::Nullable::SomeMap >& value ) = 0; + virtual ::gluecodium::optional< ::std::string > get_string_property( ) const = 0; + virtual void set_string_property( const ::gluecodium::optional< ::std::string >& value ) = 0; + virtual ::gluecodium::optional< bool > is_bool_property( ) const = 0; + virtual void set_bool_property( const ::gluecodium::optional< bool >& value ) = 0; + virtual ::gluecodium::optional< double > get_double_property( ) const = 0; + virtual void set_double_property( const ::gluecodium::optional< double >& value ) = 0; + virtual ::gluecodium::optional< int64_t > get_int_property( ) const = 0; + virtual void set_int_property( const ::gluecodium::optional< int64_t >& value ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeStruct > get_struct_property( ) const = 0; + virtual void set_struct_property( const ::gluecodium::optional< ::smoke::Nullable::SomeStruct >& value ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeEnum > get_enum_property( ) const = 0; + virtual void set_enum_property( const ::gluecodium::optional< ::smoke::Nullable::SomeEnum >& value ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeArray > get_array_property( ) const = 0; + virtual void set_array_property( const ::gluecodium::optional< ::smoke::Nullable::SomeArray >& value ) = 0; + virtual ::gluecodium::optional< ::std::vector< ::std::string > > get_inline_array_property( ) const = 0; + virtual void set_inline_array_property( const ::gluecodium::optional< ::std::vector< ::std::string > >& value ) = 0; + virtual ::gluecodium::optional< ::smoke::Nullable::SomeMap > get_map_property( ) const = 0; + virtual void set_map_property( const ::gluecodium::optional< ::smoke::Nullable::SomeMap >& value ) = 0; virtual ::std::shared_ptr< ::smoke::SomeInterface > get_instance_property( ) const = 0; virtual void set_instance_property( const ::std::shared_ptr< ::smoke::SomeInterface >& value ) = 0; }; diff --git a/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/NullableCollectionsStruct.h b/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/NullableCollectionsStruct.h index 0d911df3e9..d98de02989 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/NullableCollectionsStruct.h +++ b/gluecodium/src/test/resources/smoke/nullable/output/cpp/include/smoke/NullableCollectionsStruct.h @@ -4,20 +4,20 @@ // ------------------------------------------------------------------------------------------------- #pragma once #include "gluecodium/ExportGluecodiumCpp.h" +#include "gluecodium/Optional.h" #include "gluecodium/TimePointHash.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Nullable.h" #include #include -#include #include #include namespace smoke { struct _GLUECODIUM_CPP_EXPORT NullableCollectionsStruct { - ::std::vector< std::optional< ::std::chrono::system_clock::time_point > > dates; - ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > > structs; + ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > > dates; + ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > > structs; NullableCollectionsStruct( ); - NullableCollectionsStruct( ::std::vector< std::optional< ::std::chrono::system_clock::time_point > > dates, ::std::unordered_map< int32_t, std::optional< ::smoke::Nullable::SomeStruct > > structs ); + NullableCollectionsStruct( ::std::vector< ::gluecodium::optional< ::std::chrono::system_clock::time_point > > dates, ::std::unordered_map< int32_t, ::gluecodium::optional< ::smoke::Nullable::SomeStruct > > structs ); }; } diff --git a/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/NullableHandles.cpp b/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/NullableHandles.cpp index a1a12ea3db..2a79d45018 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/NullableHandles.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/NullableHandles.cpp @@ -1,10 +1,10 @@ #include "NullableHandles.h" #include "ConversionBase.h" #include "gluecodium/Locale.h" +#include "gluecodium/Optional.h" #include #include #include -#include #include #include #ifdef __cplusplus @@ -14,7 +14,7 @@ FfiOpaqueHandle library_Byte_create_handle_nullable(int8_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -22,20 +22,20 @@ library_Byte_create_handle_nullable(int8_t value) void library_Byte_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } int8_t library_Byte_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_UByte_create_handle_nullable(uint8_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -43,20 +43,20 @@ library_UByte_create_handle_nullable(uint8_t value) void library_UByte_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint8_t library_UByte_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Short_create_handle_nullable(int16_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -64,20 +64,20 @@ library_Short_create_handle_nullable(int16_t value) void library_Short_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } int16_t library_Short_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_UShort_create_handle_nullable(uint16_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -85,20 +85,20 @@ library_UShort_create_handle_nullable(uint16_t value) void library_UShort_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint16_t library_UShort_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Int_create_handle_nullable(int32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -106,20 +106,20 @@ library_Int_create_handle_nullable(int32_t value) void library_Int_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } int32_t library_Int_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_UInt_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -127,20 +127,20 @@ library_UInt_create_handle_nullable(uint32_t value) void library_UInt_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_UInt_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Long_create_handle_nullable(int64_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -148,20 +148,20 @@ library_Long_create_handle_nullable(int64_t value) void library_Long_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } int64_t library_Long_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_ULong_create_handle_nullable(uint64_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -169,20 +169,20 @@ library_ULong_create_handle_nullable(uint64_t value) void library_ULong_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint64_t library_ULong_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Float_create_handle_nullable(float value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -190,20 +190,20 @@ library_Float_create_handle_nullable(float value) void library_Float_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } float library_Float_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Double_create_handle_nullable(double value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -211,20 +211,20 @@ library_Double_create_handle_nullable(double value) void library_Double_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } double library_Double_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Boolean_create_handle_nullable(bool value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( (value) ) ); @@ -232,20 +232,20 @@ library_Boolean_create_handle_nullable(bool value) void library_Boolean_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } bool library_Boolean_get_value_nullable(FfiOpaqueHandle handle) { return ( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_String_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -253,20 +253,20 @@ library_String_create_handle_nullable(FfiOpaqueHandle value) void library_String_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_String_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_Blob_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional>>( + new (std::nothrow) gluecodium::optional>>( gluecodium::ffi::Conversion>>::toCpp(value) ) ); @@ -274,20 +274,20 @@ library_Blob_create_handle_nullable(FfiOpaqueHandle value) void library_Blob_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast>>*>(handle); + delete reinterpret_cast>>*>(handle); } FfiOpaqueHandle library_Blob_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion>>::toFfi( - **reinterpret_cast>>*>(handle) + **reinterpret_cast>>*>(handle) ); } FfiOpaqueHandle library_Locale_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -295,13 +295,13 @@ library_Locale_create_handle_nullable(FfiOpaqueHandle value) void library_Locale_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_Locale_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/ffi_smoke_Nullable.cpp b/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/ffi_smoke_Nullable.cpp index aacf68e044..53b79ca280 100644 --- a/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/ffi_smoke_Nullable.cpp +++ b/gluecodium/src/test/resources/smoke/nullable/output/dart/ffi/ffi_smoke_Nullable.cpp @@ -3,13 +3,13 @@ #include "InstanceCache.h" #include "FinalizerData.h" #include "IsolateContext.h" +#include "gluecodium/Optional.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" #include "smoke/Nullable.h" #include "smoke/SomeInterface.h" #include #include -#include #include #include #include @@ -22,81 +22,81 @@ extern "C" { FfiOpaqueHandle library_smoke_Nullable_methodWithString__String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_string( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithBoolean__Boolean_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_boolean( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithDouble__Double_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_double( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithInt__Long_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_int( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithSomeStruct__SomeStruct_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_some_struct( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithSomeEnum__SomeEnum_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_some_enum( - gluecodium::ffi::Conversion>::toCpp(input) + gluecodium::ffi::Conversion>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithSomeArray__ListOf_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_some_array( - gluecodium::ffi::Conversion>>::toCpp(input) + gluecodium::ffi::Conversion>>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithInlineArray__ListOf_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_inline_array( - gluecodium::ffi::Conversion>>::toCpp(input) + gluecodium::ffi::Conversion>>::toCpp(input) ) ); } FfiOpaqueHandle library_smoke_Nullable_methodWithSomeMap__MapOf_Long_to_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle input) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).method_with_some_map( - gluecodium::ffi::Conversion>>::toCpp(input) + gluecodium::ffi::Conversion>>::toCpp(input) ) ); } @@ -112,7 +112,7 @@ library_smoke_Nullable_methodWithInstance__SomeInterface_(FfiOpaqueHandle _self, FfiOpaqueHandle library_smoke_Nullable_stringProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_string_property() ); } @@ -120,13 +120,13 @@ void library_smoke_Nullable_stringProperty_set__String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_string_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_isBoolProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).is_bool_property() ); } @@ -134,13 +134,13 @@ void library_smoke_Nullable_isBoolProperty_set__Boolean_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_bool_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_doubleProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_double_property() ); } @@ -148,13 +148,13 @@ void library_smoke_Nullable_doubleProperty_set__Double_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_double_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_intProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_int_property() ); } @@ -162,13 +162,13 @@ void library_smoke_Nullable_intProperty_set__Long_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_int_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_structProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_struct_property() ); } @@ -176,13 +176,13 @@ void library_smoke_Nullable_structProperty_set__SomeStruct_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_struct_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_enumProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_enum_property() ); } @@ -190,13 +190,13 @@ void library_smoke_Nullable_enumProperty_set__SomeEnum_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_enum_property( - gluecodium::ffi::Conversion>::toCpp(value) + gluecodium::ffi::Conversion>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_arrayProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_array_property() ); } @@ -204,13 +204,13 @@ void library_smoke_Nullable_arrayProperty_set__ListOf_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_array_property( - gluecodium::ffi::Conversion>>::toCpp(value) + gluecodium::ffi::Conversion>>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_inlineArrayProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_inline_array_property() ); } @@ -218,13 +218,13 @@ void library_smoke_Nullable_inlineArrayProperty_set__ListOf_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_inline_array_property( - gluecodium::ffi::Conversion>>::toCpp(value) + gluecodium::ffi::Conversion>>::toCpp(value) ); } FfiOpaqueHandle library_smoke_Nullable_mapProperty_get(FfiOpaqueHandle _self, int32_t _isolate_id) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( (*gluecodium::ffi::Conversion>::toCpp(_self)).get_map_property() ); } @@ -232,7 +232,7 @@ void library_smoke_Nullable_mapProperty_set__MapOf_Long_to_String_(FfiOpaqueHandle _self, int32_t _isolate_id, FfiOpaqueHandle value) { gluecodium::ffi::IsolateContext _isolate_context(_isolate_id); (*gluecodium::ffi::Conversion>::toCpp(_self)).set_map_property( - gluecodium::ffi::Conversion>>::toCpp(value) + gluecodium::ffi::Conversion>>::toCpp(value) ); } FfiOpaqueHandle @@ -293,7 +293,7 @@ FfiOpaqueHandle library_smoke_Nullable_SomeStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -301,26 +301,26 @@ library_smoke_Nullable_SomeStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Nullable_SomeStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Nullable_SomeStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_create_handle(FfiOpaqueHandle stringField, FfiOpaqueHandle boolField, FfiOpaqueHandle doubleField, FfiOpaqueHandle structField, FfiOpaqueHandle enumField, FfiOpaqueHandle arrayField, FfiOpaqueHandle inlineArrayField, FfiOpaqueHandle mapField, FfiOpaqueHandle instanceField) { auto _result = new (std::nothrow) smoke::Nullable::NullableStruct(); - _result->string_field = gluecodium::ffi::Conversion>::toCpp(stringField); - _result->bool_field = gluecodium::ffi::Conversion>::toCpp(boolField); - _result->double_field = gluecodium::ffi::Conversion>::toCpp(doubleField); - _result->struct_field = gluecodium::ffi::Conversion>::toCpp(structField); - _result->enum_field = gluecodium::ffi::Conversion>::toCpp(enumField); - _result->array_field = gluecodium::ffi::Conversion>>::toCpp(arrayField); - _result->inline_array_field = gluecodium::ffi::Conversion>>::toCpp(inlineArrayField); - _result->map_field = gluecodium::ffi::Conversion>>::toCpp(mapField); + _result->string_field = gluecodium::ffi::Conversion>::toCpp(stringField); + _result->bool_field = gluecodium::ffi::Conversion>::toCpp(boolField); + _result->double_field = gluecodium::ffi::Conversion>::toCpp(doubleField); + _result->struct_field = gluecodium::ffi::Conversion>::toCpp(structField); + _result->enum_field = gluecodium::ffi::Conversion>::toCpp(enumField); + _result->array_field = gluecodium::ffi::Conversion>>::toCpp(arrayField); + _result->inline_array_field = gluecodium::ffi::Conversion>>::toCpp(inlineArrayField); + _result->map_field = gluecodium::ffi::Conversion>>::toCpp(mapField); _result->instance_field = gluecodium::ffi::Conversion>::toCpp(instanceField); return reinterpret_cast(_result); } @@ -330,49 +330,49 @@ library_smoke_Nullable_NullableStruct_release_handle(FfiOpaqueHandle handle) { } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_stringField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->string_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_boolField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->bool_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_doubleField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->double_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_structField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->struct_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_enumField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->enum_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_arrayField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( reinterpret_cast(handle)->array_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_inlineArrayField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( reinterpret_cast(handle)->inline_array_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_field_mapField(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>>::toFfi( + return gluecodium::ffi::Conversion>>::toFfi( reinterpret_cast(handle)->map_field ); } @@ -386,7 +386,7 @@ FfiOpaqueHandle library_smoke_Nullable_NullableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -394,26 +394,26 @@ library_smoke_Nullable_NullableStruct_create_handle_nullable(FfiOpaqueHandle val void library_smoke_Nullable_NullableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Nullable_NullableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_create_handle(FfiOpaqueHandle int8Field, FfiOpaqueHandle int16Field, FfiOpaqueHandle int32Field, FfiOpaqueHandle int64Field, FfiOpaqueHandle uint8Field, FfiOpaqueHandle uint16Field, FfiOpaqueHandle uint32Field, FfiOpaqueHandle uint64Field) { auto _result = new (std::nothrow) smoke::Nullable::NullableIntsStruct(); - _result->int8_field = gluecodium::ffi::Conversion>::toCpp(int8Field); - _result->int16_field = gluecodium::ffi::Conversion>::toCpp(int16Field); - _result->int32_field = gluecodium::ffi::Conversion>::toCpp(int32Field); - _result->int64_field = gluecodium::ffi::Conversion>::toCpp(int64Field); - _result->uint8_field = gluecodium::ffi::Conversion>::toCpp(uint8Field); - _result->uint16_field = gluecodium::ffi::Conversion>::toCpp(uint16Field); - _result->uint32_field = gluecodium::ffi::Conversion>::toCpp(uint32Field); - _result->uint64_field = gluecodium::ffi::Conversion>::toCpp(uint64Field); + _result->int8_field = gluecodium::ffi::Conversion>::toCpp(int8Field); + _result->int16_field = gluecodium::ffi::Conversion>::toCpp(int16Field); + _result->int32_field = gluecodium::ffi::Conversion>::toCpp(int32Field); + _result->int64_field = gluecodium::ffi::Conversion>::toCpp(int64Field); + _result->uint8_field = gluecodium::ffi::Conversion>::toCpp(uint8Field); + _result->uint16_field = gluecodium::ffi::Conversion>::toCpp(uint16Field); + _result->uint32_field = gluecodium::ffi::Conversion>::toCpp(uint32Field); + _result->uint64_field = gluecodium::ffi::Conversion>::toCpp(uint64Field); return reinterpret_cast(_result); } void @@ -422,49 +422,49 @@ library_smoke_Nullable_NullableIntsStruct_release_handle(FfiOpaqueHandle handle) } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_int8Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->int8_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_int16Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->int16_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_int32Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->int32_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_int64Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->int64_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_uint8Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->uint8_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_uint16Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->uint16_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_uint32Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->uint32_field ); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_field_uint64Field(FfiOpaqueHandle handle) { - return gluecodium::ffi::Conversion>::toFfi( + return gluecodium::ffi::Conversion>::toFfi( reinterpret_cast(handle)->uint64_field ); } @@ -472,7 +472,7 @@ FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -480,20 +480,20 @@ library_smoke_Nullable_NullableIntsStruct_create_handle_nullable(FfiOpaqueHandle void library_smoke_Nullable_NullableIntsStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Nullable_NullableIntsStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Nullable_SomeEnum_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -501,13 +501,13 @@ library_smoke_Nullable_SomeEnum_create_handle_nullable(uint32_t value) void library_smoke_Nullable_SomeEnum_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Nullable_SomeEnum_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/packages/output/dart/ffi/ffi_smoke_off_NestedPackages.cpp b/gluecodium/src/test/resources/smoke/packages/output/dart/ffi/ffi_smoke_off_NestedPackages.cpp index 1a6103b07d..7814b1f37b 100644 --- a/gluecodium/src/test/resources/smoke/packages/output/dart/ffi/ffi_smoke_off_NestedPackages.cpp +++ b/gluecodium/src/test/resources/smoke/packages/output/dart/ffi/ffi_smoke_off_NestedPackages.cpp @@ -64,7 +64,7 @@ FfiOpaqueHandle library_smoke_off_NestedPackages_SomeStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -72,13 +72,13 @@ library_smoke_off_NestedPackages_SomeStruct_create_handle_nullable(FfiOpaqueHand void library_smoke_off_NestedPackages_SomeStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_off_NestedPackages_SomeStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/platform_names/output/android/jni/com_example_smoke_barTypes_barEnum__Conversion.h b/gluecodium/src/test/resources/smoke/platform_names/output/android/jni/com_example_smoke_barTypes_barEnum__Conversion.h index 5215cbed26..93deeb2ba6 100644 --- a/gluecodium/src/test/resources/smoke/platform_names/output/android/jni/com_example_smoke_barTypes_barEnum__Conversion.h +++ b/gluecodium/src/test/resources/smoke/platform_names/output/android/jni/com_example_smoke_barTypes_barEnum__Conversion.h @@ -4,15 +4,14 @@ #pragma once #include "smoke/fooTypes.h" #include "JniReference.h" -#include - +#include "gluecodium/Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::smoke::fooTypes::fooEnum convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::fooTypes::fooEnum*); -JNIEXPORT std::optional<::smoke::fooTypes::fooEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::fooTypes::fooEnum>*); +JNIEXPORT ::gluecodium::optional<::smoke::fooTypes::fooEnum> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::fooTypes::fooEnum>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::smoke::fooTypes::fooEnum _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::fooTypes::fooEnum> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::fooTypes::fooEnum> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/properties/output/dart/ffi/ffi_smoke_Properties.cpp b/gluecodium/src/test/resources/smoke/properties/output/dart/ffi/ffi_smoke_Properties.cpp index 715a738998..631d35b97d 100644 --- a/gluecodium/src/test/resources/smoke/properties/output/dart/ffi/ffi_smoke_Properties.cpp +++ b/gluecodium/src/test/resources/smoke/properties/output/dart/ffi/ffi_smoke_Properties.cpp @@ -186,7 +186,7 @@ FfiOpaqueHandle library_smoke_Properties_ExampleStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -194,20 +194,20 @@ library_smoke_Properties_ExampleStruct_create_handle_nullable(FfiOpaqueHandle va void library_smoke_Properties_ExampleStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Properties_ExampleStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Properties_InternalErrorCode_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -215,13 +215,13 @@ library_smoke_Properties_InternalErrorCode_create_handle_nullable(uint32_t value void library_smoke_Properties_InternalErrorCode_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Properties_InternalErrorCode_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_EnableIfField__Conversion.cpp b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_EnableIfField__Conversion.cpp index ec6b223c6b..25a0b47b65 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_EnableIfField__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_EnableIfField__Conversion.cpp @@ -28,12 +28,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::E _nout.bool_field = n_bool_field; return _nout; } -std::optional<::smoke::EnableIfField> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::EnableIfField>*) +::gluecodium::optional<::smoke::EnableIfField> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::EnableIfField>*) { return _jinput - ? std::optional<::smoke::EnableIfField>(convert_from_jni(_jenv, _jinput, (::smoke::EnableIfField*)nullptr)) - : std::optional<::smoke::EnableIfField>{}; + ? ::gluecodium::optional<::smoke::EnableIfField>(convert_from_jni(_jenv, _jinput, (::smoke::EnableIfField*)nullptr)) + : ::gluecodium::optional<::smoke::EnableIfField>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/EnableIfField", com_example_smoke_EnableIfField, ::smoke::EnableIfField) JniReference @@ -46,7 +46,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::EnableIfField& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::EnableIfField> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::EnableIfField> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.cpp b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.cpp index 3bf6a0b146..a28f58c86f 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.cpp @@ -26,12 +26,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S (bool*)nullptr ); return ::smoke::SkipFieldInPlatformImmutable(std::move(n_int_field), ::smoke::DummyStruct{}, std::move(n_bool_field)); } -std::optional<::smoke::SkipFieldInPlatformImmutable> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::SkipFieldInPlatformImmutable>*) +::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>*) { return _jinput - ? std::optional<::smoke::SkipFieldInPlatformImmutable>(convert_from_jni(_jenv, _jinput, (::smoke::SkipFieldInPlatformImmutable*)nullptr)) - : std::optional<::smoke::SkipFieldInPlatformImmutable>{}; + ? ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>(convert_from_jni(_jenv, _jinput, (::smoke::SkipFieldInPlatformImmutable*)nullptr)) + : ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/SkipFieldInPlatformImmutable", com_example_smoke_SkipFieldInPlatformImmutable, ::smoke::SkipFieldInPlatformImmutable) JniReference @@ -44,7 +44,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::SkipFieldInPlatformImmutable& _ninp return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::SkipFieldInPlatformImmutable> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.h b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.h index 52361d5493..8ec62303e2 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.h +++ b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatformImmutable__Conversion.h @@ -4,15 +4,14 @@ #pragma once #include "smoke/SkipFieldInPlatformImmutable.h" #include "JniReference.h" -#include - +#include "gluecodium/Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::smoke::SkipFieldInPlatformImmutable convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::SkipFieldInPlatformImmutable*); -JNIEXPORT std::optional<::smoke::SkipFieldInPlatformImmutable> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::SkipFieldInPlatformImmutable>*); +JNIEXPORT ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::smoke::SkipFieldInPlatformImmutable& _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::SkipFieldInPlatformImmutable> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatform__Conversion.cpp b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatform__Conversion.cpp index 3d362da8b9..4cfe7e77a5 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatform__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipFieldInPlatform__Conversion.cpp @@ -28,12 +28,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.bool_field = n_bool_field; return _nout; } -std::optional<::smoke::SkipFieldInPlatform> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::SkipFieldInPlatform>*) +::gluecodium::optional<::smoke::SkipFieldInPlatform> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::SkipFieldInPlatform>*) { return _jinput - ? std::optional<::smoke::SkipFieldInPlatform>(convert_from_jni(_jenv, _jinput, (::smoke::SkipFieldInPlatform*)nullptr)) - : std::optional<::smoke::SkipFieldInPlatform>{}; + ? ::gluecodium::optional<::smoke::SkipFieldInPlatform>(convert_from_jni(_jenv, _jinput, (::smoke::SkipFieldInPlatform*)nullptr)) + : ::gluecodium::optional<::smoke::SkipFieldInPlatform>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/SkipFieldInPlatform", com_example_smoke_SkipFieldInPlatform, ::smoke::SkipFieldInPlatform) JniReference @@ -46,7 +46,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::SkipFieldInPlatform& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::SkipFieldInPlatform> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::SkipFieldInPlatform> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipField__Conversion.cpp b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipField__Conversion.cpp index 5467e32800..61daff95c8 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipField__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/android/jni/com_example_smoke_SkipField__Conversion.cpp @@ -22,12 +22,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.field = n_field; return _nout; } -std::optional<::smoke::SkipField> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::SkipField>*) +::gluecodium::optional<::smoke::SkipField> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::SkipField>*) { return _jinput - ? std::optional<::smoke::SkipField>(convert_from_jni(_jenv, _jinput, (::smoke::SkipField*)nullptr)) - : std::optional<::smoke::SkipField>{}; + ? ::gluecodium::optional<::smoke::SkipField>(convert_from_jni(_jenv, _jinput, (::smoke::SkipField*)nullptr)) + : ::gluecodium::optional<::smoke::SkipField>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/SkipField", com_example_smoke_SkipField, ::smoke::SkipField) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::SkipField& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::SkipField> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::SkipField> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_EnableIfField.cpp b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_EnableIfField.cpp index 7b77c848af..57d80d6ae5 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_EnableIfField.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_EnableIfField.cpp @@ -2,11 +2,11 @@ // #include "cbridge/include/smoke/cbridge_EnableIfField.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/EnableIfField.h" #include #include #include -#include _baseRef smoke_EnableIfField_create_handle( int32_t intField, bool boolField ) { @@ -23,7 +23,7 @@ smoke_EnableIfField_release_handle( _baseRef handle ) _baseRef smoke_EnableIfField_create_optional_handle(int32_t intField, bool boolField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::EnableIfField>( ::smoke::EnableIfField( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::EnableIfField>( ::smoke::EnableIfField( ) ); (*_struct)->int_field = intField; (*_struct)->bool_field = boolField; return reinterpret_cast<_baseRef>( _struct ); @@ -31,10 +31,10 @@ smoke_EnableIfField_create_optional_handle(int32_t intField, bool boolField) _baseRef smoke_EnableIfField_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::EnableIfField>*>( handle ) ); } void smoke_EnableIfField_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::EnableIfField>*>( handle ); } int32_t smoke_EnableIfField_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipField.cpp b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipField.cpp index da2ac2aa6a..fe1ee6b463 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipField.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipField.cpp @@ -3,10 +3,10 @@ #include "cbridge/include/smoke/cbridge_SkipField.h" #include "cbridge/include/StringHandle.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/SkipField.h" #include #include -#include #include _baseRef smoke_SkipField_create_handle( _baseRef field ) @@ -23,17 +23,17 @@ smoke_SkipField_release_handle( _baseRef handle ) _baseRef smoke_SkipField_create_optional_handle(_baseRef field) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::SkipField>( ::smoke::SkipField( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::SkipField>( ::smoke::SkipField( ) ); (*_struct)->field = Conversion<::std::string>::toCpp( field ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_SkipField_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::SkipField>*>( handle ) ); } void smoke_SkipField_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::SkipField>*>( handle ); } _baseRef smoke_SkipField_field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatform.cpp b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatform.cpp index 8830c6675e..d6fa4ebbc5 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatform.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatform.cpp @@ -2,11 +2,11 @@ // #include "cbridge/include/smoke/cbridge_SkipFieldInPlatform.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/SkipFieldInPlatform.h" #include #include #include -#include _baseRef smoke_SkipFieldInPlatform_create_handle( int32_t intField, bool boolField ) { @@ -23,7 +23,7 @@ smoke_SkipFieldInPlatform_release_handle( _baseRef handle ) _baseRef smoke_SkipFieldInPlatform_create_optional_handle(int32_t intField, bool boolField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::SkipFieldInPlatform>( ::smoke::SkipFieldInPlatform( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::SkipFieldInPlatform>( ::smoke::SkipFieldInPlatform( ) ); (*_struct)->int_field = intField; (*_struct)->bool_field = boolField; return reinterpret_cast<_baseRef>( _struct ); @@ -31,10 +31,10 @@ smoke_SkipFieldInPlatform_create_optional_handle(int32_t intField, bool boolFiel _baseRef smoke_SkipFieldInPlatform_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::SkipFieldInPlatform>*>( handle ) ); } void smoke_SkipFieldInPlatform_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::SkipFieldInPlatform>*>( handle ); } int32_t smoke_SkipFieldInPlatform_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatformImmutable.cpp b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatformImmutable.cpp index f21c0856e0..81c4f6cbbf 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatformImmutable.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/cbridge/src/smoke/cbridge_SkipFieldInPlatformImmutable.cpp @@ -2,12 +2,12 @@ // #include "cbridge/include/smoke/cbridge_SkipFieldInPlatformImmutable.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/DummyStruct.h" #include "smoke/SkipFieldInPlatformImmutable.h" #include #include #include -#include _baseRef smoke_SkipFieldInPlatformImmutable_create_handle( int32_t intField, bool boolField ) { @@ -26,16 +26,16 @@ smoke_SkipFieldInPlatformImmutable_create_optional_handle(int32_t intField, bool { auto _intField = intField; auto _boolField = boolField; - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::SkipFieldInPlatformImmutable>( ::smoke::SkipFieldInPlatformImmutable( _intField, ::smoke::DummyStruct{}, _boolField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>( ::smoke::SkipFieldInPlatformImmutable( _intField, ::smoke::DummyStruct{}, _boolField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_SkipFieldInPlatformImmutable_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>*>( handle ) ); } void smoke_SkipFieldInPlatformImmutable_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::SkipFieldInPlatformImmutable>*>( handle ); } int32_t smoke_SkipFieldInPlatformImmutable_intField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_EnableIfField.cpp b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_EnableIfField.cpp index 2e2f3b8006..c464fd760f 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_EnableIfField.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_EnableIfField.cpp @@ -35,7 +35,7 @@ FfiOpaqueHandle library_smoke_EnableIfField_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -43,13 +43,13 @@ library_smoke_EnableIfField_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_EnableIfField_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_EnableIfField_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipField.cpp b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipField.cpp index a3e14c01ac..2aa8479ecd 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipField.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipField.cpp @@ -27,7 +27,7 @@ FfiOpaqueHandle library_smoke_SkipField_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -35,13 +35,13 @@ library_smoke_SkipField_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_SkipField_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_SkipField_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatform.cpp b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatform.cpp index 04cfd736b4..777d6892b3 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatform.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatform.cpp @@ -35,7 +35,7 @@ FfiOpaqueHandle library_smoke_SkipFieldInPlatform_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -43,13 +43,13 @@ library_smoke_SkipFieldInPlatform_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_SkipFieldInPlatform_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_SkipFieldInPlatform_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatformImmutable.cpp b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatformImmutable.cpp index d60a260b84..049932dd8e 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatformImmutable.cpp +++ b/gluecodium/src/test/resources/smoke/skip/output/dart/ffi/ffi_smoke_SkipFieldInPlatformImmutable.cpp @@ -34,7 +34,7 @@ FfiOpaqueHandle library_smoke_SkipFieldInPlatformImmutable_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -42,13 +42,13 @@ library_smoke_SkipFieldInPlatformImmutable_create_handle_nullable(FfiOpaqueHandl void library_smoke_SkipFieldInPlatformImmutable_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_SkipFieldInPlatformImmutable_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.cpp index a921316fac..c6c225d07a 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.cpp @@ -84,12 +84,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S (::smoke::Structs::Point*)nullptr ); return ::smoke::Structs::AllTypesStruct(std::move(n_int8_field), std::move(n_uint8_field), std::move(n_int16_field), std::move(n_uint16_field), std::move(n_int32_field), std::move(n_uint32_field), std::move(n_int64_field), std::move(n_uint64_field), std::move(n_float_field), std::move(n_double_field), std::move(n_string_field), std::move(n_boolean_field), std::move(n_bytes_field), std::move(n_point_field)); } -std::optional<::smoke::Structs::AllTypesStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::AllTypesStruct>*) +::gluecodium::optional<::smoke::Structs::AllTypesStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::AllTypesStruct>*) { return _jinput - ? std::optional<::smoke::Structs::AllTypesStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::AllTypesStruct*)nullptr)) - : std::optional<::smoke::Structs::AllTypesStruct>{}; + ? ::gluecodium::optional<::smoke::Structs::AllTypesStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::AllTypesStruct*)nullptr)) + : ::gluecodium::optional<::smoke::Structs::AllTypesStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Structs$AllTypesStruct", com_example_smoke_Structs_00024AllTypesStruct, ::smoke::Structs::AllTypesStruct) JniReference @@ -115,7 +115,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::AllTypesStruct& _ninput) return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::AllTypesStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::AllTypesStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.h b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.h index 12e4db2e66..413b8ec95d 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.h +++ b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_AllTypesStruct__Conversion.h @@ -5,15 +5,14 @@ #include "smoke/Structs.h" #include "com_example_smoke_Structs_Point__Conversion.h" #include "JniReference.h" -#include - +#include "gluecodium/Optional.h" namespace gluecodium { namespace jni { JNIEXPORT ::smoke::Structs::AllTypesStruct convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::Structs::AllTypesStruct*); -JNIEXPORT std::optional<::smoke::Structs::AllTypesStruct> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::AllTypesStruct>*); +JNIEXPORT ::gluecodium::optional<::smoke::Structs::AllTypesStruct> convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::AllTypesStruct>*); JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::AllTypesStruct& _ninput); -JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::AllTypesStruct> _ninput); +JNIEXPORT JniReference convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::AllTypesStruct> _ninput); } } diff --git a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_ImmutableStructWithCppAccessors__Conversion.cpp b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_ImmutableStructWithCppAccessors__Conversion.cpp index 2f8bf51b9d..daed1afff1 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_ImmutableStructWithCppAccessors__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_ImmutableStructWithCppAccessors__Conversion.cpp @@ -20,12 +20,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S (::std::string*)nullptr ); return ::smoke::Structs::ImmutableStructWithCppAccessors(std::move(n_string_field)); } -std::optional<::smoke::Structs::ImmutableStructWithCppAccessors> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::ImmutableStructWithCppAccessors>*) +::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>*) { return _jinput - ? std::optional<::smoke::Structs::ImmutableStructWithCppAccessors>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::ImmutableStructWithCppAccessors*)nullptr)) - : std::optional<::smoke::Structs::ImmutableStructWithCppAccessors>{}; + ? ::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::ImmutableStructWithCppAccessors*)nullptr)) + : ::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Structs$ImmutableStructWithCppAccessors", com_example_smoke_Structs_00024ImmutableStructWithCppAccessors, ::smoke::Structs::ImmutableStructWithCppAccessors) JniReference @@ -37,7 +37,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::ImmutableStructWithCppAcce return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::ImmutableStructWithCppAccessors> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_MutableStructWithCppAccessors__Conversion.cpp b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_MutableStructWithCppAccessors__Conversion.cpp index cb05f0211f..b2cc71e07c 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_MutableStructWithCppAccessors__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_MutableStructWithCppAccessors__Conversion.cpp @@ -22,12 +22,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S _nout.set_string_field(n_string_field); return _nout; } -std::optional<::smoke::Structs::MutableStructWithCppAccessors> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::MutableStructWithCppAccessors>*) +::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>*) { return _jinput - ? std::optional<::smoke::Structs::MutableStructWithCppAccessors>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::MutableStructWithCppAccessors*)nullptr)) - : std::optional<::smoke::Structs::MutableStructWithCppAccessors>{}; + ? ::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::MutableStructWithCppAccessors*)nullptr)) + : ::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Structs$MutableStructWithCppAccessors", com_example_smoke_Structs_00024MutableStructWithCppAccessors, ::smoke::Structs::MutableStructWithCppAccessors) JniReference @@ -39,7 +39,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::MutableStructWithCppAccess return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::MutableStructWithCppAccessors> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_NestingImmutableStruct__Conversion.cpp b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_NestingImmutableStruct__Conversion.cpp index 46f7d32775..4221832417 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_NestingImmutableStruct__Conversion.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/android/jni/com_example_smoke_Structs_NestingImmutableStruct__Conversion.cpp @@ -19,12 +19,12 @@ convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::smoke::S (::smoke::Structs::AllTypesStruct*)nullptr ); return ::smoke::Structs::NestingImmutableStruct(std::move(n_struct_field)); } -std::optional<::smoke::Structs::NestingImmutableStruct> -convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, std::optional<::smoke::Structs::NestingImmutableStruct>*) +::gluecodium::optional<::smoke::Structs::NestingImmutableStruct> +convert_from_jni(JNIEnv* _jenv, const JniReference& _jinput, ::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>*) { return _jinput - ? std::optional<::smoke::Structs::NestingImmutableStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::NestingImmutableStruct*)nullptr)) - : std::optional<::smoke::Structs::NestingImmutableStruct>{}; + ? ::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>(convert_from_jni(_jenv, _jinput, (::smoke::Structs::NestingImmutableStruct*)nullptr)) + : ::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>{}; } REGISTER_JNI_CLASS_CACHE("com/example/smoke/Structs$NestingImmutableStruct", com_example_smoke_Structs_00024NestingImmutableStruct, ::smoke::Structs::NestingImmutableStruct) JniReference @@ -37,7 +37,7 @@ convert_to_jni(JNIEnv* _jenv, const ::smoke::Structs::NestingImmutableStruct& _n return _jresult; } JniReference -convert_to_jni(JNIEnv* _jenv, const std::optional<::smoke::Structs::NestingImmutableStruct> _ninput) +convert_to_jni(JNIEnv* _jenv, const ::gluecodium::optional<::smoke::Structs::NestingImmutableStruct> _ninput) { return _ninput ? convert_to_jni(_jenv, *_ninput) : JniReference{}; } diff --git a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_Structs.cpp b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_Structs.cpp index ca6d626165..1217d199b2 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_Structs.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_Structs.cpp @@ -6,13 +6,13 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "gluecodium/VectorHash.h" #include "smoke/Structs.h" #include "smoke/TypeCollection.h" #include #include #include -#include #include #include void smoke_Structs_release_handle(_baseRef handle) { @@ -64,7 +64,7 @@ smoke_Structs_Point_release_handle( _baseRef handle ) _baseRef smoke_Structs_Point_create_optional_handle(double x, double y) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::Point>( ::smoke::Structs::Point( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::Point>( ::smoke::Structs::Point( ) ); (*_struct)->x = x; (*_struct)->y = y; return reinterpret_cast<_baseRef>( _struct ); @@ -72,10 +72,10 @@ smoke_Structs_Point_create_optional_handle(double x, double y) _baseRef smoke_Structs_Point_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::Point>*>( handle ) ); } void smoke_Structs_Point_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::Point>*>( handle ); } double smoke_Structs_Point_x_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -101,7 +101,7 @@ smoke_Structs_Line_release_handle( _baseRef handle ) _baseRef smoke_Structs_Line_create_optional_handle(_baseRef a, _baseRef b) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::Line>( ::smoke::Structs::Line( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::Line>( ::smoke::Structs::Line( ) ); (*_struct)->a = Conversion<::smoke::Structs::Point>::toCpp( a ); (*_struct)->b = Conversion<::smoke::Structs::Point>::toCpp( b ); return reinterpret_cast<_baseRef>( _struct ); @@ -109,10 +109,10 @@ smoke_Structs_Line_create_optional_handle(_baseRef a, _baseRef b) _baseRef smoke_Structs_Line_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::Line>*>( handle ) ); } void smoke_Structs_Line_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::Line>*>( handle ); } _baseRef smoke_Structs_Line_a_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -164,16 +164,16 @@ smoke_Structs_AllTypesStruct_create_optional_handle(int8_t int8Field, uint8_t ui auto _booleanField = booleanField; auto _bytesField = Conversion<::std::shared_ptr< ::std::vector< uint8_t > >>::toCpp( bytesField ); auto _pointField = Conversion<::smoke::Structs::Point>::toCpp( pointField ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::AllTypesStruct>( ::smoke::Structs::AllTypesStruct( _int8Field, _uint8Field, _int16Field, _uint16Field, _int32Field, _uint32Field, _int64Field, _uint64Field, _floatField, _doubleField, _stringField, _booleanField, _bytesField, _pointField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::AllTypesStruct>( ::smoke::Structs::AllTypesStruct( _int8Field, _uint8Field, _int16Field, _uint16Field, _int32Field, _uint32Field, _int64Field, _uint64Field, _floatField, _doubleField, _stringField, _booleanField, _bytesField, _pointField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_AllTypesStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::AllTypesStruct>*>( handle ) ); } void smoke_Structs_AllTypesStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::AllTypesStruct>*>( handle ); } int8_t smoke_Structs_AllTypesStruct_int8Field_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -247,16 +247,16 @@ _baseRef smoke_Structs_NestingImmutableStruct_create_optional_handle(_baseRef structField) { auto _structField = Conversion<::smoke::Structs::AllTypesStruct>::toCpp( structField ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::NestingImmutableStruct>( ::smoke::Structs::NestingImmutableStruct( _structField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>( ::smoke::Structs::NestingImmutableStruct( _structField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_NestingImmutableStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>*>( handle ) ); } void smoke_Structs_NestingImmutableStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::NestingImmutableStruct>*>( handle ); } _baseRef smoke_Structs_NestingImmutableStruct_structField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -278,16 +278,16 @@ _baseRef smoke_Structs_DoubleNestingImmutableStruct_create_optional_handle(_baseRef nestingStructField) { auto _nestingStructField = Conversion<::smoke::Structs::NestingImmutableStruct>::toCpp( nestingStructField ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::DoubleNestingImmutableStruct>( ::smoke::Structs::DoubleNestingImmutableStruct( _nestingStructField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::DoubleNestingImmutableStruct>( ::smoke::Structs::DoubleNestingImmutableStruct( _nestingStructField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_DoubleNestingImmutableStruct_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::DoubleNestingImmutableStruct>*>( handle ) ); } void smoke_Structs_DoubleNestingImmutableStruct_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::DoubleNestingImmutableStruct>*>( handle ); } _baseRef smoke_Structs_DoubleNestingImmutableStruct_nestingStructField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -309,16 +309,16 @@ _baseRef smoke_Structs_StructWithArrayOfImmutable_create_optional_handle(_baseRef arrayField) { auto _arrayField = Conversion<::std::vector< ::smoke::Structs::AllTypesStruct >>::toCpp( arrayField ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::StructWithArrayOfImmutable>( ::smoke::Structs::StructWithArrayOfImmutable( _arrayField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::StructWithArrayOfImmutable>( ::smoke::Structs::StructWithArrayOfImmutable( _arrayField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_StructWithArrayOfImmutable_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::StructWithArrayOfImmutable>*>( handle ) ); } void smoke_Structs_StructWithArrayOfImmutable_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::StructWithArrayOfImmutable>*>( handle ); } _baseRef smoke_Structs_StructWithArrayOfImmutable_arrayField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -340,16 +340,16 @@ _baseRef smoke_Structs_ImmutableStructWithCppAccessors_create_optional_handle(_baseRef stringField) { auto _stringField = Conversion<::std::string>::toCpp( stringField ); - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::ImmutableStructWithCppAccessors>( ::smoke::Structs::ImmutableStructWithCppAccessors( _stringField ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>( ::smoke::Structs::ImmutableStructWithCppAccessors( _stringField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_ImmutableStructWithCppAccessors_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>*>( handle ) ); } void smoke_Structs_ImmutableStructWithCppAccessors_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::ImmutableStructWithCppAccessors>*>( handle ); } _baseRef smoke_Structs_ImmutableStructWithCppAccessors_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); @@ -370,17 +370,17 @@ smoke_Structs_MutableStructWithCppAccessors_release_handle( _baseRef handle ) _baseRef smoke_Structs_MutableStructWithCppAccessors_create_optional_handle(_baseRef stringField) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::Structs::MutableStructWithCppAccessors>( ::smoke::Structs::MutableStructWithCppAccessors( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>( ::smoke::Structs::MutableStructWithCppAccessors( ) ); (*_struct)->set_string_field( Conversion<::std::string>::toCpp( stringField ) ); return reinterpret_cast<_baseRef>( _struct ); } _baseRef smoke_Structs_MutableStructWithCppAccessors_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>*>( handle ) ); } void smoke_Structs_MutableStructWithCppAccessors_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::Structs::MutableStructWithCppAccessors>*>( handle ); } _baseRef smoke_Structs_MutableStructWithCppAccessors_stringField_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethods.cpp b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethods.cpp index cff0943cea..e79fde7419 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethods.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethods.cpp @@ -2,11 +2,11 @@ // #include "cbridge/include/smoke/cbridge_StructsWithMethods.h" #include "cbridge_internal/include/BaseHandleImpl.h" +#include "gluecodium/Optional.h" #include "smoke/StructsWithMethods.h" #include "smoke/ValidationUtils.h" #include #include -#include _baseRef smoke_StructsWithMethods_Vector_create_handle( double x, double y ) { @@ -23,7 +23,7 @@ smoke_StructsWithMethods_Vector_release_handle( _baseRef handle ) _baseRef smoke_StructsWithMethods_Vector_create_optional_handle(double x, double y) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::StructsWithMethods::Vector>( ::smoke::StructsWithMethods::Vector( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::StructsWithMethods::Vector>( ::smoke::StructsWithMethods::Vector( ) ); (*_struct)->x = x; (*_struct)->y = y; return reinterpret_cast<_baseRef>( _struct ); @@ -31,10 +31,10 @@ smoke_StructsWithMethods_Vector_create_optional_handle(double x, double y) _baseRef smoke_StructsWithMethods_Vector_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::StructsWithMethods::Vector>*>( handle ) ); } void smoke_StructsWithMethods_Vector_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::StructsWithMethods::Vector>*>( handle ); } double smoke_StructsWithMethods_Vector_x_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethodsInterface.cpp b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethodsInterface.cpp index 5a8057a218..ce96007a44 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethodsInterface.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/cbridge/src/smoke/cbridge_StructsWithMethodsInterface.cpp @@ -5,11 +5,11 @@ #include "cbridge_internal/include/BaseHandleImpl.h" #include "cbridge_internal/include/TypeInitRepository.h" #include "cbridge_internal/include/WrapperCache.h" +#include "gluecodium/Optional.h" #include "smoke/StructsWithMethodsInterface.h" #include "smoke/ValidationUtils.h" #include #include -#include #include void smoke_StructsWithMethodsInterface_release_handle(_baseRef handle) { delete get_pointer<::std::shared_ptr< ::smoke::StructsWithMethodsInterface >>(handle); @@ -49,7 +49,7 @@ smoke_StructsWithMethodsInterface_Vector3_release_handle( _baseRef handle ) _baseRef smoke_StructsWithMethodsInterface_Vector3_create_optional_handle(double x, double y, double z) { - auto _struct = new ( ::std::nothrow ) std::optional<::smoke::StructsWithMethodsInterface::Vector3>( ::smoke::StructsWithMethodsInterface::Vector3( ) ); + auto _struct = new ( ::std::nothrow ) ::gluecodium::optional<::smoke::StructsWithMethodsInterface::Vector3>( ::smoke::StructsWithMethodsInterface::Vector3( ) ); (*_struct)->x = x; (*_struct)->y = y; (*_struct)->z = z; @@ -58,10 +58,10 @@ smoke_StructsWithMethodsInterface_Vector3_create_optional_handle(double x, doubl _baseRef smoke_StructsWithMethodsInterface_Vector3_unwrap_optional_handle( _baseRef handle ) { - return reinterpret_cast<_baseRef>( &**reinterpret_cast*>( handle ) ); + return reinterpret_cast<_baseRef>( &**reinterpret_cast<::gluecodium::optional<::smoke::StructsWithMethodsInterface::Vector3>*>( handle ) ); } void smoke_StructsWithMethodsInterface_Vector3_release_optional_handle(_baseRef handle) { - delete reinterpret_cast*>( handle ); + delete reinterpret_cast<::gluecodium::optional<::smoke::StructsWithMethodsInterface::Vector3>*>( handle ); } double smoke_StructsWithMethodsInterface_Vector3_x_get(_baseRef handle) { auto struct_pointer = get_pointer(handle); diff --git a/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_Structs.cpp b/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_Structs.cpp index fbcca0fc19..78b917cdfd 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_Structs.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_Structs.cpp @@ -104,7 +104,7 @@ FfiOpaqueHandle library_smoke_Structs_Point_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -112,13 +112,13 @@ library_smoke_Structs_Point_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Structs_Point_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_Point_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -148,7 +148,7 @@ FfiOpaqueHandle library_smoke_Structs_Line_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -156,13 +156,13 @@ library_smoke_Structs_Line_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_Structs_Line_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_Line_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -262,7 +262,7 @@ FfiOpaqueHandle library_smoke_Structs_AllTypesStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -270,13 +270,13 @@ library_smoke_Structs_AllTypesStruct_create_handle_nullable(FfiOpaqueHandle valu void library_smoke_Structs_AllTypesStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_AllTypesStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -298,7 +298,7 @@ FfiOpaqueHandle library_smoke_Structs_NestingImmutableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -306,13 +306,13 @@ library_smoke_Structs_NestingImmutableStruct_create_handle_nullable(FfiOpaqueHan void library_smoke_Structs_NestingImmutableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_NestingImmutableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -334,7 +334,7 @@ FfiOpaqueHandle library_smoke_Structs_DoubleNestingImmutableStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -342,13 +342,13 @@ library_smoke_Structs_DoubleNestingImmutableStruct_create_handle_nullable(FfiOpa void library_smoke_Structs_DoubleNestingImmutableStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_DoubleNestingImmutableStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -370,7 +370,7 @@ FfiOpaqueHandle library_smoke_Structs_StructWithArrayOfImmutable_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -378,13 +378,13 @@ library_smoke_Structs_StructWithArrayOfImmutable_create_handle_nullable(FfiOpaqu void library_smoke_Structs_StructWithArrayOfImmutable_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_StructWithArrayOfImmutable_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -406,7 +406,7 @@ FfiOpaqueHandle library_smoke_Structs_ImmutableStructWithCppAccessors_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -414,13 +414,13 @@ library_smoke_Structs_ImmutableStructWithCppAccessors_create_handle_nullable(Ffi void library_smoke_Structs_ImmutableStructWithCppAccessors_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_ImmutableStructWithCppAccessors_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -443,7 +443,7 @@ FfiOpaqueHandle library_smoke_Structs_MutableStructWithCppAccessors_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -451,20 +451,20 @@ library_smoke_Structs_MutableStructWithCppAccessors_create_handle_nullable(FfiOp void library_smoke_Structs_MutableStructWithCppAccessors_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_Structs_MutableStructWithCppAccessors_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle library_smoke_Structs_FooBar_create_handle_nullable(uint32_t value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -472,13 +472,13 @@ library_smoke_Structs_FooBar_create_handle_nullable(uint32_t value) void library_smoke_Structs_FooBar_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } uint32_t library_smoke_Structs_FooBar_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_StructsWithMethods.cpp b/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_StructsWithMethods.cpp index 6752db90fc..a881349eb4 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_StructsWithMethods.cpp +++ b/gluecodium/src/test/resources/smoke/structs/output/dart/ffi/ffi_smoke_StructsWithMethods.cpp @@ -106,7 +106,7 @@ FfiOpaqueHandle library_smoke_StructsWithMethods_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -114,13 +114,13 @@ library_smoke_StructsWithMethods_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_StructsWithMethods_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_StructsWithMethods_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -150,7 +150,7 @@ FfiOpaqueHandle library_smoke_StructsWithMethods_Vector_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -158,13 +158,13 @@ library_smoke_StructsWithMethods_Vector_create_handle_nullable(FfiOpaqueHandle v void library_smoke_StructsWithMethods_Vector_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_StructsWithMethods_Vector_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus diff --git a/gluecodium/src/test/resources/smoke/typedefs/output/dart/ffi/ffi_smoke_TypeDefs.cpp b/gluecodium/src/test/resources/smoke/typedefs/output/dart/ffi/ffi_smoke_TypeDefs.cpp index 62457c3e6d..e831c8ba34 100644 --- a/gluecodium/src/test/resources/smoke/typedefs/output/dart/ffi/ffi_smoke_TypeDefs.cpp +++ b/gluecodium/src/test/resources/smoke/typedefs/output/dart/ffi/ffi_smoke_TypeDefs.cpp @@ -126,7 +126,7 @@ FfiOpaqueHandle library_smoke_TypeDefs_StructHavingAliasFieldDefinedBelow_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -134,13 +134,13 @@ library_smoke_TypeDefs_StructHavingAliasFieldDefinedBelow_create_handle_nullable void library_smoke_TypeDefs_StructHavingAliasFieldDefinedBelow_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_TypeDefs_StructHavingAliasFieldDefinedBelow_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } FfiOpaqueHandle @@ -163,7 +163,7 @@ FfiOpaqueHandle library_smoke_TypeDefs_TestStruct_create_handle_nullable(FfiOpaqueHandle value) { return reinterpret_cast( - new (std::nothrow) std::optional( + new (std::nothrow) gluecodium::optional( gluecodium::ffi::Conversion::toCpp(value) ) ); @@ -171,13 +171,13 @@ library_smoke_TypeDefs_TestStruct_create_handle_nullable(FfiOpaqueHandle value) void library_smoke_TypeDefs_TestStruct_release_handle_nullable(FfiOpaqueHandle handle) { - delete reinterpret_cast*>(handle); + delete reinterpret_cast*>(handle); } FfiOpaqueHandle library_smoke_TypeDefs_TestStruct_get_value_nullable(FfiOpaqueHandle handle) { return gluecodium::ffi::Conversion::toFfi( - **reinterpret_cast*>(handle) + **reinterpret_cast*>(handle) ); } #ifdef __cplusplus