Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21051] DynamicType to IDL serializer #4787

Merged
merged 52 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
736b5df
Add tree container
juanlofer-eprosima May 14, 2024
20a1aac
DynamicType to IDL serializer
juanlofer-eprosima May 14, 2024
4e0d229
Make methods return RETCODES and noexcept
Tempate Jun 18, 2024
7261e85
Move TreeNodeType methods to a different file
Tempate Jun 18, 2024
c1d83b6
Check ReturnCodes from the DynamicTypes API
Tempate Jun 18, 2024
d6819c7
Replace ostream with string
Tempate Jun 18, 2024
6278ce6
Cover unbounded sequence scenario
Tempate Jun 18, 2024
96532d6
Support TK_INT8 & TK_UINT8
Tempate Jun 18, 2024
7a31baa
Include safety checks
Tempate Jun 18, 2024
c8a8e94
Add DOCSTRING descriptions
Tempate Jun 18, 2024
1b50212
Tests - Dynamic Types to IDL
Tempate Jun 19, 2024
fdd8c20
Tests fixes - unbounded sequence & array length
Tempate Jun 19, 2024
f06af4d
Tests fixes - TK_ENUM
Tempate Jun 20, 2024
489de2c
Tests fixes - TK_UNION
Tempate Jun 20, 2024
33ae94f
Update versions.md
Tempate Jun 20, 2024
7e7ad25
Move dyn_type_tree to type_conversion
Tempate Jun 20, 2024
f2cfee8
Tests - Tree
Tempate Jun 20, 2024
9e18246
Tests fixes - Tree depth
Tempate Jun 20, 2024
7ab683c
Rename Tree to TreeNode
Tempate Jun 20, 2024
00f95e4
Tests - Refactor Dynamic Types to IDL
Tempate Jun 21, 2024
7f85c7e
Support TK_BITSET
Tempate Jun 24, 2024
4502ffa
Tests - TK_BITSET
Tempate Jun 24, 2024
abaa9f5
Support TK_BITMASK
Tempate Jun 24, 2024
a4c5bdb
Tests - TK_BITMASK
Tempate Jun 24, 2024
6a36c4d
Support TK_ALIAS
Tempate Jun 24, 2024
95f9e36
Tests - TK_ALIAS
Tempate Jun 24, 2024
16e8b2e
Support Annotation @key
Tempate Jun 24, 2024
eb8e73a
Tests - Annotation @key
Tempate Jun 24, 2024
da9068f
Rearrange & sort methods
Tempate Jun 25, 2024
0d9ce7f
Support Annotation @extensibility
Tempate Jun 25, 2024
3077276
Tests - Annotation @extensibility
Tempate Jun 25, 2024
2e54986
Tests - Nested Struct
Tempate Jun 25, 2024
30f9e1a
Support inheritance in TK_STRUCT
Tempate Jun 25, 2024
2e4da04
Tests - Inheritance in TK_STRUCT
Tempate Jun 25, 2024
54308b6
Rebase fix
Tempate Jul 4, 2024
8991b45
Review - Restructure the code & regenerate types
Tempate Jul 4, 2024
6b4ba36
Review - Apply suggestions
Tempate Jul 5, 2024
f8d75ab
Review - Refactor Tests
Tempate Jul 5, 2024
a27a0c7
Review - Primitives test
Tempate Jul 8, 2024
0fa22bd
Apply suggestions
Tempate Jul 8, 2024
07acbba
Review - Apply suggestions
Tempate Jul 9, 2024
0a0e984
Review - Sort dependencies
Tempate Jul 10, 2024
169019f
Fix - Declaration of `bits` hides previous local declaration
Tempate Jul 10, 2024
1a49fa6
Fix - Linking issues
Tempate Jul 10, 2024
9a5a3a0
Fix - Declaration of `info` hides member
Tempate Jul 10, 2024
802a6d9
Fix - to_upper
Tempate Jul 10, 2024
890c285
Review - Apply suggestions
Tempate Jul 11, 2024
8419c84
Review - Apply JSON suggestions
Tempate Jul 11, 2024
0626d71
Uncrustify
Tempate Jul 11, 2024
1e866de
Review - Apply suggestions
Tempate Jul 11, 2024
d82da58
Fix - default_type_kind may be used uninitialized
Tempate Jul 11, 2024
d3842f4
Fix - signed/unsigned mismatch
Tempate Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions include/fastdds/dds/xtypes/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
#define FASTDDS_DDS_XTYPES__UTILS_HPP

#include <iostream>
#include <string>

#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>
#include <fastdds/fastdds_dll.hpp>

namespace eprosima {
Expand All @@ -35,6 +37,17 @@ enum class DynamicDataJsonFormat
EPROSIMA,
};

/**
* @brief Serializes a @ref DynamicType into its IDL representation.
*
* @param [in] dynamic_type The @ref DynamicType to serialize.
* @param [in,out] output \c std::ostream reference containing the IDL representation.
* @retval RETCODE_OK when serialization fully succeeds, and inner (member serialization) failing code otherwise.
*/
FASTDDS_EXPORTED_API ReturnCode_t idl_serialize(
const DynamicType::_ref_type& dynamic_type,
std::ostream& output) noexcept;

/*!
* Serializes a @ref DynamicData into a JSON object, which is then dumped into an \c std::ostream.
* @param[in] data @ref DynamicData reference to be serialized.
Expand Down
1 change: 1 addition & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ set(${PROJECT_NAME}_source_files
fastdds/xtypes/dynamic_types/TypeDescriptorImpl.cpp
fastdds/xtypes/dynamic_types/VerbatimTextDescriptorImpl.cpp
fastdds/xtypes/exception/Exception.cpp
fastdds/xtypes/serializers/idl/dynamic_type_idl.cpp
fastdds/xtypes/serializers/json/dynamic_data_json.cpp
fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx
fastdds/xtypes/type_representation/TypeObjectRegistry.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/fastdds/xtypes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ target_sources(fastdds-xtypes-dynamic-types-impl INTERFACE
dynamic_types/TypeDescriptorImpl.hpp
dynamic_types/VerbatimTextDescriptorImpl.cpp
dynamic_types/VerbatimTextDescriptorImpl.hpp
serializers/idl/dynamic_type_idl.cpp
serializers/idl/dynamic_type_idl.hpp
serializers/json/dynamic_data_json.cpp
serializers/json/dynamic_data_json.hpp
utils.cpp
Expand Down
Loading
Loading