From 2d10cde6a5ed40c7b0ed53d3dcc0a8913001f6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Thu, 26 Sep 2024 12:56:00 +0200 Subject: [PATCH] Add support @value annotation on fastddsgen (#917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- code/FastDDSGenCodeTester.cpp | 2 +- docs/fastdds/xml_configuration/dynamic_types.rst | 3 +-- docs/fastdds/xtypes/language_binding.rst | 4 ---- docs/fastddsgen/dataTypes/dataTypes.rst | 3 ++- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/code/FastDDSGenCodeTester.cpp b/code/FastDDSGenCodeTester.cpp index cca5b46ae..8829bea92 100644 --- a/code/FastDDSGenCodeTester.cpp +++ b/code/FastDDSGenCodeTester.cpp @@ -163,7 +163,7 @@ enum Enumeration : int32_t { RED, GREEN, - BLUE + BLUE = 3 }; //! diff --git a/docs/fastdds/xml_configuration/dynamic_types.rst b/docs/fastdds/xml_configuration/dynamic_types.rst index 860428577..886f765d8 100644 --- a/docs/fastdds/xml_configuration/dynamic_types.rst +++ b/docs/fastdds/xml_configuration/dynamic_types.rst @@ -150,8 +150,7 @@ Optionally, unsigned integer attribute :code:`value` might be added to set a spe .. note:: - :code:`value` attribute is equivalent to :code:`@value` builtin annotation which is not still supported in neither - the plain (IDL) nor |DynamicTypes|. + :code:`value` attribute is equivalent to :code:`@value` builtin annotation. Please, refer to :ref:`xtypes_supportedtypes_enumeration` for more information on enumeration types. diff --git a/docs/fastdds/xtypes/language_binding.rst b/docs/fastdds/xtypes/language_binding.rst index 847da3d18..ab1ab50a2 100644 --- a/docs/fastdds/xtypes/language_binding.rst +++ b/docs/fastdds/xtypes/language_binding.rst @@ -298,10 +298,6 @@ For the enumeration type to be consistent, the remaining enumeration literals mu Additionally, the enumeration literal value might be set using |MemberDescriptor-api| :code:`default_value` property. The behavior is the same as setting the :code:`@value` :ref:`builtin annotation`. -.. note:: - - Currently, Fast DDS-Gen does not support :code:`@value` builtin annotation. - As the enumeration type is basically a signed integer type which might take only some specific values defined with the enumeration literals, the corresponding DynamicData getters and setters are the ones corresponding to the underlying signed integer type (and any other method promotable to that specific primitive type). diff --git a/docs/fastddsgen/dataTypes/dataTypes.rst b/docs/fastddsgen/dataTypes/dataTypes.rst index 0c011b5ce..3028904b7 100644 --- a/docs/fastddsgen/dataTypes/dataTypes.rst +++ b/docs/fastddsgen/dataTypes/dataTypes.rst @@ -362,6 +362,7 @@ The following IDL enumeration: { RED, GREEN, + @value(3) BLUE }; @@ -572,7 +573,7 @@ annotations might be applied without the need of defining them). - ❌ * - :code:`@value` - Set constant value to `enumerations`_ literal. - - ❌ + - ✅ * - :code:`@verbatim` - Add comment or text to the element. - ❌