From fb2fc626c27e2506374526d46d1a0522283e5454 Mon Sep 17 00:00:00 2001 From: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:13:10 +0100 Subject: [PATCH] C++: add missing export macro to 'CppEnumeration.mustache' Generated files for C++ did not contain export macro for enumerations. That was not the case of structs and classes. The reason for that was missing inclusion of 'CppExportMacro' in 'CppEnumeration.mustache'. Note: the change in logic is only a single line. The remaining changes in the commit are related to smoke tests -- the expected generated files with enumerations have been adjusted. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com> --- CHANGELOG.md | 1 + .../templates/cpp/CppEnumeration.mustache | 4 ++-- .../output/cpp/include/smoke/AttributesEnum.h | 9 ++++++- .../cpp/include/smoke/CppRefReturnType.h | 2 +- .../output/cpp/include/smoke/Comments.h | 2 +- .../cpp/include/smoke/DeprecationComments.h | 2 +- .../include/smoke/DeprecationCommentsOnly.h | 2 +- .../cpp/include/smoke/ExcludedComments.h | 2 +- .../cpp/include/smoke/ExcludedCommentsOnly.h | 2 +- .../cpp/include/smoke/PlatformComments.h | 2 +- .../output/cpp/include/smoke/Constants.h | 17 ++++++++++++- .../output/cpp/include/smoke/Constructors.h | 2 +- .../cpp/include/smoke/DeclarationOrder.h | 19 ++++++++++++++- .../output/cpp/include/smoke/OrderInClass.h | 2 +- .../output/cpp/include/smoke/OrderInStruct.h | 15 +++++++++++- .../smoke/OrderInStructWithFunctions.h | 16 ++++++++++++- .../output/cpp/include/smoke/EnumWithAlias.h | 10 +++++++- .../include/smoke/EnumWithToStringHelper.h | 9 ++++++- .../enums/output/cpp/include/smoke/Enums.h | 4 ++-- .../cpp/include/smoke/EnumsInTypeCollection.h | 10 +++++++- .../output/cpp/include/smoke/Equatable.h | 24 ++++++++++++++++++- .../errors/output/cpp/include/smoke/Errors.h | 2 +- .../output/cpp/include/package/Types.h | 16 ++++++++++++- .../smoke/GenericTypesWithCompoundTypes.h | 2 +- .../output/cpp/include/namerules/NameRules.h | 2 +- .../output/cpp/include/smoke/FreeEnum.h | 10 +++++++- .../output/cpp/include/smoke/LevelOne.h | 2 +- .../output/cpp/include/smoke/OuterStruct.h | 2 +- .../output/cpp/include/smoke/Nullable.h | 2 +- .../output/cpp/include/smoke/fooTypes.h | 15 +++++++++++- .../output/cpp/include/smoke/Properties.h | 2 +- .../cpp/include/smoke/EnableIfTypesEnabled.h | 14 ++++++++++- .../cpp/include/smoke/SkipEnumeratorAutoTag.h | 9 ++++++- .../include/smoke/SkipEnumeratorExplicitTag.h | 9 ++++++- .../output/cpp/include/smoke/Structs.h | 2 +- 35 files changed, 209 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f813b4d18..cb3e4447ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased ### Bug fixes: + * C++: Added generation of missing export macro for enumerations. * C++: Fixed generation of getters and setters for accessors attribute -- non-trivial types use references now. * Added missing generation of conversion functions for lambdas defined in structs for Swift. * Fixed a bug related to exporting nested types defined in a type annotated as internal. diff --git a/gluecodium/src/main/resources/templates/cpp/CppEnumeration.mustache b/gluecodium/src/main/resources/templates/cpp/CppEnumeration.mustache index 96bd1bbf23..6aad929f49 100644 --- a/gluecodium/src/main/resources/templates/cpp/CppEnumeration.mustache +++ b/gluecodium/src/main/resources/templates/cpp/CppEnumeration.mustache @@ -1,6 +1,6 @@ {{!! ! - ! Copyright (C) 2016-2020 HERE Europe B.V. + ! Copyright (C) 2016-2024 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. @@ -20,7 +20,7 @@ !}} {{#unless external.cpp}} {{>cpp/CppDocComment}} -enum class {{>cpp/CppAttributesInline}}{{resolveName}} { +enum class {{>cpp/CppExportMacro}}{{>cpp/CppAttributesInline}}{{resolveName}} { {{#enumerators}} {{prefixPartial "cpp/CppDocComment" " "}}{{prefixPartial "cpp/CppAttributes" " "}}{{!! }} {{resolveName}}{{#explicitValue}} = {{resolveName}}{{/explicitValue}}{{#if iter.hasNext}},{{/if}} diff --git a/gluecodium/src/test/resources/smoke/attributes/output/cpp/include/smoke/AttributesEnum.h b/gluecodium/src/test/resources/smoke/attributes/output/cpp/include/smoke/AttributesEnum.h index 725de1fc4b..f7abc799fa 100644 --- a/gluecodium/src/test/resources/smoke/attributes/output/cpp/include/smoke/AttributesEnum.h +++ b/gluecodium/src/test/resources/smoke/attributes/output/cpp/include/smoke/AttributesEnum.h @@ -1,13 +1,20 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include + namespace smoke { -enum class [[OnEnumeration]] AttributesEnum { +enum class _GLUECODIUM_CPP_EXPORT [[OnEnumeration]] AttributesEnum { [[OnEnumerator]] NOPE }; + + + } 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 43ac07acf9..668c23468c 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 @@ -22,7 +22,7 @@ class _GLUECODIUM_CPP_EXPORT CppRefReturnType { public: - enum class InternalError { + enum class _GLUECODIUM_CPP_EXPORT InternalError { FOO, BAR }; 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 678426e38f..0b59a905cd 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 @@ -30,7 +30,7 @@ class _GLUECODIUM_CPP_EXPORT Comments { * This is some very useful enum. */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { /** * Not quite useful diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationComments.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationComments.h index bd166aff96..e1803114d9 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationComments.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationComments.h @@ -28,7 +28,7 @@ class _GLUECODIUM_CPP_EXPORT DeprecationComments { * This is some very useful enum. * \deprecated Unfortunately, this enum is deprecated. Use ::smoke::Comments::SomeEnum instead. */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { /** * Not quite useful * \deprecated Unfortunately, this item is deprecated. diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationCommentsOnly.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationCommentsOnly.h index fde1adeea9..209a9f7238 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationCommentsOnly.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/DeprecationCommentsOnly.h @@ -25,7 +25,7 @@ class _GLUECODIUM_CPP_EXPORT DeprecationCommentsOnly { /** * \deprecated Unfortunately, this enum is deprecated. */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { /** * \deprecated Unfortunately, this item is deprecated. */ diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedComments.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedComments.h index 7967a2af8c..0d72a3b0fd 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedComments.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedComments.h @@ -31,7 +31,7 @@ class _GLUECODIUM_CPP_EXPORT ExcludedComments { * \private */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { /** * Not quite useful * \private diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedCommentsOnly.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedCommentsOnly.h index 57ad9d08b6..69c899eb8b 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedCommentsOnly.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/ExcludedCommentsOnly.h @@ -29,7 +29,7 @@ class _GLUECODIUM_CPP_EXPORT ExcludedCommentsOnly { * \private */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { /** * \private diff --git a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/PlatformComments.h b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/PlatformComments.h index d880511839..eb6ef2a8e0 100644 --- a/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/PlatformComments.h +++ b/gluecodium/src/test/resources/smoke/comments/output/cpp/include/smoke/PlatformComments.h @@ -24,7 +24,7 @@ class _GLUECODIUM_CPP_EXPORT PlatformComments { * An error code when something goes wrong. */ - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { USELESS, USEFUL }; diff --git a/gluecodium/src/test/resources/smoke/constants/output/cpp/include/smoke/Constants.h b/gluecodium/src/test/resources/smoke/constants/output/cpp/include/smoke/Constants.h index 2223965f2a..b63069f4fa 100644 --- a/gluecodium/src/test/resources/smoke/constants/output/cpp/include/smoke/Constants.h +++ b/gluecodium/src/test/resources/smoke/constants/output/cpp/include/smoke/Constants.h @@ -1,23 +1,38 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT Constants { static const bool BOOL_CONSTANT; + static const int32_t INT_CONSTANT; + static const uint32_t UINT_CONSTANT; + static const float FLOAT_CONSTANT; + static const double DOUBLE_CONSTANT; + static const ::std::string STRING_CONSTANT; - enum class StateEnum { + + enum class _GLUECODIUM_CPP_EXPORT StateEnum { OFF, ON }; + + static const ::smoke::Constants::StateEnum ENUM_CONSTANT; + }; + + } diff --git a/gluecodium/src/test/resources/smoke/constructors/output/cpp/include/smoke/Constructors.h b/gluecodium/src/test/resources/smoke/constructors/output/cpp/include/smoke/Constructors.h index 6aab66a7ec..a42923f32d 100644 --- a/gluecodium/src/test/resources/smoke/constructors/output/cpp/include/smoke/Constructors.h +++ b/gluecodium/src/test/resources/smoke/constructors/output/cpp/include/smoke/Constructors.h @@ -24,7 +24,7 @@ class _GLUECODIUM_CPP_EXPORT Constructors { public: - enum class ErrorEnum { + enum class _GLUECODIUM_CPP_EXPORT ErrorEnum { NONE, CRASHED }; diff --git a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/DeclarationOrder.h b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/DeclarationOrder.h index 0015688ba0..afb66092d2 100644 --- a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/DeclarationOrder.h +++ b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/DeclarationOrder.h @@ -1,8 +1,11 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include "gluecodium/UnorderedMapHash.h" #include "gluecodium/VectorHash.h" @@ -10,28 +13,42 @@ #include #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT DeclarationOrder { struct _GLUECODIUM_CPP_EXPORT NestedStruct { ::std::string some_field; + NestedStruct( ); explicit NestedStruct( ::std::string some_field ); + }; - enum class SomeEnum { + + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR = 7 }; + + using SomeTypeDef = int32_t; + using NestedStructArray = ::std::vector< ::smoke::DeclarationOrder::NestedStruct >; + using ErrorCodeToMessageMap = ::std::unordered_map< int32_t, ::smoke::DeclarationOrder::NestedStructArray >; + struct _GLUECODIUM_CPP_EXPORT MainStruct { ::smoke::DeclarationOrder::NestedStruct struct_field; ::smoke::DeclarationOrder::SomeTypeDef type_def_field; ::smoke::DeclarationOrder::NestedStructArray struct_array_field; ::smoke::DeclarationOrder::ErrorCodeToMessageMap map_field; ::smoke::DeclarationOrder::SomeEnum enum_field; + MainStruct( ); MainStruct( ::smoke::DeclarationOrder::NestedStruct struct_field, ::smoke::DeclarationOrder::SomeTypeDef type_def_field, ::smoke::DeclarationOrder::NestedStructArray struct_array_field, ::smoke::DeclarationOrder::ErrorCodeToMessageMap map_field, ::smoke::DeclarationOrder::SomeEnum enum_field ); + }; + }; + + } diff --git a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInClass.h b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInClass.h index 5cedf3f9bd..5aeb40712f 100644 --- a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInClass.h +++ b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInClass.h @@ -22,7 +22,7 @@ class _GLUECODIUM_CPP_EXPORT OrderInClass { public: - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR = 7 }; diff --git a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStruct.h b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStruct.h index 773bd594c1..04f16c9188 100644 --- a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStruct.h +++ b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStruct.h @@ -1,25 +1,38 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT OrderInStruct { struct _GLUECODIUM_CPP_EXPORT NestedStruct { ::std::string some_field; + NestedStruct( ); explicit NestedStruct( ::std::string some_field ); + }; - enum class SomeEnum { + + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR = 7 }; + + ::smoke::OrderInStruct::NestedStruct struct_field; ::smoke::OrderInStruct::SomeEnum enum_field; + OrderInStruct( ); OrderInStruct( ::smoke::OrderInStruct::NestedStruct struct_field, ::smoke::OrderInStruct::SomeEnum enum_field ); + }; + + } diff --git a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStructWithFunctions.h b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStructWithFunctions.h index 0b35c31e64..263c25a1ab 100644 --- a/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStructWithFunctions.h +++ b/gluecodium/src/test/resources/smoke/declaration_order/output/cpp/include/smoke/OrderInStructWithFunctions.h @@ -1,25 +1,39 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT OrderInStructWithFunctions { struct _GLUECODIUM_CPP_EXPORT NestedStruct { ::std::string some_field; + NestedStruct( ); explicit NestedStruct( ::std::string some_field ); + }; - enum class SomeEnum { + + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR = 7 }; + + ::std::string some_field; + OrderInStructWithFunctions( ); explicit OrderInStructWithFunctions( ::std::string some_field ); + ::smoke::OrderInStructWithFunctions::SomeEnum do_stuff( const ::smoke::OrderInStructWithFunctions::NestedStruct& struct_foo ) const; + }; + + } diff --git a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithAlias.h b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithAlias.h index f332d744a8..88bf9a4c3f 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithAlias.h +++ b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithAlias.h @@ -1,21 +1,29 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { -enum class EnumWithAlias { +enum class _GLUECODIUM_CPP_EXPORT EnumWithAlias { ONE = 2, TWO, THREE, FIRST = ::smoke::EnumWithAlias::ONE, THE_BEST = ::smoke::EnumWithAlias::FIRST }; + + + _GLUECODIUM_CPP_EXPORT ::std::error_code make_error_code( ::smoke::EnumWithAlias value ) noexcept; } + namespace std { template <> diff --git a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithToStringHelper.h b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithToStringHelper.h index 74106ecd05..7321be2cf4 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithToStringHelper.h +++ b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumWithToStringHelper.h @@ -1,16 +1,23 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { -enum class EnumWithToStringHelper { +enum class _GLUECODIUM_CPP_EXPORT EnumWithToStringHelper { FIRST, SECOND }; + std::string_view _GLUECODIUM_CPP_EXPORT to_string(EnumWithToStringHelper enumeration); + + } diff --git a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/Enums.h b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/Enums.h index 5489eb1a42..a1a0a4d72a 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/Enums.h +++ b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/Enums.h @@ -21,13 +21,13 @@ class _GLUECODIUM_CPP_EXPORT Enums { public: - enum class SimpleEnum { + enum class _GLUECODIUM_CPP_EXPORT SimpleEnum { FIRST, SECOND }; - enum class InternalErrorCode { + enum class _GLUECODIUM_CPP_EXPORT InternalErrorCode { ERROR_NONE, ERROR_FATAL = 999 }; diff --git a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumsInTypeCollection.h b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumsInTypeCollection.h index 5a1e1f21c0..9cdb10b115 100644 --- a/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumsInTypeCollection.h +++ b/gluecodium/src/test/resources/smoke/enums/output/cpp/include/smoke/EnumsInTypeCollection.h @@ -1,15 +1,23 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT EnumsInTypeCollection { - enum class TCEnum { + enum class _GLUECODIUM_CPP_EXPORT TCEnum { FIRST, SECOND }; + + }; + + } 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..f97cf84570 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 @@ -1,8 +1,11 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include "gluecodium/Hash.h" #include "gluecodium/UnorderedMapHash.h" @@ -12,20 +15,28 @@ #include #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT Equatable { struct _GLUECODIUM_CPP_EXPORT NestedEquatableStruct { ::std::string foo_field; + NestedEquatableStruct( ); explicit NestedEquatableStruct( ::std::string foo_field ); + bool operator==( const NestedEquatableStruct& rhs ) const; bool operator!=( const NestedEquatableStruct& rhs ) const; + }; - enum class SomeEnum { + + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR }; + + using ErrorCodeToMessageMap = ::std::unordered_map< int32_t, ::std::string >; + struct _GLUECODIUM_CPP_EXPORT EquatableStruct { bool bool_field; int32_t int_field; @@ -37,11 +48,15 @@ struct _GLUECODIUM_CPP_EXPORT Equatable { ::smoke::Equatable::SomeEnum enum_field; ::std::vector< ::std::string > array_field; ::smoke::Equatable::ErrorCodeToMessageMap map_field; + EquatableStruct( ); EquatableStruct( bool bool_field, int32_t int_field, int64_t long_field, float float_field, double double_field, ::std::string string_field, ::smoke::Equatable::NestedEquatableStruct struct_field, ::smoke::Equatable::SomeEnum enum_field, ::std::vector< ::std::string > array_field, ::smoke::Equatable::ErrorCodeToMessageMap map_field ); + bool operator==( const EquatableStruct& rhs ) const; 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 >(); @@ -52,13 +67,20 @@ struct _GLUECODIUM_CPP_EXPORT Equatable { 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 >(); + 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 ); + bool operator==( const EquatableNullableStruct& rhs ) const; bool operator!=( const EquatableNullableStruct& rhs ) const; + }; + }; + + } + namespace gluecodium { template<> struct hash< ::smoke::Equatable::EquatableStruct > { diff --git a/gluecodium/src/test/resources/smoke/errors/output/cpp/include/smoke/Errors.h b/gluecodium/src/test/resources/smoke/errors/output/cpp/include/smoke/Errors.h index 4c36d2dcc8..6d80664ccd 100644 --- a/gluecodium/src/test/resources/smoke/errors/output/cpp/include/smoke/Errors.h +++ b/gluecodium/src/test/resources/smoke/errors/output/cpp/include/smoke/Errors.h @@ -22,7 +22,7 @@ class _GLUECODIUM_CPP_EXPORT Errors { public: - enum class InternalErrorCode { + enum class _GLUECODIUM_CPP_EXPORT InternalErrorCode { ERROR_NONE, ERROR_FATAL }; diff --git a/gluecodium/src/test/resources/smoke/escaped_names/output/cpp/include/package/Types.h b/gluecodium/src/test/resources/smoke/escaped_names/output/cpp/include/package/Types.h index 8ee39d73c4..6114d22ff9 100644 --- a/gluecodium/src/test/resources/smoke/escaped_names/output/cpp/include/package/Types.h +++ b/gluecodium/src/test/resources/smoke/escaped_names/output/cpp/include/package/Types.h @@ -1,28 +1,42 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include "gluecodium/VectorHash.h" #include #include #include + namespace package { struct _GLUECODIUM_CPP_EXPORT Types { - enum class Enum { + enum class _GLUECODIUM_CPP_EXPORT Enum { NA_N }; + + struct _GLUECODIUM_CPP_EXPORT Struct { ::package::Types::Enum null = ::package::Types::Enum::NA_N; + Struct( ); explicit Struct( ::package::Types::Enum null ); + }; + static const ::package::Types::Enum CONST; + using ULong = ::std::vector< ::package::Types::Struct >; + }; + + _GLUECODIUM_CPP_EXPORT ::std::error_code make_error_code( ::package::Types::Enum value ) noexcept; } + namespace std { template <> diff --git a/gluecodium/src/test/resources/smoke/generic_types/output/cpp/include/smoke/GenericTypesWithCompoundTypes.h b/gluecodium/src/test/resources/smoke/generic_types/output/cpp/include/smoke/GenericTypesWithCompoundTypes.h index 9a35f955f1..865cf45c00 100644 --- a/gluecodium/src/test/resources/smoke/generic_types/output/cpp/include/smoke/GenericTypesWithCompoundTypes.h +++ b/gluecodium/src/test/resources/smoke/generic_types/output/cpp/include/smoke/GenericTypesWithCompoundTypes.h @@ -38,7 +38,7 @@ class _GLUECODIUM_CPP_EXPORT GenericTypesWithCompoundTypes { public: - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { FOO, BAR }; diff --git a/gluecodium/src/test/resources/smoke/name_rules/output/cpp/include/namerules/NameRules.h b/gluecodium/src/test/resources/smoke/name_rules/output/cpp/include/namerules/NameRules.h index 5597fd4cbb..0392ceeccd 100644 --- a/gluecodium/src/test/resources/smoke/name_rules/output/cpp/include/namerules/NameRules.h +++ b/gluecodium/src/test/resources/smoke/name_rules/output/cpp/include/namerules/NameRules.h @@ -23,7 +23,7 @@ class _GLUECODIUM_CPP_EXPORT NameRules { public: - enum class ExampleErrorCode { + enum class _GLUECODIUM_CPP_EXPORT ExampleErrorCode { NONE, FATAL }; diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/FreeEnum.h b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/FreeEnum.h index 58fb9bde9e..a781404be0 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/FreeEnum.h +++ b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/FreeEnum.h @@ -1,18 +1,26 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { -enum class FreeEnum { +enum class _GLUECODIUM_CPP_EXPORT FreeEnum { FOO, BAR }; + + + _GLUECODIUM_CPP_EXPORT ::std::error_code make_error_code( ::smoke::FreeEnum value ) noexcept; } + namespace std { template <> diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/LevelOne.h b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/LevelOne.h index 01a867cf82..ef81c7d4df 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/LevelOne.h +++ b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/LevelOne.h @@ -35,7 +35,7 @@ class _GLUECODIUM_CPP_EXPORT LevelOne { public: - enum class LevelFourEnum { + enum class _GLUECODIUM_CPP_EXPORT LevelFourEnum { NONE }; diff --git a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/OuterStruct.h b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/OuterStruct.h index 24fe326ee9..abb4f35a4a 100644 --- a/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/OuterStruct.h +++ b/gluecodium/src/test/resources/smoke/nesting/output/cpp/include/smoke/OuterStruct.h @@ -35,7 +35,7 @@ struct _GLUECODIUM_CPP_EXPORT OuterStruct { }; - enum class InnerEnum { + enum class _GLUECODIUM_CPP_EXPORT InnerEnum { FOO, BAR }; 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 1456d4685b..dd4d3b0c3d 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 @@ -32,7 +32,7 @@ class _GLUECODIUM_CPP_EXPORT Nullable { public: - enum class SomeEnum { + enum class _GLUECODIUM_CPP_EXPORT SomeEnum { ON, OFF }; diff --git a/gluecodium/src/test/resources/smoke/platform_names/output/cpp/include/smoke/fooTypes.h b/gluecodium/src/test/resources/smoke/platform_names/output/cpp/include/smoke/fooTypes.h index 378d65c9cc..44bdc41dbe 100644 --- a/gluecodium/src/test/resources/smoke/platform_names/output/cpp/include/smoke/fooTypes.h +++ b/gluecodium/src/test/resources/smoke/platform_names/output/cpp/include/smoke/fooTypes.h @@ -1,22 +1,35 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT fooTypes { struct _GLUECODIUM_CPP_EXPORT fooStruct { ::std::string FOO_FIELD; + fooStruct( ); explicit fooStruct( ::std::string FOO_FIELD ); + static ::smoke::fooTypes::fooStruct FooCreate( const ::std::string& FooParameter ); + }; - enum class fooEnum { + + enum class _GLUECODIUM_CPP_EXPORT fooEnum { foo_item }; + + using fooTypedef = double; + }; + + } diff --git a/gluecodium/src/test/resources/smoke/properties/output/cpp/include/smoke/Properties.h b/gluecodium/src/test/resources/smoke/properties/output/cpp/include/smoke/Properties.h index 6318617026..39fc4898a6 100644 --- a/gluecodium/src/test/resources/smoke/properties/output/cpp/include/smoke/Properties.h +++ b/gluecodium/src/test/resources/smoke/properties/output/cpp/include/smoke/Properties.h @@ -29,7 +29,7 @@ class _GLUECODIUM_CPP_EXPORT Properties { public: - enum class InternalErrorCode { + enum class _GLUECODIUM_CPP_EXPORT InternalErrorCode { ERROR_NONE, ERROR_FATAL = 999 }; diff --git a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/EnableIfTypesEnabled.h b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/EnableIfTypesEnabled.h index 9f0eb8eb80..4b310c099b 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/EnableIfTypesEnabled.h +++ b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/EnableIfTypesEnabled.h @@ -1,20 +1,32 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include + namespace smoke { struct _GLUECODIUM_CPP_EXPORT EnableIfTypesEnabled { static const bool PLACE_HOLDER_ENABLED; - enum class EnableMe { + + enum class _GLUECODIUM_CPP_EXPORT EnableMe { NOPE }; + + struct _GLUECODIUM_CPP_EXPORT EnableMeToo { ::smoke::EnableIfTypesEnabled::EnableMe field; + EnableMeToo( ); explicit EnableMeToo( ::smoke::EnableIfTypesEnabled::EnableMe field ); + }; + }; + + } diff --git a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorAutoTag.h b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorAutoTag.h index e2b747eeb3..3881863a68 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorAutoTag.h +++ b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorAutoTag.h @@ -1,13 +1,20 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include + namespace smoke { -enum class SkipEnumeratorAutoTag { +enum class _GLUECODIUM_CPP_EXPORT SkipEnumeratorAutoTag { ONE, THREE }; + + + } diff --git a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorExplicitTag.h b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorExplicitTag.h index 04f84f6ae7..3e4e5ade68 100644 --- a/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorExplicitTag.h +++ b/gluecodium/src/test/resources/smoke/skip/output/cpp/include/smoke/SkipEnumeratorExplicitTag.h @@ -1,14 +1,21 @@ // ------------------------------------------------------------------------------------------------- // + // // ------------------------------------------------------------------------------------------------- + #pragma once + #include "gluecodium/ExportGluecodiumCpp.h" #include + namespace smoke { -enum class SkipEnumeratorExplicitTag { +enum class _GLUECODIUM_CPP_EXPORT SkipEnumeratorExplicitTag { ZERO, ONE = 3, THREE }; + + + } diff --git a/gluecodium/src/test/resources/smoke/structs/output/cpp/include/smoke/Structs.h b/gluecodium/src/test/resources/smoke/structs/output/cpp/include/smoke/Structs.h index 21b955bfb0..6a86598414 100644 --- a/gluecodium/src/test/resources/smoke/structs/output/cpp/include/smoke/Structs.h +++ b/gluecodium/src/test/resources/smoke/structs/output/cpp/include/smoke/Structs.h @@ -23,7 +23,7 @@ class _GLUECODIUM_CPP_EXPORT Structs { public: - enum class FooBar { + enum class _GLUECODIUM_CPP_EXPORT FooBar { FOO, BAR };