From 73ff2c10f3eae618b98100e6934e60a9d3b4ce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Fri, 17 Nov 2023 10:00:47 +0100 Subject: [PATCH] Support of Fast-CDR v1 (#3970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #19760. Coexist fastcdr v1 and v2 Signed-off-by: Ricardo González Moreno * Refs #19760. Coexist fastcdr v1 and v2 [new approach] Signed-off-by: Ricardo González Moreno * Refs #19760. Compile on VS2017 Signed-off-by: Ricardo González Moreno * Refs #19760. Fix asan Signed-off-by: Ricardo González Moreno * Refs #19760. Apply suggestion Signed-off-by: Ricardo González Moreno * Refs #19760. Apply suggestion Signed-off-by: Ricardo González Moreno * Refs #19760. Only show serialization methods deprecation in Fast CDR major > 1 Signed-off-by: EduPonz * Refs #19760. Fix compilation warnings and errors Signed-off-by: Ricardo González Moreno * Refs #19760. Fix warnings Signed-off-by: Ricardo González Moreno * Refs #18687. Trying compile VS2017 Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Moreno Signed-off-by: EduPonz Co-authored-by: EduPonz --- CMakeLists.txt | 2 +- cmake/packaging/Config.cmake.in | 2 +- .../HelloWorld.cxx | 10 +- .../AdvancedConfigurationExample/HelloWorld.h | 11 + .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../HelloWorldv1.cxx | 288 + .../HelloWorldv1.h | 243 + .../BasicConfigurationExample/HelloWorld.cxx | 10 +- .../BasicConfigurationExample/HelloWorld.h | 11 + .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../HelloWorldv1.cxx | 288 + .../BasicConfigurationExample/HelloWorldv1.h | 243 + examples/cpp/dds/Configurability/sample.cxx | 10 +- examples/cpp/dds/Configurability/sample.h | 11 + .../cpp/dds/Configurability/sampleCdrAux.hpp | 5 +- .../cpp/dds/Configurability/sampleCdrAux.ipp | 6 +- .../dds/Configurability/samplePubSubTypes.cxx | 62 +- .../dds/Configurability/samplePubSubTypes.h | 2 + examples/cpp/dds/Configurability/samplev1.cxx | 280 + examples/cpp/dds/Configurability/samplev1.h | 236 + .../CMakeLists.txt | 1 + .../HelloWorld.cxx | 10 +- .../ContentFilteredTopicExample/HelloWorld.h | 11 + .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../HelloWorldTypeObject.cxx | 16 +- .../HelloWorldTypeObject.h | 2 + .../HelloWorldv1.cxx | 290 + .../HelloWorldv1.h | 243 + .../cpp/dds/CustomListenerExample/Topic.cxx | 10 +- .../cpp/dds/CustomListenerExample/Topic.h | 11 + .../dds/CustomListenerExample/TopicCdrAux.hpp | 5 +- .../dds/CustomListenerExample/TopicCdrAux.ipp | 6 +- .../TopicPubSubTypes.cxx | 62 +- .../CustomListenerExample/TopicPubSubTypes.h | 2 + .../cpp/dds/CustomListenerExample/Topicv1.cxx | 286 + .../cpp/dds/CustomListenerExample/Topicv1.h | 243 + .../CustomPayloadPoolData.cxx | 10 +- .../CustomPayloadPoolData.h | 11 + .../CustomPayloadPoolDataCdrAux.hpp | 5 +- .../CustomPayloadPoolDataCdrAux.ipp | 6 +- .../CustomPayloadPoolDataPubSubTypes.cxx | 62 +- .../CustomPayloadPoolDataPubSubTypes.h | 4 +- .../CustomPayloadPoolDatav1.cxx | 286 + .../CustomPayloadPoolDatav1.h | 243 + .../DeadlineQoSExample/deadlinepayload.cxx | 10 +- .../dds/DeadlineQoSExample/deadlinepayload.h | 11 + .../deadlinepayloadCdrAux.hpp | 5 +- .../deadlinepayloadCdrAux.ipp | 6 +- .../deadlinepayloadPubSubTypes.cxx | 62 +- .../deadlinepayloadPubSubTypes.h | 2 + .../DeadlineQoSExample/deadlinepayloadv1.cxx | 294 + .../DeadlineQoSExample/deadlinepayloadv1.h | 243 + .../cpp/dds/DisablePositiveACKs/Topic.cxx | 10 +- examples/cpp/dds/DisablePositiveACKs/Topic.h | 11 + .../dds/DisablePositiveACKs/TopicCdrAux.hpp | 5 +- .../dds/DisablePositiveACKs/TopicCdrAux.ipp | 6 +- .../DisablePositiveACKs/TopicPubSubTypes.cxx | 62 +- .../DisablePositiveACKs/TopicPubSubTypes.h | 2 + .../cpp/dds/DisablePositiveACKs/Topicv1.cxx | 286 + .../cpp/dds/DisablePositiveACKs/Topicv1.h | 243 + .../types/HelloWorld.cxx | 10 +- .../DiscoveryServerExample/types/HelloWorld.h | 11 + .../types/HelloWorldCdrAux.hpp | 5 +- .../types/HelloWorldCdrAux.ipp | 6 +- .../types/HelloWorldPubSubTypes.cxx | 62 +- .../types/HelloWorldPubSubTypes.h | 2 + .../types/HelloWorldv1.cxx | 286 + .../types/HelloWorldv1.h | 243 + .../cpp/dds/Filtering/FilteringExample.cxx | 10 +- examples/cpp/dds/Filtering/FilteringExample.h | 11 + .../dds/Filtering/FilteringExampleCdrAux.hpp | 5 +- .../dds/Filtering/FilteringExampleCdrAux.ipp | 6 +- .../Filtering/FilteringExamplePubSubTypes.cxx | 62 +- .../Filtering/FilteringExamplePubSubTypes.h | 2 + .../cpp/dds/Filtering/FilteringExamplev1.cxx | 223 + .../cpp/dds/Filtering/FilteringExamplev1.h | 215 + .../FlowControlExample/FlowControlExample.cxx | 10 +- .../FlowControlExample/FlowControlExample.h | 11 + .../FlowControlExampleCdrAux.hpp | 5 +- .../FlowControlExampleCdrAux.ipp | 6 +- .../FlowControlExamplePubSubTypes.cxx | 62 +- .../FlowControlExamplePubSubTypes.h | 2 + .../FlowControlExamplev1.cxx | 288 + .../FlowControlExample/FlowControlExamplev1.h | 243 + .../cpp/dds/HelloWorldExample/HelloWorld.cxx | 10 +- .../cpp/dds/HelloWorldExample/HelloWorld.h | 11 + .../HelloWorldExample/HelloWorldCdrAux.hpp | 5 +- .../HelloWorldExample/HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldExample/HelloWorldPubSubTypes.h | 2 + .../dds/HelloWorldExample/HelloWorldv1.cxx | 286 + .../cpp/dds/HelloWorldExample/HelloWorldv1.h | 243 + .../HelloWorld.cxx | 10 +- .../HelloWorldExampleDataSharing/HelloWorld.h | 12 + .../HelloWorldCdrAux.hpp | 3 + .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../HelloWorldv1.cxx | 290 + .../HelloWorldv1.h | 243 + .../HelloWorldExampleSharedMem/HelloWorld.cxx | 18 +- .../HelloWorldExampleSharedMem/HelloWorld.h | 21 +- .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../HelloWorldv1.cxx | 351 + .../HelloWorldExampleSharedMem/HelloWorldv1.h | 271 + .../dds/HelloWorldExampleTCP/HelloWorld.cxx | 10 +- .../cpp/dds/HelloWorldExampleTCP/HelloWorld.h | 11 + .../HelloWorldExampleTCP/HelloWorldCdrAux.hpp | 5 +- .../HelloWorldExampleTCP/HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../dds/HelloWorldExampleTCP/HelloWorldv1.cxx | 286 + .../dds/HelloWorldExampleTCP/HelloWorldv1.h | 243 + examples/cpp/dds/HistoryKind/sample.cxx | 10 +- examples/cpp/dds/HistoryKind/sample.h | 11 + examples/cpp/dds/HistoryKind/sampleCdrAux.hpp | 5 +- examples/cpp/dds/HistoryKind/sampleCdrAux.ipp | 6 +- .../cpp/dds/HistoryKind/samplePubSubTypes.cxx | 62 +- .../cpp/dds/HistoryKind/samplePubSubTypes.h | 2 + examples/cpp/dds/HistoryKind/samplev1.cxx | 280 + examples/cpp/dds/HistoryKind/samplev1.h | 236 + examples/cpp/dds/Keys/sample.cxx | 10 +- examples/cpp/dds/Keys/sample.h | 11 + examples/cpp/dds/Keys/sampleCdrAux.hpp | 5 +- examples/cpp/dds/Keys/sampleCdrAux.ipp | 6 +- examples/cpp/dds/Keys/samplePubSubTypes.cxx | 62 +- examples/cpp/dds/Keys/samplePubSubTypes.h | 2 + examples/cpp/dds/Keys/samplev1.cxx | 280 + examples/cpp/dds/Keys/samplev1.h | 236 + examples/cpp/dds/LateJoiners/sample.cxx | 10 +- examples/cpp/dds/LateJoiners/sample.h | 11 + examples/cpp/dds/LateJoiners/sampleCdrAux.hpp | 5 +- examples/cpp/dds/LateJoiners/sampleCdrAux.ipp | 6 +- .../cpp/dds/LateJoiners/samplePubSubTypes.cxx | 62 +- .../cpp/dds/LateJoiners/samplePubSubTypes.h | 2 + examples/cpp/dds/LateJoiners/samplev1.cxx | 280 + examples/cpp/dds/LateJoiners/samplev1.h | 236 + .../cpp/dds/LifespanQoSExample/Lifespan.cxx | 10 +- .../cpp/dds/LifespanQoSExample/Lifespan.h | 11 + .../dds/LifespanQoSExample/LifespanCdrAux.hpp | 5 +- .../dds/LifespanQoSExample/LifespanCdrAux.ipp | 6 +- .../LifespanPubSubTypes.cxx | 62 +- .../LifespanQoSExample/LifespanPubSubTypes.h | 2 + .../cpp/dds/LifespanQoSExample/Lifespanv1.cxx | 286 + .../cpp/dds/LifespanQoSExample/Lifespanv1.h | 243 + examples/cpp/dds/LivelinessQoS/Topic.cxx | 10 +- examples/cpp/dds/LivelinessQoS/Topic.h | 11 + .../cpp/dds/LivelinessQoS/TopicCdrAux.hpp | 5 +- .../cpp/dds/LivelinessQoS/TopicCdrAux.ipp | 6 +- .../dds/LivelinessQoS/TopicPubSubTypes.cxx | 62 +- .../cpp/dds/LivelinessQoS/TopicPubSubTypes.h | 2 + examples/cpp/dds/LivelinessQoS/Topicv1.cxx | 286 + examples/cpp/dds/LivelinessQoS/Topicv1.h | 243 + .../OwnershipStrength.cxx | 10 +- .../OwnershipStrength.h | 11 + .../OwnershipStrengthCdrAux.hpp | 5 +- .../OwnershipStrengthCdrAux.ipp | 6 +- .../OwnershipStrengthPubSubTypes.cxx | 62 +- .../OwnershipStrengthPubSubTypes.h | 2 + .../OwnershipStrengthv1.cxx | 339 + .../OwnershipStrengthv1.h | 264 + .../dds/RequestReplyExample/CMakeLists.txt | 1 + .../dds/RequestReplyExample/Calculator.cxx | 15 +- .../cpp/dds/RequestReplyExample/Calculator.h | 13 + .../RequestReplyExample/CalculatorCdrAux.hpp | 7 +- .../RequestReplyExample/CalculatorCdrAux.ipp | 9 +- .../CalculatorPubSubTypes.cxx | 120 +- .../CalculatorPubSubTypes.h | 4 + .../dds/RequestReplyExample/Calculatorv1.cxx | 467 + .../dds/RequestReplyExample/Calculatorv1.h | 407 + .../dds/SampleConfig_Controller/sample.cxx | 10 +- .../cpp/dds/SampleConfig_Controller/sample.h | 11 + .../SampleConfig_Controller/sampleCdrAux.hpp | 5 +- .../SampleConfig_Controller/sampleCdrAux.ipp | 6 +- .../samplePubSubTypes.cxx | 62 +- .../samplePubSubTypes.h | 2 + .../dds/SampleConfig_Controller/samplev1.cxx | 280 + .../dds/SampleConfig_Controller/samplev1.h | 236 + .../cpp/dds/SampleConfig_Events/sample.cxx | 10 +- examples/cpp/dds/SampleConfig_Events/sample.h | 11 + .../dds/SampleConfig_Events/sampleCdrAux.hpp | 5 +- .../dds/SampleConfig_Events/sampleCdrAux.ipp | 6 +- .../SampleConfig_Events/samplePubSubTypes.cxx | 62 +- .../SampleConfig_Events/samplePubSubTypes.h | 2 + .../cpp/dds/SampleConfig_Events/samplev1.cxx | 280 + .../cpp/dds/SampleConfig_Events/samplev1.h | 236 + .../dds/SampleConfig_Multimedia/sample.cxx | 10 +- .../cpp/dds/SampleConfig_Multimedia/sample.h | 11 + .../SampleConfig_Multimedia/sampleCdrAux.hpp | 5 +- .../SampleConfig_Multimedia/sampleCdrAux.ipp | 6 +- .../samplePubSubTypes.cxx | 62 +- .../samplePubSubTypes.h | 2 + .../dds/SampleConfig_Multimedia/samplev1.cxx | 280 + .../dds/SampleConfig_Multimedia/samplev1.h | 236 + .../SecureHelloWorldExample/HelloWorld.cxx | 10 +- .../dds/SecureHelloWorldExample/HelloWorld.h | 11 + .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../SecureHelloWorldExample/HelloWorldv1.cxx | 286 + .../SecureHelloWorldExample/HelloWorldv1.h | 243 + .../StaticHelloWorldExample/HelloWorld.cxx | 10 +- .../dds/StaticHelloWorldExample/HelloWorld.h | 11 + .../HelloWorldCdrAux.hpp | 5 +- .../HelloWorldCdrAux.ipp | 6 +- .../HelloWorldPubSubTypes.cxx | 62 +- .../HelloWorldPubSubTypes.h | 2 + .../StaticHelloWorldExample/HelloWorldv1.cxx | 286 + .../StaticHelloWorldExample/HelloWorldv1.h | 243 + .../WriterLoansExample/LoanableHelloWorld.cxx | 10 +- .../WriterLoansExample/LoanableHelloWorld.h | 11 + .../LoanableHelloWorldCdrAux.hpp | 5 +- .../LoanableHelloWorldCdrAux.ipp | 6 +- .../LoanableHelloWorldPubSubTypes.cxx | 62 +- .../LoanableHelloWorldPubSubTypes.h | 2 + .../LoanableHelloWorldv1.cxx | 288 + .../WriterLoansExample/LoanableHelloWorldv1.h | 243 + .../ZeroCopyExample/LoanableHelloWorld.cxx | 10 +- .../dds/ZeroCopyExample/LoanableHelloWorld.h | 11 + .../LoanableHelloWorldCdrAux.hpp | 5 +- .../LoanableHelloWorldCdrAux.ipp | 6 +- .../LoanableHelloWorldPubSubTypes.cxx | 62 +- .../LoanableHelloWorldPubSubTypes.h | 2 + .../ZeroCopyExample/LoanableHelloWorldv1.cxx | 288 + .../ZeroCopyExample/LoanableHelloWorldv1.h | 243 + .../dds/builtin/common/ReplyHeader.hpp | 6 +- .../dds/builtin/common/RequestHeader.hpp | 6 +- include/fastdds/dds/builtin/common/Types.hpp | 12 +- .../typelookup/common/TypeLookupTypes.hpp | 60 +- .../fastdds/rtps/common/CdrSerialization.hpp | 75 +- include/fastdds/rtps/writer/RTPSWriter.h | 6 +- include/fastrtps/config.h.in | 6 + .../fastrtps/types/AnnotationParameterValue.h | 36 +- include/fastrtps/types/TypeIdentifier.h | 6 +- include/fastrtps/types/TypeIdentifierTypes.h | 66 +- include/fastrtps/types/TypeObject.h | 498 +- include/fastrtps/types/TypeObjectHashId.h | 14 + src/cpp/CMakeLists.txt | 1 + .../AnnotationParameterValue.cpp | 56 +- .../AnnotationParameterValueCdrAux.ipp | 143 + .../BuiltinAnnotationsTypeObject.cpp | 229 +- src/cpp/dynamic-types/DynamicPubSubType.cpp | 20 +- .../DynamicTypeBuilderFactory.cpp | 61 +- src/cpp/dynamic-types/TypeIdentifier.cpp | 5 +- .../dynamic-types/TypeIdentifierCdrAux.ipp | 62 + src/cpp/dynamic-types/TypeIdentifierTypes.cpp | 5 +- .../TypeIdentifierTypesCdrAux.ipp | 354 +- src/cpp/dynamic-types/TypeObject.cpp | 5 +- src/cpp/dynamic-types/TypeObjectCdrAux.ipp | 1882 +++- src/cpp/dynamic-types/TypeObjectFactory.cpp | 3 +- src/cpp/dynamic-types/TypeObjectHashId.cpp | 83 +- .../dynamic-types/TypeObjectHashIdCdrAux.ipp | 115 + src/cpp/dynamic-types/TypesBase.cpp | 25 +- .../fastdds/builtin/common/RPCHeadersImpl.cpp | 4 +- .../builtin/common/RPCHeadersImplCdrAux.ipp | 46 + .../builtin/typelookup/TypeLookupManager.cpp | 2 +- .../typelookup/common/TypeLookupTypes.cpp | 27 +- .../common/TypeLookupTypesCdrAux.ipp | 303 +- .../core/policy/QosPoliciesSerializer.hpp | 37 +- .../DDSSQLFilter/DDSFilterExpression.cpp | 7 +- .../rtps/transport/tcp/TCPControlMessage.cpp | 41 +- .../cryptography/AESGCMGMAC_Transform.cpp | 10 + src/cpp/statistics/types/types.cxx | 683 +- src/cpp/statistics/types/types.h | 4467 ++++----- src/cpp/statistics/types/typesCdrAux.hpp | 34 +- src/cpp/statistics/types/typesCdrAux.ipp | 171 +- src/cpp/statistics/types/typesPubSubTypes.cxx | 819 +- src/cpp/statistics/types/typesPubSubTypes.h | 31 + src/cpp/statistics/types/typesv1.cxx | 4757 ++++++++++ src/cpp/statistics/types/typesv1.h | 3092 +++++++ test/blackbox/CMakeLists.txt | 17 + test/blackbox/common/RTPSAsSocketWriter.hpp | 9 + .../common/RTPSWithRegistrationReader.hpp | 7 +- .../common/RTPSWithRegistrationWriter.hpp | 8 + test/blackbox/types/Data1mb.cxx | 12 +- test/blackbox/types/Data1mb.h | 13 + test/blackbox/types/Data1mbCdrAux.hpp | 7 +- test/blackbox/types/Data1mbCdrAux.ipp | 8 +- test/blackbox/types/Data1mbPubSubTypes.cxx | 64 +- test/blackbox/types/Data1mbPubSubTypes.h | 4 + test/blackbox/types/Data1mbv1.cxx | 243 + test/blackbox/types/Data1mbv1.h | 224 + test/blackbox/types/Data64kb.cxx | 12 +- test/blackbox/types/Data64kb.h | 13 + test/blackbox/types/Data64kbCdrAux.hpp | 7 +- test/blackbox/types/Data64kbCdrAux.ipp | 8 +- test/blackbox/types/Data64kbPubSubTypes.cxx | 64 +- test/blackbox/types/Data64kbPubSubTypes.h | 4 + test/blackbox/types/Data64kbv1.cxx | 243 + test/blackbox/types/Data64kbv1.h | 224 + test/blackbox/types/FixedSized.cxx | 10 +- test/blackbox/types/FixedSized.h | 11 + test/blackbox/types/FixedSizedCdrAux.hpp | 5 +- test/blackbox/types/FixedSizedCdrAux.ipp | 6 +- test/blackbox/types/FixedSizedPubSubTypes.cxx | 62 +- test/blackbox/types/FixedSizedPubSubTypes.h | 2 + test/blackbox/types/FixedSizedv1.cxx | 223 + test/blackbox/types/FixedSizedv1.h | 215 + test/blackbox/types/HelloWorld.cxx | 10 +- test/blackbox/types/HelloWorld.h | 11 + test/blackbox/types/HelloWorldCdrAux.hpp | 5 +- test/blackbox/types/HelloWorldCdrAux.ipp | 6 +- test/blackbox/types/HelloWorldPubSubTypes.cxx | 62 +- test/blackbox/types/HelloWorldPubSubTypes.h | 2 + test/blackbox/types/HelloWorldTypeObject.cxx | 16 +- test/blackbox/types/HelloWorldTypeObject.h | 2 + test/blackbox/types/HelloWorldv1.cxx | 294 + test/blackbox/types/HelloWorldv1.h | 243 + test/blackbox/types/KeyedData1mb.cxx | 12 +- test/blackbox/types/KeyedData1mb.h | 13 + test/blackbox/types/KeyedData1mbCdrAux.hpp | 7 +- test/blackbox/types/KeyedData1mbCdrAux.ipp | 8 +- .../types/KeyedData1mbPubSubTypes.cxx | 64 +- test/blackbox/types/KeyedData1mbPubSubTypes.h | 4 + test/blackbox/types/KeyedData1mbv1.cxx | 300 + test/blackbox/types/KeyedData1mbv1.h | 245 + test/blackbox/types/KeyedHelloWorld.cxx | 10 +- test/blackbox/types/KeyedHelloWorld.h | 11 + test/blackbox/types/KeyedHelloWorldCdrAux.hpp | 5 +- test/blackbox/types/KeyedHelloWorldCdrAux.ipp | 6 +- .../types/KeyedHelloWorldPubSubTypes.cxx | 62 +- .../types/KeyedHelloWorldPubSubTypes.h | 2 + test/blackbox/types/KeyedHelloWorldv1.cxx | 348 + test/blackbox/types/KeyedHelloWorldv1.h | 264 + test/blackbox/types/StringTest.cxx | 10 +- test/blackbox/types/StringTest.h | 11 + test/blackbox/types/StringTestCdrAux.hpp | 5 +- test/blackbox/types/StringTestCdrAux.ipp | 6 +- test/blackbox/types/StringTestPubSubTypes.cxx | 62 +- test/blackbox/types/StringTestPubSubTypes.h | 2 + test/blackbox/types/StringTestv1.cxx | 237 + test/blackbox/types/StringTestv1.h | 222 + .../types/TestIncludeRegression3361.cxx | 8 + .../types/TestIncludeRegression3361.h | 13 +- .../TestIncludeRegression3361TypeObject.cxx | 12 +- .../types/TestIncludeRegression3361v1.cxx | 95 + .../types/TestIncludeRegression3361v1.h | 80 + test/blackbox/types/TestRegression3361.cxx | 10 +- test/blackbox/types/TestRegression3361.h | 11 + .../types/TestRegression3361CdrAux.hpp | 5 +- .../types/TestRegression3361CdrAux.ipp | 6 +- .../types/TestRegression3361PubSubTypes.cxx | 62 +- .../types/TestRegression3361PubSubTypes.h | 2 + .../types/TestRegression3361TypeObject.cxx | 16 +- .../types/TestRegression3361TypeObject.h | 2 + test/blackbox/types/TestRegression3361v1.cxx | 238 + test/blackbox/types/TestRegression3361v1.h | 223 + test/blackbox/types/statistics/types.cxx | 683 +- test/blackbox/types/statistics/types.h | 4467 ++++----- .../blackbox/types/statistics/typesCdrAux.hpp | 34 +- .../blackbox/types/statistics/typesCdrAux.ipp | 171 +- .../types/statistics/typesPubSubTypes.cxx | 819 +- .../types/statistics/typesPubSubTypes.h | 31 + test/blackbox/types/statistics/typesv1.cxx | 4757 ++++++++++ test/blackbox/types/statistics/typesv1.h | 3092 +++++++ test/communication/CMakeLists.txt | 5 +- test/dds/communication/CMakeLists.txt | 5 +- test/profiling/allocations/AllocTestType.cxx | 10 +- test/profiling/allocations/AllocTestType.h | 11 + .../allocations/AllocTestTypeCdrAux.hpp | 5 +- .../allocations/AllocTestTypeCdrAux.ipp | 6 +- .../allocations/AllocTestTypePubSubTypes.cxx | 62 +- .../allocations/AllocTestTypePubSubTypes.h | 2 + .../profiling/allocations/AllocTestTypev1.cxx | 223 + test/profiling/allocations/AllocTestTypev1.h | 215 + test/realtime/UserThreadNonBlockedTest.cpp | 7 +- test/unittest/dds/publisher/CMakeLists.txt | 1 + test/unittest/dds/status/CMakeLists.txt | 3 +- .../dds/subscriber/FooBoundedTypeSupport.hpp | 11 +- .../dds/subscriber/FooTypeSupport.hpp | 20 +- .../data_types/ContentFilterTestType.cxx | 145 +- .../data_types/ContentFilterTestType.h | 175 +- .../ContentFilterTestTypeCdrAux.hpp | 11 +- .../ContentFilterTestTypeCdrAux.ipp | 13 +- .../ContentFilterTestTypePubSubTypes.cxx | 124 +- .../ContentFilterTestTypePubSubTypes.h | 8 + .../ContentFilterTestTypeTypeObject.cxx | 176 +- .../ContentFilterTestTypeTypeObject.h | 8 + .../data_types/ContentFilterTestTypev1.cxx | 5318 +++++++++++ .../data_types/ContentFilterTestTypev1.h | 2358 +++++ test/unittest/dynamic_types/CMakeLists.txt | 3 + .../DynamicComplexTypesTests.cpp | 8 +- .../dynamic_types/DynamicTypesTests.cpp | 20 +- test/unittest/dynamic_types/idl/Basic.cxx | 194 +- test/unittest/dynamic_types/idl/Basic.h | 93 + .../dynamic_types/idl/BasicCdrAux.hpp | 93 +- .../dynamic_types/idl/BasicCdrAux.ipp | 140 +- .../dynamic_types/idl/BasicPubSubTypes.cxx | 1886 +++- .../dynamic_types/idl/BasicPubSubTypes.h | 85 + .../dynamic_types/idl/BasicTypeObject.cxx | 472 +- .../dynamic_types/idl/BasicTypeObject.h | 82 + test/unittest/dynamic_types/idl/Basicv1.cxx | 6119 ++++++++++++ test/unittest/dynamic_types/idl/Basicv1.h | 5326 +++++++++++ test/unittest/dynamic_types/idl/Test.cxx | 35 +- test/unittest/dynamic_types/idl/Test.h | 28 +- .../unittest/dynamic_types/idl/TestCdrAux.hpp | 30 +- .../unittest/dynamic_types/idl/TestCdrAux.ipp | 44 +- .../dynamic_types/idl/TestPubSubTypes.cxx | 255 +- .../dynamic_types/idl/TestPubSubTypes.h | 16 + .../dynamic_types/idl/TestTypeObject.cxx | 146 +- .../dynamic_types/idl/TestTypeObject.h | 14 + test/unittest/dynamic_types/idl/Testv1.cxx | 3744 ++++++++ test/unittest/dynamic_types/idl/Testv1.h | 1872 ++++ .../dynamic_types/idl/new_features_4_2.cxx | 213 +- .../dynamic_types/idl/new_features_4_2.h | 993 +- .../idl/new_features_4_2CdrAux.hpp | 20 +- .../idl/new_features_4_2CdrAux.ipp | 67 +- .../idl/new_features_4_2PubSubTypes.cxx | 245 +- .../idl/new_features_4_2PubSubTypes.h | 17 + .../idl/new_features_4_2TypeObject.cxx | 126 +- .../idl/new_features_4_2TypeObject.h | 14 + .../dynamic_types/idl/new_features_4_2v1.cxx | 2905 ++++++ .../dynamic_types/idl/new_features_4_2v1.h | 1737 ++++ test/unittest/rtps/writer/RTPSWriterTests.cpp | 9 + test/unittest/statistics/dds/CMakeLists.txt | 6 +- test/unittest/statistics/rtps/CMakeLists.txt | 3 +- test/unittest/xtypes/CMakeLists.txt | 4 +- test/unittest/xtypes/idl/Types.cxx | 239 +- test/unittest/xtypes/idl/Types.h | 127 +- test/unittest/xtypes/idl/TypesCdrAux.hpp | 125 +- test/unittest/xtypes/idl/TypesCdrAux.ipp | 186 +- test/unittest/xtypes/idl/TypesPubSubTypes.cxx | 2142 ++++- test/unittest/xtypes/idl/TypesPubSubTypes.h | 121 + test/unittest/xtypes/idl/TypesTypeObject.cxx | 544 +- test/unittest/xtypes/idl/TypesTypeObject.h | 116 + test/unittest/xtypes/idl/Typesv1.cxx | 8202 +++++++++++++++++ test/unittest/xtypes/idl/Typesv1.h | 6495 +++++++++++++ test/unittest/xtypes/idl/WideEnum.cxx | 19 +- test/unittest/xtypes/idl/WideEnum.h | 15 + test/unittest/xtypes/idl/WideEnumCdrAux.hpp | 10 +- test/unittest/xtypes/idl/WideEnumCdrAux.ipp | 17 +- .../xtypes/idl/WideEnumPubSubTypes.cxx | 123 +- .../unittest/xtypes/idl/WideEnumPubSubTypes.h | 7 + .../xtypes/idl/WideEnumTypeObject.cxx | 46 +- test/unittest/xtypes/idl/WideEnumTypeObject.h | 6 + test/unittest/xtypes/idl/WideEnumv1.cxx | 858 ++ test/unittest/xtypes/idl/WideEnumv1.h | 559 ++ test/xtypes/CMakeLists.txt | 1 + test/xtypes/idl/Types.cxx | 239 +- test/xtypes/idl/Types.h | 127 +- test/xtypes/idl/TypesCdrAux.hpp | 125 +- test/xtypes/idl/TypesCdrAux.ipp | 186 +- test/xtypes/idl/TypesPubSubTypes.cxx | 2142 ++++- test/xtypes/idl/TypesPubSubTypes.h | 121 + test/xtypes/idl/TypesTypeObject.cxx | 544 +- test/xtypes/idl/TypesTypeObject.h | 116 + test/xtypes/idl/Typesv1.cxx | 8202 +++++++++++++++++ test/xtypes/idl/Typesv1.h | 6495 +++++++++++++ .../scripts/update_generated_code_from_idl.sh | 15 +- 462 files changed, 120708 insertions(+), 9644 deletions(-) create mode 100644 examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/Configurability/samplev1.cxx create mode 100644 examples/cpp/dds/Configurability/samplev1.h create mode 100644 examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/CustomListenerExample/Topicv1.cxx create mode 100644 examples/cpp/dds/CustomListenerExample/Topicv1.h create mode 100644 examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx create mode 100644 examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h create mode 100644 examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx create mode 100644 examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h create mode 100644 examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx create mode 100644 examples/cpp/dds/DisablePositiveACKs/Topicv1.h create mode 100644 examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h create mode 100644 examples/cpp/dds/Filtering/FilteringExamplev1.cxx create mode 100644 examples/cpp/dds/Filtering/FilteringExamplev1.h create mode 100644 examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx create mode 100644 examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h create mode 100644 examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/HelloWorldExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h create mode 100644 examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h create mode 100644 examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h create mode 100644 examples/cpp/dds/HistoryKind/samplev1.cxx create mode 100644 examples/cpp/dds/HistoryKind/samplev1.h create mode 100644 examples/cpp/dds/Keys/samplev1.cxx create mode 100644 examples/cpp/dds/Keys/samplev1.h create mode 100644 examples/cpp/dds/LateJoiners/samplev1.cxx create mode 100644 examples/cpp/dds/LateJoiners/samplev1.h create mode 100644 examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx create mode 100644 examples/cpp/dds/LifespanQoSExample/Lifespanv1.h create mode 100644 examples/cpp/dds/LivelinessQoS/Topicv1.cxx create mode 100644 examples/cpp/dds/LivelinessQoS/Topicv1.h create mode 100644 examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx create mode 100644 examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h create mode 100644 examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx create mode 100644 examples/cpp/dds/RequestReplyExample/Calculatorv1.h create mode 100644 examples/cpp/dds/SampleConfig_Controller/samplev1.cxx create mode 100644 examples/cpp/dds/SampleConfig_Controller/samplev1.h create mode 100644 examples/cpp/dds/SampleConfig_Events/samplev1.cxx create mode 100644 examples/cpp/dds/SampleConfig_Events/samplev1.h create mode 100644 examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx create mode 100644 examples/cpp/dds/SampleConfig_Multimedia/samplev1.h create mode 100644 examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx create mode 100644 examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h create mode 100644 examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx create mode 100644 examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h create mode 100644 examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx create mode 100644 examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h create mode 100644 src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp create mode 100644 src/cpp/statistics/types/typesv1.cxx create mode 100644 src/cpp/statistics/types/typesv1.h create mode 100644 test/blackbox/types/Data1mbv1.cxx create mode 100644 test/blackbox/types/Data1mbv1.h create mode 100644 test/blackbox/types/Data64kbv1.cxx create mode 100644 test/blackbox/types/Data64kbv1.h create mode 100644 test/blackbox/types/FixedSizedv1.cxx create mode 100644 test/blackbox/types/FixedSizedv1.h create mode 100644 test/blackbox/types/HelloWorldv1.cxx create mode 100644 test/blackbox/types/HelloWorldv1.h create mode 100644 test/blackbox/types/KeyedData1mbv1.cxx create mode 100644 test/blackbox/types/KeyedData1mbv1.h create mode 100644 test/blackbox/types/KeyedHelloWorldv1.cxx create mode 100644 test/blackbox/types/KeyedHelloWorldv1.h create mode 100644 test/blackbox/types/StringTestv1.cxx create mode 100644 test/blackbox/types/StringTestv1.h create mode 100644 test/blackbox/types/TestIncludeRegression3361v1.cxx create mode 100644 test/blackbox/types/TestIncludeRegression3361v1.h create mode 100644 test/blackbox/types/TestRegression3361v1.cxx create mode 100644 test/blackbox/types/TestRegression3361v1.h create mode 100644 test/blackbox/types/statistics/typesv1.cxx create mode 100644 test/blackbox/types/statistics/typesv1.h create mode 100644 test/profiling/allocations/AllocTestTypev1.cxx create mode 100644 test/profiling/allocations/AllocTestTypev1.h create mode 100644 test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx create mode 100644 test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h create mode 100644 test/unittest/dynamic_types/idl/Basicv1.cxx create mode 100644 test/unittest/dynamic_types/idl/Basicv1.h create mode 100644 test/unittest/dynamic_types/idl/Testv1.cxx create mode 100644 test/unittest/dynamic_types/idl/Testv1.h create mode 100644 test/unittest/dynamic_types/idl/new_features_4_2v1.cxx create mode 100644 test/unittest/dynamic_types/idl/new_features_4_2v1.h create mode 100644 test/unittest/xtypes/idl/Typesv1.cxx create mode 100644 test/unittest/xtypes/idl/Typesv1.h create mode 100644 test/unittest/xtypes/idl/WideEnumv1.cxx create mode 100644 test/unittest/xtypes/idl/WideEnumv1.h create mode 100644 test/xtypes/idl/Typesv1.cxx create mode 100644 test/xtypes/idl/Typesv1.h diff --git a/CMakeLists.txt b/CMakeLists.txt index cd6123bde7a..46f5cc9cce0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,7 @@ if(NOT BUILD_SHARED_LIBS) set(FASTDDS_STATIC ON) endif() -eprosima_find_package(fastcdr 2.0 REQUIRED) +eprosima_find_package(fastcdr REQUIRED) eprosima_find_thirdparty(Asio asio VERSION 1.10.8) eprosima_find_thirdparty(TinyXML2 tinyxml2) diff --git a/cmake/packaging/Config.cmake.in b/cmake/packaging/Config.cmake.in index ffca4d06970..01693a9a802 100644 --- a/cmake/packaging/Config.cmake.in +++ b/cmake/packaging/Config.cmake.in @@ -22,7 +22,7 @@ endif() set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@") -find_package(fastcdr 2 REQUIRED) +find_package(fastcdr REQUIRED) find_package(foonathan_memory REQUIRED) find_package(TinyXML2 QUIET) @FASTRTPS_INSTALLER_DEPS_ANCILLARY@ diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx index 4b6dbb914d9..0d9236d0cee 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::array& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h index b92a48b0083..aaf09e4bc57 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.hpp index 5074f2bd347..5c8468e7cb1 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.h index f382d2212e5..ddbfbab5db6 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.cxx b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..3b9a562b692 --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 28ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // char m_message + memset(&m_message, 0, ((20)) * 1); + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message; + + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::array& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::array&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::array& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::array& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.h b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.h new file mode 100644 index 00000000000..4d6e4158cbc --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::array m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx index 4b6dbb914d9..0d9236d0cee 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::array& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h index b92a48b0083..aaf09e4bc57 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp index 5074f2bd347..5c8468e7cb1 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h index f382d2212e5..ddbfbab5db6 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..3b9a562b692 --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 28ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // char m_message + memset(&m_message, 0, ((20)) * 1); + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message; + + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::array& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::array&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::array& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::array& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h new file mode 100644 index 00000000000..4d6e4158cbc --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::array m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Configurability/sample.cxx b/examples/cpp/dds/Configurability/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/Configurability/sample.cxx +++ b/examples/cpp/dds/Configurability/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sample.h b/examples/cpp/dds/Configurability/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/Configurability/sample.h +++ b/examples/cpp/dds/Configurability/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.hpp b/examples/cpp/dds/Configurability/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.hpp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.ipp b/examples/cpp/dds/Configurability/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.ipp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.h b/examples/cpp/dds/Configurability/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.h +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/Configurability/samplev1.cxx b/examples/cpp/dds/Configurability/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/Configurability/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Configurability/samplev1.h b/examples/cpp/dds/Configurability/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/Configurability/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt index 56f926b2fc0..b556d135900 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt +++ b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt @@ -32,6 +32,7 @@ set(CFT_COMMON_SOURCES ContentFilteredTopicExamplePublisher.cpp ContentFilteredTopicExampleSubscriber.cpp HelloWorld.cxx + HelloWorldv1.cxx HelloWorldPubSubTypes.cxx HelloWorldTypeObject.cxx ) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx index 528b9b08b61..502f3953b05 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "HelloWorldTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - // Just to register all known types registerHelloWorldTypes(); } @@ -69,7 +73,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -79,7 +82,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -166,3 +168,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx index d321cdbf1dd..69e829c28d7 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -54,6 +52,8 @@ void registerHelloWorldTypes() }); } + + const TypeIdentifier* GetHelloWorldIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); @@ -142,7 +142,6 @@ const TypeObject* GetMinimalHelloWorldObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -158,7 +157,11 @@ const TypeObject* GetMinimalHelloWorldObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -226,7 +229,6 @@ const TypeObject* GetCompleteHelloWorldObject() // Header type_object->complete().struct_type().header().detail().type_name("HelloWorld"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -242,7 +244,11 @@ const TypeObject* GetCompleteHelloWorldObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h index c28779dbebb..76b2a621eb7 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h @@ -54,6 +54,8 @@ using namespace eprosima::fastrtps::types; eProsima_user_DllExport void registerHelloWorldTypes(); + + eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..bb049241e49 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx @@ -0,0 +1,290 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "HelloWorldTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + + // Just to register all known types + registerHelloWorldTypes(); +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topic.cxx b/examples/cpp/dds/CustomListenerExample/Topic.cxx index f67aac66721..ca86d176ba1 100644 --- a/examples/cpp/dds/CustomListenerExample/Topic.cxx +++ b/examples/cpp/dds/CustomListenerExample/Topic.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Topic.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + Topic::Topic() { - } Topic::~Topic() @@ -65,7 +69,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& Topic::message() // Include auxiliary functions like for serializing/deserializing. #include "TopicCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topic.h b/examples/cpp/dds/CustomListenerExample/Topic.h index 626d82f1f00..2596f317a1e 100644 --- a/examples/cpp/dds/CustomListenerExample/Topic.h +++ b/examples/cpp/dds/CustomListenerExample/Topic.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Topicv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TOPIC_H_ #define _FAST_DDS_GENERATED_TOPIC_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -182,3 +190,6 @@ class Topic #endif // _FAST_DDS_GENERATED_TOPIC_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp index ddeb29f1f34..619cdbbb7b8 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ + diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp index ae393c9ae1b..ac5a8c39ef9 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ + diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx index 16d50e821f6..ce688064a0e 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + TopicPubSubType::TopicPubSubType() { setName("Topic"); - uint32_t type_size = Topic_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Topic::getMaxCdrSerializedSize()); +#else + Topic_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool TopicPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool TopicPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool TopicPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function TopicPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool TopicPubSubType::getKey( Topic_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Topic_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h index f3dff789a8e..b9100bacbe9 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.cxx b/examples/cpp/dds/CustomListenerExample/Topicv1.cxx new file mode 100644 index 00000000000..a3e85584242 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/Topicv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Topic.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Topic_max_cdr_typesize 268ULL; + + + + +Topic::Topic() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +Topic::~Topic() +{ +} + +Topic::Topic( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +Topic::Topic( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +Topic& Topic::operator =( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +Topic& Topic::operator =( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool Topic::operator ==( + const Topic& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool Topic::operator !=( + const Topic& x) const +{ + return !(*this == x); +} + +size_t Topic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Topic_max_cdr_typesize; +} + +size_t Topic::getCdrSerializedSize( + const Topic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Topic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void Topic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool Topic::isKeyDefined() +{ + return false; +} + +void Topic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void Topic::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t Topic::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& Topic::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void Topic::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void Topic::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& Topic::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& Topic::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.h b/examples/cpp/dds/CustomListenerExample/Topicv1.h new file mode 100644 index 00000000000..9a6dfa97b4d --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/Topicv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TOPIC_H_ +#define _FAST_DDS_GENERATED_TOPIC_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Topic& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_TOPIC_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx index b6ae6afe3c4..7f304177d38 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "CustomPayloadPoolData.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + CustomPayloadPoolData::CustomPayloadPoolData() { - } CustomPayloadPoolData::~CustomPayloadPoolData() @@ -65,7 +69,6 @@ CustomPayloadPoolData& CustomPayloadPoolData::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ CustomPayloadPoolData& CustomPayloadPoolData::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& CustomPayloadPoolData::message() // Include auxiliary functions like for serializing/deserializing. #include "CustomPayloadPoolDataCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h index 95ed42fe447..46b1c16c138 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "CustomPayloadPoolDatav1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ #define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. * @ingroup CustomPayloadPoolData @@ -182,3 +190,6 @@ class CustomPayloadPoolData #endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp index b25f49dbaf7..3d50c83da22 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const CustomPayloadPoolData& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ + diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp index 04dd887bd59..0fb2b162fb2 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_IPP_ + diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx index 14861477dab..ffd0e7faa97 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "CustomPayloadPoolDataPubSubTypes.h" #include "CustomPayloadPoolDataCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + CustomPayloadPoolDataPubSubType::CustomPayloadPoolDataPubSubType() { setName("CustomPayloadPoolData"); - uint32_t type_size = CustomPayloadPoolData_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CustomPayloadPoolData::getMaxCdrSerializedSize()); +#else + CustomPayloadPoolData_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool CustomPayloadPoolDataPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool CustomPayloadPoolDataPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool CustomPayloadPoolDataPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function CustomPayloadPoolDataPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool CustomPayloadPoolDataPubSubType::getKey( CustomPayloadPoolData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || CustomPayloadPoolData_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h index 770cfba4c62..a8ae92cfc06 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type CustomPayloadPoolData defined by the user in the IDL file. * @ingroup CustomPayloadPoolData @@ -103,7 +105,7 @@ class CustomPayloadPoolDataPubSubType : public eprosima::fastdds::dds::TopicData } eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override { static_cast(data_representation); return false; diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx new file mode 100644 index 00000000000..51f45ea225f --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file CustomPayloadPoolData.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "CustomPayloadPoolData.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define CustomPayloadPoolData_max_cdr_typesize 268ULL; + + + + +CustomPayloadPoolData::CustomPayloadPoolData() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +CustomPayloadPoolData::~CustomPayloadPoolData() +{ +} + +CustomPayloadPoolData::CustomPayloadPoolData( + const CustomPayloadPoolData& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +CustomPayloadPoolData::CustomPayloadPoolData( + CustomPayloadPoolData&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +CustomPayloadPoolData& CustomPayloadPoolData::operator =( + const CustomPayloadPoolData& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +CustomPayloadPoolData& CustomPayloadPoolData::operator =( + CustomPayloadPoolData&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool CustomPayloadPoolData::operator ==( + const CustomPayloadPoolData& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool CustomPayloadPoolData::operator !=( + const CustomPayloadPoolData& x) const +{ + return !(*this == x); +} + +size_t CustomPayloadPoolData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return CustomPayloadPoolData_max_cdr_typesize; +} + +size_t CustomPayloadPoolData::getCdrSerializedSize( + const CustomPayloadPoolData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void CustomPayloadPoolData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void CustomPayloadPoolData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool CustomPayloadPoolData::isKeyDefined() +{ + return false; +} + +void CustomPayloadPoolData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void CustomPayloadPoolData::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t CustomPayloadPoolData::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& CustomPayloadPoolData::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void CustomPayloadPoolData::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void CustomPayloadPoolData::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& CustomPayloadPoolData::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& CustomPayloadPoolData::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h new file mode 100644 index 00000000000..ac30ce9a3b4 --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file CustomPayloadPoolData.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ +#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CUSTOMPAYLOADPOOLDATA_SOURCE) +#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllexport ) +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllimport ) +#endif // CUSTOMPAYLOADPOOLDATA_SOURCE +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CUSTOMPAYLOADPOOLDATA_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. + * @ingroup CustomPayloadPoolData + */ +class CustomPayloadPoolData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CustomPayloadPoolData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CustomPayloadPoolData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData( + const CustomPayloadPoolData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData( + CustomPayloadPoolData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData& operator =( + const CustomPayloadPoolData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object CustomPayloadPoolData that will be copied. + */ + eProsima_user_DllExport CustomPayloadPoolData& operator =( + CustomPayloadPoolData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x CustomPayloadPoolData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CustomPayloadPoolData& x) const; + + /*! + * @brief Comparison operator. + * @param x CustomPayloadPoolData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CustomPayloadPoolData& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const CustomPayloadPoolData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx index fe759abedf5..ded92f4bcdc 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "deadlinepayload.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloMsg::HelloMsg() { - } HelloMsg::~HelloMsg() @@ -65,7 +69,6 @@ HelloMsg& HelloMsg::operator =( m_deadlinekey = x.m_deadlinekey; m_payload = x.m_payload; - return *this; } @@ -75,7 +78,6 @@ HelloMsg& HelloMsg::operator =( m_deadlinekey = x.m_deadlinekey; m_payload = std::move(x.m_payload); - return *this; } @@ -162,3 +164,5 @@ eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() // Include auxiliary functions like for serializing/deserializing. #include "deadlinepayloadCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h index e884f8c1d3f..4dd530394b2 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "deadlinepayloadv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ #define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloMsg defined by the user in the IDL file. * @ingroup deadlinepayload @@ -182,3 +190,6 @@ class HelloMsg #endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp index c87d7e77b14..cf5ad3e0bdc 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloMsg& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ + diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp index 422eed60c3c..a16c0446aab 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.deadlinekey() << eprosima::fastcdr::MemberId(1) << data.payload() ; - scdr.end_serialize_type(current_state); } @@ -126,4 +127,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_IPP_ + diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx index 674028033fe..300ac806538 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "deadlinepayloadPubSubTypes.h" #include "deadlinepayloadCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloMsgPubSubType::HelloMsgPubSubType() { setName("HelloMsg"); - uint32_t type_size = HelloMsg_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloMsg::getMaxCdrSerializedSize()); +#else + HelloMsg_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool HelloMsgPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloMsgPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloMsgPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloMsgPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloMsgPubSubType::getKey( HelloMsg_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloMsg_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h index 6d69873f88d..bc9fceae08e 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloMsg defined by the user in the IDL file. * @ingroup deadlinepayload diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx new file mode 100644 index 00000000000..6e8e3e66443 --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx @@ -0,0 +1,294 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file deadlinepayload.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "deadlinepayload.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloMsg_max_cdr_typesize 269ULL; + + + + +HelloMsg::HelloMsg() +{ + // unsigned short m_deadlinekey + m_deadlinekey = 0; + // /type_d() m_payload + + +} + +HelloMsg::~HelloMsg() +{ +} + +HelloMsg::HelloMsg( + const HelloMsg& x) +{ + m_deadlinekey = x.m_deadlinekey; + + + m_payload = x.m_payload; + +} + +HelloMsg::HelloMsg( + HelloMsg&& x) noexcept +{ + m_deadlinekey = x.m_deadlinekey; + + + m_payload = std::move(x.m_payload); + +} + +HelloMsg& HelloMsg::operator =( + const HelloMsg& x) +{ + m_deadlinekey = x.m_deadlinekey; + + + m_payload = x.m_payload; + + return *this; +} + +HelloMsg& HelloMsg::operator =( + HelloMsg&& x) noexcept +{ + m_deadlinekey = x.m_deadlinekey; + + + m_payload = std::move(x.m_payload); + + return *this; +} + +bool HelloMsg::operator ==( + const HelloMsg& x) const +{ + return (m_deadlinekey == x.m_deadlinekey && + m_payload == x.m_payload); +} + +bool HelloMsg::operator !=( + const HelloMsg& x) const +{ + return !(*this == x); +} + +size_t HelloMsg::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloMsg_max_cdr_typesize; +} + +size_t HelloMsg::getCdrSerializedSize( + const HelloMsg& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.payload().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloMsg::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_deadlinekey; + + scdr << m_payload.c_str(); + +} + +void HelloMsg::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_deadlinekey; + + + + { + std::string aux; + dcdr >> aux; + m_payload = aux.c_str(); + } + + +} + + +bool HelloMsg::isKeyDefined() +{ + return true; +} + +void HelloMsg::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + scdr << m_deadlinekey; + + +} + +/*! + * @brief This function sets a value in member deadlinekey + * @param _deadlinekey New value for member deadlinekey + */ +void HelloMsg::deadlinekey( + uint16_t _deadlinekey) +{ + m_deadlinekey = _deadlinekey; +} + +/*! + * @brief This function returns the value of member deadlinekey + * @return Value of member deadlinekey + */ +uint16_t HelloMsg::deadlinekey() const +{ + return m_deadlinekey; +} + +/*! + * @brief This function returns a reference to member deadlinekey + * @return Reference to member deadlinekey + */ +uint16_t& HelloMsg::deadlinekey() +{ + return m_deadlinekey; +} + + +/*! + * @brief This function copies the value in member payload + * @param _payload New value to be copied in member payload + */ +void HelloMsg::payload( + const eprosima::fastrtps::fixed_string<256>& _payload) +{ + m_payload = _payload; +} + +/*! + * @brief This function moves the value in member payload + * @param _payload New value to be moved in member payload + */ +void HelloMsg::payload( + eprosima::fastrtps::fixed_string<256>&& _payload) +{ + m_payload = std::move(_payload); +} + +/*! + * @brief This function returns a constant reference to member payload + * @return Constant reference to member payload + */ +const eprosima::fastrtps::fixed_string<256>& HelloMsg::payload() const +{ + return m_payload; +} + +/*! + * @brief This function returns a reference to member payload + * @return Reference to member payload + */ +eprosima::fastrtps::fixed_string<256>& HelloMsg::payload() +{ + return m_payload; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h new file mode 100644 index 00000000000..143be9e6dca --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file deadlinepayload.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ +#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DEADLINEPAYLOAD_SOURCE) +#define DEADLINEPAYLOAD_DllAPI __declspec( dllexport ) +#else +#define DEADLINEPAYLOAD_DllAPI __declspec( dllimport ) +#endif // DEADLINEPAYLOAD_SOURCE +#else +#define DEADLINEPAYLOAD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DEADLINEPAYLOAD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloMsg defined by the user in the IDL file. + * @ingroup deadlinepayload + */ +class HelloMsg +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloMsg(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloMsg(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg( + const HelloMsg& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg( + HelloMsg&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg& operator =( + const HelloMsg& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloMsg that will be copied. + */ + eProsima_user_DllExport HelloMsg& operator =( + HelloMsg&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloMsg object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloMsg& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloMsg object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloMsg& x) const; + + /*! + * @brief This function sets a value in member deadlinekey + * @param _deadlinekey New value for member deadlinekey + */ + eProsima_user_DllExport void deadlinekey( + uint16_t _deadlinekey); + + /*! + * @brief This function returns the value of member deadlinekey + * @return Value of member deadlinekey + */ + eProsima_user_DllExport uint16_t deadlinekey() const; + + /*! + * @brief This function returns a reference to member deadlinekey + * @return Reference to member deadlinekey + */ + eProsima_user_DllExport uint16_t& deadlinekey(); + + + /*! + * @brief This function copies the value in member payload + * @param _payload New value to be copied in member payload + */ + eProsima_user_DllExport void payload( + const eprosima::fastrtps::fixed_string<256>& _payload); + + /*! + * @brief This function moves the value in member payload + * @param _payload New value to be moved in member payload + */ + eProsima_user_DllExport void payload( + eprosima::fastrtps::fixed_string<256>&& _payload); + + /*! + * @brief This function returns a constant reference to member payload + * @return Constant reference to member payload + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<256>& payload() const; + + /*! + * @brief This function returns a reference to member payload + * @return Reference to member payload + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<256>& payload(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloMsg& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_deadlinekey; + eprosima::fastrtps::fixed_string<256> m_payload; + +}; + + +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx index f67aac66721..ca86d176ba1 100644 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Topic.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + Topic::Topic() { - } Topic::~Topic() @@ -65,7 +69,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& Topic::message() // Include auxiliary functions like for serializing/deserializing. #include "TopicCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.h b/examples/cpp/dds/DisablePositiveACKs/Topic.h index 626d82f1f00..2596f317a1e 100644 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.h +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Topicv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TOPIC_H_ #define _FAST_DDS_GENERATED_TOPIC_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -182,3 +190,6 @@ class Topic #endif // _FAST_DDS_GENERATED_TOPIC_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp index ddeb29f1f34..619cdbbb7b8 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ + diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp index ae393c9ae1b..ac5a8c39ef9 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ + diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx index 16d50e821f6..ce688064a0e 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + TopicPubSubType::TopicPubSubType() { setName("Topic"); - uint32_t type_size = Topic_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Topic::getMaxCdrSerializedSize()); +#else + Topic_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool TopicPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool TopicPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool TopicPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function TopicPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool TopicPubSubType::getKey( Topic_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Topic_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h index f3dff789a8e..b9100bacbe9 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx b/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx new file mode 100644 index 00000000000..a3e85584242 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Topic.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Topic_max_cdr_typesize 268ULL; + + + + +Topic::Topic() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +Topic::~Topic() +{ +} + +Topic::Topic( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +Topic::Topic( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +Topic& Topic::operator =( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +Topic& Topic::operator =( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool Topic::operator ==( + const Topic& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool Topic::operator !=( + const Topic& x) const +{ + return !(*this == x); +} + +size_t Topic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Topic_max_cdr_typesize; +} + +size_t Topic::getCdrSerializedSize( + const Topic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Topic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void Topic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool Topic::isKeyDefined() +{ + return false; +} + +void Topic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void Topic::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t Topic::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& Topic::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void Topic::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void Topic::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& Topic::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& Topic::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.h b/examples/cpp/dds/DisablePositiveACKs/Topicv1.h new file mode 100644 index 00000000000..9a6dfa97b4d --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/Topicv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TOPIC_H_ +#define _FAST_DDS_GENERATED_TOPIC_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Topic& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_TOPIC_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx index bcda56fb45a..4b415d67769 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx new file mode 100644 index 00000000000..90e82ea88a7 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Filtering/FilteringExample.cxx b/examples/cpp/dds/Filtering/FilteringExample.cxx index 9082cdc76fd..3f489150d46 100644 --- a/examples/cpp/dds/Filtering/FilteringExample.cxx +++ b/examples/cpp/dds/Filtering/FilteringExample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "FilteringExample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + FilteringExample::FilteringExample() { - } FilteringExample::~FilteringExample() @@ -62,7 +66,6 @@ FilteringExample& FilteringExample::operator =( { m_sampleNumber = x.m_sampleNumber; - return *this; } @@ -71,7 +74,6 @@ FilteringExample& FilteringExample::operator =( { m_sampleNumber = x.m_sampleNumber; - return *this; } @@ -118,3 +120,5 @@ int32_t& FilteringExample::sampleNumber() // Include auxiliary functions like for serializing/deserializing. #include "FilteringExampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExample.h b/examples/cpp/dds/Filtering/FilteringExample.h index 4958b49d2d3..c57439eb75c 100644 --- a/examples/cpp/dds/Filtering/FilteringExample.h +++ b/examples/cpp/dds/Filtering/FilteringExample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "FilteringExamplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ #define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure FilteringExample defined by the user in the IDL file. * @ingroup FilteringExample @@ -154,3 +162,6 @@ class FilteringExample #endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp index 520f94c7b47..54b78a2c93a 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FilteringExample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp index 7aa0f984fa6..d2fdb2c7032 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.sampleNumber() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +116,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx index e2dc809b151..be0bd937a6b 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "FilteringExamplePubSubTypes.h" #include "FilteringExampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + FilteringExamplePubSubType::FilteringExamplePubSubType() { setName("FilteringExample"); - uint32_t type_size = FilteringExample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(FilteringExample::getMaxCdrSerializedSize()); +#else + FilteringExample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool FilteringExamplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool FilteringExamplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool FilteringExamplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function FilteringExamplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool FilteringExamplePubSubType::getKey( FilteringExample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || FilteringExample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h index 6c7f65d7d7b..7f167f7b498 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type FilteringExample defined by the user in the IDL file. * @ingroup FilteringExample diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.cxx b/examples/cpp/dds/Filtering/FilteringExamplev1.cxx new file mode 100644 index 00000000000..22b80052278 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExamplev1.cxx @@ -0,0 +1,223 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FilteringExample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "FilteringExample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define FilteringExample_max_cdr_typesize 8ULL; + + + + +FilteringExample::FilteringExample() +{ + // long m_sampleNumber + m_sampleNumber = 0; + +} + +FilteringExample::~FilteringExample() +{ +} + +FilteringExample::FilteringExample( + const FilteringExample& x) +{ + m_sampleNumber = x.m_sampleNumber; + +} + +FilteringExample::FilteringExample( + FilteringExample&& x) noexcept +{ + m_sampleNumber = x.m_sampleNumber; + +} + +FilteringExample& FilteringExample::operator =( + const FilteringExample& x) +{ + m_sampleNumber = x.m_sampleNumber; + + return *this; +} + +FilteringExample& FilteringExample::operator =( + FilteringExample&& x) noexcept +{ + m_sampleNumber = x.m_sampleNumber; + + return *this; +} + +bool FilteringExample::operator ==( + const FilteringExample& x) const +{ + return (m_sampleNumber == x.m_sampleNumber); +} + +bool FilteringExample::operator !=( + const FilteringExample& x) const +{ + return !(*this == x); +} + +size_t FilteringExample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return FilteringExample_max_cdr_typesize; +} + +size_t FilteringExample::getCdrSerializedSize( + const FilteringExample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void FilteringExample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sampleNumber; + +} + +void FilteringExample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sampleNumber; + + +} + + +bool FilteringExample::isKeyDefined() +{ + return false; +} + +void FilteringExample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member sampleNumber + * @param _sampleNumber New value for member sampleNumber + */ +void FilteringExample::sampleNumber( + int32_t _sampleNumber) +{ + m_sampleNumber = _sampleNumber; +} + +/*! + * @brief This function returns the value of member sampleNumber + * @return Value of member sampleNumber + */ +int32_t FilteringExample::sampleNumber() const +{ + return m_sampleNumber; +} + +/*! + * @brief This function returns a reference to member sampleNumber + * @return Reference to member sampleNumber + */ +int32_t& FilteringExample::sampleNumber() +{ + return m_sampleNumber; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.h b/examples/cpp/dds/Filtering/FilteringExamplev1.h new file mode 100644 index 00000000000..5d82d5d1853 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExamplev1.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FilteringExample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ +#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FILTERINGEXAMPLE_SOURCE) +#define FILTERINGEXAMPLE_DllAPI __declspec( dllexport ) +#else +#define FILTERINGEXAMPLE_DllAPI __declspec( dllimport ) +#endif // FILTERINGEXAMPLE_SOURCE +#else +#define FILTERINGEXAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FILTERINGEXAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure FilteringExample defined by the user in the IDL file. + * @ingroup FilteringExample + */ +class FilteringExample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FilteringExample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FilteringExample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample( + const FilteringExample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample( + FilteringExample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample& operator =( + const FilteringExample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object FilteringExample that will be copied. + */ + eProsima_user_DllExport FilteringExample& operator =( + FilteringExample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x FilteringExample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FilteringExample& x) const; + + /*! + * @brief Comparison operator. + * @param x FilteringExample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FilteringExample& x) const; + + /*! + * @brief This function sets a value in member sampleNumber + * @param _sampleNumber New value for member sampleNumber + */ + eProsima_user_DllExport void sampleNumber( + int32_t _sampleNumber); + + /*! + * @brief This function returns the value of member sampleNumber + * @return Value of member sampleNumber + */ + eProsima_user_DllExport int32_t sampleNumber() const; + + /*! + * @brief This function returns a reference to member sampleNumber + * @return Reference to member sampleNumber + */ + eProsima_user_DllExport int32_t& sampleNumber(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const FilteringExample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int32_t m_sampleNumber; + +}; + + +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx index 69020f5e69b..c38d02771de 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "FlowControlExample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + FlowControlExample::FlowControlExample() { - } FlowControlExample::~FlowControlExample() @@ -65,7 +69,6 @@ FlowControlExample& FlowControlExample::operator =( m_message = x.m_message; m_wasFast = x.m_wasFast; - return *this; } @@ -75,7 +78,6 @@ FlowControlExample& FlowControlExample::operator =( m_message = std::move(x.m_message); m_wasFast = x.m_wasFast; - return *this; } @@ -162,3 +164,5 @@ char& FlowControlExample::wasFast() // Include auxiliary functions like for serializing/deserializing. #include "FlowControlExampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.h b/examples/cpp/dds/FlowControlExample/FlowControlExample.h index 0ed53f6f944..f73d6e41c08 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "FlowControlExamplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ #define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. * @ingroup FlowControlExample @@ -182,3 +190,6 @@ class FlowControlExample #endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp index 6b8709f13b4..4ef8e609e19 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FlowControlExample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp index da745000ceb..361c67ee3cf 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.message() << eprosima::fastcdr::MemberId(1) << data.wasFast() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx index 5aa33dc0daf..1d375cfbfe3 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "FlowControlExamplePubSubTypes.h" #include "FlowControlExampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + FlowControlExamplePubSubType::FlowControlExamplePubSubType() { setName("FlowControlExample"); - uint32_t type_size = FlowControlExample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(FlowControlExample::getMaxCdrSerializedSize()); +#else + FlowControlExample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool FlowControlExamplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool FlowControlExamplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool FlowControlExamplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function FlowControlExamplePubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool FlowControlExamplePubSubType::getKey( FlowControlExample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || FlowControlExample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h index bcca9e58bf0..f47b513e629 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type FlowControlExample defined by the user in the IDL file. * @ingroup FlowControlExample diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx new file mode 100644 index 00000000000..8da82aa6d10 --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FlowControlExample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "FlowControlExample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define FlowControlExample_max_cdr_typesize 600005ULL; + + + + +FlowControlExample::FlowControlExample() +{ + // char m_message + memset(&m_message, 0, ((600000)) * 1); + // char m_wasFast + m_wasFast = 0; + +} + +FlowControlExample::~FlowControlExample() +{ +} + +FlowControlExample::FlowControlExample( + const FlowControlExample& x) +{ + m_message = x.m_message; + + + m_wasFast = x.m_wasFast; + +} + +FlowControlExample::FlowControlExample( + FlowControlExample&& x) noexcept +{ + m_message = std::move(x.m_message); + + + m_wasFast = x.m_wasFast; + +} + +FlowControlExample& FlowControlExample::operator =( + const FlowControlExample& x) +{ + m_message = x.m_message; + + + m_wasFast = x.m_wasFast; + + return *this; +} + +FlowControlExample& FlowControlExample::operator =( + FlowControlExample&& x) noexcept +{ + m_message = std::move(x.m_message); + + + m_wasFast = x.m_wasFast; + + return *this; +} + +bool FlowControlExample::operator ==( + const FlowControlExample& x) const +{ + return (m_message == x.m_message && + m_wasFast == x.m_wasFast); +} + +bool FlowControlExample::operator !=( + const FlowControlExample& x) const +{ + return !(*this == x); +} + +size_t FlowControlExample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return FlowControlExample_max_cdr_typesize; +} + +size_t FlowControlExample::getCdrSerializedSize( + const FlowControlExample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((600000)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void FlowControlExample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_message; + + + scdr << m_wasFast; + +} + +void FlowControlExample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_message; + + + + dcdr >> m_wasFast; + + +} + + +bool FlowControlExample::isKeyDefined() +{ + return false; +} + +void FlowControlExample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void FlowControlExample::message( + const std::array& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void FlowControlExample::message( + std::array&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::array& FlowControlExample::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::array& FlowControlExample::message() +{ + return m_message; +} + + +/*! + * @brief This function sets a value in member wasFast + * @param _wasFast New value for member wasFast + */ +void FlowControlExample::wasFast( + char _wasFast) +{ + m_wasFast = _wasFast; +} + +/*! + * @brief This function returns the value of member wasFast + * @return Value of member wasFast + */ +char FlowControlExample::wasFast() const +{ + return m_wasFast; +} + +/*! + * @brief This function returns a reference to member wasFast + * @return Reference to member wasFast + */ +char& FlowControlExample::wasFast() +{ + return m_wasFast; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h new file mode 100644 index 00000000000..f945a894288 --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FlowControlExample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ +#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FLOWCONTROLEXAMPLE_SOURCE) +#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllexport ) +#else +#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllimport ) +#endif // FLOWCONTROLEXAMPLE_SOURCE +#else +#define FLOWCONTROLEXAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FLOWCONTROLEXAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. + * @ingroup FlowControlExample + */ +class FlowControlExample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FlowControlExample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FlowControlExample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample( + const FlowControlExample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample( + FlowControlExample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample& operator =( + const FlowControlExample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object FlowControlExample that will be copied. + */ + eProsima_user_DllExport FlowControlExample& operator =( + FlowControlExample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x FlowControlExample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FlowControlExample& x) const; + + /*! + * @brief Comparison operator. + * @param x FlowControlExample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FlowControlExample& x) const; + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message(); + + + /*! + * @brief This function sets a value in member wasFast + * @param _wasFast New value for member wasFast + */ + eProsima_user_DllExport void wasFast( + char _wasFast); + + /*! + * @brief This function returns the value of member wasFast + * @return Value of member wasFast + */ + eProsima_user_DllExport char wasFast() const; + + /*! + * @brief This function returns a reference to member wasFast + * @return Reference to member wasFast + */ + eProsima_user_DllExport char& wasFast(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const FlowControlExample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_message; + char m_wasFast; + +}; + + +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx index bcda56fb45a..4b415d67769 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.h b/examples/cpp/dds/HelloWorldExample/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..90e82ea88a7 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx index 6f85242dc7d..3622c2401de 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ eprosima::fastcdr::fixed_string<20>& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h index a09bb581bc8..3488835aafe 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -177,7 +185,11 @@ class HelloWorld uint32_t m_index{0}; eprosima::fastcdr::fixed_string<20> m_message; + }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp index 4334027c0af..b0d081fe956 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -43,3 +45,4 @@ eProsima_user_DllExport void serialize_key( } // namespace eprosima #endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h index f382d2212e5..ddbfbab5db6 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx new file mode 100644 index 00000000000..27e02c6c6d3 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx @@ -0,0 +1,290 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 33ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + { + std::string aux; + dcdr >> aux; + m_message = aux.c_str(); + } + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const eprosima::fastrtps::fixed_string<20>& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + eprosima::fastrtps::fixed_string<20>&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const eprosima::fastrtps::fixed_string<20>& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +eprosima::fastrtps::fixed_string<20>& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h new file mode 100644 index 00000000000..ed5646c8cfa --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastrtps::fixed_string<20>& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastrtps::fixed_string<20>&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<20>& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<20>& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + eprosima::fastrtps::fixed_string<20> m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx index a9d0db2f7a9..68c604b6588 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -68,7 +72,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; m_data = x.m_data; - return *this; } @@ -79,7 +82,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); m_data = std::move(x.m_data); - return *this; } @@ -170,7 +172,7 @@ std::string& HelloWorld::message() * @param _data New value to be copied in member data */ void HelloWorld::data( - const std::array& _data) + const std::array& _data) { m_data = _data; } @@ -180,7 +182,7 @@ void HelloWorld::data( * @param _data New value to be moved in member data */ void HelloWorld::data( - std::array&& _data) + std::array&& _data) { m_data = std::move(_data); } @@ -189,7 +191,7 @@ void HelloWorld::data( * @brief This function returns a constant reference to member data * @return Constant reference to member data */ -const std::array& HelloWorld::data() const +const std::array& HelloWorld::data() const { return m_data; } @@ -198,7 +200,7 @@ const std::array& HelloWorld::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -std::array& HelloWorld::data() +std::array& HelloWorld::data() { return m_data; } @@ -206,3 +208,5 @@ std::array& HelloWorld::data() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h index e9af9e1ca5f..deb44d359b1 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -179,34 +187,37 @@ class HelloWorld * @param _data New value to be copied in member data */ eProsima_user_DllExport void data( - const std::array& _data); + const std::array& _data); /*! * @brief This function moves the value in member data * @param _data New value to be moved in member data */ eProsima_user_DllExport void data( - std::array&& _data); + std::array&& _data); /*! * @brief This function returns a constant reference to member data * @return Constant reference to member data */ - eProsima_user_DllExport const std::array& data() const; + eProsima_user_DllExport const std::array& data() const; /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport std::array& data(); + eProsima_user_DllExport std::array& data(); private: uint32_t m_index{0}; std::string m_message; - std::array m_data; + std::array m_data; }; #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp index 0ee7a21c956..77b8e2a63aa 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp index 82b4a89899b..2243fe1af8d 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -81,7 +83,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.message() << eprosima::fastcdr::MemberId(2) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -131,4 +132,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx new file mode 100644 index 00000000000..0136d21e4c7 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx @@ -0,0 +1,351 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 1048844ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + // char m_data + memset(&m_data, 0, ((1024*1024)) * 1); + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + + m_data = x.m_data; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + + m_data = std::move(x.m_data); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + + m_data = x.m_data; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + + m_data = std::move(x.m_data); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message && + m_data == x.m_data); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + current_alignment += (((1024*1024)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + + scdr << m_data; + + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + + + dcdr >> m_data; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void HelloWorld::data( + const std::array& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void HelloWorld::data( + std::array&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::array& HelloWorld::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::array& HelloWorld::data() +{ + return m_data; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h new file mode 100644 index 00000000000..dbe1c673dc3 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h @@ -0,0 +1,271 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::array& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::array&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::array& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::array& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + std::array m_data; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx index bcda56fb45a..4b415d67769 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx new file mode 100644 index 00000000000..90e82ea88a7 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/sample.cxx b/examples/cpp/dds/HistoryKind/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/HistoryKind/sample.cxx +++ b/examples/cpp/dds/HistoryKind/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sample.h b/examples/cpp/dds/HistoryKind/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/HistoryKind/sample.h +++ b/examples/cpp/dds/HistoryKind/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/HistoryKind/samplev1.cxx b/examples/cpp/dds/HistoryKind/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/samplev1.h b/examples/cpp/dds/HistoryKind/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/HistoryKind/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/sample.cxx b/examples/cpp/dds/Keys/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/Keys/sample.cxx +++ b/examples/cpp/dds/Keys/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sample.h b/examples/cpp/dds/Keys/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/Keys/sample.h +++ b/examples/cpp/dds/Keys/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sampleCdrAux.hpp b/examples/cpp/dds/Keys/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.hpp +++ b/examples/cpp/dds/Keys/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/Keys/sampleCdrAux.ipp b/examples/cpp/dds/Keys/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.ipp +++ b/examples/cpp/dds/Keys/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.cxx b/examples/cpp/dds/Keys/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Keys/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.h b/examples/cpp/dds/Keys/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.h +++ b/examples/cpp/dds/Keys/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/Keys/samplev1.cxx b/examples/cpp/dds/Keys/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/Keys/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/samplev1.h b/examples/cpp/dds/Keys/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/Keys/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/sample.cxx b/examples/cpp/dds/LateJoiners/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/LateJoiners/sample.cxx +++ b/examples/cpp/dds/LateJoiners/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sample.h b/examples/cpp/dds/LateJoiners/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/LateJoiners/sample.h +++ b/examples/cpp/dds/LateJoiners/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/LateJoiners/samplev1.cxx b/examples/cpp/dds/LateJoiners/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/samplev1.h b/examples/cpp/dds/LateJoiners/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/LateJoiners/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx index 8043cc45e41..66c85b61161 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Lifespan.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + Lifespan::Lifespan() { - } Lifespan::~Lifespan() @@ -65,7 +69,6 @@ Lifespan& Lifespan::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ Lifespan& Lifespan::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& Lifespan::message() // Include auxiliary functions like for serializing/deserializing. #include "LifespanCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.h b/examples/cpp/dds/LifespanQoSExample/Lifespan.h index 0afdc676b81..5d6e5da9c5c 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.h +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Lifespanv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ #define _FAST_DDS_GENERATED_LIFESPAN_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure Lifespan defined by the user in the IDL file. * @ingroup Lifespan @@ -182,3 +190,6 @@ class Lifespan #endif // _FAST_DDS_GENERATED_LIFESPAN_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp index c7718699f2e..770a53f6a14 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Lifespan& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ + diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp index e7c9d4ba56c..59e8f99cfd7 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LIFESPANCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LIFESPANCDRAUX_IPP_ + diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx index 63fc0868bf1..05b7ea5970c 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "LifespanPubSubTypes.h" #include "LifespanCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + LifespanPubSubType::LifespanPubSubType() { setName("Lifespan"); - uint32_t type_size = Lifespan_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Lifespan::getMaxCdrSerializedSize()); +#else + Lifespan_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool LifespanPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool LifespanPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool LifespanPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function LifespanPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool LifespanPubSubType::getKey( Lifespan_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Lifespan_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h index bb386cc47ee..01b48528ed9 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type Lifespan defined by the user in the IDL file. * @ingroup Lifespan diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx new file mode 100644 index 00000000000..81eaa4dd19b --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Lifespan.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Lifespan.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Lifespan_max_cdr_typesize 268ULL; + + + + +Lifespan::Lifespan() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +Lifespan::~Lifespan() +{ +} + +Lifespan::Lifespan( + const Lifespan& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +Lifespan::Lifespan( + Lifespan&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +Lifespan& Lifespan::operator =( + const Lifespan& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +Lifespan& Lifespan::operator =( + Lifespan&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool Lifespan::operator ==( + const Lifespan& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool Lifespan::operator !=( + const Lifespan& x) const +{ + return !(*this == x); +} + +size_t Lifespan::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Lifespan_max_cdr_typesize; +} + +size_t Lifespan::getCdrSerializedSize( + const Lifespan& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Lifespan::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void Lifespan::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool Lifespan::isKeyDefined() +{ + return false; +} + +void Lifespan::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void Lifespan::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t Lifespan::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& Lifespan::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void Lifespan::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void Lifespan::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& Lifespan::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& Lifespan::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h new file mode 100644 index 00000000000..5c47027b0c6 --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Lifespan.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ +#define _FAST_DDS_GENERATED_LIFESPAN_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LIFESPAN_SOURCE) +#define LIFESPAN_DllAPI __declspec( dllexport ) +#else +#define LIFESPAN_DllAPI __declspec( dllimport ) +#endif // LIFESPAN_SOURCE +#else +#define LIFESPAN_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LIFESPAN_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure Lifespan defined by the user in the IDL file. + * @ingroup Lifespan + */ +class Lifespan +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Lifespan(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Lifespan(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan( + const Lifespan& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan( + Lifespan&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan& operator =( + const Lifespan& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Lifespan that will be copied. + */ + eProsima_user_DllExport Lifespan& operator =( + Lifespan&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Lifespan object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Lifespan& x) const; + + /*! + * @brief Comparison operator. + * @param x Lifespan object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Lifespan& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Lifespan& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_LIFESPAN_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topic.cxx b/examples/cpp/dds/LivelinessQoS/Topic.cxx index f67aac66721..ca86d176ba1 100644 --- a/examples/cpp/dds/LivelinessQoS/Topic.cxx +++ b/examples/cpp/dds/LivelinessQoS/Topic.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Topic.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + Topic::Topic() { - } Topic::~Topic() @@ -65,7 +69,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ Topic& Topic::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& Topic::message() // Include auxiliary functions like for serializing/deserializing. #include "TopicCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topic.h b/examples/cpp/dds/LivelinessQoS/Topic.h index 626d82f1f00..2596f317a1e 100644 --- a/examples/cpp/dds/LivelinessQoS/Topic.h +++ b/examples/cpp/dds/LivelinessQoS/Topic.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Topicv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TOPIC_H_ #define _FAST_DDS_GENERATED_TOPIC_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -182,3 +190,6 @@ class Topic #endif // _FAST_DDS_GENERATED_TOPIC_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp index ddeb29f1f34..619cdbbb7b8 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ + diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp index ae393c9ae1b..ac5a8c39ef9 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TOPICCDRAUX_IPP_ + diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx index 16d50e821f6..ce688064a0e 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + TopicPubSubType::TopicPubSubType() { setName("Topic"); - uint32_t type_size = Topic_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Topic::getMaxCdrSerializedSize()); +#else + Topic_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool TopicPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool TopicPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool TopicPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function TopicPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool TopicPubSubType::getKey( Topic_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Topic_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h index f3dff789a8e..b9100bacbe9 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.cxx b/examples/cpp/dds/LivelinessQoS/Topicv1.cxx new file mode 100644 index 00000000000..a3e85584242 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/Topicv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Topic.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Topic_max_cdr_typesize 268ULL; + + + + +Topic::Topic() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +Topic::~Topic() +{ +} + +Topic::Topic( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +Topic::Topic( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +Topic& Topic::operator =( + const Topic& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +Topic& Topic::operator =( + Topic&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool Topic::operator ==( + const Topic& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool Topic::operator !=( + const Topic& x) const +{ + return !(*this == x); +} + +size_t Topic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Topic_max_cdr_typesize; +} + +size_t Topic::getCdrSerializedSize( + const Topic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void Topic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void Topic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool Topic::isKeyDefined() +{ + return false; +} + +void Topic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void Topic::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t Topic::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& Topic::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void Topic::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void Topic::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& Topic::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& Topic::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.h b/examples/cpp/dds/LivelinessQoS/Topicv1.h new file mode 100644 index 00000000000..9a6dfa97b4d --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/Topicv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Topic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TOPIC_H_ +#define _FAST_DDS_GENERATED_TOPIC_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TOPIC_SOURCE) +#define TOPIC_DllAPI __declspec( dllexport ) +#else +#define TOPIC_DllAPI __declspec( dllimport ) +#endif // TOPIC_SOURCE +#else +#define TOPIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TOPIC_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure Topic defined by the user in the IDL file. + * @ingroup Topic + */ +class Topic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Topic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Topic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + const Topic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic( + Topic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + const Topic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Topic that will be copied. + */ + eProsima_user_DllExport Topic& operator =( + Topic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Topic& x) const; + + /*! + * @brief Comparison operator. + * @param x Topic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Topic& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Topic& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_TOPIC_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx index 5e1081d3afb..c566d2aa145 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "OwnershipStrength.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + ExampleMessage::ExampleMessage() { - } ExampleMessage::~ExampleMessage() @@ -68,7 +72,6 @@ ExampleMessage& ExampleMessage::operator =( m_index = x.m_index; m_ownershipStrength = x.m_ownershipStrength; m_message = x.m_message; - return *this; } @@ -79,7 +82,6 @@ ExampleMessage& ExampleMessage::operator =( m_index = x.m_index; m_ownershipStrength = x.m_ownershipStrength; m_message = std::move(x.m_message); - return *this; } @@ -196,3 +198,5 @@ std::string& ExampleMessage::message() // Include auxiliary functions like for serializing/deserializing. #include "OwnershipStrengthCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h index 4f3e10d2620..2ce1eddefa3 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "OwnershipStrengthv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ #define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. * @ingroup OwnershipStrength @@ -203,3 +211,6 @@ class ExampleMessage #endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp index 82d5a059f50..d0eed4b0f5f 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ExampleMessage& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ + diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp index 12c6662e208..5adb5bdd0a1 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -81,7 +83,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.ownershipStrength() << eprosima::fastcdr::MemberId(2) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -131,4 +132,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_IPP_ + diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx index 4acd0968533..279bcd498c4 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "OwnershipStrengthPubSubTypes.h" #include "OwnershipStrengthCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + ExampleMessagePubSubType::ExampleMessagePubSubType() { setName("ExampleMessage"); - uint32_t type_size = ExampleMessage_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ExampleMessage::getMaxCdrSerializedSize()); +#else + ExampleMessage_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool ExampleMessagePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool ExampleMessagePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool ExampleMessagePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function ExampleMessagePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool ExampleMessagePubSubType::getKey( ExampleMessage_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ExampleMessage_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h index efd7aac3919..0ab6652c4ee 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type ExampleMessage defined by the user in the IDL file. * @ingroup OwnershipStrength diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx new file mode 100644 index 00000000000..b98d38c3f26 --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx @@ -0,0 +1,339 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file OwnershipStrength.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "OwnershipStrength.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define ExampleMessage_max_cdr_typesize 272ULL; + + + + +ExampleMessage::ExampleMessage() +{ + // unsigned long m_index + m_index = 0; + // unsigned long m_ownershipStrength + m_ownershipStrength = 0; + // /type_d() m_message + + +} + +ExampleMessage::~ExampleMessage() +{ +} + +ExampleMessage::ExampleMessage( + const ExampleMessage& x) +{ + m_index = x.m_index; + + + m_ownershipStrength = x.m_ownershipStrength; + + + m_message = x.m_message; + +} + +ExampleMessage::ExampleMessage( + ExampleMessage&& x) noexcept +{ + m_index = x.m_index; + + + m_ownershipStrength = x.m_ownershipStrength; + + + m_message = std::move(x.m_message); + +} + +ExampleMessage& ExampleMessage::operator =( + const ExampleMessage& x) +{ + m_index = x.m_index; + + + m_ownershipStrength = x.m_ownershipStrength; + + + m_message = x.m_message; + + return *this; +} + +ExampleMessage& ExampleMessage::operator =( + ExampleMessage&& x) noexcept +{ + m_index = x.m_index; + + + m_ownershipStrength = x.m_ownershipStrength; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool ExampleMessage::operator ==( + const ExampleMessage& x) const +{ + return (m_index == x.m_index && + m_ownershipStrength == x.m_ownershipStrength && + m_message == x.m_message); +} + +bool ExampleMessage::operator !=( + const ExampleMessage& x) const +{ + return !(*this == x); +} + +size_t ExampleMessage::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ExampleMessage_max_cdr_typesize; +} + +size_t ExampleMessage::getCdrSerializedSize( + const ExampleMessage& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void ExampleMessage::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_ownershipStrength; + + scdr << m_message.c_str(); + +} + +void ExampleMessage::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_ownershipStrength; + + + + dcdr >> m_message; + + +} + + +bool ExampleMessage::isKeyDefined() +{ + return false; +} + +void ExampleMessage::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void ExampleMessage::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t ExampleMessage::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& ExampleMessage::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member ownershipStrength + * @param _ownershipStrength New value for member ownershipStrength + */ +void ExampleMessage::ownershipStrength( + uint32_t _ownershipStrength) +{ + m_ownershipStrength = _ownershipStrength; +} + +/*! + * @brief This function returns the value of member ownershipStrength + * @return Value of member ownershipStrength + */ +uint32_t ExampleMessage::ownershipStrength() const +{ + return m_ownershipStrength; +} + +/*! + * @brief This function returns a reference to member ownershipStrength + * @return Reference to member ownershipStrength + */ +uint32_t& ExampleMessage::ownershipStrength() +{ + return m_ownershipStrength; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void ExampleMessage::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void ExampleMessage::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& ExampleMessage::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& ExampleMessage::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h new file mode 100644 index 00000000000..4f7eb44a631 --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file OwnershipStrength.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ +#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(OWNERSHIPSTRENGTH_SOURCE) +#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllexport ) +#else +#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllimport ) +#endif // OWNERSHIPSTRENGTH_SOURCE +#else +#define OWNERSHIPSTRENGTH_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define OWNERSHIPSTRENGTH_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. + * @ingroup OwnershipStrength + */ +class ExampleMessage +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExampleMessage(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExampleMessage(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage( + const ExampleMessage& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage( + ExampleMessage&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage& operator =( + const ExampleMessage& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ExampleMessage that will be copied. + */ + eProsima_user_DllExport ExampleMessage& operator =( + ExampleMessage&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ExampleMessage object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExampleMessage& x) const; + + /*! + * @brief Comparison operator. + * @param x ExampleMessage object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExampleMessage& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function sets a value in member ownershipStrength + * @param _ownershipStrength New value for member ownershipStrength + */ + eProsima_user_DllExport void ownershipStrength( + uint32_t _ownershipStrength); + + /*! + * @brief This function returns the value of member ownershipStrength + * @return Value of member ownershipStrength + */ + eProsima_user_DllExport uint32_t ownershipStrength() const; + + /*! + * @brief This function returns a reference to member ownershipStrength + * @return Reference to member ownershipStrength + */ + eProsima_user_DllExport uint32_t& ownershipStrength(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ExampleMessage& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + uint32_t m_ownershipStrength; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt index 3caf91e4c37..1af4ae77aad 100644 --- a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt +++ b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt @@ -37,6 +37,7 @@ endif() message(STATUS "Configuring Request-Reply example...") set(DDS_REQUEST_REPLY_EXAMPLE_COMMON_SOURCES Calculator.cxx + Calculatorv1.cxx CalculatorPubSubTypes.cxx ) set( DDS_REQUEST_REPLY_EXAMPLE_CLIENT_SOURCES diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.cxx b/examples/cpp/dds/RequestReplyExample/Calculator.cxx index 925deff7f8d..664663c6180 100644 --- a/examples/cpp/dds/RequestReplyExample/Calculator.cxx +++ b/examples/cpp/dds/RequestReplyExample/Calculator.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Calculator.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + RequestType::RequestType() { - } RequestType::~RequestType() @@ -68,7 +72,6 @@ RequestType& RequestType::operator =( m_operation = x.m_operation; m_x = x.m_x; m_y = x.m_y; - return *this; } @@ -79,7 +82,6 @@ RequestType& RequestType::operator =( m_operation = x.m_operation; m_x = x.m_x; m_y = x.m_y; - return *this; } @@ -184,9 +186,10 @@ int32_t& RequestType::y() } + + ReplyType::ReplyType() { - } ReplyType::~ReplyType() @@ -210,7 +213,6 @@ ReplyType& ReplyType::operator =( { m_z = x.m_z; - return *this; } @@ -219,7 +221,6 @@ ReplyType& ReplyType::operator =( { m_z = x.m_z; - return *this; } @@ -266,3 +267,5 @@ int64_t& ReplyType::z() // Include auxiliary functions like for serializing/deserializing. #include "CalculatorCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.h b/examples/cpp/dds/RequestReplyExample/Calculator.h index b8e674d3f61..945af396175 100644 --- a/examples/cpp/dds/RequestReplyExample/Calculator.h +++ b/examples/cpp/dds/RequestReplyExample/Calculator.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Calculatorv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ #define _FAST_DDS_GENERATED_CALCULATOR_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -78,6 +84,8 @@ enum OperationType : uint32_t MULTIPLICATION, DIVISION }; + + /*! * @brief This class represents the structure RequestType defined by the user in the IDL file. * @ingroup Calculator @@ -204,6 +212,8 @@ class RequestType int32_t m_y{0}; }; + + /*! * @brief This class represents the structure ReplyType defined by the user in the IDL file. * @ingroup Calculator @@ -291,3 +301,6 @@ class ReplyType #endif // _FAST_DDS_GENERATED_CALCULATOR_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp index b68ae47455a..ca610452fdb 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp @@ -37,10 +37,14 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const RequestType& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ReplyType& data); @@ -49,4 +53,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ + diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp index 4f0696767ca..4930387fbbd 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -81,7 +83,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.x() << eprosima::fastcdr::MemberId(2) << data.y() ; - scdr.end_serialize_type(current_state); } @@ -127,6 +128,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -166,7 +169,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.z() ; - scdr.end_serialize_type(current_state); } @@ -208,4 +210,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CALCULATORCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CALCULATORCDRAUX_IPP_ + diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx index a8f4eedde2b..e928e28c98d 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "CalculatorPubSubTypes.h" #include "CalculatorCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + RequestTypePubSubType::RequestTypePubSubType() { setName("RequestType"); - uint32_t type_size = RequestType_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(RequestType::getMaxCdrSerializedSize()); +#else + RequestType_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool RequestTypePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool RequestTypePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool RequestTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function RequestTypePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool RequestTypePubSubType::getKey( RequestType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || RequestType_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -183,10 +219,17 @@ bool RequestTypePubSubType::getKey( return true; } + + ReplyTypePubSubType::ReplyTypePubSubType() { setName("ReplyType"); - uint32_t type_size = ReplyType_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ReplyType::getMaxCdrSerializedSize()); +#else + ReplyType_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -217,10 +260,12 @@ bool ReplyTypePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -235,7 +280,11 @@ bool ReplyTypePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -252,7 +301,11 @@ bool ReplyTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -275,13 +328,26 @@ std::function ReplyTypePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -313,12 +379,20 @@ bool ReplyTypePubSubType::getKey( ReplyType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ReplyType_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h index 66aa9875a87..ae4b2b39e8d 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type RequestType defined by the user in the IDL file. * @ingroup Calculator @@ -126,6 +128,8 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ReplyType defined by the user in the IDL file. * @ingroup Calculator diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx b/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx new file mode 100644 index 00000000000..50874dc3bc9 --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx @@ -0,0 +1,467 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Calculator.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Calculator.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define ReplyType_max_cdr_typesize 16ULL; +#define RequestType_max_cdr_typesize 16ULL; + + + + +RequestType::RequestType() +{ + // OperationType m_operation + m_operation = ::ADDITION; + // long m_x + m_x = 0; + // long m_y + m_y = 0; + +} + +RequestType::~RequestType() +{ +} + +RequestType::RequestType( + const RequestType& x) +{ + m_operation = x.m_operation; + + + m_x = x.m_x; + + + m_y = x.m_y; + +} + +RequestType::RequestType( + RequestType&& x) noexcept +{ + m_operation = x.m_operation; + + + m_x = x.m_x; + + + m_y = x.m_y; + +} + +RequestType& RequestType::operator =( + const RequestType& x) +{ + m_operation = x.m_operation; + + + m_x = x.m_x; + + + m_y = x.m_y; + + return *this; +} + +RequestType& RequestType::operator =( + RequestType&& x) noexcept +{ + m_operation = x.m_operation; + + + m_x = x.m_x; + + + m_y = x.m_y; + + return *this; +} + +bool RequestType::operator ==( + const RequestType& x) const +{ + return (m_operation == x.m_operation && + m_x == x.m_x && + m_y == x.m_y); +} + +bool RequestType::operator !=( + const RequestType& x) const +{ + return !(*this == x); +} + +size_t RequestType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return RequestType_max_cdr_typesize; +} + +size_t RequestType::getCdrSerializedSize( + const RequestType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void RequestType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_operation; + + scdr << m_x; + + scdr << m_y; + +} + +void RequestType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_operation = (OperationType)enum_value; + } + + + + dcdr >> m_x; + + + + dcdr >> m_y; + + +} + + +bool RequestType::isKeyDefined() +{ + return false; +} + +void RequestType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member operation + * @param _operation New value for member operation + */ +void RequestType::operation( + OperationType _operation) +{ + m_operation = _operation; +} + +/*! + * @brief This function returns the value of member operation + * @return Value of member operation + */ +OperationType RequestType::operation() const +{ + return m_operation; +} + +/*! + * @brief This function returns a reference to member operation + * @return Reference to member operation + */ +OperationType& RequestType::operation() +{ + return m_operation; +} + + +/*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ +void RequestType::x( + int32_t _x) +{ + m_x = _x; +} + +/*! + * @brief This function returns the value of member x + * @return Value of member x + */ +int32_t RequestType::x() const +{ + return m_x; +} + +/*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ +int32_t& RequestType::x() +{ + return m_x; +} + + +/*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ +void RequestType::y( + int32_t _y) +{ + m_y = _y; +} + +/*! + * @brief This function returns the value of member y + * @return Value of member y + */ +int32_t RequestType::y() const +{ + return m_y; +} + +/*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ +int32_t& RequestType::y() +{ + return m_y; +} + + + + + +ReplyType::ReplyType() +{ + // long long m_z + m_z = 0; + +} + +ReplyType::~ReplyType() +{ +} + +ReplyType::ReplyType( + const ReplyType& x) +{ + m_z = x.m_z; + +} + +ReplyType::ReplyType( + ReplyType&& x) noexcept +{ + m_z = x.m_z; + +} + +ReplyType& ReplyType::operator =( + const ReplyType& x) +{ + m_z = x.m_z; + + return *this; +} + +ReplyType& ReplyType::operator =( + ReplyType&& x) noexcept +{ + m_z = x.m_z; + + return *this; +} + +bool ReplyType::operator ==( + const ReplyType& x) const +{ + return (m_z == x.m_z); +} + +bool ReplyType::operator !=( + const ReplyType& x) const +{ + return !(*this == x); +} + +size_t ReplyType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ReplyType_max_cdr_typesize; +} + +size_t ReplyType::getCdrSerializedSize( + const ReplyType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void ReplyType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_z; + +} + +void ReplyType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_z; + + +} + + +bool ReplyType::isKeyDefined() +{ + return false; +} + +void ReplyType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ +void ReplyType::z( + int64_t _z) +{ + m_z = _z; +} + +/*! + * @brief This function returns the value of member z + * @return Value of member z + */ +int64_t ReplyType::z() const +{ + return m_z; +} + +/*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ +int64_t& ReplyType::z() +{ + return m_z; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.h b/examples/cpp/dds/RequestReplyExample/Calculatorv1.h new file mode 100644 index 00000000000..d0af12a2c6f --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/Calculatorv1.h @@ -0,0 +1,407 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Calculator.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ +#define _FAST_DDS_GENERATED_CALCULATOR_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CALCULATOR_SOURCE) +#define CALCULATOR_DllAPI __declspec( dllexport ) +#else +#define CALCULATOR_DllAPI __declspec( dllimport ) +#endif // CALCULATOR_SOURCE +#else +#define CALCULATOR_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CALCULATOR_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration OperationType defined by the user in the IDL file. + * @ingroup Calculator + */ +enum OperationType : uint32_t +{ + ADDITION, + SUBTRACTION, + MULTIPLICATION, + DIVISION +}; + + +/*! + * @brief This class represents the structure RequestType defined by the user in the IDL file. + * @ingroup Calculator + */ +class RequestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport RequestType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~RequestType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType( + const RequestType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType( + RequestType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType& operator =( + const RequestType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object RequestType that will be copied. + */ + eProsima_user_DllExport RequestType& operator =( + RequestType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x RequestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const RequestType& x) const; + + /*! + * @brief Comparison operator. + * @param x RequestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const RequestType& x) const; + + /*! + * @brief This function sets a value in member operation + * @param _operation New value for member operation + */ + eProsima_user_DllExport void operation( + OperationType _operation); + + /*! + * @brief This function returns the value of member operation + * @return Value of member operation + */ + eProsima_user_DllExport OperationType operation() const; + + /*! + * @brief This function returns a reference to member operation + * @return Reference to member operation + */ + eProsima_user_DllExport OperationType& operation(); + + + /*! + * @brief This function sets a value in member x + * @param _x New value for member x + */ + eProsima_user_DllExport void x( + int32_t _x); + + /*! + * @brief This function returns the value of member x + * @return Value of member x + */ + eProsima_user_DllExport int32_t x() const; + + /*! + * @brief This function returns a reference to member x + * @return Reference to member x + */ + eProsima_user_DllExport int32_t& x(); + + + /*! + * @brief This function sets a value in member y + * @param _y New value for member y + */ + eProsima_user_DllExport void y( + int32_t _y); + + /*! + * @brief This function returns the value of member y + * @return Value of member y + */ + eProsima_user_DllExport int32_t y() const; + + /*! + * @brief This function returns a reference to member y + * @return Reference to member y + */ + eProsima_user_DllExport int32_t& y(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const RequestType& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + OperationType m_operation; + int32_t m_x; + int32_t m_y; + +}; + + + +/*! + * @brief This class represents the structure ReplyType defined by the user in the IDL file. + * @ingroup Calculator + */ +class ReplyType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ReplyType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ReplyType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType( + const ReplyType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType( + ReplyType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType& operator =( + const ReplyType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ReplyType that will be copied. + */ + eProsima_user_DllExport ReplyType& operator =( + ReplyType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ReplyType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ReplyType& x) const; + + /*! + * @brief Comparison operator. + * @param x ReplyType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ReplyType& x) const; + + /*! + * @brief This function sets a value in member z + * @param _z New value for member z + */ + eProsima_user_DllExport void z( + int64_t _z); + + /*! + * @brief This function returns the value of member z + * @return Value of member z + */ + eProsima_user_DllExport int64_t z() const; + + /*! + * @brief This function returns a reference to member z + * @return Reference to member z + */ + eProsima_user_DllExport int64_t& z(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ReplyType& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int64_t m_z; + +}; + + +#endif // _FAST_DDS_GENERATED_CALCULATOR_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.cxx b/examples/cpp/dds/SampleConfig_Controller/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Controller/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.h b/examples/cpp/dds/SampleConfig_Controller/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sample.h +++ b/examples/cpp/dds/SampleConfig_Controller/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx b/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.h b/examples/cpp/dds/SampleConfig_Controller/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.cxx b/examples/cpp/dds/SampleConfig_Events/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/SampleConfig_Events/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Events/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.h b/examples/cpp/dds/SampleConfig_Events/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/SampleConfig_Events/sample.h +++ b/examples/cpp/dds/SampleConfig_Events/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.cxx b/examples/cpp/dds/SampleConfig_Events/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.h b/examples/cpp/dds/SampleConfig_Events/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx index cad55c2b6a2..360d4a1b2b2 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "sample.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + sample::sample() { - } sample::~sample() @@ -65,7 +69,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -75,7 +78,6 @@ sample& sample::operator =( m_index = x.m_index; m_key_value = x.m_key_value; - return *this; } @@ -152,3 +154,5 @@ uint8_t& sample::key_value() // Include auxiliary functions like for serializing/deserializing. #include "sampleCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.h b/examples/cpp/dds/SampleConfig_Multimedia/sample.h index 16768c10310..c050c8527cc 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.h +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "samplev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_SAMPLE_H_ #define _FAST_DDS_GENERATED_SAMPLE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -175,3 +183,6 @@ class sample #endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp index 0d79a66ffde..18ed5857add 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp index 74199e69eae..11bc4709a6e 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.key_value() ; - scdr.end_serialize_type(current_state); } @@ -125,4 +126,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SAMPLECDRAUX_IPP_ + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx index 2d598b8daab..9095d77083a 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + samplePubSubType::samplePubSubType() { setName("sample"); - uint32_t type_size = sample_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(sample::getMaxCdrSerializedSize()); +#else + sample_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool samplePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool samplePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool samplePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function samplePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool samplePubSubType::getKey( sample_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || sample_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h index 35d8573e107..ec881115211 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx new file mode 100644 index 00000000000..3b735befaf8 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx @@ -0,0 +1,280 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "sample.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define sample_max_cdr_typesize 6ULL; + + + + +sample::sample() +{ + // octet m_index + m_index = 0; + // octet m_key_value + m_key_value = 0; + +} + +sample::~sample() +{ +} + +sample::sample( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample::sample( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + +} + +sample& sample::operator =( + const sample& x) +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +sample& sample::operator =( + sample&& x) noexcept +{ + m_index = x.m_index; + + + m_key_value = x.m_key_value; + + return *this; +} + +bool sample::operator ==( + const sample& x) const +{ + return (m_index == x.m_index && + m_key_value == x.m_key_value); +} + +bool sample::operator !=( + const sample& x) const +{ + return !(*this == x); +} + +size_t sample::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return sample_max_cdr_typesize; +} + +size_t sample::getCdrSerializedSize( + const sample& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void sample::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_key_value; + +} + +void sample::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_key_value; + + +} + + +bool sample::isKeyDefined() +{ + return true; +} + +void sample::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + + scdr << m_key_value; + +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void sample::index( + uint8_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint8_t sample::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint8_t& sample::index() +{ + return m_index; +} + + +/*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ +void sample::key_value( + uint8_t _key_value) +{ + m_key_value = _key_value; +} + +/*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ +uint8_t sample::key_value() const +{ + return m_key_value; +} + +/*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ +uint8_t& sample::key_value() +{ + return m_key_value; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h new file mode 100644 index 00000000000..97613067c8b --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h @@ -0,0 +1,236 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file sample.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ +#define _FAST_DDS_GENERATED_SAMPLE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const; + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index(); + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value); + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const; + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const sample& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_index; + uint8_t m_key_value; + +}; + + +#endif // _FAST_DDS_GENERATED_SAMPLE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx index bcda56fb45a..4b415d67769 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..90e82ea88a7 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx index bcda56fb45a..4b415d67769 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - } HelloWorld::~HelloWorld() @@ -65,7 +69,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::string& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h index 0c6d098011f..5cd0ddba511 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp index cf39bf78389..9f346d306be 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h index f6c88d5c191..cb61cd6ba23 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx new file mode 100644 index 00000000000..90e82ea88a7 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx @@ -0,0 +1,286 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 268ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned long m_index + m_index = 0; + // /type_d() m_message + + +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const std::string& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + std::string&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::string& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::string& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h new file mode 100644 index 00000000000..7758cd793fd --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::string m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx index 5e73a8b37eb..54ca2b05ab0 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "LoanableHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + LoanableHelloWorld::LoanableHelloWorld() { - } LoanableHelloWorld::~LoanableHelloWorld() @@ -65,7 +69,6 @@ LoanableHelloWorld& LoanableHelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ LoanableHelloWorld& LoanableHelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::array& LoanableHelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "LoanableHelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h index ccbe1975bda..80d8feaca9b 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "LoanableHelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. * @ingroup LoanableHelloWorld @@ -182,3 +190,6 @@ class LoanableHelloWorld #endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp index 006f1c1a692..c29aaedaaff 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp index 863b9eb6a86..640061e832c 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx index de7c98a245e..668ff484ea0 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); - uint32_t type_size = LoanableHelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LoanableHelloWorld::getMaxCdrSerializedSize()); +#else + LoanableHelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool LoanableHelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool LoanableHelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool LoanableHelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function LoanableHelloWorldPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool LoanableHelloWorldPubSubType::getKey( LoanableHelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LoanableHelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h index 3573a005607..06ba8663ef8 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + #ifndef SWIG namespace detail { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx new file mode 100644 index 00000000000..63da3dfddbc --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file LoanableHelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LoanableHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define LoanableHelloWorld_max_cdr_typesize 260ULL; + + + + +LoanableHelloWorld::LoanableHelloWorld() +{ + // unsigned long m_index + m_index = 0; + // char m_message + memset(&m_message, 0, ((256)) * 1); + +} + +LoanableHelloWorld::~LoanableHelloWorld() +{ +} + +LoanableHelloWorld::LoanableHelloWorld( + const LoanableHelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +LoanableHelloWorld::LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +LoanableHelloWorld& LoanableHelloWorld::operator =( + const LoanableHelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +LoanableHelloWorld& LoanableHelloWorld::operator =( + LoanableHelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool LoanableHelloWorld::operator ==( + const LoanableHelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool LoanableHelloWorld::operator !=( + const LoanableHelloWorld& x) const +{ + return !(*this == x); +} + +size_t LoanableHelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LoanableHelloWorld_max_cdr_typesize; +} + +size_t LoanableHelloWorld::getCdrSerializedSize( + const LoanableHelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void LoanableHelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message; + + +} + +void LoanableHelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool LoanableHelloWorld::isKeyDefined() +{ + return false; +} + +void LoanableHelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void LoanableHelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t LoanableHelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& LoanableHelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void LoanableHelloWorld::message( + const std::array& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void LoanableHelloWorld::message( + std::array&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::array& LoanableHelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::array& LoanableHelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h new file mode 100644 index 00000000000..2c3cedf747b --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file LoanableHelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LOANABLEHELLOWORLD_SOURCE) +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // LOANABLEHELLOWORLD_SOURCE +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. + * @ingroup LoanableHelloWorld + */ +class LoanableHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoanableHelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoanableHelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + const LoanableHelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + const LoanableHelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + LoanableHelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoanableHelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoanableHelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LoanableHelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::array m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx index 5e73a8b37eb..54ca2b05ab0 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "LoanableHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + LoanableHelloWorld::LoanableHelloWorld() { - } LoanableHelloWorld::~LoanableHelloWorld() @@ -65,7 +69,6 @@ LoanableHelloWorld& LoanableHelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -75,7 +78,6 @@ LoanableHelloWorld& LoanableHelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -162,3 +164,5 @@ std::array& LoanableHelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "LoanableHelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h index ccbe1975bda..80d8feaca9b 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "LoanableHelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. * @ingroup LoanableHelloWorld @@ -182,3 +190,6 @@ class LoanableHelloWorld #endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp index 006f1c1a692..c29aaedaaff 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ + diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp index 863b9eb6a86..640061e832c 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_IPP_ + diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx index de7c98a245e..668ff484ea0 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); - uint32_t type_size = LoanableHelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LoanableHelloWorld::getMaxCdrSerializedSize()); +#else + LoanableHelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool LoanableHelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool LoanableHelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool LoanableHelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function LoanableHelloWorldPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool LoanableHelloWorldPubSubType::getKey( LoanableHelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LoanableHelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h index 3573a005607..06ba8663ef8 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + #ifndef SWIG namespace detail { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx new file mode 100644 index 00000000000..63da3dfddbc --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx @@ -0,0 +1,288 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file LoanableHelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "LoanableHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define LoanableHelloWorld_max_cdr_typesize 260ULL; + + + + +LoanableHelloWorld::LoanableHelloWorld() +{ + // unsigned long m_index + m_index = 0; + // char m_message + memset(&m_message, 0, ((256)) * 1); + +} + +LoanableHelloWorld::~LoanableHelloWorld() +{ +} + +LoanableHelloWorld::LoanableHelloWorld( + const LoanableHelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +LoanableHelloWorld::LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +LoanableHelloWorld& LoanableHelloWorld::operator =( + const LoanableHelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +LoanableHelloWorld& LoanableHelloWorld::operator =( + LoanableHelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool LoanableHelloWorld::operator ==( + const LoanableHelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool LoanableHelloWorld::operator !=( + const LoanableHelloWorld& x) const +{ + return !(*this == x); +} + +size_t LoanableHelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LoanableHelloWorld_max_cdr_typesize; +} + +size_t LoanableHelloWorld::getCdrSerializedSize( + const LoanableHelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void LoanableHelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message; + + +} + +void LoanableHelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + dcdr >> m_message; + + +} + + +bool LoanableHelloWorld::isKeyDefined() +{ + return false; +} + +void LoanableHelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void LoanableHelloWorld::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t LoanableHelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& LoanableHelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void LoanableHelloWorld::message( + const std::array& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void LoanableHelloWorld::message( + std::array&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const std::array& LoanableHelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +std::array& LoanableHelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h new file mode 100644 index 00000000000..2c3cedf747b --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file LoanableHelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(LOANABLEHELLOWORLD_SOURCE) +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // LOANABLEHELLOWORLD_SOURCE +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define LOANABLEHELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. + * @ingroup LoanableHelloWorld + */ +class LoanableHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LoanableHelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LoanableHelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + const LoanableHelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld( + LoanableHelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + const LoanableHelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LoanableHelloWorld that will be copied. + */ + eProsima_user_DllExport LoanableHelloWorld& operator =( + LoanableHelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LoanableHelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x LoanableHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LoanableHelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::array& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::array&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::array& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::array& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LoanableHelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + std::array m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/include/fastdds/dds/builtin/common/ReplyHeader.hpp b/include/fastdds/dds/builtin/common/ReplyHeader.hpp index 758315b3011..f643a5789eb 100644 --- a/include/fastdds/dds/builtin/common/ReplyHeader.hpp +++ b/include/fastdds/dds/builtin/common/ReplyHeader.hpp @@ -40,18 +40,18 @@ struct ReplyHeader RemoteExceptionCode_t remoteEx; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::ReplyHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const ReplyHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::ReplyHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::ReplyHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::ReplyHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastdds/dds/builtin/common/RequestHeader.hpp b/include/fastdds/dds/builtin/common/RequestHeader.hpp index f290dd6b18d..bf7edd4fb8f 100644 --- a/include/fastdds/dds/builtin/common/RequestHeader.hpp +++ b/include/fastdds/dds/builtin/common/RequestHeader.hpp @@ -40,18 +40,18 @@ struct RequestHeader InstanceName instanceName; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::RequestHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const RequestHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::RequestHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::rpc::RequestHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::rpc::RequestHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastdds/dds/builtin/common/Types.hpp b/include/fastdds/dds/builtin/common/Types.hpp index 0516990b904..b7e1e02b34a 100644 --- a/include/fastdds/dds/builtin/common/Types.hpp +++ b/include/fastdds/dds/builtin/common/Types.hpp @@ -20,14 +20,24 @@ #ifndef TYPES_HPP #define TYPES_HPP +#include +#if FASTCDR_VERSION_MAJOR == 1 +#include +#else #include +#endif // FASTCDR_VERSION_MAJOR == 1 namespace eprosima { namespace fastdds { namespace dds { namespace rpc { -using InstanceName = fastcdr::string_255; +using InstanceName = +#if FASTCDR_VERSION_MAJOR == 1 + fastrtps::string_255; +#else + fastcdr::string_255; +#endif // FASTCDR_VERSION_MAJOR == 1 enum RemoteExceptionCode_t { diff --git a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp index f18fedf15c4..23ebf8ec020 100644 --- a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp +++ b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp @@ -45,18 +45,18 @@ struct TypeLookup_getTypes_In std::vector type_ids; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypes_In& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -76,18 +76,18 @@ struct TypeLookup_getTypes_Out std::vector complete_to_minimal; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypes_Out& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -138,18 +138,18 @@ class TypeLookup_getTypes_Result RTPS_DllAPI TypeLookup_getTypes_Out& result(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypes_Result& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -175,19 +175,19 @@ class TypeLookup_getTypeDependencies_In std::vector continuation_point; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypeDependencies_In& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -209,19 +209,19 @@ class TypeLookup_getTypeDependencies_Out std::vector continuation_point; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypeDependencies_Out& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -272,19 +272,19 @@ class TypeLookup_getTypeDependencies_Result RTPS_DllAPI TypeLookup_getTypeDependencies_Out& result(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_getTypeDependencies_Result& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -349,18 +349,18 @@ class TypeLookup_Call RTPS_DllAPI TypeLookup_getTypeDependencies_In& getTypeDependencies(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_Call& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -388,18 +388,18 @@ class TypeLookup_Request TypeLookup_Call data; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_Request& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -460,18 +460,18 @@ class TypeLookup_Return RTPS_DllAPI TypeLookup_getTypeDependencies_Result& getTypeDependencies(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_Return& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -499,18 +499,18 @@ class TypeLookup_Reply TypeLookup_Return return_value; #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeLookup_Reply& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastdds/rtps/common/CdrSerialization.hpp b/include/fastdds/rtps/common/CdrSerialization.hpp index 5b27b58af89..33f30ec5699 100644 --- a/include/fastdds/rtps/common/CdrSerialization.hpp +++ b/include/fastdds/rtps/common/CdrSerialization.hpp @@ -19,7 +19,78 @@ #ifndef FASTDDS_RTPS_COMMON_CDRSERIALIZATION_HPP #define FASTDDS_RTPS_COMMON_CDRSERIALIZATION_HPP -#include +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#include +#include + +namespace eprosima { +namespace fastcdr { + +namespace CdrVersion { +const eprosima::fastcdr::Cdr::CdrType DDS_CDR = eprosima::fastcdr::Cdr::CdrType::DDS_CDR; +const eprosima::fastcdr::Cdr::CdrType XCDRv1 = eprosima::fastcdr::Cdr::CdrType::DDS_CDR; +const eprosima::fastcdr::Cdr::CdrType XCDRv2 = eprosima::fastcdr::Cdr::CdrType::DDS_CDR; +} // namespace CdrVersion + +class CdrSizeCalculator; + +template +extern size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const _T& data, + size_t& current_alignment); + +template +extern void serialize( + Cdr&, + const _T&); + +template +extern void deserialize( + Cdr&, + _T&); + +// Dummy class +class CdrSizeCalculator +{ +public: + + CdrSizeCalculator( + eprosima::fastcdr::Cdr::CdrType) + { + } + + template + size_t calculate_serialized_size( + const _T& data, + size_t current_alignment) + { + return eprosima::fastcdr::calculate_serialized_size(*this, data, current_alignment); + } + +}; + +template +using fixed_string = eprosima::fastrtps::fixed_string; + +} // namespace fastcdr +} // namespace eprosima + +namespace eprosima { +namespace fastdds { +namespace rtps { +//! Default XCDR encoding version used in Fast DDS. +constexpr eprosima::fastcdr::Cdr::CdrType DEFAULT_XCDR_VERSION {eprosima::fastcdr::Cdr::CdrType::DDS_CDR}; +} // namespace rtps +} // namespace fastdds +} // namespace eprosima + +#else + +#include namespace eprosima { namespace fastdds { @@ -30,4 +101,6 @@ constexpr eprosima::fastcdr::CdrVersion DEFAULT_XCDR_VERSION {eprosima::fastcdr: } // namespace fastdds } // namespace eprosima +#endif //FASTCDR_VERSION_MAJOR == 1 + #endif // FASTDDS_RTPS_COMMON_CDRSERIALIZATION_HPP diff --git a/include/fastdds/rtps/writer/RTPSWriter.h b/include/fastdds/rtps/writer/RTPSWriter.h index 64e7202e0b2..25b4f1d9232 100644 --- a/include/fastdds/rtps/writer/RTPSWriter.h +++ b/include/fastdds/rtps/writer/RTPSWriter.h @@ -25,8 +25,6 @@ #include #include -#include - #include #include #include @@ -125,10 +123,14 @@ class RTPSWriter { return new_change([data]() -> uint32_t { +#if FASTCDR_VERSION_MAJOR == 1 + return (uint32_t)T::getCdrSerializedSize(data); +#else eprosima::fastcdr::CdrSizeCalculator calculator( eprosima::fastdds::rtps::DEFAULT_XCDR_VERSION); size_t current_alignment {0}; return (uint32_t)calculator.calculate_serialized_size(data, current_alignment); +#endif // if FASTCDR_VERSION_MAJOR == 1 }, changeKind, handle); } diff --git a/include/fastrtps/config.h.in b/include/fastrtps/config.h.in index 59d60f78472..0894de29a6b 100644 --- a/include/fastrtps/config.h.in +++ b/include/fastrtps/config.h.in @@ -124,4 +124,10 @@ (FASTRTPS_VERSION_MAJOR == major && FASTRTPS_VERSION_MINOR < minor), \ "TODO before version " #major "." #minor " : " #msg); +#if FASTCDR_VERSION_MAJOR > 1 +#define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg) +#else +#define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) +#endif + #endif // _FASTRTPS_CONFIG_H_ diff --git a/include/fastrtps/types/AnnotationParameterValue.h b/include/fastrtps/types/AnnotationParameterValue.h index be5480d5e83..c57430fb200 100644 --- a/include/fastrtps/types/AnnotationParameterValue.h +++ b/include/fastrtps/types/AnnotationParameterValue.h @@ -110,7 +110,7 @@ class ExtendedAnnotationParameterValue * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const ExtendedAnnotationParameterValue& data, @@ -120,7 +120,7 @@ class ExtendedAnnotationParameterValue * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -129,7 +129,7 @@ class ExtendedAnnotationParameterValue * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedAnnotationParameterValue::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -602,7 +602,7 @@ class AnnotationParameterValue * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AnnotationParameterValue::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AnnotationParameterValue& data, @@ -612,7 +612,7 @@ class AnnotationParameterValue * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AnnotationParameterValue::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -621,7 +621,7 @@ class AnnotationParameterValue * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AnnotationParameterValue::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AnnotationParameterValue::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -951,7 +951,7 @@ class AppliedAnnotationParameter * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AppliedAnnotationParameter& data, @@ -961,7 +961,7 @@ class AppliedAnnotationParameter * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -970,7 +970,7 @@ class AppliedAnnotationParameter * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotationParameter::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1115,16 +1115,16 @@ class AppliedAnnotation } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotation::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AppliedAnnotation& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotation::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedAnnotation::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedAnnotation::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1241,18 +1241,18 @@ class AppliedVerbatimAnnotation } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AppliedVerbatimAnnotation& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedVerbatimAnnotation::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1393,18 +1393,18 @@ class AppliedBuiltinMemberAnnotations } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AppliedBuiltinMemberAnnotations& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastrtps/types/TypeIdentifier.h b/include/fastrtps/types/TypeIdentifier.h index fbdd4bb9209..b49cf48d396 100644 --- a/include/fastrtps/types/TypeIdentifier.h +++ b/include/fastrtps/types/TypeIdentifier.h @@ -367,7 +367,7 @@ class TypeIdentifier * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifier::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeIdentifier& data, @@ -377,7 +377,7 @@ class TypeIdentifier * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifier::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -386,7 +386,7 @@ class TypeIdentifier * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifier::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifier::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastrtps/types/TypeIdentifierTypes.h b/include/fastrtps/types/TypeIdentifierTypes.h index 07adbd0ebaa..0a3095d8285 100644 --- a/include/fastrtps/types/TypeIdentifierTypes.h +++ b/include/fastrtps/types/TypeIdentifierTypes.h @@ -133,7 +133,7 @@ class StringSTypeDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringSTypeDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const StringSTypeDefn& data, @@ -144,7 +144,7 @@ class StringSTypeDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringSTypeDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -153,7 +153,7 @@ class StringSTypeDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringSTypeDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringSTypeDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -252,7 +252,7 @@ class StringLTypeDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringLTypeDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const StringLTypeDefn& data, @@ -263,7 +263,7 @@ class StringLTypeDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringLTypeDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -272,7 +272,7 @@ class StringLTypeDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StringLTypeDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StringLTypeDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -399,7 +399,7 @@ class PlainCollectionHeader final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainCollectionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainCollectionHeader& data, @@ -410,7 +410,7 @@ class PlainCollectionHeader final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainCollectionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -419,7 +419,7 @@ class PlainCollectionHeader final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainCollectionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainCollectionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -578,7 +578,7 @@ class PlainSequenceSElemDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainSequenceSElemDefn& data, @@ -589,7 +589,7 @@ class PlainSequenceSElemDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -598,7 +598,7 @@ class PlainSequenceSElemDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceSElemDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -758,7 +758,7 @@ class PlainSequenceLElemDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainSequenceLElemDefn& data, @@ -769,7 +769,7 @@ class PlainSequenceLElemDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -778,7 +778,7 @@ class PlainSequenceLElemDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainSequenceLElemDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -948,7 +948,7 @@ class PlainArraySElemDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArraySElemDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainArraySElemDefn& data, @@ -959,7 +959,7 @@ class PlainArraySElemDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArraySElemDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -968,7 +968,7 @@ class PlainArraySElemDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArraySElemDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArraySElemDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1138,7 +1138,7 @@ class PlainArrayLElemDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainArrayLElemDefn& data, @@ -1149,7 +1149,7 @@ class PlainArrayLElemDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -1158,7 +1158,7 @@ class PlainArrayLElemDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainArrayLElemDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1371,7 +1371,7 @@ class PlainMapSTypeDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainMapSTypeDefn& data, @@ -1382,7 +1382,7 @@ class PlainMapSTypeDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -1391,7 +1391,7 @@ class PlainMapSTypeDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapSTypeDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1606,7 +1606,7 @@ class PlainMapLTypeDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const PlainMapLTypeDefn& data, @@ -1617,7 +1617,7 @@ class PlainMapLTypeDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -1626,7 +1626,7 @@ class PlainMapLTypeDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::PlainMapLTypeDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1791,7 +1791,7 @@ class StronglyConnectedComponentId final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const StronglyConnectedComponentId& data, @@ -1802,7 +1802,7 @@ class StronglyConnectedComponentId final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -1811,7 +1811,7 @@ class StronglyConnectedComponentId final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::StronglyConnectedComponentId::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1880,7 +1880,7 @@ class ExtendedTypeDefn final * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedTypeDefn::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const ExtendedTypeDefn& data, @@ -1891,7 +1891,7 @@ class ExtendedTypeDefn final * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedTypeDefn::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI virtual void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -1900,7 +1900,7 @@ class ExtendedTypeDefn final * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::ExtendedTypeDefn::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::ExtendedTypeDefn::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI virtual void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastrtps/types/TypeObject.h b/include/fastrtps/types/TypeObject.h index fbec4e34db7..a755ddac2dd 100644 --- a/include/fastrtps/types/TypeObject.h +++ b/include/fastrtps/types/TypeObject.h @@ -122,16 +122,16 @@ class CommonStructMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonStructMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonStructMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonStructMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonStructMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonStructMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -239,16 +239,16 @@ class CompleteMemberDetail } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMemberDetail::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteMemberDetail& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMemberDetail::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMemberDetail::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMemberDetail::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -311,16 +311,16 @@ class MinimalMemberDetail final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMemberDetail::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalMemberDetail& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMemberDetail::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMemberDetail::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMemberDetail::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -403,16 +403,16 @@ class CompleteStructMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteStructMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -499,16 +499,16 @@ class MinimalStructMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalStructMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -571,16 +571,16 @@ class AppliedBuiltinTypeAnnotations } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const AppliedBuiltinTypeAnnotations& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -617,16 +617,16 @@ class MinimalTypeDetail MinimalTypeDetail&& x); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeDetail::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalTypeDetail& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeDetail::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeDetail::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeDetail::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -733,16 +733,16 @@ class CompleteTypeDetail } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeDetail::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteTypeDetail& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeDetail::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeDetail::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeDetail::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -825,16 +825,16 @@ class CompleteStructHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteStructHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -916,16 +916,16 @@ class MinimalStructHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalStructHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1031,16 +1031,16 @@ class CompleteStructType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteStructType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteStructType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteStructType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1147,16 +1147,16 @@ class MinimalStructType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalStructType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalStructType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalStructType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1292,16 +1292,16 @@ class CommonUnionMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonUnionMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonUnionMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonUnionMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonUnionMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonUnionMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1387,16 +1387,16 @@ class CompleteUnionMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteUnionMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1483,16 +1483,16 @@ class MinimalUnionMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalUnionMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1578,16 +1578,16 @@ class CommonDiscriminatorMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonDiscriminatorMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonDiscriminatorMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1694,16 +1694,16 @@ class CompleteDiscriminatorMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteDiscriminatorMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteDiscriminatorMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1765,16 +1765,16 @@ class MinimalDiscriminatorMember } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalDiscriminatorMember& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalDiscriminatorMember::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1833,16 +1833,16 @@ class CompleteUnionHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteUnionHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -1901,16 +1901,16 @@ class MinimalUnionHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalUnionHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2038,16 +2038,16 @@ class CompleteUnionType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteUnionType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteUnionType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteUnionType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2178,16 +2178,16 @@ class MinimalUnionType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalUnionType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalUnionType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalUnionType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2273,16 +2273,16 @@ class CommonAnnotationParameter } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAnnotationParameter::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonAnnotationParameter& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAnnotationParameter::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAnnotationParameter::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAnnotationParameter::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2390,16 +2390,16 @@ class CompleteAnnotationParameter } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAnnotationParameter& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationParameter::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2507,16 +2507,16 @@ class MinimalAnnotationParameter } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAnnotationParameter& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationParameter::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2579,16 +2579,16 @@ class CompleteAnnotationHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAnnotationHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2625,16 +2625,16 @@ class MinimalAnnotationHeader MinimalAnnotationHeader&& x); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAnnotationHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2741,16 +2741,16 @@ class CompleteAnnotationType final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAnnotationType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAnnotationType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAnnotationType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2856,16 +2856,16 @@ class MinimalAnnotationType final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAnnotationType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAnnotationType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAnnotationType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -2950,16 +2950,16 @@ class CommonAliasBody } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAliasBody::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonAliasBody& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAliasBody::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonAliasBody::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonAliasBody::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3064,16 +3064,16 @@ class CompleteAliasBody } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasBody::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAliasBody& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasBody::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasBody::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasBody::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3133,16 +3133,16 @@ class MinimalAliasBody } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasBody::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAliasBody& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasBody::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasBody::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasBody::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3200,16 +3200,16 @@ class CompleteAliasHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAliasHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3245,16 +3245,16 @@ class MinimalAliasHeader MinimalAliasHeader&& x); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAliasHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3360,16 +3360,16 @@ class CompleteAliasType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteAliasType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteAliasType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteAliasType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3474,16 +3474,16 @@ class MinimalAliasType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalAliasType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalAliasType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalAliasType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3567,16 +3567,16 @@ class CompleteElementDetail } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteElementDetail::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteElementDetail& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteElementDetail::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteElementDetail::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteElementDetail::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3658,16 +3658,16 @@ class CommonCollectionElement final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionElement::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonCollectionElement& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionElement::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionElement::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionElement::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3750,16 +3750,16 @@ class CompleteCollectionElement } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionElement::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteCollectionElement& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionElement::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionElement::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionElement::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3819,16 +3819,16 @@ class MinimalCollectionElement } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionElement::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalCollectionElement& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionElement::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionElement::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionElement::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3887,16 +3887,16 @@ class CommonCollectionHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonCollectionHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonCollectionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonCollectionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -3978,16 +3978,16 @@ class CompleteCollectionHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteCollectionHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteCollectionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteCollectionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4047,16 +4047,16 @@ class MinimalCollectionHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalCollectionHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalCollectionHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalCollectionHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4162,16 +4162,16 @@ class CompleteSequenceType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteSequenceType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteSequenceType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteSequenceType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteSequenceType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteSequenceType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4278,16 +4278,16 @@ class MinimalSequenceType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalSequenceType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalSequenceType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalSequenceType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalSequenceType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalSequenceType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4349,16 +4349,16 @@ class CommonArrayHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonArrayHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonArrayHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonArrayHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonArrayHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonArrayHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4440,16 +4440,16 @@ class CompleteArrayHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteArrayHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4509,16 +4509,16 @@ class MinimalArrayHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalArrayHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4623,16 +4623,16 @@ class CompleteArrayType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteArrayType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteArrayType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteArrayType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4739,16 +4739,16 @@ class MinimalArrayType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalArrayType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalArrayType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalArrayType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -4879,16 +4879,16 @@ class CompleteMapType final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMapType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteMapType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMapType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteMapType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteMapType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5018,16 +5018,16 @@ class MinimalMapType final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMapType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalMapType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMapType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalMapType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalMapType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5117,16 +5117,16 @@ class CommonEnumeratedLiteral } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonEnumeratedLiteral& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedLiteral::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5211,16 +5211,16 @@ class CompleteEnumeratedLiteral } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteEnumeratedLiteral& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedLiteral::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5307,16 +5307,16 @@ class MinimalEnumeratedLiteral } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalEnumeratedLiteral& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedLiteral::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5379,16 +5379,16 @@ class CommonEnumeratedHeader final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonEnumeratedHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonEnumeratedHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5470,16 +5470,16 @@ class CompleteEnumeratedHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteEnumeratedHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5539,16 +5539,16 @@ class MinimalEnumeratedHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalEnumeratedHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5654,16 +5654,16 @@ class CompleteEnumeratedType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteEnumeratedType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteEnumeratedType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteEnumeratedType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5770,16 +5770,16 @@ class MinimalEnumeratedType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalEnumeratedType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalEnumeratedType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalEnumeratedType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5865,16 +5865,16 @@ class CommonBitflag final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitflag::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonBitflag& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitflag::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitflag::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitflag::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -5957,16 +5957,16 @@ class CompleteBitflag } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitflag::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteBitflag& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitflag::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitflag::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitflag::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6050,16 +6050,16 @@ class MinimalBitflag } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitflag::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalBitflag& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitflag::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitflag::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitflag::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6122,16 +6122,16 @@ class CommonBitmaskHeader final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitmaskHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonBitmaskHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitmaskHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitmaskHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitmaskHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6238,16 +6238,16 @@ class CompleteBitmaskType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitmaskType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteBitmaskType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitmaskType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitmaskType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitmaskType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6354,16 +6354,16 @@ class MinimalBitmaskType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitmaskType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalBitmaskType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitmaskType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitmaskType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitmaskType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6494,16 +6494,16 @@ class CommonBitfield final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitfield::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CommonBitfield& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitfield::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CommonBitfield::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CommonBitfield::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6588,16 +6588,16 @@ class CompleteBitfield } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitfield::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfield::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteBitfield& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitfield::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfield::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitfielddeserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitfielddeserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6681,16 +6681,16 @@ class MinimalBitfield } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitfield::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalBitfield& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitfield::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitfield::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitfield::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6773,16 +6773,16 @@ class CompleteBitsetHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteBitsetHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6842,16 +6842,16 @@ class MinimalBitsetHeader } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetHeader::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalBitsetHeader& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetHeader::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetHeader::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetHeader::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -6955,16 +6955,16 @@ class CompleteBitsetType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteBitsetType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteBitsetType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteBitsetType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7071,16 +7071,16 @@ class MinimalBitsetType } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalBitsetType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalBitsetType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalBitsetType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7123,16 +7123,16 @@ class CompleteExtendedType CompleteExtendedType&& x); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteExtendedType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteExtendedType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteExtendedType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteExtendedType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteExtendedType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7171,16 +7171,16 @@ class MinimalExtendedType MinimalExtendedType&& x); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalExtendedType::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalExtendedType& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalExtendedType::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalExtendedType::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalExtendedType::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7275,16 +7275,16 @@ class CompleteTypeObject final RTPS_DllAPI CompleteExtendedType& extended_type(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeObject::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const CompleteTypeObject& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeObject::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::CompleteTypeObject::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::CompleteTypeObject::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7389,16 +7389,16 @@ class MinimalTypeObject final RTPS_DllAPI MinimalExtendedType& extended_type(); #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeObject::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const MinimalTypeObject& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeObject::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::MinimalTypeObject::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::MinimalTypeObject::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7551,7 +7551,7 @@ class TypeObject * @param current_alignment Buffer alignment. * @return Serialized size. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeObject::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeObject& data, @@ -7560,7 +7560,7 @@ class TypeObject * @brief This function serializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeObject::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; @@ -7569,7 +7569,7 @@ class TypeObject * @brief This function deserializes an object using CDR serialization. * @param cdr CDR serialization object. */ - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeObject::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeObject::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7667,16 +7667,16 @@ class TypeIdentifierTypeObjectPair final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeIdentifierTypeObjectPair& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierTypeObjectPair::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7753,16 +7753,16 @@ class TypeIdentifierPair final } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierPair::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeIdentifierPair& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierPair::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierPair::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierPair::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7839,16 +7839,16 @@ class TypeIdentifierWithSize } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeIdentifierWithSize& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithSize::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -7950,16 +7950,16 @@ class TypeIdentifierWithDependencies } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeIdentifierWithDependencies& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeIdentifierWithDependencies::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); @@ -8042,18 +8042,18 @@ class TypeInformation } #ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeInformation::getCdrSerializedSize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::getCdrSerializedSize()", "In favor of version using eprosima::fastcdr::calculate_serialized_size.") RTPS_DllAPI static size_t getCdrSerializedSize( const TypeInformation& data, size_t current_alignment = 0); - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeInformation::serialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::serialize()", "In favor of version using eprosima::fastcdr::serialize.") RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& cdr) const; - FASTDDS_DEPRECATED_UNTIL(3, "eprosima::fastrtps::types::TypeInformation::deserialize()", + FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastrtps::types::TypeInformation::deserialize()", "In favor of version using eprosima::fastcdr::deserialize.") RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& cdr); diff --git a/include/fastrtps/types/TypeObjectHashId.h b/include/fastrtps/types/TypeObjectHashId.h index 30f53b24525..6e9d9ad69ea 100644 --- a/include/fastrtps/types/TypeObjectHashId.h +++ b/include/fastrtps/types/TypeObjectHashId.h @@ -138,6 +138,20 @@ class TypeObjectHashId */ EquivalenceHash& hash(); + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + void deserialize( + eprosima::fastcdr::Cdr& cdr); + /*! * @brief This function returns the maximum serialized size of the Key of an object * depending on the buffer alignment. diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index efff95a806f..9a459ac15b7 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -261,6 +261,7 @@ if (FASTDDS_STATISTICS) statistics/rtps/writer/StatisticsWriterImpl.cpp statistics/types/typesPubSubTypes.cxx statistics/types/types.cxx + statistics/types/typesv1.cxx ) list(APPEND ${PROJECT_NAME}_source_files diff --git a/src/cpp/dynamic-types/AnnotationParameterValue.cpp b/src/cpp/dynamic-types/AnnotationParameterValue.cpp index 73ae8ae2a39..6cfbb6d8a60 100644 --- a/src/cpp/dynamic-types/AnnotationParameterValue.cpp +++ b/src/cpp/dynamic-types/AnnotationParameterValue.cpp @@ -21,10 +21,7 @@ #include -#include -#include -#include - +#include #include using namespace eprosima::fastcdr::exception; @@ -1385,15 +1382,16 @@ bool AppliedAnnotationParameter::operator ==( m_value == other.m_value; } -size_t AppliedAnnotationParameter::getKeyMaxCdrSerializedSize( - size_t current_alignment) +void AppliedAnnotationParameter::serialize( + eprosima::fastcdr::Cdr& scdr) const { - size_t current_align = current_alignment; - - - + eprosima::fastcdr::serialize(scdr, *this); +} - return current_align; +void AppliedAnnotationParameter::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + eprosima::fastcdr::deserialize(dcdr, *this); } bool AppliedAnnotationParameter::isKeyDefined() @@ -1456,12 +1454,16 @@ bool AppliedAnnotation::operator ==( return false; } -size_t AppliedAnnotation::getKeyMaxCdrSerializedSize( - size_t current_alignment) +void AppliedAnnotation::serialize( + eprosima::fastcdr::Cdr& scdr) const { - size_t current_align = current_alignment; + eprosima::fastcdr::serialize(scdr, *this); +} - return current_align; +void AppliedAnnotation::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + eprosima::fastcdr::deserialize(dcdr, *this); } bool AppliedAnnotation::isKeyDefined() @@ -1526,12 +1528,16 @@ bool AppliedVerbatimAnnotation::operator ==( m_text == other.m_text; } -size_t AppliedVerbatimAnnotation::getKeyMaxCdrSerializedSize( - size_t current_alignment) +void AppliedVerbatimAnnotation::serialize( + eprosima::fastcdr::Cdr& scdr) const { - size_t current_align = current_alignment; + eprosima::fastcdr::serialize(scdr, *this); +} - return current_align; +void AppliedVerbatimAnnotation::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + eprosima::fastcdr::deserialize(dcdr, *this); } bool AppliedVerbatimAnnotation::isKeyDefined() @@ -1601,12 +1607,16 @@ bool AppliedBuiltinMemberAnnotations::operator ==( m_hash_id == other.m_hash_id; } -size_t AppliedBuiltinMemberAnnotations::getKeyMaxCdrSerializedSize( - size_t current_alignment) +void AppliedBuiltinMemberAnnotations::serialize( + eprosima::fastcdr::Cdr& scdr) const { - size_t current_align = current_alignment; + eprosima::fastcdr::serialize(scdr, *this); +} - return current_align; +void AppliedBuiltinMemberAnnotations::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + eprosima::fastcdr::deserialize(dcdr, *this); } bool AppliedBuiltinMemberAnnotations::isKeyDefined() diff --git a/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp b/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp index da0c968adf1..4daac3b61d4 100644 --- a/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp +++ b/src/cpp/dynamic-types/AnnotationParameterValueCdrAux.ipp @@ -47,6 +47,87 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::AnnotationParameterValue& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + switch (data._d()) + { + case eprosima::fastrtps::types::TK_BOOLEAN: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + case eprosima::fastrtps::types::TK_BYTE: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + case eprosima::fastrtps::types::TK_INT16: + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + break; + case eprosima::fastrtps::types::TK_UINT16: + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + break; + case eprosima::fastrtps::types::TK_INT32: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + case eprosima::fastrtps::types::TK_UINT32: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + case eprosima::fastrtps::types::TK_INT64: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + case eprosima::fastrtps::types::TK_UINT64: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + case eprosima::fastrtps::types::TK_FLOAT32: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + case eprosima::fastrtps::types::TK_FLOAT64: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + case eprosima::fastrtps::types::TK_FLOAT128: + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); + + break; + case eprosima::fastrtps::types::TK_CHAR8: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + case eprosima::fastrtps::types::TK_CHAR16: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + case eprosima::fastrtps::types::TK_ENUM: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + case eprosima::fastrtps::types::TK_STRING8: + current_alignment += 4 + + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string8_value().size() + 1; + break; + case eprosima::fastrtps::types::TK_STRING16: + current_alignment += 4 + + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string16_value().size() + 1; + break; + default: + calculate_serialized_size(calculator, data.extended_value(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -143,6 +224,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -277,6 +360,17 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::AppliedAnnotationParameter& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.value(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -289,6 +383,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -315,6 +411,21 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::AppliedAnnotation& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.annotation_typeid(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.param_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.param_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -327,6 +438,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -353,6 +466,19 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::AppliedVerbatimAnnotation& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.placement().size() + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.language().size() + 1; + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.text().size() + 1; + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -367,6 +493,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -395,6 +523,19 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::AppliedBuiltinMemberAnnotations& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.unit().size() + 1; + calculate_serialized_size(calculator, data.min(), current_alignment); + calculate_serialized_size(calculator, data.max(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.hash_id().size() + 1; + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -411,6 +552,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> diff --git a/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp b/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp index bb37e715cf5..729dda56952 100644 --- a/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp +++ b/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp @@ -29,10 +29,7 @@ char dummy; #include #include -#include -#include -#include - +#include #include #include #include @@ -209,7 +206,11 @@ const TypeObject* GetMinimalidObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -268,7 +269,11 @@ const TypeObject* GetCompleteidObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -349,7 +354,11 @@ const TypeObject* GetMinimalautoidObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -413,7 +422,11 @@ const TypeObject* GetCompleteautoidObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -526,7 +539,11 @@ const TypeObject* GetMinimalAutoidKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -609,7 +626,11 @@ const TypeObject* GetCompleteAutoidKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -690,7 +711,11 @@ const TypeObject* GetMinimaloptionalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -753,7 +778,11 @@ const TypeObject* GetCompleteoptionalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -830,7 +859,11 @@ const TypeObject* GetMinimalpositionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -889,7 +922,11 @@ const TypeObject* GetCompletepositionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -966,7 +1003,11 @@ const TypeObject* GetMinimalvalueObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1025,7 +1066,11 @@ const TypeObject* GetCompletevalueObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1104,7 +1149,11 @@ const TypeObject* GetMinimalextensibilityObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1164,7 +1213,11 @@ const TypeObject* GetCompleteextensibilityObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1295,7 +1348,11 @@ const TypeObject* GetMinimalExtensibilityKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1392,7 +1449,11 @@ const TypeObject* GetCompleteExtensibilityKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1464,7 +1525,11 @@ const TypeObject* GetMinimalfinalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1517,7 +1582,11 @@ const TypeObject* GetCompletefinalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1588,7 +1657,11 @@ const TypeObject* GetMinimalappendableObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1641,7 +1714,11 @@ const TypeObject* GetCompleteappendableObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1712,7 +1789,11 @@ const TypeObject* GetMinimalmutableObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1765,7 +1846,11 @@ const TypeObject* GetCompletemutableObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1846,7 +1931,11 @@ const TypeObject* GetMinimalkeyObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1909,7 +1998,11 @@ const TypeObject* GetCompletekeyObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1991,7 +2084,11 @@ const TypeObject* GetMinimalmust_understandObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2054,7 +2151,11 @@ const TypeObject* GetCompletemust_understandObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2126,7 +2227,11 @@ const TypeObject* GetMinimaldefault_literalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2179,7 +2284,11 @@ const TypeObject* GetCompletedefault_literalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2256,7 +2365,11 @@ const TypeObject* GetMinimaldefaultObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2315,7 +2428,11 @@ const TypeObject* GetCompletedefaultObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2398,7 +2515,11 @@ const TypeObject* GetMinimalrangeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2463,7 +2584,11 @@ const TypeObject* GetCompleterangeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2540,7 +2665,11 @@ const TypeObject* GetMinimalminObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2599,7 +2728,11 @@ const TypeObject* GetCompleteminObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2676,7 +2809,11 @@ const TypeObject* GetMinimalmaxObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2735,7 +2872,11 @@ const TypeObject* GetCompletemaxObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2812,7 +2953,11 @@ const TypeObject* GetMinimalunitObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2871,7 +3016,11 @@ const TypeObject* GetCompleteunitObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2948,7 +3097,11 @@ const TypeObject* GetMinimalbit_boundObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3007,7 +3160,11 @@ const TypeObject* GetCompletebit_boundObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3088,7 +3245,11 @@ const TypeObject* GetMinimalexternalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3151,7 +3312,11 @@ const TypeObject* GetCompleteexternalObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3232,7 +3397,11 @@ const TypeObject* GetMinimalnestedObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3295,7 +3464,11 @@ const TypeObject* GetCompletenestedObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3393,7 +3566,11 @@ const TypeObject* GetMinimalverbatimObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3473,7 +3650,11 @@ const TypeObject* GetCompleteverbatimObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3652,7 +3833,11 @@ const TypeObject* GetMinimalPlacementKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3791,7 +3976,11 @@ const TypeObject* GetCompletePlacementKindObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3873,7 +4062,11 @@ const TypeObject* GetMinimalserviceObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3936,7 +4129,11 @@ const TypeObject* GetCompleteserviceObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4017,7 +4214,11 @@ const TypeObject* GetMinimalonewayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4080,7 +4281,11 @@ const TypeObject* GetCompleteonewayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4161,7 +4366,11 @@ const TypeObject* GetMinimalamiObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4224,7 +4433,11 @@ const TypeObject* GetCompleteamiObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4306,7 +4519,11 @@ const TypeObject* GetMinimalnon_serializedObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4369,7 +4586,11 @@ const TypeObject* GetCompletenon_serializedObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/src/cpp/dynamic-types/DynamicPubSubType.cpp b/src/cpp/dynamic-types/DynamicPubSubType.cpp index 70bf2334028..8e6910e8412 100644 --- a/src/cpp/dynamic-types/DynamicPubSubType.cpp +++ b/src/cpp/dynamic-types/DynamicPubSubType.cpp @@ -12,10 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include #include +#include #include #include #include @@ -108,7 +107,12 @@ bool DynamicPubSubType::deserialize( void* data) { eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer); + eprosima::fastcdr::Cdr deser(fastbuffer +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { @@ -150,7 +154,11 @@ bool DynamicPubSubType::getKey( if (force_md5 || keyBufferSize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, (unsigned int)ser.getSerializedDataLength()); +#else m_md5.update(m_keyBuffer, (unsigned int)ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -198,6 +206,7 @@ bool DynamicPubSubType::serialize( fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion:: XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 if (data_representation == fastdds::dds::DataRepresentationId_t::XCDR_DATA_REPRESENTATION) { if (MUTABLE == extensibility_) @@ -224,6 +233,7 @@ bool DynamicPubSubType::serialize( ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); } } +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -236,7 +246,11 @@ bool DynamicPubSubType::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp index 809eb3d8c0e..5f02c0a0e8c 100644 --- a/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp +++ b/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp @@ -12,11 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include - #include +#include #include #include #include @@ -1491,7 +1488,11 @@ void DynamicTypeBuilderFactory::build_alias_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1547,7 +1548,11 @@ void DynamicTypeBuilderFactory::build_alias_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1610,7 +1615,11 @@ void DynamicTypeBuilderFactory::build_enum_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1656,7 +1665,11 @@ void DynamicTypeBuilderFactory::build_enum_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1764,7 +1777,11 @@ void DynamicTypeBuilderFactory::build_struct_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1857,7 +1874,11 @@ void DynamicTypeBuilderFactory::build_struct_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1969,7 +1990,11 @@ void DynamicTypeBuilderFactory::build_union_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2071,7 +2096,11 @@ void DynamicTypeBuilderFactory::build_union_type_code( payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2152,7 +2181,11 @@ void DynamicTypeBuilderFactory::build_bitset_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2219,7 +2252,11 @@ void DynamicTypeBuilderFactory::build_bitset_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2287,7 +2324,11 @@ void DynamicTypeBuilderFactory::build_bitmask_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2340,7 +2381,11 @@ void DynamicTypeBuilderFactory::build_bitmask_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2416,7 +2461,11 @@ void DynamicTypeBuilderFactory::build_annotation_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2482,7 +2531,11 @@ void DynamicTypeBuilderFactory::build_annotation_type_code( { ser << st; } +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/src/cpp/dynamic-types/TypeIdentifier.cpp b/src/cpp/dynamic-types/TypeIdentifier.cpp index dc6928a7875..ce24a3fce37 100644 --- a/src/cpp/dynamic-types/TypeIdentifier.cpp +++ b/src/cpp/dynamic-types/TypeIdentifier.cpp @@ -21,11 +21,8 @@ #include -#include -#include -#include - #include +#include #include #include diff --git a/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp b/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp index a9603a27f8b..a8e10941610 100644 --- a/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp +++ b/src/cpp/dynamic-types/TypeIdentifierCdrAux.ipp @@ -23,6 +23,66 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::TypeIdentifier& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + switch (data._d()) + { + case eprosima::fastrtps::types::TI_STRING8_SMALL: + case eprosima::fastrtps::types::TI_STRING16_SMALL: + calculate_serialized_size(calculator, data.string_sdefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_STRING8_LARGE: + case eprosima::fastrtps::types::TI_STRING16_LARGE: + calculate_serialized_size(calculator, data.string_ldefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_SMALL: + calculate_serialized_size(calculator, data.seq_sdefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_SEQUENCE_LARGE: + calculate_serialized_size(calculator, data.seq_ldefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_ARRAY_SMALL: + calculate_serialized_size(calculator, data.array_sdefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_ARRAY_LARGE: + calculate_serialized_size(calculator, data.array_ldefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_MAP_SMALL: + calculate_serialized_size(calculator, data.map_sdefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_PLAIN_MAP_LARGE: + calculate_serialized_size(calculator, data.map_ldefn(), current_alignment); + + break; + case eprosima::fastrtps::types::TI_STRONGLY_CONNECTED_COMPONENT: + calculate_serialized_size(calculator, data.sc_component_id(), current_alignment); + + break; + case eprosima::fastrtps::types::EK_COMPLETE: + case eprosima::fastrtps::types::EK_MINIMAL: + current_alignment += 14 + eprosima::fastcdr::Cdr::alignment(current_alignment, 14); + + break; + default: + calculate_serialized_size(calculator, data.extended_defn(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -92,6 +152,8 @@ size_t calculate_serialized_size( } return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> diff --git a/src/cpp/dynamic-types/TypeIdentifierTypes.cpp b/src/cpp/dynamic-types/TypeIdentifierTypes.cpp index d39d6239b5b..7ba824e1449 100644 --- a/src/cpp/dynamic-types/TypeIdentifierTypes.cpp +++ b/src/cpp/dynamic-types/TypeIdentifierTypes.cpp @@ -22,10 +22,7 @@ #include #include -#include -#include -#include - +#include #include #include #include diff --git a/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp b/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp index 455d005e53e..f51bc2e76b4 100644 --- a/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp +++ b/src/cpp/dynamic-types/TypeIdentifierTypesCdrAux.ipp @@ -23,6 +23,16 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::StringSTypeDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + return current_alignment - initial_alignment; +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -34,6 +44,8 @@ size_t calculate_serialized_size( return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -42,6 +54,18 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::StringLTypeDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -53,6 +77,8 @@ size_t calculate_serialized_size( return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -61,6 +87,20 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainCollectionHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -74,6 +114,8 @@ size_t calculate_serialized_size( return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -82,6 +124,30 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainSequenceSElemDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.element_identifier() != nullptr) + { + size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -105,6 +171,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -113,6 +181,30 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainSequenceLElemDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.element_identifier() != nullptr) + { + size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -136,6 +228,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -144,6 +238,31 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainArraySElemDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += (data.array_bound_seq().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.element_identifier() != nullptr) + { + size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + + return current_alignment - initial_alignment; +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -167,6 +286,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -175,6 +296,31 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainArrayLElemDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + current_alignment += (data.array_bound_seq().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.element_identifier() != nullptr) + { + size_t size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size_t size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -198,6 +344,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -206,6 +354,47 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainMapSTypeDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + size_t size = 0; + if (data.element_identifier() != nullptr) + { + size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.key_identifier() != nullptr) + { + size = calculate_serialized_size(calculator, *data.key_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -242,6 +431,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -250,6 +441,46 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::PlainMapLTypeDefn& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + size_t size = 0; + if (data.element_identifier() != nullptr) + { + size = calculate_serialized_size(calculator, *data.element_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + //current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + if (data.key_identifier() != nullptr) + { + size = calculate_serialized_size(calculator, *data.key_identifier(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + else + { + eprosima::fastrtps::types::TypeIdentifier emptyId; + size = calculate_serialized_size(calculator, emptyId, current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -286,6 +517,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -294,6 +527,20 @@ size_t calculate_serialized_size( const eprosima::fastrtps::types::StronglyConnectedComponentId& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + size_t initial_alignment = current_alignment; + + //current_alignment += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + size_t size = calculate_serialized_size(calculator, data.sc_component_id(), current_alignment); + current_alignment += size + eprosima::fastcdr::Cdr::alignment(current_alignment, size); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -308,6 +555,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -357,7 +606,12 @@ void serialize( const eprosima::fastrtps::types::PlainCollectionHeader& data) { scdr << data.equiv_kind(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.element_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.element_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -366,7 +620,13 @@ void deserialize( eprosima::fastrtps::types::PlainCollectionHeader& data) { dcdr >> data.equiv_kind(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.element_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.element_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -394,11 +654,10 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.bound(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); } template<> @@ -426,11 +685,10 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.bound(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); } template<> @@ -459,11 +717,10 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.array_bound_seq(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); } template<> @@ -491,11 +748,10 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.array_bound_seq(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); } template<> @@ -514,7 +770,12 @@ void serialize( eprosima::fastrtps::types::TypeIdentifier emptyId; scdr << emptyId; } +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.key_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.key_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 if (data.key_identifier() != nullptr) { scdr << *data.key_identifier(); @@ -533,17 +794,21 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.bound(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.key_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.key_flags(); - if (data.key_identifier() == nullptr) - { - data.key_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.key_identifier(); +#endif // FASTCDR_VERSION_MAJOR == 1 + + eprosima::fastrtps::types::TypeIdentifier key_type_id; + dcdr >> key_type_id; + data.key_identifier(&key_type_id); } template<> @@ -562,7 +827,12 @@ void serialize( eprosima::fastrtps::types::TypeIdentifier emptyId; scdr << emptyId; } +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.key_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.key_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 if (data.key_identifier() != nullptr) { scdr << *data.key_identifier(); @@ -581,17 +851,21 @@ void deserialize( { dcdr >> data.header(); dcdr >> data.bound(); - if (data.element_identifier() == nullptr) - { - data.element_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.element_identifier(); + + eprosima::fastrtps::types::TypeIdentifier elem_type_id; + dcdr >> elem_type_id; + data.element_identifier(&elem_type_id); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.key_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.key_flags(); - if (data.key_identifier() == nullptr) - { - data.key_identifier(new eprosima::fastrtps::types::TypeIdentifier()); - } - dcdr >> *data.key_identifier(); +#endif // FASTCDR_VERSION_MAJOR == 1 + + eprosima::fastrtps::types::TypeIdentifier key_type_id; + dcdr >> key_type_id; + data.key_identifier(&key_type_id); } template<> diff --git a/src/cpp/dynamic-types/TypeObject.cpp b/src/cpp/dynamic-types/TypeObject.cpp index f2ac173f458..282bdb29425 100644 --- a/src/cpp/dynamic-types/TypeObject.cpp +++ b/src/cpp/dynamic-types/TypeObject.cpp @@ -12,11 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include - #include +#include #include #include #include diff --git a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp b/src/cpp/dynamic-types/TypeObjectCdrAux.ipp index e5a4f4b87b0..7d765faa064 100644 --- a/src/cpp/dynamic-types/TypeObjectCdrAux.ipp +++ b/src/cpp/dynamic-types/TypeObjectCdrAux.ipp @@ -23,6 +23,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonStructMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.member_type_id(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -37,6 +49,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -45,7 +59,12 @@ RTPS_DllAPI void serialize( const eprosima::fastrtps::types::CommonStructMember& data) { scdr << data.member_id(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.member_type_id(); } @@ -55,7 +74,13 @@ RTPS_DllAPI void deserialize( eprosima::fastrtps::types::CommonStructMember& data) { dcdr >> data.member_id(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.member_type_id(); } @@ -65,6 +90,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteMemberDetail& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -79,6 +121,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -107,6 +151,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalMemberDetail& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -117,6 +173,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -141,6 +199,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteStructMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -153,6 +222,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -179,6 +250,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalStructMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -191,6 +273,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -217,6 +301,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::AppliedBuiltinTypeAnnotations& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.verbatim(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -227,6 +321,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -274,6 +370,22 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteTypeDetail& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.type_name().size() + 1; + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -288,6 +400,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -316,6 +430,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteStructHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -328,6 +453,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -354,6 +481,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalStructHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -366,6 +504,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -392,6 +532,22 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteStructType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.struct_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -406,6 +562,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -413,7 +571,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteStructType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.struct_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.member_seq(); } @@ -423,7 +586,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteStructType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.struct_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.struct_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.member_seq(); } @@ -434,6 +603,22 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalStructType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.struct_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -448,6 +633,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -455,7 +642,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalStructType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.struct_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.struct_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.member_seq(); } @@ -465,7 +657,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalStructType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.struct_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.struct_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.member_seq(); } @@ -476,6 +674,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonUnionMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.type_id(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.label_seq().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -492,6 +708,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -500,7 +718,12 @@ RTPS_DllAPI void serialize( const eprosima::fastrtps::types::CommonUnionMember& data) { scdr << data.member_id(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.type_id(); scdr << data.label_seq(); } @@ -511,7 +734,13 @@ RTPS_DllAPI void deserialize( eprosima::fastrtps::types::CommonUnionMember& data) { dcdr >> data.member_id(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.type_id(); dcdr >> data.label_seq(); } @@ -522,6 +751,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteUnionMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -534,6 +774,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -560,6 +802,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalUnionMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -572,6 +825,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -598,6 +853,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonDiscriminatorMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.type_id(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -610,6 +876,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -617,7 +885,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CommonDiscriminatorMember& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.type_id(); } @@ -626,7 +899,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CommonDiscriminatorMember& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.type_id(); } @@ -636,6 +915,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteDiscriminatorMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -650,6 +946,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -678,6 +976,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalDiscriminatorMember& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -688,6 +996,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -712,6 +1022,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteUnionHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -722,6 +1042,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -746,6 +1068,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalUnionHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -756,6 +1088,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -780,6 +1114,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteUnionType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.union_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.discriminator(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -796,6 +1148,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -803,7 +1157,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteUnionType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.union_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.discriminator(); scdr << data.member_seq(); @@ -814,7 +1173,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteUnionType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.union_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.union_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.discriminator(); dcdr >> data.member_seq(); @@ -826,6 +1191,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalUnionType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.union_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.discriminator(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -842,6 +1225,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -849,7 +1234,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalUnionType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.union_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.union_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.discriminator(); scdr << data.member_seq(); @@ -860,7 +1250,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalUnionType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.union_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.union_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.discriminator(); dcdr >> data.member_seq(); @@ -872,6 +1268,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonAnnotationParameter& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.member_flags(), current_alignment); + calculate_serialized_size(calculator, data.member_type_id(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -884,6 +1291,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -891,7 +1300,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CommonAnnotationParameter& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.member_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.member_type_id(); } @@ -900,7 +1314,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CommonAnnotationParameter& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.member_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.member_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.member_type_id(); } @@ -910,6 +1330,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAnnotationParameter& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.default_value(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -924,6 +1356,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -952,6 +1386,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalAnnotationParameter& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.name().size() + 1; + calculate_serialized_size(calculator, data.default_value(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -966,6 +1412,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -994,6 +1442,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAnnotationHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 4 + + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.annotation_name().size() + 1; + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1004,6 +1464,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1051,6 +1513,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAnnotationType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at( + a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1065,6 +1545,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1072,7 +1554,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteAnnotationType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.annotation_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.member_seq(); } @@ -1082,7 +1569,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteAnnotationType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.annotation_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.annotation_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.member_seq(); } @@ -1093,6 +1586,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalAnnotationType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.annotation_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.member_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.member_seq().at(a), + current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1107,6 +1618,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1114,7 +1627,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalAnnotationType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.annotation_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.annotation_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.member_seq(); } @@ -1124,7 +1642,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalAnnotationType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.annotation_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.annotation_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.member_seq(); } @@ -1135,6 +1659,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonAliasBody& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.related_flags(), current_alignment); + calculate_serialized_size(calculator, data.related_type(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1147,6 +1682,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1154,7 +1691,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CommonAliasBody& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.related_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.related_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.related_type(); } @@ -1163,7 +1705,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CommonAliasBody& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.related_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.related_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.related_type(); } @@ -1173,6 +1721,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAliasBody& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1187,6 +1752,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1215,6 +1782,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalAliasBody& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1225,6 +1802,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1249,6 +1828,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAliasHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1259,6 +1848,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1306,6 +1897,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteAliasType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.alias_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.body(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1320,6 +1923,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1327,7 +1932,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteAliasType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.alias_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.body(); } @@ -1337,7 +1947,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteAliasType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.alias_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.alias_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.body(); } @@ -1348,6 +1964,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalAliasType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.alias_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.body(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1362,6 +1990,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1369,7 +1999,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalAliasType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.alias_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.alias_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.body(); } @@ -1379,7 +2014,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalAliasType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.alias_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.alias_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.body(); } @@ -1390,6 +2031,22 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteElementDetail& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.ann_builtin(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.ann_custom().size(); ++a) + { + calculate_serialized_size(calculator, data.ann_custom().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1402,6 +2059,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1428,6 +2087,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonCollectionElement& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.element_flags(), current_alignment); + calculate_serialized_size(calculator, data.type(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1440,6 +2110,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1447,7 +2119,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CommonCollectionElement& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.element_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.element_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.type(); } @@ -1456,7 +2133,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CommonCollectionElement& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.element_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.element_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.type(); } @@ -1466,6 +2149,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteCollectionElement& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1478,6 +2172,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1504,6 +2200,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalCollectionElement& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1514,6 +2220,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1538,7 +2246,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonCollectionHeader& data, size_t& current_alignment) { - size_t calculated_size {calculator.begin_calculate_type_serialized_size( +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; + + return current_alignment - initial_alignment; +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( @@ -1548,6 +2266,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1572,6 +2292,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteCollectionHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1584,6 +2315,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1610,6 +2343,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalCollectionHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1620,6 +2363,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1644,6 +2389,29 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalSequenceType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; + // SEQUENCE + /* + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for(size_t a = 0; a < data.param_seq().size(); ++a) + { + current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); + } + */ + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1658,6 +2426,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1665,7 +2435,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteSequenceType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.element(); } @@ -1675,7 +2450,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteSequenceType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.element(); } @@ -1686,6 +2467,29 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteSequenceType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + // FIXED_SIXE current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + // STRING current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.str().size() + 1; + // SEQUENCE + /* + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for(size_t a = 0; a < data.param_seq().size(); ++a) + { + current_alignment += AppliedAnnotationParameter::getCdrSerializedSize(data.param_seq().at(a), current_alignment); + } + */ + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1700,6 +2504,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1707,7 +2513,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalSequenceType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.element(); } @@ -1717,7 +2528,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalSequenceType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.element(); } @@ -1728,6 +2545,21 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonArrayHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.bound_seq().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1738,6 +2570,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1762,6 +2596,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteArrayHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1774,6 +2619,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1800,6 +2647,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalArrayHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1810,6 +2667,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1834,6 +2693,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteArrayType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1848,6 +2719,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1855,7 +2728,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteArrayType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.element(); } @@ -1865,7 +2743,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteArrayType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.element(); } @@ -1876,6 +2760,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalArrayType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1890,6 +2786,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1897,7 +2795,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalArrayType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.element(); } @@ -1907,7 +2810,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalArrayType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.element(); } @@ -1918,6 +2827,19 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteMapType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.key(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1934,6 +2856,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1941,7 +2865,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteMapType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.key(); scdr << data.element(); @@ -1952,7 +2881,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteMapType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.key(); dcdr >> data.element(); @@ -1964,6 +2899,19 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalMapType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.collection_flag(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + calculate_serialized_size(calculator, data.key(), current_alignment); + calculate_serialized_size(calculator, data.element(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -1980,6 +2928,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -1987,7 +2937,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalMapType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.collection_flag().bitset().to_ulong()); + scdr << bits; +#else scdr << data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.key(); scdr << data.element(); @@ -1998,7 +2953,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalMapType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.collection_flag().bitset(std::bitset<16>(bits)); +#else dcdr >> data.collection_flag(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.key(); dcdr >> data.element(); @@ -2010,6 +2971,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonEnumeratedLiteral& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + calculate_serialized_size(calculator, data.flags(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2022,6 +2994,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2030,7 +3004,12 @@ RTPS_DllAPI void serialize( const eprosima::fastrtps::types::CommonEnumeratedLiteral& data) { scdr << data.value(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2039,7 +3018,13 @@ RTPS_DllAPI void deserialize( eprosima::fastrtps::types::CommonEnumeratedLiteral& data) { dcdr >> data.value(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2048,6 +3033,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteEnumeratedLiteral& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2060,6 +3056,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2086,6 +3084,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalEnumeratedLiteral& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2098,6 +3107,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2124,6 +3135,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonEnumeratedHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2134,6 +3157,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2158,6 +3183,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteEnumeratedHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2170,6 +3206,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2196,6 +3234,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalEnumeratedHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2206,6 +3254,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2230,6 +3280,24 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteEnumeratedType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.enum_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.literal_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.literal_seq().at(a), + current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2244,6 +3312,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2251,7 +3321,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteEnumeratedType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.enum_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.literal_seq(); } @@ -2261,7 +3336,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteEnumeratedType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.enum_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.enum_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.literal_seq(); } @@ -2272,6 +3353,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalEnumeratedType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.enum_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.literal_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.literal_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2286,6 +3384,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2293,7 +3393,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalEnumeratedType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.enum_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.enum_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.literal_seq(); } @@ -2303,7 +3408,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalEnumeratedType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.enum_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.enum_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.literal_seq(); } @@ -2314,6 +3425,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonBitflag& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + calculate_serialized_size(calculator, data.flags(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2326,6 +3448,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2334,7 +3458,12 @@ RTPS_DllAPI void serialize( const eprosima::fastrtps::types::CommonBitflag& data) { scdr << data.position(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2343,7 +3472,13 @@ RTPS_DllAPI void deserialize( eprosima::fastrtps::types::CommonBitflag& data) { dcdr >> data.position(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2352,6 +3487,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteBitflag& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2364,6 +3510,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2390,6 +3538,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalBitflag& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2402,6 +3561,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2428,6 +3589,18 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonBitmaskHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + static_cast(data); + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2438,6 +3611,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2462,6 +3637,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteBitmaskType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.flag_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2476,6 +3668,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2483,7 +3677,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteBitmaskType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.bitmask_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.flag_seq(); } @@ -2493,7 +3692,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteBitmaskType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.bitmask_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.bitmask_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.flag_seq(); } @@ -2504,6 +3709,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalBitmaskType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.bitmask_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.flag_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.flag_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2518,6 +3740,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2525,7 +3749,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalBitmaskType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitmask_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.bitmask_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.flag_seq(); } @@ -2535,7 +3764,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalBitmaskType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.bitmask_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.bitmask_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.flag_seq(); } @@ -2546,6 +3781,19 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CommonBitfield& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + calculate_serialized_size(calculator, data.flags(), current_alignment); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2562,6 +3810,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2570,7 +3820,12 @@ RTPS_DllAPI void serialize( const eprosima::fastrtps::types::CommonBitfield& data) { scdr << data.position(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.bitcount(); scdr << data.holder_type(); } @@ -2581,7 +3836,13 @@ RTPS_DllAPI void deserialize( eprosima::fastrtps::types::CommonBitfield& data) { dcdr >> data.position(); +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.bitcount(); dcdr >> data.holder_type(); } @@ -2592,6 +3853,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteBitfield& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2604,6 +3876,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2630,6 +3904,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalBitfield& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.common(), current_alignment); + current_alignment += ((4) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2642,6 +3927,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2668,6 +3955,17 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteBitsetHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.base_type(), current_alignment); + calculate_serialized_size(calculator, data.detail(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2680,6 +3978,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2706,6 +4006,16 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalBitsetHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.base_type(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2716,6 +4026,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2740,6 +4052,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::CompleteBitsetType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.field_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2754,6 +4083,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2761,7 +4092,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::CompleteBitsetType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.field_seq(); } @@ -2771,7 +4107,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::CompleteBitsetType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.bitset_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.field_seq(); } @@ -2782,6 +4124,23 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalBitsetType& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.bitset_flags(), current_alignment); + calculate_serialized_size(calculator, data.header(), current_alignment); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.field_seq().size(); ++a) + { + calculate_serialized_size(calculator, data.field_seq().at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -2796,6 +4155,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -2803,7 +4164,12 @@ RTPS_DllAPI void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastrtps::types::MinimalBitsetType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitset_flags().bitset().to_ulong()); + scdr << bits; +#else scdr << data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 scdr << data.header(); scdr << data.field_seq(); } @@ -2813,7 +4179,13 @@ RTPS_DllAPI void deserialize( eprosima::fastcdr::Cdr& dcdr, eprosima::fastrtps::types::MinimalBitsetType& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + dcdr >> bits; + data.bitset_flags().bitset(std::bitset<16>(bits)); +#else dcdr >> data.bitset_flags(); +#endif // FASTCDR_VERSION_MAJOR == 1 dcdr >> data.header(); dcdr >> data.field_seq(); } @@ -2867,170 +4239,60 @@ RTPS_DllAPI void deserialize( template<> RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data, + const eprosima::fastrtps::types::CompleteTypeObject& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculate_serialized_size(calculator, data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculate_serialized_size(calculator, data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculate_serialized_size(calculator, data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculate_serialized_size(calculator, data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculate_serialized_size(calculator, data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculate_serialized_size(calculator, data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculate_serialized_size(calculator, data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculate_serialized_size(calculator, data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); + break; + default: + calculate_serialized_size(calculator, data.extended_type(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_object(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - scdr << data.type_identifier(); - scdr << data.type_object(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) -{ - dcdr >> data.type_identifier(); - dcdr >> data.type_object(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierPair& data, - size_t& current_alignment) -{ - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_identifier1(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.type_identifier2(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - scdr << data.type_identifier1(); - scdr << data.type_identifier2(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierPair& data) -{ - dcdr >> data.type_identifier1(); - dcdr >> data.type_identifier2(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data, - size_t& current_alignment) -{ - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_id(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.typeobject_serialized_size(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - scdr << data.type_id(); - scdr << data.typeobject_serialized_size(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithSize& data) -{ - dcdr >> data.type_id(); - dcdr >> data.typeobject_serialized_size(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data, - size_t& current_alignment) -{ - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.typeid_with_size(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.dependent_typeid_count(), current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 2), data.dependent_typeids(), current_alignment); - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; -} - -template<> -RTPS_DllAPI void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - scdr << data.typeid_with_size(); - scdr << data.dependent_typeid_count(); - scdr << data.dependent_typeids(); -} - -template<> -RTPS_DllAPI void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) -{ - dcdr >> data.typeid_with_size(); - dcdr >> data.dependent_typeid_count(); - dcdr >> data.dependent_typeids(); -} - -template<> -RTPS_DllAPI size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::CompleteTypeObject& data, - size_t& current_alignment) -{ - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); + 0), data._d(), current_alignment); switch (data._d()) { @@ -3084,6 +4346,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -3182,6 +4446,52 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::MinimalTypeObject& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + switch (data._d()) + { + case eprosima::fastrtps::types::TK_ALIAS: + calculate_serialized_size(calculator, data.alias_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ANNOTATION: + calculate_serialized_size(calculator, data.annotation_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_STRUCTURE: + calculate_serialized_size(calculator, data.struct_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_UNION: + calculate_serialized_size(calculator, data.union_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITSET: + calculate_serialized_size(calculator, data.bitset_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_SEQUENCE: + calculate_serialized_size(calculator, data.sequence_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ARRAY: + calculate_serialized_size(calculator, data.array_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_MAP: + calculate_serialized_size(calculator, data.map_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_ENUM: + calculate_serialized_size(calculator, data.enumerated_type(), current_alignment); + break; + case eprosima::fastrtps::types::TK_BITMASK: + calculate_serialized_size(calculator, data.bitmask_type(), current_alignment); + break; + default: + calculate_serialized_size(calculator, data.extended_type(), current_alignment); + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -3240,6 +4550,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -3338,6 +4650,28 @@ RTPS_DllAPI size_t calculate_serialized_size( const eprosima::fastrtps::types::TypeObject& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + calculate_serialized_size(calculator, data.complete(), current_alignment); + break; + case eprosima::fastrtps::types::EK_MINIMAL: + calculate_serialized_size(calculator, data.minimal(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -3362,6 +4696,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -3404,12 +4740,238 @@ RTPS_DllAPI void deserialize( } } +template<> +RTPS_DllAPI size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data, + size_t& current_alignment) +{ +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.type_identifier(), current_alignment); + calculate_serialized_size(calculator, data.type_object(), current_alignment); + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_identifier(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_object(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 +} + +template<> +RTPS_DllAPI void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) +{ + scdr << data.type_identifier(); + scdr << data.type_object(); +} + +template<> +RTPS_DllAPI void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierTypeObjectPair& data) +{ + dcdr >> data.type_identifier(); + dcdr >> data.type_object(); +} + +template<> +RTPS_DllAPI size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierPair& data, + size_t& current_alignment) +{ +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.type_identifier1(), current_alignment); + calculate_serialized_size(calculator, data.type_identifier2(), current_alignment); + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_identifier1(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.type_identifier2(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 +} + +template<> +RTPS_DllAPI void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierPair& data) +{ + scdr << data.type_identifier1(); + scdr << data.type_identifier2(); +} + +template<> +RTPS_DllAPI void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierPair& data) +{ + dcdr >> data.type_identifier1(); + dcdr >> data.type_identifier2(); +} + +template<> +RTPS_DllAPI size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierWithSize& data, + size_t& current_alignment) +{ +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.type_id(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_id(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.typeobject_serialized_size(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 +} + +template<> +RTPS_DllAPI void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierWithSize& data) +{ + scdr << data.type_id(); + scdr << data.typeobject_serialized_size(); +} + +template<> +RTPS_DllAPI void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierWithSize& data) +{ + dcdr >> data.type_id(); + dcdr >> data.typeobject_serialized_size(); +} + +template<> +RTPS_DllAPI size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data, + size_t& current_alignment) +{ +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.typeid_with_size(), current_alignment); + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + for (size_t a = 0; a < data.dependent_typeids().size(); ++a) + { + calculate_serialized_size(calculator, data.dependent_typeids().at( + a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.typeid_with_size(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.dependent_typeid_count(), current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 2), data.dependent_typeids(), current_alignment); + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 +} + +template<> +RTPS_DllAPI void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) +{ + scdr << data.typeid_with_size(); + scdr << data.dependent_typeid_count(); + scdr << data.dependent_typeids(); +} + +template<> +RTPS_DllAPI void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeIdentifierWithDependencies& data) +{ + dcdr >> data.typeid_with_size(); + dcdr >> data.dependent_typeid_count(); + dcdr >> data.dependent_typeids(); +} + template<> RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastrtps::types::TypeInformation& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + calculate_serialized_size(calculator, data.minimal(), current_alignment); + calculate_serialized_size(calculator, data.complete(), current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -3422,6 +4984,8 @@ RTPS_DllAPI size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> diff --git a/src/cpp/dynamic-types/TypeObjectFactory.cpp b/src/cpp/dynamic-types/TypeObjectFactory.cpp index 3abfcf14d57..9f24d1dc235 100644 --- a/src/cpp/dynamic-types/TypeObjectFactory.cpp +++ b/src/cpp/dynamic-types/TypeObjectFactory.cpp @@ -14,9 +14,8 @@ #include -#include - #include +#include #include #include #include diff --git a/src/cpp/dynamic-types/TypeObjectHashId.cpp b/src/cpp/dynamic-types/TypeObjectHashId.cpp index b0ff5bfb511..1d415c3e6db 100644 --- a/src/cpp/dynamic-types/TypeObjectHashId.cpp +++ b/src/cpp/dynamic-types/TypeObjectHashId.cpp @@ -19,12 +19,11 @@ * This file was generated by the tool gen and modified manually. */ +#include #include -#include -#include +#include "TypeObjectHashIdCdrAux.ipp" -#include using namespace eprosima::fastcdr::exception; #include @@ -211,80 +210,18 @@ EquivalenceHash& TypeObjectHashId::hash() return m_hash; } -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -namespace eprosima { -namespace fastcdr { -template<> -size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastrtps::types::TypeObjectHashId& data, - size_t& current_alignment) +void TypeObjectHashId::serialize( + eprosima::fastcdr::Cdr& scdr) const { - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - calculated_size += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); break; - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - - return calculated_size; -} - -template<> -void serialize( - eprosima::fastcdr::Cdr& scdr, - const eprosima::fastrtps::types::TypeObjectHashId& data) -{ - scdr << data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - scdr << data.hash()[i]; - } - break; - default: - break; - } + eprosima::fastcdr::serialize(scdr, *this); } -template<> -void deserialize( - eprosima::fastcdr::Cdr& dcdr, - eprosima::fastrtps::types::TypeObjectHashId& data) +void TypeObjectHashId::deserialize( + eprosima::fastcdr::Cdr& dcdr) { - dcdr >> data._d(); - - switch (data._d()) - { - case eprosima::fastrtps::types::EK_COMPLETE: - case eprosima::fastrtps::types::EK_MINIMAL: - for (int i = 0; i < 14; ++i) - { - dcdr >> data.hash()[i]; - } - break; - default: - break; - } + eprosima::fastcdr::deserialize(dcdr, *this); } -} // namespace fastcdr +} // namespace types +} // namespace fastrtps } // namespace eprosima diff --git a/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp b/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp new file mode 100644 index 00000000000..1207c7dc943 --- /dev/null +++ b/src/cpp/dynamic-types/TypeObjectHashIdCdrAux.ipp @@ -0,0 +1,115 @@ + +// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +#ifndef DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP +#define DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP + +namespace eprosima { +namespace fastcdr { +template<> +size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const eprosima::fastrtps::types::TypeObjectHashId& data, + size_t& current_alignment) +{ +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + case eprosima::fastrtps::types::EK_MINIMAL: + current_alignment += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data._d(), current_alignment); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + case eprosima::fastrtps::types::EK_MINIMAL: + calculated_size += ((14) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); break; + default: + break; + } + + calculated_size += calculator.end_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 +} + +template<> +void serialize( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastrtps::types::TypeObjectHashId& data) +{ + scdr << data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + case eprosima::fastrtps::types::EK_MINIMAL: + for (int i = 0; i < 14; ++i) + { + scdr << data.hash()[i]; + } + break; + default: + break; + } +} + +template<> +void deserialize( + eprosima::fastcdr::Cdr& dcdr, + eprosima::fastrtps::types::TypeObjectHashId& data) +{ + dcdr >> data._d(); + + switch (data._d()) + { + case eprosima::fastrtps::types::EK_COMPLETE: + case eprosima::fastrtps::types::EK_MINIMAL: + for (int i = 0; i < 14; ++i) + { + dcdr >> data.hash()[i]; + } + break; + default: + break; + } +} + +} // namespace fastcdr +} // namespace eprosima + +#endif // DYNAMIC_TYPES_TYPEOBJECTHASHIDCDRAUX_IPP diff --git a/src/cpp/dynamic-types/TypesBase.cpp b/src/cpp/dynamic-types/TypesBase.cpp index da44e844d5b..c88f3f1afdc 100644 --- a/src/cpp/dynamic-types/TypesBase.cpp +++ b/src/cpp/dynamic-types/TypesBase.cpp @@ -16,8 +16,7 @@ * @file TypesBase.cpp */ -#include -#include +#include #include namespace eprosima { @@ -38,7 +37,12 @@ void serialize( eprosima::fastcdr::Cdr& cdr, const eprosima::fastrtps::types::MemberFlag& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitset().to_ulong()); + cdr << bits; +#else cdr << data.bitset(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -46,9 +50,15 @@ void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastrtps::types::MemberFlag& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + cdr >> bits; + data.bitset(std::bitset<16>(bits)); +#else std::bitset<16> bitset; cdr >> bitset; data.bitset(bitset); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -67,7 +77,12 @@ void serialize( eprosima::fastcdr::Cdr& cdr, const eprosima::fastrtps::types::TypeFlag& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits = static_cast(data.bitset().to_ulong()); + cdr << bits; +#else cdr << data.bitset(); +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -75,9 +90,15 @@ void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastrtps::types::TypeFlag& data) { +#if FASTCDR_VERSION_MAJOR == 1 + uint16_t bits; + cdr >> bits; + data.bitset(std::bitset<16>(bits)); +#else std::bitset<16> bitset; cdr >> bitset; data.bitset(bitset); +#endif // FASTCDR_VERSION_MAJOR == 1 } } // namespace fastcdr diff --git a/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp b/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp index 704d877245e..5cdca291d7d 100644 --- a/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp +++ b/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp @@ -17,11 +17,9 @@ * */ -#include -#include - #include #include +#include #include "RPCHeadersImplCdrAux.ipp" diff --git a/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp b/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp index e3fcd3809c8..b6729395808 100644 --- a/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp +++ b/src/cpp/fastdds/builtin/common/RPCHeadersImplCdrAux.ipp @@ -23,6 +23,19 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::rpc::ReplyHeader&, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); // RemoteException + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -34,6 +47,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -72,7 +87,13 @@ void deserialize( dcdr >> data.relatedRequestId.sequence_number().high; dcdr >> data.relatedRequestId.sequence_number().low; +#if FASTCDR_VERSION_MAJOR == 1 + uint32_t aux; + dcdr >> aux; + data.remoteEx = static_cast(aux); +#else dcdr >> data.remoteEx; +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -81,6 +102,19 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::rpc::RequestHeader& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + static_cast(calculator); + size_t initial_alignment = current_alignment; + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); // SampleIdentity.GUID_t + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // SampleIdentity.SequenceNumber_t + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.instanceName.size() + 1; + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -93,6 +127,8 @@ size_t calculate_serialized_size( return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -111,7 +147,11 @@ void serialize( scdr << data.requestId.sequence_number().high; scdr << data.requestId.sequence_number().low; +#if FASTCDR_VERSION_MAJOR == 1 scdr << data.instanceName.to_string(); +#else + scdr << data.instanceName; +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -130,7 +170,13 @@ void deserialize( dcdr >> data.requestId.sequence_number().high; dcdr >> data.requestId.sequence_number().low; +#if FASTCDR_VERSION_MAJOR == 1 + std::string aux; + dcdr >> aux; + data.instanceName = aux; +#else dcdr >> data.instanceName; +#endif // FASTCDR_VERSION_MAJOR == 1 } } // namespace fastcdr diff --git a/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp index 9b69f10f57c..8ae2c618c54 100644 --- a/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp +++ b/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp @@ -19,11 +19,11 @@ #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp index 658b2bef365..7876c5f1a4c 100644 --- a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp +++ b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp @@ -17,11 +17,8 @@ * */ -#include -#include -#include - #include +#include #include using namespace eprosima; @@ -1072,7 +1069,12 @@ bool TypeLookup_RequestTypeSupport::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length +#else payload->length = static_cast(ser.get_serialized_data_length()); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + // return true; } @@ -1083,7 +1085,11 @@ bool TypeLookup_RequestTypeSupport::deserialize( TypeLookup_Request* p_type = static_cast(data); //Convert DATA to pointer of your type //eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->max_size); - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { @@ -1167,7 +1173,12 @@ bool TypeLookup_ReplyTypeSupport::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); //Get the serialized length +#else payload->length = static_cast(ser.get_serialized_data_length()); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -1177,7 +1188,11 @@ bool TypeLookup_ReplyTypeSupport::deserialize( { TypeLookup_Reply* p_type = static_cast(data); //Convert DATA to pointer of your type eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { diff --git a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp index b00c5ac86d4..b5d7ef0c66b 100644 --- a/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp +++ b/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypesCdrAux.ipp @@ -17,143 +17,210 @@ namespace eprosima { namespace fastcdr { + template<> size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data, size_t& current_alignment) { - size_t calculated_size {calculator.begin_calculate_type_serialized_size( - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; +#if FASTCDR_VERSION_MAJOR == 1 - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data._d(), current_alignment); + size_t initial_alignment = current_alignment; - switch (data._d()) + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for (size_t a = 0; a < data.type_ids.size(); ++a) { - case 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.result(), current_alignment); - break; - default: - break; + current_alignment += calculate_serialized_size(calculator, data.type_ids.at(a), current_alignment); } + return current_alignment - initial_alignment; + +#else + + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 0), data.type_ids, current_alignment); + calculated_size += calculator.end_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> void serialize( eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) { - scdr << data._d(); - switch (data._d()) - { - case 0: - scdr << data.result(); - break; - default: - break; - } + scdr << data.type_ids; } template<> void deserialize( eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) { - dcdr >> data._d(); - switch (data._d()) - { - case 0: - dcdr >> data.result(); - break; - default: - break; - } + dcdr >> data.type_ids; } template<> size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for (size_t a = 0; a < data.types.size(); ++a) + { + current_alignment += calculate_serialized_size(calculator, data.types.at(a), current_alignment); + } + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for (size_t a = 0; a < data.complete_to_minimal.size(); ++a) + { + current_alignment += + calculate_serialized_size(calculator, data.complete_to_minimal.at(a), current_alignment); + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.type_ids, current_alignment); + 0), data.types, current_alignment); + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.complete_to_minimal, current_alignment); calculated_size += calculator.end_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); + return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> void serialize( eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) { - scdr << data.type_ids; + scdr << data.types; + scdr << data.complete_to_minimal; } template<> void deserialize( eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In& data) + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) { - dcdr >> data.type_ids; + dcdr >> data.types; + dcdr >> data.complete_to_minimal; } template<> size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data, + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + switch (data._d()) + { + case 0: + current_alignment += calculate_serialized_size(calculator, data.result(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 0), data.types, current_alignment); - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( - 1), data.complete_to_minimal, current_alignment); + 0), data._d(), current_alignment); + + switch (data._d()) + { + case 0: + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId( + 1), data.result(), current_alignment); + break; + default: + break; + } calculated_size += calculator.end_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); - return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> void serialize( eprosima::fastcdr::Cdr& scdr, - const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) + const eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) { + scdr << data._d(); - scdr << data.types; - scdr << data.complete_to_minimal; + switch (data._d()) + { + case 0: + scdr << data.result(); + break; + default: + break; + } } template<> void deserialize( eprosima::fastcdr::Cdr& dcdr, - eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out& data) + eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result& data) { + dcdr >> data._d(); - dcdr >> data.types; - dcdr >> data.complete_to_minimal; + switch (data._d()) + { + case 0: + dcdr >> data.result(); + break; + default: + break; + } } template<> @@ -162,6 +229,25 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for (size_t a = 0; a < data.type_ids.size(); ++a) + { + current_alignment += calculate_serialized_size(calculator, data.type_ids.at(a), current_alignment); + } + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (data.continuation_point.size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -174,6 +260,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -202,6 +290,26 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for (size_t a = 0; a < data.dependent_typeids.size(); ++a) + { + current_alignment += calculate_serialized_size(calculator, data.dependent_typeids.at( + a), current_alignment); + } + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (data.continuation_point.size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -214,6 +322,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -242,6 +352,25 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + switch (data._d()) + { + case 0 /* TODO DDS_RETCODE_OK */: + current_alignment += calculate_serialized_size(calculator, data.result(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -262,6 +391,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -304,6 +435,28 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_Call& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + switch (data._d()) + { + case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: + current_alignment += calculate_serialized_size(calculator, data.getTypes(), current_alignment); + break; + case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: + current_alignment += calculate_serialized_size(calculator, data.getTypeDependencies(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -328,6 +481,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -376,6 +531,17 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_Request& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header, current_alignment); + current_alignment += calculate_serialized_size(calculator, data.data, current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -388,6 +554,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -416,6 +584,28 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_Return& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + switch (data._d()) + { + case eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Hash: + current_alignment += calculate_serialized_size(calculator, data.getType(), current_alignment); + break; + case eprosima::fastdds::dds::builtin::TypeLookup_getDependencies_Hash: + current_alignment += calculate_serialized_size(calculator, data.getTypeDependencies(), current_alignment); + break; + default: + break; + } + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -440,6 +630,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> @@ -488,6 +680,17 @@ size_t calculate_serialized_size( const eprosima::fastdds::dds::builtin::TypeLookup_Reply& data, size_t& current_alignment) { +#if FASTCDR_VERSION_MAJOR == 1 + + size_t initial_alignment = current_alignment; + + current_alignment += calculate_serialized_size(calculator, data.header, current_alignment); + current_alignment += calculate_serialized_size(calculator, data.return_value, current_alignment); + + return current_alignment - initial_alignment; + +#else + size_t calculated_size {calculator.begin_calculate_type_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment)}; @@ -500,6 +703,8 @@ size_t calculate_serialized_size( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2, current_alignment); return calculated_size; + +#endif // FASTCDR_VERSION_MAJOR == 1 } template<> diff --git a/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp b/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp index 79f9bc7dba5..dd48cbb4d75 100644 --- a/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp +++ b/src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp @@ -20,10 +20,8 @@ #ifndef FASTDDS_CORE_PLICY__QOSPOLICIESSERIALIZER_HPP_ #define FASTDDS_CORE_PLICY__QOSPOLICIESSERIALIZER_HPP_ -#include -#include - #include +#include #include "ParameterSerializer.hpp" namespace eprosima { @@ -908,8 +906,13 @@ inline bool QosPoliciesSerializer::add_to_cdr_message( ser.serialize_encapsulation(); ser << qos_policy.m_type_identifier; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + size = (ser.getSerializedDataLength() + 3) & ~3; +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length size = (ser.get_serialized_data_length() + 3) & ~3; +#endif // FASTCDR_VERSION_MAJOR == 1 bool valid = fastrtps::rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid); valid &= fastrtps::rtps::CDRMessage::addUInt16(cdr_message, static_cast(size)); @@ -934,7 +937,11 @@ inline bool QosPoliciesSerializer::read_content_from_cdr_message( fastrtps::rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { @@ -981,8 +988,13 @@ inline bool QosPoliciesSerializer::add_to_cdr_message( ser.serialize_encapsulation(); ser << qos_policy.m_type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + size = (ser.getSerializedDataLength() + 3) & ~3; +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length size = (ser.get_serialized_data_length() + 3) & ~3; +#endif // FASTCDR_VERSION_MAJOR == 1 bool valid = fastrtps::rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid); valid &= fastrtps::rtps::CDRMessage::addUInt16(cdr_message, static_cast(size)); @@ -1007,7 +1019,11 @@ inline bool QosPoliciesSerializer::read_content_from_cdr_message( fastrtps::rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { @@ -1055,8 +1071,13 @@ inline bool QosPoliciesSerializer::add_to_cdr_message( ser.serialize_encapsulation(); ser << qos_policy.type_information; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + size = (ser.getSerializedDataLength() + 3) & ~3; +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length size = (ser.get_serialized_data_length() + 3) & ~3; +#endif // FASTCDR_VERSION_MAJOR == 1 bool valid = fastrtps::rtps::CDRMessage::addUInt16(cdr_message, qos_policy.Pid); valid &= fastrtps::rtps::CDRMessage::addUInt16(cdr_message, static_cast(size)); @@ -1081,7 +1102,11 @@ inline bool QosPoliciesSerializer::read_content_from_cd fastrtps::rtps::CDRMessage::readData(cdr_message, payload.data, parameter_length); // Object that manages the raw buffer. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); try { diff --git a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp index af52f002b94..a2f083468d0 100644 --- a/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp +++ b/src/cpp/fastdds/topic/DDSSQLFilter/DDSFilterExpression.cpp @@ -57,7 +57,12 @@ bool DDSFilterExpression::evaluate( try { FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - Cdr deser(fastbuffer); + Cdr deser(fastbuffer +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); deser.read_encapsulation(); dyn_data_->deserialize(deser); } diff --git a/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp b/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp index 5ce30c116a9..99a0a408f2a 100644 --- a/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp +++ b/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp @@ -26,13 +26,11 @@ char dummy; } // namespace #endif // ifdef _WIN32 + +#include #include #include -#include -#include - -#include using namespace eprosima::fastcdr::exception; #include @@ -169,7 +167,12 @@ bool ConnectionRequest_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -256,7 +259,12 @@ bool OpenLogicalPortRequest_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -344,7 +352,12 @@ bool CheckLogicalPortsRequest_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -431,7 +444,12 @@ bool KeepAliveRequest_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -518,7 +536,12 @@ bool LogicalPortIsClosedRequest_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -605,7 +628,12 @@ bool BindConnectionResponse_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } @@ -693,7 +721,12 @@ bool CheckLogicalPortsResponse_t::serialize( return false; } +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload->length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 + return true; } diff --git a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp index f06d16753b2..8d7bb092f0c 100644 --- a/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp +++ b/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -37,6 +38,15 @@ #undef max #endif // ifdef WIN32 +#if FASTCDR_VERSION_MAJOR == 1 +#define change_endianness changeEndianness +#define get_serialized_data_length getSerializedDataLength +#define get_state getState +#define get_current_position getCurrentPosition +#define get_buffer_pointer getBufferPointer +#define set_state setState +#endif // FASTCDR_VERSION_MAJOR == 1 + using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps::rtps::security; diff --git a/src/cpp/statistics/types/types.cxx b/src/cpp/statistics/types/types.cxx index bf6b1c9ee78..9dcb86ef67b 100644 --- a/src/cpp/statistics/types/types.cxx +++ b/src/cpp/statistics/types/types.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "types.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,52 +39,59 @@ using namespace eprosima::fastcdr::exception; #include -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s() -{ +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + + +EntityId_s::EntityId_s() +{ } -eprosima::fastdds::statistics::detail::EntityId_s::~EntityId_s() +EntityId_s::~EntityId_s() { } -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( +EntityId_s::EntityId_s( const EntityId_s& x) { m_value = x.m_value; } -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( +EntityId_s::EntityId_s( EntityId_s&& x) noexcept { m_value = std::move(x.m_value); } -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::EntityId_s::operator =( +EntityId_s& EntityId_s::operator =( const EntityId_s& x) { m_value = x.m_value; - return *this; } -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::EntityId_s::operator =( +EntityId_s& EntityId_s::operator =( EntityId_s&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool eprosima::fastdds::statistics::detail::EntityId_s::operator ==( +bool EntityId_s::operator ==( const EntityId_s& x) const { return (m_value == x.m_value); } -bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( +bool EntityId_s::operator !=( const EntityId_s& x) const { return !(*this == x); @@ -91,7 +101,7 @@ bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void eprosima::fastdds::statistics::detail::EntityId_s::value( +void EntityId_s::value( const std::array& _value) { m_value = _value; @@ -101,7 +111,7 @@ void eprosima::fastdds::statistics::detail::EntityId_s::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void eprosima::fastdds::statistics::detail::EntityId_s::value( +void EntityId_s::value( std::array&& _value) { m_value = std::move(_value); @@ -111,7 +121,7 @@ void eprosima::fastdds::statistics::detail::EntityId_s::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::array& eprosima::fastdds::statistics::detail::EntityId_s::value() const +const std::array& EntityId_s::value() const { return m_value; } @@ -120,58 +130,57 @@ const std::array& eprosima::fastdds::statistics::detail::EntityId_s: * @brief This function returns a reference to member value * @return Reference to member value */ -std::array& eprosima::fastdds::statistics::detail::EntityId_s::value() +std::array& EntityId_s::value() { return m_value; } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s() -{ + +GuidPrefix_s::GuidPrefix_s() +{ } -eprosima::fastdds::statistics::detail::GuidPrefix_s::~GuidPrefix_s() +GuidPrefix_s::~GuidPrefix_s() { } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( +GuidPrefix_s::GuidPrefix_s( const GuidPrefix_s& x) { m_value = x.m_value; } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( +GuidPrefix_s::GuidPrefix_s( GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); } -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GuidPrefix_s::operator =( +GuidPrefix_s& GuidPrefix_s::operator =( const GuidPrefix_s& x) { m_value = x.m_value; - return *this; } -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GuidPrefix_s::operator =( +GuidPrefix_s& GuidPrefix_s::operator =( GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator ==( +bool GuidPrefix_s::operator ==( const GuidPrefix_s& x) const { return (m_value == x.m_value); } -bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( +bool GuidPrefix_s::operator !=( const GuidPrefix_s& x) const { return !(*this == x); @@ -181,7 +190,7 @@ bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( +void GuidPrefix_s::value( const std::array& _value) { m_value = _value; @@ -191,7 +200,7 @@ void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( +void GuidPrefix_s::value( std::array&& _value) { m_value = std::move(_value); @@ -201,7 +210,7 @@ void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::value() const +const std::array& GuidPrefix_s::value() const { return m_value; } @@ -210,63 +219,62 @@ const std::array& eprosima::fastdds::statistics::detail::GuidPrefix * @brief This function returns a reference to member value * @return Reference to member value */ -std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::value() +std::array& GuidPrefix_s::value() { return m_value; } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s() -{ + +GUID_s::GUID_s() +{ } -eprosima::fastdds::statistics::detail::GUID_s::~GUID_s() +GUID_s::~GUID_s() { } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s( +GUID_s::GUID_s( const GUID_s& x) { m_guidPrefix = x.m_guidPrefix; m_entityId = x.m_entityId; } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s( +GUID_s::GUID_s( GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); } -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::GUID_s::operator =( +GUID_s& GUID_s::operator =( const GUID_s& x) { m_guidPrefix = x.m_guidPrefix; m_entityId = x.m_entityId; - return *this; } -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::GUID_s::operator =( +GUID_s& GUID_s::operator =( GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); - return *this; } -bool eprosima::fastdds::statistics::detail::GUID_s::operator ==( +bool GUID_s::operator ==( const GUID_s& x) const { return (m_guidPrefix == x.m_guidPrefix && m_entityId == x.m_entityId); } -bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( +bool GUID_s::operator !=( const GUID_s& x) const { return !(*this == x); @@ -276,7 +284,7 @@ bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( * @brief This function copies the value in member guidPrefix * @param _guidPrefix New value to be copied in member guidPrefix */ -void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( +void GUID_s::guidPrefix( const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) { m_guidPrefix = _guidPrefix; @@ -286,7 +294,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( * @brief This function moves the value in member guidPrefix * @param _guidPrefix New value to be moved in member guidPrefix */ -void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( +void GUID_s::guidPrefix( eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) { m_guidPrefix = std::move(_guidPrefix); @@ -296,7 +304,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( * @brief This function returns a constant reference to member guidPrefix * @return Constant reference to member guidPrefix */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GUID_s::guidPrefix() const +const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const { return m_guidPrefix; } @@ -305,7 +313,7 @@ const eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::st * @brief This function returns a reference to member guidPrefix * @return Reference to member guidPrefix */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GUID_s::guidPrefix() +eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() { return m_guidPrefix; } @@ -315,7 +323,7 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statisti * @brief This function copies the value in member entityId * @param _entityId New value to be copied in member entityId */ -void eprosima::fastdds::statistics::detail::GUID_s::entityId( +void GUID_s::entityId( const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) { m_entityId = _entityId; @@ -325,7 +333,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::entityId( * @brief This function moves the value in member entityId * @param _entityId New value to be moved in member entityId */ -void eprosima::fastdds::statistics::detail::GUID_s::entityId( +void GUID_s::entityId( eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) { m_entityId = std::move(_entityId); @@ -335,7 +343,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::entityId( * @brief This function returns a constant reference to member entityId * @return Constant reference to member entityId */ -const eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::GUID_s::entityId() const +const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const { return m_entityId; } @@ -344,63 +352,62 @@ const eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::stat * @brief This function returns a reference to member entityId * @return Reference to member entityId */ -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::GUID_s::entityId() +eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() { return m_entityId; } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s() -{ + +SequenceNumber_s::SequenceNumber_s() +{ } -eprosima::fastdds::statistics::detail::SequenceNumber_s::~SequenceNumber_s() +SequenceNumber_s::~SequenceNumber_s() { } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( +SequenceNumber_s::SequenceNumber_s( const SequenceNumber_s& x) { m_high = x.m_high; m_low = x.m_low; } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( +SequenceNumber_s::SequenceNumber_s( SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; } -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SequenceNumber_s::operator =( +SequenceNumber_s& SequenceNumber_s::operator =( const SequenceNumber_s& x) { m_high = x.m_high; m_low = x.m_low; - return *this; } -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SequenceNumber_s::operator =( +SequenceNumber_s& SequenceNumber_s::operator =( SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; - return *this; } -bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator ==( +bool SequenceNumber_s::operator ==( const SequenceNumber_s& x) const { return (m_high == x.m_high && m_low == x.m_low); } -bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( +bool SequenceNumber_s::operator !=( const SequenceNumber_s& x) const { return !(*this == x); @@ -410,7 +417,7 @@ bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( * @brief This function sets a value in member high * @param _high New value for member high */ -void eprosima::fastdds::statistics::detail::SequenceNumber_s::high( +void SequenceNumber_s::high( int32_t _high) { m_high = _high; @@ -420,7 +427,7 @@ void eprosima::fastdds::statistics::detail::SequenceNumber_s::high( * @brief This function returns the value of member high * @return Value of member high */ -int32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::high() const +int32_t SequenceNumber_s::high() const { return m_high; } @@ -429,7 +436,7 @@ int32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::high() const * @brief This function returns a reference to member high * @return Reference to member high */ -int32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::high() +int32_t& SequenceNumber_s::high() { return m_high; } @@ -439,7 +446,7 @@ int32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::high() * @brief This function sets a value in member low * @param _low New value for member low */ -void eprosima::fastdds::statistics::detail::SequenceNumber_s::low( +void SequenceNumber_s::low( uint32_t _low) { m_low = _low; @@ -449,7 +456,7 @@ void eprosima::fastdds::statistics::detail::SequenceNumber_s::low( * @brief This function returns the value of member low * @return Value of member low */ -uint32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::low() const +uint32_t SequenceNumber_s::low() const { return m_low; } @@ -458,63 +465,62 @@ uint32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::low() const * @brief This function returns a reference to member low * @return Reference to member low */ -uint32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::low() +uint32_t& SequenceNumber_s::low() { return m_low; } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s() -{ + +SampleIdentity_s::SampleIdentity_s() +{ } -eprosima::fastdds::statistics::detail::SampleIdentity_s::~SampleIdentity_s() +SampleIdentity_s::~SampleIdentity_s() { } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( +SampleIdentity_s::SampleIdentity_s( const SampleIdentity_s& x) { m_writer_guid = x.m_writer_guid; m_sequence_number = x.m_sequence_number; } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( +SampleIdentity_s::SampleIdentity_s( SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); } -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::operator =( +SampleIdentity_s& SampleIdentity_s::operator =( const SampleIdentity_s& x) { m_writer_guid = x.m_writer_guid; m_sequence_number = x.m_sequence_number; - return *this; } -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::operator =( +SampleIdentity_s& SampleIdentity_s::operator =( SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); - return *this; } -bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator ==( +bool SampleIdentity_s::operator ==( const SampleIdentity_s& x) const { return (m_writer_guid == x.m_writer_guid && m_sequence_number == x.m_sequence_number); } -bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( +bool SampleIdentity_s::operator !=( const SampleIdentity_s& x) const { return !(*this == x); @@ -524,7 +530,7 @@ bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( +void SampleIdentity_s::writer_guid( const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) { m_writer_guid = _writer_guid; @@ -534,7 +540,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( * @brief This function moves the value in member writer_guid * @param _writer_guid New value to be moved in member writer_guid */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( +void SampleIdentity_s::writer_guid( eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) { m_writer_guid = std::move(_writer_guid); @@ -544,7 +550,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( * @brief This function returns a constant reference to member writer_guid * @return Constant reference to member writer_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const { return m_writer_guid; } @@ -553,7 +559,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member writer_guid * @return Reference to member writer_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid() +eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() { return m_writer_guid; } @@ -563,7 +569,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::de * @brief This function copies the value in member sequence_number * @param _sequence_number New value to be copied in member sequence_number */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( +void SampleIdentity_s::sequence_number( const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) { m_sequence_number = _sequence_number; @@ -573,7 +579,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( * @brief This function moves the value in member sequence_number * @param _sequence_number New value to be moved in member sequence_number */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( +void SampleIdentity_s::sequence_number( eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) { m_sequence_number = std::move(_sequence_number); @@ -583,7 +589,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( * @brief This function returns a constant reference to member sequence_number * @return Constant reference to member sequence_number */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number() const +const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const { return m_sequence_number; } @@ -592,22 +598,23 @@ const eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds * @brief This function returns a reference to member sequence_number * @return Reference to member sequence_number */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number() +eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() { return m_sequence_number; } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s() -{ + +Locator_s::Locator_s() +{ } -eprosima::fastdds::statistics::detail::Locator_s::~Locator_s() +Locator_s::~Locator_s() { } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s( +Locator_s::Locator_s( const Locator_s& x) { m_kind = x.m_kind; @@ -615,7 +622,7 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( m_address = x.m_address; } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s( +Locator_s::Locator_s( Locator_s&& x) noexcept { m_kind = x.m_kind; @@ -623,29 +630,27 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( m_address = std::move(x.m_address); } -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::detail::Locator_s::operator =( +Locator_s& Locator_s::operator =( const Locator_s& x) { m_kind = x.m_kind; m_port = x.m_port; m_address = x.m_address; - return *this; } -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::detail::Locator_s::operator =( +Locator_s& Locator_s::operator =( Locator_s&& x) noexcept { m_kind = x.m_kind; m_port = x.m_port; m_address = std::move(x.m_address); - return *this; } -bool eprosima::fastdds::statistics::detail::Locator_s::operator ==( +bool Locator_s::operator ==( const Locator_s& x) const { return (m_kind == x.m_kind && @@ -653,7 +658,7 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator ==( m_address == x.m_address); } -bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( +bool Locator_s::operator !=( const Locator_s& x) const { return !(*this == x); @@ -663,7 +668,7 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( * @brief This function sets a value in member kind * @param _kind New value for member kind */ -void eprosima::fastdds::statistics::detail::Locator_s::kind( +void Locator_s::kind( int32_t _kind) { m_kind = _kind; @@ -673,7 +678,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::kind( * @brief This function returns the value of member kind * @return Value of member kind */ -int32_t eprosima::fastdds::statistics::detail::Locator_s::kind() const +int32_t Locator_s::kind() const { return m_kind; } @@ -682,7 +687,7 @@ int32_t eprosima::fastdds::statistics::detail::Locator_s::kind() const * @brief This function returns a reference to member kind * @return Reference to member kind */ -int32_t& eprosima::fastdds::statistics::detail::Locator_s::kind() +int32_t& Locator_s::kind() { return m_kind; } @@ -692,7 +697,7 @@ int32_t& eprosima::fastdds::statistics::detail::Locator_s::kind() * @brief This function sets a value in member port * @param _port New value for member port */ -void eprosima::fastdds::statistics::detail::Locator_s::port( +void Locator_s::port( uint32_t _port) { m_port = _port; @@ -702,7 +707,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::port( * @brief This function returns the value of member port * @return Value of member port */ -uint32_t eprosima::fastdds::statistics::detail::Locator_s::port() const +uint32_t Locator_s::port() const { return m_port; } @@ -711,7 +716,7 @@ uint32_t eprosima::fastdds::statistics::detail::Locator_s::port() const * @brief This function returns a reference to member port * @return Reference to member port */ -uint32_t& eprosima::fastdds::statistics::detail::Locator_s::port() +uint32_t& Locator_s::port() { return m_port; } @@ -721,7 +726,7 @@ uint32_t& eprosima::fastdds::statistics::detail::Locator_s::port() * @brief This function copies the value in member address * @param _address New value to be copied in member address */ -void eprosima::fastdds::statistics::detail::Locator_s::address( +void Locator_s::address( const std::array& _address) { m_address = _address; @@ -731,7 +736,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::address( * @brief This function moves the value in member address * @param _address New value to be moved in member address */ -void eprosima::fastdds::statistics::detail::Locator_s::address( +void Locator_s::address( std::array&& _address) { m_address = std::move(_address); @@ -741,7 +746,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::address( * @brief This function returns a constant reference to member address * @return Constant reference to member address */ -const std::array& eprosima::fastdds::statistics::detail::Locator_s::address() const +const std::array& Locator_s::address() const { return m_address; } @@ -750,23 +755,26 @@ const std::array& eprosima::fastdds::statistics::detail::Locator_s: * @brief This function returns a reference to member address * @return Reference to member address */ -std::array& eprosima::fastdds::statistics::detail::Locator_s::address() +std::array& Locator_s::address() { return m_address; } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime() -{ +} // namespace detail + + +DiscoveryTime::DiscoveryTime() +{ } -eprosima::fastdds::statistics::DiscoveryTime::~DiscoveryTime() +DiscoveryTime::~DiscoveryTime() { } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( +DiscoveryTime::DiscoveryTime( const DiscoveryTime& x) { m_local_participant_guid = x.m_local_participant_guid; @@ -777,7 +785,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( m_process = x.m_process; } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( +DiscoveryTime::DiscoveryTime( DiscoveryTime&& x) noexcept { m_local_participant_guid = std::move(x.m_local_participant_guid); @@ -788,7 +796,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( m_process = std::move(x.m_process); } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::DiscoveryTime::operator =( +DiscoveryTime& DiscoveryTime::operator =( const DiscoveryTime& x) { @@ -798,11 +806,10 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dis m_host = x.m_host; m_user = x.m_user; m_process = x.m_process; - return *this; } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::DiscoveryTime::operator =( +DiscoveryTime& DiscoveryTime::operator =( DiscoveryTime&& x) noexcept { @@ -812,11 +819,10 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dis m_host = std::move(x.m_host); m_user = std::move(x.m_user); m_process = std::move(x.m_process); - return *this; } -bool eprosima::fastdds::statistics::DiscoveryTime::operator ==( +bool DiscoveryTime::operator ==( const DiscoveryTime& x) const { return (m_local_participant_guid == x.m_local_participant_guid && @@ -827,7 +833,7 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator ==( m_process == x.m_process); } -bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( +bool DiscoveryTime::operator !=( const DiscoveryTime& x) const { return !(*this == x); @@ -837,7 +843,7 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( * @brief This function copies the value in member local_participant_guid * @param _local_participant_guid New value to be copied in member local_participant_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( +void DiscoveryTime::local_participant_guid( const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) { m_local_participant_guid = _local_participant_guid; @@ -847,7 +853,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( * @brief This function moves the value in member local_participant_guid * @param _local_participant_guid New value to be moved in member local_participant_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( +void DiscoveryTime::local_participant_guid( eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) { m_local_participant_guid = std::move(_local_participant_guid); @@ -857,7 +863,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( * @brief This function returns a constant reference to member local_participant_guid * @return Constant reference to member local_participant_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const { return m_local_participant_guid; } @@ -866,7 +872,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member local_participant_guid * @return Reference to member local_participant_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid() +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() { return m_local_participant_guid; } @@ -876,7 +882,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di * @brief This function copies the value in member remote_entity_guid * @param _remote_entity_guid New value to be copied in member remote_entity_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( +void DiscoveryTime::remote_entity_guid( const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) { m_remote_entity_guid = _remote_entity_guid; @@ -886,7 +892,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( * @brief This function moves the value in member remote_entity_guid * @param _remote_entity_guid New value to be moved in member remote_entity_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( +void DiscoveryTime::remote_entity_guid( eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) { m_remote_entity_guid = std::move(_remote_entity_guid); @@ -896,7 +902,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( * @brief This function returns a constant reference to member remote_entity_guid * @return Constant reference to member remote_entity_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const { return m_remote_entity_guid; } @@ -905,7 +911,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member remote_entity_guid * @return Reference to member remote_entity_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid() +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() { return m_remote_entity_guid; } @@ -915,7 +921,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di * @brief This function sets a value in member time * @param _time New value for member time */ -void eprosima::fastdds::statistics::DiscoveryTime::time( +void DiscoveryTime::time( uint64_t _time) { m_time = _time; @@ -925,7 +931,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::time( * @brief This function returns the value of member time * @return Value of member time */ -uint64_t eprosima::fastdds::statistics::DiscoveryTime::time() const +uint64_t DiscoveryTime::time() const { return m_time; } @@ -934,7 +940,7 @@ uint64_t eprosima::fastdds::statistics::DiscoveryTime::time() const * @brief This function returns a reference to member time * @return Reference to member time */ -uint64_t& eprosima::fastdds::statistics::DiscoveryTime::time() +uint64_t& DiscoveryTime::time() { return m_time; } @@ -944,7 +950,7 @@ uint64_t& eprosima::fastdds::statistics::DiscoveryTime::time() * @brief This function copies the value in member host * @param _host New value to be copied in member host */ -void eprosima::fastdds::statistics::DiscoveryTime::host( +void DiscoveryTime::host( const std::string& _host) { m_host = _host; @@ -954,7 +960,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::host( * @brief This function moves the value in member host * @param _host New value to be moved in member host */ -void eprosima::fastdds::statistics::DiscoveryTime::host( +void DiscoveryTime::host( std::string&& _host) { m_host = std::move(_host); @@ -964,7 +970,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::host( * @brief This function returns a constant reference to member host * @return Constant reference to member host */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::host() const +const std::string& DiscoveryTime::host() const { return m_host; } @@ -973,7 +979,7 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::host() const * @brief This function returns a reference to member host * @return Reference to member host */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::host() +std::string& DiscoveryTime::host() { return m_host; } @@ -983,7 +989,7 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::host() * @brief This function copies the value in member user * @param _user New value to be copied in member user */ -void eprosima::fastdds::statistics::DiscoveryTime::user( +void DiscoveryTime::user( const std::string& _user) { m_user = _user; @@ -993,7 +999,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::user( * @brief This function moves the value in member user * @param _user New value to be moved in member user */ -void eprosima::fastdds::statistics::DiscoveryTime::user( +void DiscoveryTime::user( std::string&& _user) { m_user = std::move(_user); @@ -1003,7 +1009,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::user( * @brief This function returns a constant reference to member user * @return Constant reference to member user */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::user() const +const std::string& DiscoveryTime::user() const { return m_user; } @@ -1012,7 +1018,7 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::user() const * @brief This function returns a reference to member user * @return Reference to member user */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::user() +std::string& DiscoveryTime::user() { return m_user; } @@ -1022,7 +1028,7 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::user() * @brief This function copies the value in member process * @param _process New value to be copied in member process */ -void eprosima::fastdds::statistics::DiscoveryTime::process( +void DiscoveryTime::process( const std::string& _process) { m_process = _process; @@ -1032,7 +1038,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::process( * @brief This function moves the value in member process * @param _process New value to be moved in member process */ -void eprosima::fastdds::statistics::DiscoveryTime::process( +void DiscoveryTime::process( std::string&& _process) { m_process = std::move(_process); @@ -1042,7 +1048,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::process( * @brief This function returns a constant reference to member process * @return Constant reference to member process */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::process() const +const std::string& DiscoveryTime::process() const { return m_process; } @@ -1051,63 +1057,62 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::process() const * @brief This function returns a reference to member process * @return Reference to member process */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::process() +std::string& DiscoveryTime::process() { return m_process; } -eprosima::fastdds::statistics::EntityCount::EntityCount() -{ + +EntityCount::EntityCount() +{ } -eprosima::fastdds::statistics::EntityCount::~EntityCount() +EntityCount::~EntityCount() { } -eprosima::fastdds::statistics::EntityCount::EntityCount( +EntityCount::EntityCount( const EntityCount& x) { m_guid = x.m_guid; m_count = x.m_count; } -eprosima::fastdds::statistics::EntityCount::EntityCount( +EntityCount::EntityCount( EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::EntityCount::operator =( +EntityCount& EntityCount::operator =( const EntityCount& x) { m_guid = x.m_guid; m_count = x.m_count; - return *this; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::EntityCount::operator =( +EntityCount& EntityCount::operator =( EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; - return *this; } -bool eprosima::fastdds::statistics::EntityCount::operator ==( +bool EntityCount::operator ==( const EntityCount& x) const { return (m_guid == x.m_guid && m_count == x.m_count); } -bool eprosima::fastdds::statistics::EntityCount::operator !=( +bool EntityCount::operator !=( const EntityCount& x) const { return !(*this == x); @@ -1117,7 +1122,7 @@ bool eprosima::fastdds::statistics::EntityCount::operator !=( * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid */ -void eprosima::fastdds::statistics::EntityCount::guid( +void EntityCount::guid( const eprosima::fastdds::statistics::detail::GUID_s& _guid) { m_guid = _guid; @@ -1127,7 +1132,7 @@ void eprosima::fastdds::statistics::EntityCount::guid( * @brief This function moves the value in member guid * @param _guid New value to be moved in member guid */ -void eprosima::fastdds::statistics::EntityCount::guid( +void EntityCount::guid( eprosima::fastdds::statistics::detail::GUID_s&& _guid) { m_guid = std::move(_guid); @@ -1137,7 +1142,7 @@ void eprosima::fastdds::statistics::EntityCount::guid( * @brief This function returns a constant reference to member guid * @return Constant reference to member guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityCount::guid() const +const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const { return m_guid; } @@ -1146,7 +1151,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member guid * @return Reference to member guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityCount::guid() +eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() { return m_guid; } @@ -1156,7 +1161,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function sets a value in member count * @param _count New value for member count */ -void eprosima::fastdds::statistics::EntityCount::count( +void EntityCount::count( uint64_t _count) { m_count = _count; @@ -1166,7 +1171,7 @@ void eprosima::fastdds::statistics::EntityCount::count( * @brief This function returns the value of member count * @return Value of member count */ -uint64_t eprosima::fastdds::statistics::EntityCount::count() const +uint64_t EntityCount::count() const { return m_count; } @@ -1175,63 +1180,62 @@ uint64_t eprosima::fastdds::statistics::EntityCount::count() const * @brief This function returns a reference to member count * @return Reference to member count */ -uint64_t& eprosima::fastdds::statistics::EntityCount::count() +uint64_t& EntityCount::count() { return m_count; } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount() -{ + +SampleIdentityCount::SampleIdentityCount() +{ } -eprosima::fastdds::statistics::SampleIdentityCount::~SampleIdentityCount() +SampleIdentityCount::~SampleIdentityCount() { } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( +SampleIdentityCount::SampleIdentityCount( const SampleIdentityCount& x) { m_sample_id = x.m_sample_id; m_count = x.m_count; } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( +SampleIdentityCount::SampleIdentityCount( SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::SampleIdentityCount::operator =( +SampleIdentityCount& SampleIdentityCount::operator =( const SampleIdentityCount& x) { m_sample_id = x.m_sample_id; m_count = x.m_count; - return *this; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::SampleIdentityCount::operator =( +SampleIdentityCount& SampleIdentityCount::operator =( SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; - return *this; } -bool eprosima::fastdds::statistics::SampleIdentityCount::operator ==( +bool SampleIdentityCount::operator ==( const SampleIdentityCount& x) const { return (m_sample_id == x.m_sample_id && m_count == x.m_count); } -bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( +bool SampleIdentityCount::operator !=( const SampleIdentityCount& x) const { return !(*this == x); @@ -1241,7 +1245,7 @@ bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( * @brief This function copies the value in member sample_id * @param _sample_id New value to be copied in member sample_id */ -void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( +void SampleIdentityCount::sample_id( const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) { m_sample_id = _sample_id; @@ -1251,7 +1255,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( * @brief This function moves the value in member sample_id * @param _sample_id New value to be moved in member sample_id */ -void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( +void SampleIdentityCount::sample_id( eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) { m_sample_id = std::move(_sample_id); @@ -1261,7 +1265,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( * @brief This function returns a constant reference to member sample_id * @return Constant reference to member sample_id */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::SampleIdentityCount::sample_id() const +const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const { return m_sample_id; } @@ -1270,7 +1274,7 @@ const eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds * @brief This function returns a reference to member sample_id * @return Reference to member sample_id */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::SampleIdentityCount::sample_id() +eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() { return m_sample_id; } @@ -1280,7 +1284,7 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::stat * @brief This function sets a value in member count * @param _count New value for member count */ -void eprosima::fastdds::statistics::SampleIdentityCount::count( +void SampleIdentityCount::count( uint64_t _count) { m_count = _count; @@ -1290,7 +1294,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::count( * @brief This function returns the value of member count * @return Value of member count */ -uint64_t eprosima::fastdds::statistics::SampleIdentityCount::count() const +uint64_t SampleIdentityCount::count() const { return m_count; } @@ -1299,22 +1303,23 @@ uint64_t eprosima::fastdds::statistics::SampleIdentityCount::count() const * @brief This function returns a reference to member count * @return Reference to member count */ -uint64_t& eprosima::fastdds::statistics::SampleIdentityCount::count() +uint64_t& SampleIdentityCount::count() { return m_count; } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic() -{ + +Entity2LocatorTraffic::Entity2LocatorTraffic() +{ } -eprosima::fastdds::statistics::Entity2LocatorTraffic::~Entity2LocatorTraffic() +Entity2LocatorTraffic::~Entity2LocatorTraffic() { } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( +Entity2LocatorTraffic::Entity2LocatorTraffic( const Entity2LocatorTraffic& x) { m_src_guid = x.m_src_guid; @@ -1324,7 +1329,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( m_byte_magnitude_order = x.m_byte_magnitude_order; } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( +Entity2LocatorTraffic::Entity2LocatorTraffic( Entity2LocatorTraffic&& x) noexcept { m_src_guid = std::move(x.m_src_guid); @@ -1334,7 +1339,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( m_byte_magnitude_order = x.m_byte_magnitude_order; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Entity2LocatorTraffic::operator =( +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( const Entity2LocatorTraffic& x) { @@ -1343,11 +1348,10 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist m_packet_count = x.m_packet_count; m_byte_count = x.m_byte_count; m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Entity2LocatorTraffic::operator =( +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( Entity2LocatorTraffic&& x) noexcept { @@ -1356,11 +1360,10 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist m_packet_count = x.m_packet_count; m_byte_count = x.m_byte_count; m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; } -bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator ==( +bool Entity2LocatorTraffic::operator ==( const Entity2LocatorTraffic& x) const { return (m_src_guid == x.m_src_guid && @@ -1370,7 +1373,7 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator ==( m_byte_magnitude_order == x.m_byte_magnitude_order); } -bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( +bool Entity2LocatorTraffic::operator !=( const Entity2LocatorTraffic& x) const { return !(*this == x); @@ -1380,7 +1383,7 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( * @brief This function copies the value in member src_guid * @param _src_guid New value to be copied in member src_guid */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( +void Entity2LocatorTraffic::src_guid( const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) { m_src_guid = _src_guid; @@ -1390,7 +1393,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( * @brief This function moves the value in member src_guid * @param _src_guid New value to be moved in member src_guid */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( +void Entity2LocatorTraffic::src_guid( eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) { m_src_guid = std::move(_src_guid); @@ -1400,7 +1403,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( * @brief This function returns a constant reference to member src_guid * @return Constant reference to member src_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const { return m_src_guid; } @@ -1409,7 +1412,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member src_guid * @return Reference to member src_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid() +eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() { return m_src_guid; } @@ -1419,7 +1422,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( +void Entity2LocatorTraffic::dst_locator( const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) { m_dst_locator = _dst_locator; @@ -1429,7 +1432,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( * @brief This function moves the value in member dst_locator * @param _dst_locator New value to be moved in member dst_locator */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( +void Entity2LocatorTraffic::dst_locator( eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) { m_dst_locator = std::move(_dst_locator); @@ -1439,7 +1442,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( * @brief This function returns a constant reference to member dst_locator * @return Constant reference to member dst_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const { return m_dst_locator; } @@ -1448,7 +1451,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member dst_locator * @return Reference to member dst_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator() +eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() { return m_dst_locator; } @@ -1458,7 +1461,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function sets a value in member packet_count * @param _packet_count New value for member packet_count */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count( +void Entity2LocatorTraffic::packet_count( uint64_t _packet_count) { m_packet_count = _packet_count; @@ -1468,7 +1471,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count( * @brief This function returns the value of member packet_count * @return Value of member packet_count */ -uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() const +uint64_t Entity2LocatorTraffic::packet_count() const { return m_packet_count; } @@ -1477,7 +1480,7 @@ uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() co * @brief This function returns a reference to member packet_count * @return Reference to member packet_count */ -uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() +uint64_t& Entity2LocatorTraffic::packet_count() { return m_packet_count; } @@ -1487,7 +1490,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() * @brief This function sets a value in member byte_count * @param _byte_count New value for member byte_count */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count( +void Entity2LocatorTraffic::byte_count( uint64_t _byte_count) { m_byte_count = _byte_count; @@ -1497,7 +1500,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count( * @brief This function returns the value of member byte_count * @return Value of member byte_count */ -uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() const +uint64_t Entity2LocatorTraffic::byte_count() const { return m_byte_count; } @@ -1506,7 +1509,7 @@ uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() cons * @brief This function returns a reference to member byte_count * @return Reference to member byte_count */ -uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() +uint64_t& Entity2LocatorTraffic::byte_count() { return m_byte_count; } @@ -1516,7 +1519,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() * @brief This function sets a value in member byte_magnitude_order * @param _byte_magnitude_order New value for member byte_magnitude_order */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order( +void Entity2LocatorTraffic::byte_magnitude_order( int16_t _byte_magnitude_order) { m_byte_magnitude_order = _byte_magnitude_order; @@ -1526,7 +1529,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order( * @brief This function returns the value of member byte_magnitude_order * @return Value of member byte_magnitude_order */ -int16_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order() const +int16_t Entity2LocatorTraffic::byte_magnitude_order() const { return m_byte_magnitude_order; } @@ -1535,22 +1538,23 @@ int16_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_ord * @brief This function returns a reference to member byte_magnitude_order * @return Reference to member byte_magnitude_order */ -int16_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order() +int16_t& Entity2LocatorTraffic::byte_magnitude_order() { return m_byte_magnitude_order; } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData() -{ + +WriterReaderData::WriterReaderData() +{ } -eprosima::fastdds::statistics::WriterReaderData::~WriterReaderData() +WriterReaderData::~WriterReaderData() { } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( +WriterReaderData::WriterReaderData( const WriterReaderData& x) { m_writer_guid = x.m_writer_guid; @@ -1558,7 +1562,7 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( m_data = x.m_data; } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( +WriterReaderData::WriterReaderData( WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); @@ -1566,29 +1570,27 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( m_data = x.m_data; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::WriterReaderData::operator =( +WriterReaderData& WriterReaderData::operator =( const WriterReaderData& x) { m_writer_guid = x.m_writer_guid; m_reader_guid = x.m_reader_guid; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::WriterReaderData::operator =( +WriterReaderData& WriterReaderData::operator =( WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_reader_guid = std::move(x.m_reader_guid); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::WriterReaderData::operator ==( +bool WriterReaderData::operator ==( const WriterReaderData& x) const { return (m_writer_guid == x.m_writer_guid && @@ -1596,7 +1598,7 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator ==( m_data == x.m_data); } -bool eprosima::fastdds::statistics::WriterReaderData::operator !=( +bool WriterReaderData::operator !=( const WriterReaderData& x) const { return !(*this == x); @@ -1606,7 +1608,7 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator !=( * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid */ -void eprosima::fastdds::statistics::WriterReaderData::writer_guid( +void WriterReaderData::writer_guid( const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) { m_writer_guid = _writer_guid; @@ -1616,7 +1618,7 @@ void eprosima::fastdds::statistics::WriterReaderData::writer_guid( * @brief This function moves the value in member writer_guid * @param _writer_guid New value to be moved in member writer_guid */ -void eprosima::fastdds::statistics::WriterReaderData::writer_guid( +void WriterReaderData::writer_guid( eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) { m_writer_guid = std::move(_writer_guid); @@ -1626,7 +1628,7 @@ void eprosima::fastdds::statistics::WriterReaderData::writer_guid( * @brief This function returns a constant reference to member writer_guid * @return Constant reference to member writer_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::writer_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const { return m_writer_guid; } @@ -1635,7 +1637,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member writer_guid * @return Reference to member writer_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::writer_guid() +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() { return m_writer_guid; } @@ -1645,7 +1647,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr * @brief This function copies the value in member reader_guid * @param _reader_guid New value to be copied in member reader_guid */ -void eprosima::fastdds::statistics::WriterReaderData::reader_guid( +void WriterReaderData::reader_guid( const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) { m_reader_guid = _reader_guid; @@ -1655,7 +1657,7 @@ void eprosima::fastdds::statistics::WriterReaderData::reader_guid( * @brief This function moves the value in member reader_guid * @param _reader_guid New value to be moved in member reader_guid */ -void eprosima::fastdds::statistics::WriterReaderData::reader_guid( +void WriterReaderData::reader_guid( eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) { m_reader_guid = std::move(_reader_guid); @@ -1665,7 +1667,7 @@ void eprosima::fastdds::statistics::WriterReaderData::reader_guid( * @brief This function returns a constant reference to member reader_guid * @return Constant reference to member reader_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::reader_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const { return m_reader_guid; } @@ -1674,7 +1676,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member reader_guid * @return Reference to member reader_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::reader_guid() +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() { return m_reader_guid; } @@ -1684,7 +1686,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::WriterReaderData::data( +void WriterReaderData::data( float _data) { m_data = _data; @@ -1694,7 +1696,7 @@ void eprosima::fastdds::statistics::WriterReaderData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::WriterReaderData::data() const +float WriterReaderData::data() const { return m_data; } @@ -1703,22 +1705,23 @@ float eprosima::fastdds::statistics::WriterReaderData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::WriterReaderData::data() +float& WriterReaderData::data() { return m_data; } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData() -{ + +Locator2LocatorData::Locator2LocatorData() +{ } -eprosima::fastdds::statistics::Locator2LocatorData::~Locator2LocatorData() +Locator2LocatorData::~Locator2LocatorData() { } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( +Locator2LocatorData::Locator2LocatorData( const Locator2LocatorData& x) { m_src_locator = x.m_src_locator; @@ -1726,7 +1729,7 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( m_data = x.m_data; } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( +Locator2LocatorData::Locator2LocatorData( Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); @@ -1734,29 +1737,27 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( m_data = x.m_data; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Locator2LocatorData::operator =( +Locator2LocatorData& Locator2LocatorData::operator =( const Locator2LocatorData& x) { m_src_locator = x.m_src_locator; m_dst_locator = x.m_dst_locator; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Locator2LocatorData::operator =( +Locator2LocatorData& Locator2LocatorData::operator =( Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); m_dst_locator = std::move(x.m_dst_locator); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::Locator2LocatorData::operator ==( +bool Locator2LocatorData::operator ==( const Locator2LocatorData& x) const { return (m_src_locator == x.m_src_locator && @@ -1764,7 +1765,7 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator ==( m_data == x.m_data); } -bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( +bool Locator2LocatorData::operator !=( const Locator2LocatorData& x) const { return !(*this == x); @@ -1774,7 +1775,7 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( * @brief This function copies the value in member src_locator * @param _src_locator New value to be copied in member src_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( +void Locator2LocatorData::src_locator( const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) { m_src_locator = _src_locator; @@ -1784,7 +1785,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( * @brief This function moves the value in member src_locator * @param _src_locator New value to be moved in member src_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( +void Locator2LocatorData::src_locator( eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) { m_src_locator = std::move(_src_locator); @@ -1794,7 +1795,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( * @brief This function returns a constant reference to member src_locator * @return Constant reference to member src_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::src_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const { return m_src_locator; } @@ -1803,7 +1804,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member src_locator * @return Reference to member src_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::src_locator() +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() { return m_src_locator; } @@ -1813,7 +1814,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( +void Locator2LocatorData::dst_locator( const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) { m_dst_locator = _dst_locator; @@ -1823,7 +1824,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( * @brief This function moves the value in member dst_locator * @param _dst_locator New value to be moved in member dst_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( +void Locator2LocatorData::dst_locator( eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) { m_dst_locator = std::move(_dst_locator); @@ -1833,7 +1834,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( * @brief This function returns a constant reference to member dst_locator * @return Constant reference to member dst_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::dst_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const { return m_dst_locator; } @@ -1842,7 +1843,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member dst_locator * @return Reference to member dst_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::dst_locator() +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() { return m_dst_locator; } @@ -1852,7 +1853,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::Locator2LocatorData::data( +void Locator2LocatorData::data( float _data) { m_data = _data; @@ -1862,7 +1863,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::Locator2LocatorData::data() const +float Locator2LocatorData::data() const { return m_data; } @@ -1871,63 +1872,62 @@ float eprosima::fastdds::statistics::Locator2LocatorData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::Locator2LocatorData::data() +float& Locator2LocatorData::data() { return m_data; } -eprosima::fastdds::statistics::EntityData::EntityData() -{ + +EntityData::EntityData() +{ } -eprosima::fastdds::statistics::EntityData::~EntityData() +EntityData::~EntityData() { } -eprosima::fastdds::statistics::EntityData::EntityData( +EntityData::EntityData( const EntityData& x) { m_guid = x.m_guid; m_data = x.m_data; } -eprosima::fastdds::statistics::EntityData::EntityData( +EntityData::EntityData( EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::EntityData::operator =( +EntityData& EntityData::operator =( const EntityData& x) { m_guid = x.m_guid; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::EntityData::operator =( +EntityData& EntityData::operator =( EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::EntityData::operator ==( +bool EntityData::operator ==( const EntityData& x) const { return (m_guid == x.m_guid && m_data == x.m_data); } -bool eprosima::fastdds::statistics::EntityData::operator !=( +bool EntityData::operator !=( const EntityData& x) const { return !(*this == x); @@ -1937,7 +1937,7 @@ bool eprosima::fastdds::statistics::EntityData::operator !=( * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid */ -void eprosima::fastdds::statistics::EntityData::guid( +void EntityData::guid( const eprosima::fastdds::statistics::detail::GUID_s& _guid) { m_guid = _guid; @@ -1947,7 +1947,7 @@ void eprosima::fastdds::statistics::EntityData::guid( * @brief This function moves the value in member guid * @param _guid New value to be moved in member guid */ -void eprosima::fastdds::statistics::EntityData::guid( +void EntityData::guid( eprosima::fastdds::statistics::detail::GUID_s&& _guid) { m_guid = std::move(_guid); @@ -1957,7 +1957,7 @@ void eprosima::fastdds::statistics::EntityData::guid( * @brief This function returns a constant reference to member guid * @return Constant reference to member guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityData::guid() const +const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const { return m_guid; } @@ -1966,7 +1966,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member guid * @return Reference to member guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityData::guid() +eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() { return m_guid; } @@ -1976,7 +1976,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::EntityData::data( +void EntityData::data( float _data) { m_data = _data; @@ -1986,7 +1986,7 @@ void eprosima::fastdds::statistics::EntityData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::EntityData::data() const +float EntityData::data() const { return m_data; } @@ -1995,22 +1995,23 @@ float eprosima::fastdds::statistics::EntityData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::EntityData::data() +float& EntityData::data() { return m_data; } -eprosima::fastdds::statistics::PhysicalData::PhysicalData() -{ + +PhysicalData::PhysicalData() +{ } -eprosima::fastdds::statistics::PhysicalData::~PhysicalData() +PhysicalData::~PhysicalData() { } -eprosima::fastdds::statistics::PhysicalData::PhysicalData( +PhysicalData::PhysicalData( const PhysicalData& x) { m_participant_guid = x.m_participant_guid; @@ -2019,7 +2020,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( m_process = x.m_process; } -eprosima::fastdds::statistics::PhysicalData::PhysicalData( +PhysicalData::PhysicalData( PhysicalData&& x) noexcept { m_participant_guid = std::move(x.m_participant_guid); @@ -2028,7 +2029,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( m_process = std::move(x.m_process); } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::PhysicalData::operator =( +PhysicalData& PhysicalData::operator =( const PhysicalData& x) { @@ -2036,11 +2037,10 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Phys m_host = x.m_host; m_user = x.m_user; m_process = x.m_process; - return *this; } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::PhysicalData::operator =( +PhysicalData& PhysicalData::operator =( PhysicalData&& x) noexcept { @@ -2048,11 +2048,10 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Phys m_host = std::move(x.m_host); m_user = std::move(x.m_user); m_process = std::move(x.m_process); - return *this; } -bool eprosima::fastdds::statistics::PhysicalData::operator ==( +bool PhysicalData::operator ==( const PhysicalData& x) const { return (m_participant_guid == x.m_participant_guid && @@ -2061,7 +2060,7 @@ bool eprosima::fastdds::statistics::PhysicalData::operator ==( m_process == x.m_process); } -bool eprosima::fastdds::statistics::PhysicalData::operator !=( +bool PhysicalData::operator !=( const PhysicalData& x) const { return !(*this == x); @@ -2071,7 +2070,7 @@ bool eprosima::fastdds::statistics::PhysicalData::operator !=( * @brief This function copies the value in member participant_guid * @param _participant_guid New value to be copied in member participant_guid */ -void eprosima::fastdds::statistics::PhysicalData::participant_guid( +void PhysicalData::participant_guid( const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) { m_participant_guid = _participant_guid; @@ -2081,7 +2080,7 @@ void eprosima::fastdds::statistics::PhysicalData::participant_guid( * @brief This function moves the value in member participant_guid * @param _participant_guid New value to be moved in member participant_guid */ -void eprosima::fastdds::statistics::PhysicalData::participant_guid( +void PhysicalData::participant_guid( eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) { m_participant_guid = std::move(_participant_guid); @@ -2091,7 +2090,7 @@ void eprosima::fastdds::statistics::PhysicalData::participant_guid( * @brief This function returns a constant reference to member participant_guid * @return Constant reference to member participant_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::PhysicalData::participant_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const { return m_participant_guid; } @@ -2100,7 +2099,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member participant_guid * @return Reference to member participant_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::PhysicalData::participant_guid() +eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() { return m_participant_guid; } @@ -2110,7 +2109,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Ph * @brief This function copies the value in member host * @param _host New value to be copied in member host */ -void eprosima::fastdds::statistics::PhysicalData::host( +void PhysicalData::host( const std::string& _host) { m_host = _host; @@ -2120,7 +2119,7 @@ void eprosima::fastdds::statistics::PhysicalData::host( * @brief This function moves the value in member host * @param _host New value to be moved in member host */ -void eprosima::fastdds::statistics::PhysicalData::host( +void PhysicalData::host( std::string&& _host) { m_host = std::move(_host); @@ -2130,7 +2129,7 @@ void eprosima::fastdds::statistics::PhysicalData::host( * @brief This function returns a constant reference to member host * @return Constant reference to member host */ -const std::string& eprosima::fastdds::statistics::PhysicalData::host() const +const std::string& PhysicalData::host() const { return m_host; } @@ -2139,7 +2138,7 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::host() const * @brief This function returns a reference to member host * @return Reference to member host */ -std::string& eprosima::fastdds::statistics::PhysicalData::host() +std::string& PhysicalData::host() { return m_host; } @@ -2149,7 +2148,7 @@ std::string& eprosima::fastdds::statistics::PhysicalData::host() * @brief This function copies the value in member user * @param _user New value to be copied in member user */ -void eprosima::fastdds::statistics::PhysicalData::user( +void PhysicalData::user( const std::string& _user) { m_user = _user; @@ -2159,7 +2158,7 @@ void eprosima::fastdds::statistics::PhysicalData::user( * @brief This function moves the value in member user * @param _user New value to be moved in member user */ -void eprosima::fastdds::statistics::PhysicalData::user( +void PhysicalData::user( std::string&& _user) { m_user = std::move(_user); @@ -2169,7 +2168,7 @@ void eprosima::fastdds::statistics::PhysicalData::user( * @brief This function returns a constant reference to member user * @return Constant reference to member user */ -const std::string& eprosima::fastdds::statistics::PhysicalData::user() const +const std::string& PhysicalData::user() const { return m_user; } @@ -2178,7 +2177,7 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::user() const * @brief This function returns a reference to member user * @return Reference to member user */ -std::string& eprosima::fastdds::statistics::PhysicalData::user() +std::string& PhysicalData::user() { return m_user; } @@ -2188,7 +2187,7 @@ std::string& eprosima::fastdds::statistics::PhysicalData::user() * @brief This function copies the value in member process * @param _process New value to be copied in member process */ -void eprosima::fastdds::statistics::PhysicalData::process( +void PhysicalData::process( const std::string& _process) { m_process = _process; @@ -2198,7 +2197,7 @@ void eprosima::fastdds::statistics::PhysicalData::process( * @brief This function moves the value in member process * @param _process New value to be moved in member process */ -void eprosima::fastdds::statistics::PhysicalData::process( +void PhysicalData::process( std::string&& _process) { m_process = std::move(_process); @@ -2208,7 +2207,7 @@ void eprosima::fastdds::statistics::PhysicalData::process( * @brief This function returns a constant reference to member process * @return Constant reference to member process */ -const std::string& eprosima::fastdds::statistics::PhysicalData::process() const +const std::string& PhysicalData::process() const { return m_process; } @@ -2217,23 +2216,25 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::process() const * @brief This function returns a reference to member process * @return Reference to member process */ -std::string& eprosima::fastdds::statistics::PhysicalData::process() +std::string& PhysicalData::process() { return m_process; } -eprosima::fastdds::statistics::Data::Data() + + +Data::Data() { m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; } -eprosima::fastdds::statistics::Data::~Data() +Data::~Data() { } -eprosima::fastdds::statistics::Data::Data( +Data::Data( const Data& x) { m__d = x.m__d; @@ -2293,7 +2294,7 @@ eprosima::fastdds::statistics::Data::Data( } } -eprosima::fastdds::statistics::Data::Data( +Data::Data( Data&& x) noexcept { m__d = x.m__d; @@ -2361,7 +2362,7 @@ eprosima::fastdds::statistics::Data::Data( } } -eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operator =( +Data& Data::operator =( const Data& x) { m__d = x.m__d; @@ -2423,7 +2424,7 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat return *this; } -eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operator =( +Data& Data::operator =( Data&& x) noexcept { m__d = x.m__d; @@ -2493,7 +2494,7 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat return *this; } -bool eprosima::fastdds::statistics::Data::operator ==( +bool Data::operator ==( const Data& x) const { if (m__d != x.m__d) @@ -2557,13 +2558,13 @@ bool eprosima::fastdds::statistics::Data::operator ==( return false; } -bool eprosima::fastdds::statistics::Data::operator !=( +bool Data::operator !=( const Data& x) const { return !(*this == x); } -void eprosima::fastdds::statistics::Data::_d( +void Data::_d( eprosima::fastdds::statistics::EventKind __d) { bool b = false; @@ -2683,6 +2684,8 @@ void eprosima::fastdds::statistics::Data::_d( } break; + default: + break; } if (!b) @@ -2693,17 +2696,17 @@ void eprosima::fastdds::statistics::Data::_d( m__d = __d; } -eprosima::fastdds::statistics::EventKind eprosima::fastdds::statistics::Data::_d() const +eprosima::fastdds::statistics::EventKind Data::_d() const { return m__d; } -eprosima::fastdds::statistics::EventKind& eprosima::fastdds::statistics::Data::_d() +eprosima::fastdds::statistics::EventKind& Data::_d() { return m__d; } -void eprosima::fastdds::statistics::Data::writer_reader_data( +void Data::writer_reader_data( const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) { m_writer_reader_data = _writer_reader_data; @@ -2711,7 +2714,7 @@ void eprosima::fastdds::statistics::Data::writer_reader_data( } -void eprosima::fastdds::statistics::Data::writer_reader_data( +void Data::writer_reader_data( eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) { m_writer_reader_data = std::move(_writer_reader_data); @@ -2719,7 +2722,7 @@ void eprosima::fastdds::statistics::Data::writer_reader_data( } -const eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::Data::writer_reader_data() const +const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const { bool b = false; @@ -2740,7 +2743,7 @@ const eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statis return m_writer_reader_data; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::Data::writer_reader_data() +eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() { bool b = false; @@ -2762,7 +2765,7 @@ eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics:: } -void eprosima::fastdds::statistics::Data::locator2locator_data( +void Data::locator2locator_data( const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) { m_locator2locator_data = _locator2locator_data; @@ -2770,7 +2773,7 @@ void eprosima::fastdds::statistics::Data::locator2locator_data( } -void eprosima::fastdds::statistics::Data::locator2locator_data( +void Data::locator2locator_data( eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) { m_locator2locator_data = std::move(_locator2locator_data); @@ -2778,7 +2781,7 @@ void eprosima::fastdds::statistics::Data::locator2locator_data( } -const eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Data::locator2locator_data() const +const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const { bool b = false; @@ -2799,7 +2802,7 @@ const eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::sta return m_locator2locator_data; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Data::locator2locator_data() +eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() { bool b = false; @@ -2821,7 +2824,7 @@ eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistic } -void eprosima::fastdds::statistics::Data::entity_data( +void Data::entity_data( const eprosima::fastdds::statistics::EntityData& _entity_data) { m_entity_data = _entity_data; @@ -2829,7 +2832,7 @@ void eprosima::fastdds::statistics::Data::entity_data( } -void eprosima::fastdds::statistics::Data::entity_data( +void Data::entity_data( eprosima::fastdds::statistics::EntityData&& _entity_data) { m_entity_data = std::move(_entity_data); @@ -2837,7 +2840,7 @@ void eprosima::fastdds::statistics::Data::entity_data( } -const eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data::entity_data() const +const eprosima::fastdds::statistics::EntityData& Data::entity_data() const { bool b = false; @@ -2859,7 +2862,7 @@ const eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics:: return m_entity_data; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data::entity_data() +eprosima::fastdds::statistics::EntityData& Data::entity_data() { bool b = false; @@ -2882,7 +2885,7 @@ eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data:: } -void eprosima::fastdds::statistics::Data::entity2locator_traffic( +void Data::entity2locator_traffic( const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) { m_entity2locator_traffic = _entity2locator_traffic; @@ -2890,7 +2893,7 @@ void eprosima::fastdds::statistics::Data::entity2locator_traffic( } -void eprosima::fastdds::statistics::Data::entity2locator_traffic( +void Data::entity2locator_traffic( eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) { m_entity2locator_traffic = std::move(_entity2locator_traffic); @@ -2898,7 +2901,7 @@ void eprosima::fastdds::statistics::Data::entity2locator_traffic( } -const eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Data::entity2locator_traffic() const +const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const { bool b = false; @@ -2920,7 +2923,7 @@ const eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::s return m_entity2locator_traffic; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Data::entity2locator_traffic() +eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() { bool b = false; @@ -2943,7 +2946,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist } -void eprosima::fastdds::statistics::Data::entity_count( +void Data::entity_count( const eprosima::fastdds::statistics::EntityCount& _entity_count) { m_entity_count = _entity_count; @@ -2951,7 +2954,7 @@ void eprosima::fastdds::statistics::Data::entity_count( } -void eprosima::fastdds::statistics::Data::entity_count( +void Data::entity_count( eprosima::fastdds::statistics::EntityCount&& _entity_count) { m_entity_count = std::move(_entity_count); @@ -2959,7 +2962,7 @@ void eprosima::fastdds::statistics::Data::entity_count( } -const eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data::entity_count() const +const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const { bool b = false; @@ -2987,7 +2990,7 @@ const eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics: return m_entity_count; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data::entity_count() +eprosima::fastdds::statistics::EntityCount& Data::entity_count() { bool b = false; @@ -3016,7 +3019,7 @@ eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data: } -void eprosima::fastdds::statistics::Data::discovery_time( +void Data::discovery_time( const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) { m_discovery_time = _discovery_time; @@ -3024,7 +3027,7 @@ void eprosima::fastdds::statistics::Data::discovery_time( } -void eprosima::fastdds::statistics::Data::discovery_time( +void Data::discovery_time( eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) { m_discovery_time = std::move(_discovery_time); @@ -3032,7 +3035,7 @@ void eprosima::fastdds::statistics::Data::discovery_time( } -const eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Data::discovery_time() const +const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const { bool b = false; @@ -3053,7 +3056,7 @@ const eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistic return m_discovery_time; } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Data::discovery_time() +eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() { bool b = false; @@ -3075,7 +3078,7 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dat } -void eprosima::fastdds::statistics::Data::sample_identity_count( +void Data::sample_identity_count( const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) { m_sample_identity_count = _sample_identity_count; @@ -3083,7 +3086,7 @@ void eprosima::fastdds::statistics::Data::sample_identity_count( } -void eprosima::fastdds::statistics::Data::sample_identity_count( +void Data::sample_identity_count( eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) { m_sample_identity_count = std::move(_sample_identity_count); @@ -3091,7 +3094,7 @@ void eprosima::fastdds::statistics::Data::sample_identity_count( } -const eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::Data::sample_identity_count() const +const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const { bool b = false; @@ -3112,7 +3115,7 @@ const eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::sta return m_sample_identity_count; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::Data::sample_identity_count() +eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() { bool b = false; @@ -3134,7 +3137,7 @@ eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistic } -void eprosima::fastdds::statistics::Data::physical_data( +void Data::physical_data( const eprosima::fastdds::statistics::PhysicalData& _physical_data) { m_physical_data = _physical_data; @@ -3142,7 +3145,7 @@ void eprosima::fastdds::statistics::Data::physical_data( } -void eprosima::fastdds::statistics::Data::physical_data( +void Data::physical_data( eprosima::fastdds::statistics::PhysicalData&& _physical_data) { m_physical_data = std::move(_physical_data); @@ -3150,7 +3153,7 @@ void eprosima::fastdds::statistics::Data::physical_data( } -const eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data::physical_data() const +const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const { bool b = false; @@ -3171,7 +3174,7 @@ const eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics return m_physical_data; } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data::physical_data() +eprosima::fastdds::statistics::PhysicalData& Data::physical_data() { bool b = false; @@ -3195,6 +3198,14 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data +} // namespace statistics + + +} // namespace fastdds + +} // namespace eprosima // Include auxiliary functions like for serializing/deserializing. #include "typesCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/types.h b/src/cpp/statistics/types/types.h index fe4fbc1123d..c51a79f2044 100644 --- a/src/cpp/statistics/types/types.h +++ b/src/cpp/statistics/types/types.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "typesv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -68,2217 +74,2258 @@ class CdrSizeCalculator; namespace eprosima { - namespace fastdds { - namespace statistics { - namespace detail { - /*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ - class EntityId_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - private: - - std::array m_value{0}; - - }; - /*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ - class GuidPrefix_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - private: - - std::array m_value{0}; - - }; - /*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ - class GUID_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - - private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - - }; - /*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ - class SequenceNumber_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - - private: - - int32_t m_high{0}; - uint32_t m_low{0}; - - }; - /*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentity_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - - }; - /*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ - class Locator_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - - private: - - int32_t m_kind{0}; - uint32_t m_port{0}; - std::array m_address{0}; - - }; - } // namespace detail - /*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ - class DiscoveryTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time{0}; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - /*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ - class EntityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count{0}; - - }; - /*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count{0}; - - }; - /*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ - class Entity2LocatorTraffic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count{0}; - uint64_t m_byte_count{0}; - int16_t m_byte_magnitude_order{0}; - - }; - /*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ - class WriterReaderData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ - class Locator2LocatorData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ - class EntityData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ - class PhysicalData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - /*! - * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. - * @ingroup types - */ - enum EventKindBits : uint32_t - { - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 - }; - typedef uint32_t EventKind; - /*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ - class Data - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - - private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; - }; - } // namespace statistics - } // namespace fastdds + +namespace fastdds { + +namespace statistics { + +namespace detail { + + + +/*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ +class EntityId_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ +class GuidPrefix_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ +class GUID_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const; + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); + +private: + + eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; + eprosima::fastdds::statistics::detail::EntityId_s m_entityId; + +}; + + +/*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ +class SequenceNumber_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const; + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high); + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const; + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high(); + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low); + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const; + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low(); + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; + + +/*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentity_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; + +}; + + +/*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ +class Locator_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const; + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind); + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const; + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind(); + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port); + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const; + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port(); + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address); + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address); + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const; + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address(); + +private: + + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; + +}; + +} // namespace detail + + +/*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ +class DiscoveryTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const; + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time); + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const; + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; + eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; + uint64_t m_time{0}; + std::string m_host; + std::string m_user; + std::string m_process; + +}; + + +/*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ +class EntityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + uint64_t m_count{0}; + +}; + + +/*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const; + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + +private: + + eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; + uint64_t m_count{0}; + +}; + + +/*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ +class Entity2LocatorTraffic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count); + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const; + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count(); + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count); + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const; + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count(); + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order); + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const; + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_src_guid; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + uint64_t m_packet_count{0}; + uint64_t m_byte_count{0}; + int16_t m_byte_magnitude_order{0}; + +}; + + +/*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ +class WriterReaderData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ +class Locator2LocatorData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const; + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::Locator_s m_src_locator; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ +class EntityData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ +class PhysicalData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const; + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +/*! + * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. + * @ingroup types + */ +enum EventKindBits : uint32_t +{ + HISTORY2HISTORY_LATENCY = 0x01ull << 0, + NETWORK_LATENCY = 0x01ull << 1, + PUBLICATION_THROUGHPUT = 0x01ull << 2, + SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, + RTPS_SENT = 0x01ull << 4, + RTPS_LOST = 0x01ull << 5, + RESENT_DATAS = 0x01ull << 6, + HEARTBEAT_COUNT = 0x01ull << 7, + ACKNACK_COUNT = 0x01ull << 8, + NACKFRAG_COUNT = 0x01ull << 9, + GAP_COUNT = 0x01ull << 10, + DATA_COUNT = 0x01ull << 11, + PDP_PACKETS = 0x01ull << 12, + EDP_PACKETS = 0x01ull << 13, + DISCOVERED_ENTITY = 0x01ull << 14, + SAMPLE_DATAS = 0x01ull << 15, + PHYSICAL_DATA = 0x01ull << 16 +}; +typedef uint32_t EventKind; + + +/*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ +class Data +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::EventKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data); + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data); + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count); + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count); + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data); + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data); + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); + +private: + + eprosima::fastdds::statistics::EventKind m__d; + + eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; + eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; + eprosima::fastdds::statistics::EntityData m_entity_data; + eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; + eprosima::fastdds::statistics::EntityCount m_entity_count; + eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; + eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; + eprosima::fastdds::statistics::PhysicalData m_physical_data; +}; + +} // namespace statistics + +} // namespace fastdds + } // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/src/cpp/statistics/types/typesCdrAux.hpp b/src/cpp/statistics/types/typesCdrAux.hpp index 274084a335c..92b36ffa689 100644 --- a/src/cpp/statistics/types/typesCdrAux.hpp +++ b/src/cpp/statistics/types/typesCdrAux.hpp @@ -75,59 +75,87 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data); @@ -138,7 +166,11 @@ eProsima_user_DllExport void serialize_key( + + + } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ + diff --git a/src/cpp/statistics/types/typesCdrAux.ipp b/src/cpp/statistics/types/typesCdrAux.ipp index 4fddae426c7..feec2a39a65 100644 --- a/src/cpp/statistics/types/typesCdrAux.ipp +++ b/src/cpp/statistics/types/typesCdrAux.ipp @@ -34,12 +34,16 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::EntityId_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -64,6 +68,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -73,7 +79,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.value() ; - scdr.end_serialize_type(current_state); } @@ -82,6 +87,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -106,17 +113,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -141,6 +154,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -150,7 +165,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.value() ; - scdr.end_serialize_type(current_state); } @@ -159,6 +173,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -183,17 +199,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::GUID_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -221,6 +243,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -231,7 +255,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guidPrefix() << eprosima::fastcdr::MemberId(1) << data.entityId() ; - scdr.end_serialize_type(current_state); } @@ -240,6 +263,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -268,17 +293,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -306,6 +337,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -316,7 +349,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.high() << eprosima::fastcdr::MemberId(1) << data.low() ; - scdr.end_serialize_type(current_state); } @@ -325,6 +357,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -353,17 +387,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -391,6 +431,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -401,7 +443,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.writer_guid() << eprosima::fastcdr::MemberId(1) << data.sequence_number() ; - scdr.end_serialize_type(current_state); } @@ -410,6 +451,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -438,17 +481,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::Locator_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -479,6 +528,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -490,7 +541,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.port() << eprosima::fastcdr::MemberId(2) << data.address() ; - scdr.end_serialize_type(current_state); } @@ -499,6 +549,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -531,18 +583,24 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::DiscoveryTime& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -582,6 +640,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -596,7 +656,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(4) << data.user() << eprosima::fastcdr::MemberId(5) << data.process() ; - scdr.end_serialize_type(current_state); } @@ -605,6 +664,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -649,6 +710,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.local_participant_guid(); @@ -662,12 +725,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::EntityCount& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -695,6 +762,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -705,7 +774,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guid() << eprosima::fastcdr::MemberId(1) << data.count() ; - scdr.end_serialize_type(current_state); } @@ -714,6 +782,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -742,6 +812,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.guid(); @@ -750,12 +822,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::SampleIdentityCount& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -783,6 +859,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -793,7 +871,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.sample_id() << eprosima::fastcdr::MemberId(1) << data.count() ; - scdr.end_serialize_type(current_state); } @@ -802,6 +879,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -830,6 +909,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.sample_id(); @@ -838,12 +919,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -880,6 +965,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -893,7 +980,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.byte_count() << eprosima::fastcdr::MemberId(4) << data.byte_magnitude_order() ; - scdr.end_serialize_type(current_state); } @@ -902,6 +988,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -942,6 +1030,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.src_guid(); @@ -954,12 +1044,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::WriterReaderData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -990,6 +1084,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1001,7 +1097,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.reader_guid() << eprosima::fastcdr::MemberId(2) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1010,6 +1105,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1042,6 +1139,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.writer_guid(); @@ -1052,12 +1151,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Locator2LocatorData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1088,6 +1191,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1099,7 +1204,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.dst_locator() << eprosima::fastcdr::MemberId(2) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1108,6 +1212,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1140,6 +1246,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.src_locator(); @@ -1150,12 +1258,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::EntityData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1183,6 +1295,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1193,7 +1307,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guid() << eprosima::fastcdr::MemberId(1) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1202,6 +1315,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1230,6 +1345,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.guid(); @@ -1238,12 +1355,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::PhysicalData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1277,6 +1398,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1289,7 +1412,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(2) << data.user() << eprosima::fastcdr::MemberId(3) << data.process() ; - scdr.end_serialize_type(current_state); } @@ -1298,6 +1420,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1334,6 +1458,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.participant_guid(); @@ -1345,12 +1471,16 @@ void serialize_key( + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Data& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1414,6 +1544,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.physical_data(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -1427,6 +1559,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Data& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1478,6 +1612,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(7) << data.physical_data(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -1488,6 +1624,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Data& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1543,6 +1681,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.physical_data(); break; + default: + break; } ret_value = false; break; @@ -1558,4 +1698,5 @@ eProsima_user_DllExport void deserialize( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ + diff --git a/src/cpp/statistics/types/typesPubSubTypes.cxx b/src/cpp/statistics/types/typesPubSubTypes.cxx index 70cf4e48131..5d92b732491 100644 --- a/src/cpp/statistics/types/typesPubSubTypes.cxx +++ b/src/cpp/statistics/types/typesPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "typesPubSubTypes.h" #include "typesCdrAux.hpp" @@ -35,10 +33,17 @@ namespace eprosima { namespace fastdds { namespace statistics { namespace detail { + + EntityId_sPubSubType::EntityId_sPubSubType() { setName("eprosima::fastdds::statistics::detail::EntityId_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityId_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -69,10 +74,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -87,7 +94,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -104,7 +115,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -127,13 +142,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -165,12 +193,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -187,10 +223,17 @@ namespace eprosima { return true; } + + GuidPrefix_sPubSubType::GuidPrefix_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GuidPrefix_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GuidPrefix_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -221,10 +264,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -239,7 +284,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -256,7 +305,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -279,13 +332,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -317,12 +383,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -339,10 +413,17 @@ namespace eprosima { return true; } + + GUID_sPubSubType::GUID_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GUID_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GUID_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -373,10 +454,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -391,7 +474,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -408,7 +495,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -431,13 +522,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -469,12 +573,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -491,10 +603,17 @@ namespace eprosima { return true; } + + SequenceNumber_sPubSubType::SequenceNumber_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SequenceNumber_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceNumber_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -525,10 +644,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -543,7 +664,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -560,7 +685,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -583,13 +712,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -621,12 +763,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -643,10 +793,17 @@ namespace eprosima { return true; } + + SampleIdentity_sPubSubType::SampleIdentity_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SampleIdentity_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SampleIdentity_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -677,10 +834,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -695,7 +854,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -712,7 +875,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -735,13 +902,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -773,12 +953,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -795,10 +983,17 @@ namespace eprosima { return true; } + + Locator_sPubSubType::Locator_sPubSubType() { setName("eprosima::fastdds::statistics::detail::Locator_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Locator_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -829,10 +1024,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -847,7 +1044,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -864,7 +1065,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -887,13 +1092,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -925,12 +1143,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -950,10 +1176,17 @@ namespace eprosima { } //End of namespace detail + + DiscoveryTimePubSubType::DiscoveryTimePubSubType() { setName("eprosima::fastdds::statistics::DiscoveryTime"); - uint32_t type_size = eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(DiscoveryTime::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -984,10 +1217,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1002,7 +1237,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1019,7 +1258,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1042,13 +1285,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1080,12 +1336,20 @@ namespace eprosima { eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1102,10 +1366,17 @@ namespace eprosima { return true; } + + EntityCountPubSubType::EntityCountPubSubType() { setName("eprosima::fastdds::statistics::EntityCount"); - uint32_t type_size = eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityCount::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1136,10 +1407,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1154,7 +1427,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1171,7 +1448,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1194,13 +1475,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1232,12 +1526,20 @@ namespace eprosima { eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1254,10 +1556,17 @@ namespace eprosima { return true; } + + SampleIdentityCountPubSubType::SampleIdentityCountPubSubType() { setName("eprosima::fastdds::statistics::SampleIdentityCount"); - uint32_t type_size = eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SampleIdentityCount::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1288,10 +1597,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1306,7 +1617,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1323,7 +1638,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1346,13 +1665,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1384,12 +1716,20 @@ namespace eprosima { eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1406,10 +1746,17 @@ namespace eprosima { return true; } + + Entity2LocatorTrafficPubSubType::Entity2LocatorTrafficPubSubType() { setName("eprosima::fastdds::statistics::Entity2LocatorTraffic"); - uint32_t type_size = eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Entity2LocatorTraffic::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1440,10 +1787,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1458,7 +1807,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1475,7 +1828,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1498,13 +1855,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1536,12 +1906,20 @@ namespace eprosima { eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1558,10 +1936,17 @@ namespace eprosima { return true; } + + WriterReaderDataPubSubType::WriterReaderDataPubSubType() { setName("eprosima::fastdds::statistics::WriterReaderData"); - uint32_t type_size = eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(WriterReaderData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1592,10 +1977,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1610,7 +1997,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1627,7 +2018,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1650,13 +2045,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1688,12 +2096,20 @@ namespace eprosima { eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1710,10 +2126,17 @@ namespace eprosima { return true; } + + Locator2LocatorDataPubSubType::Locator2LocatorDataPubSubType() { setName("eprosima::fastdds::statistics::Locator2LocatorData"); - uint32_t type_size = eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Locator2LocatorData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1744,10 +2167,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1762,7 +2187,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1779,7 +2208,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1802,13 +2235,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1840,12 +2286,20 @@ namespace eprosima { eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1862,10 +2316,17 @@ namespace eprosima { return true; } + + EntityDataPubSubType::EntityDataPubSubType() { setName("eprosima::fastdds::statistics::EntityData"); - uint32_t type_size = eprosima_fastdds_statistics_EntityData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_EntityData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1896,10 +2357,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1914,7 +2377,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1931,7 +2398,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1954,13 +2425,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1992,12 +2476,20 @@ namespace eprosima { eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2014,10 +2506,17 @@ namespace eprosima { return true; } + + PhysicalDataPubSubType::PhysicalDataPubSubType() { setName("eprosima::fastdds::statistics::PhysicalData"); - uint32_t type_size = eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(PhysicalData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -2048,10 +2547,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2066,7 +2567,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2083,7 +2588,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2106,13 +2615,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2144,12 +2666,20 @@ namespace eprosima { eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2169,6 +2699,9 @@ namespace eprosima { + + + } //End of namespace statistics diff --git a/src/cpp/statistics/types/typesPubSubTypes.h b/src/cpp/statistics/types/typesPubSubTypes.h index 70a533940bb..33e545416c8 100644 --- a/src/cpp/statistics/types/typesPubSubTypes.h +++ b/src/cpp/statistics/types/typesPubSubTypes.h @@ -46,6 +46,8 @@ namespace eprosima namespace detail { + + /*! * @brief This class represents the TopicDataType of the type EntityId_s defined by the user in the IDL file. * @ingroup types @@ -134,6 +136,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type GuidPrefix_s defined by the user in the IDL file. * @ingroup types @@ -222,6 +226,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type GUID_s defined by the user in the IDL file. * @ingroup types @@ -310,6 +316,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SequenceNumber_s defined by the user in the IDL file. * @ingroup types @@ -398,6 +406,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SampleIdentity_s defined by the user in the IDL file. * @ingroup types @@ -486,6 +496,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Locator_s defined by the user in the IDL file. * @ingroup types @@ -575,6 +587,8 @@ namespace eprosima }; } + + /*! * @brief This class represents the TopicDataType of the type DiscoveryTime defined by the user in the IDL file. * @ingroup types @@ -663,6 +677,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type EntityCount defined by the user in the IDL file. * @ingroup types @@ -751,6 +767,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SampleIdentityCount defined by the user in the IDL file. * @ingroup types @@ -839,6 +857,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Entity2LocatorTraffic defined by the user in the IDL file. * @ingroup types @@ -927,6 +947,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type WriterReaderData defined by the user in the IDL file. * @ingroup types @@ -1015,6 +1037,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Locator2LocatorData defined by the user in the IDL file. * @ingroup types @@ -1103,6 +1127,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type EntityData defined by the user in the IDL file. * @ingroup types @@ -1191,6 +1217,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type PhysicalData defined by the user in the IDL file. * @ingroup types @@ -1280,6 +1308,9 @@ namespace eprosima }; + + + } } } diff --git a/src/cpp/statistics/types/typesv1.cxx b/src/cpp/statistics/types/typesv1.cxx new file mode 100644 index 00000000000..80c55edc2e6 --- /dev/null +++ b/src/cpp/statistics/types/typesv1.cxx @@ -0,0 +1,4757 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "types.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; +#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; + +#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; + +#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; +#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; +#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; +#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; +#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; +#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; +#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; +#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; + + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + + + +EntityId_s::EntityId_s() +{ + // octet m_value + memset(&m_value, 0, ((4)) * 1); + +} + +EntityId_s::~EntityId_s() +{ +} + +EntityId_s::EntityId_s( + const EntityId_s& x) +{ + m_value = x.m_value; + +} + +EntityId_s::EntityId_s( + EntityId_s&& x) noexcept +{ + m_value = std::move(x.m_value); + +} + +EntityId_s& EntityId_s::operator =( + const EntityId_s& x) +{ + m_value = x.m_value; + + return *this; +} + +EntityId_s& EntityId_s::operator =( + EntityId_s&& x) noexcept +{ + m_value = std::move(x.m_value); + + return *this; +} + +bool EntityId_s::operator ==( + const EntityId_s& x) const +{ + return (m_value == x.m_value); +} + +bool EntityId_s::operator !=( + const EntityId_s& x) const +{ + return !(*this == x); +} + +size_t EntityId_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; +} + +size_t EntityId_s::getCdrSerializedSize( + const EntityId_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void EntityId_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_value; + + +} + +void EntityId_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_value; + + +} + + +bool EntityId_s::isKeyDefined() +{ + return false; +} + +void EntityId_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void EntityId_s::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void EntityId_s::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& EntityId_s::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& EntityId_s::value() +{ + return m_value; +} + + + + + +GuidPrefix_s::GuidPrefix_s() +{ + // octet m_value + memset(&m_value, 0, ((12)) * 1); + +} + +GuidPrefix_s::~GuidPrefix_s() +{ +} + +GuidPrefix_s::GuidPrefix_s( + const GuidPrefix_s& x) +{ + m_value = x.m_value; + +} + +GuidPrefix_s::GuidPrefix_s( + GuidPrefix_s&& x) noexcept +{ + m_value = std::move(x.m_value); + +} + +GuidPrefix_s& GuidPrefix_s::operator =( + const GuidPrefix_s& x) +{ + m_value = x.m_value; + + return *this; +} + +GuidPrefix_s& GuidPrefix_s::operator =( + GuidPrefix_s&& x) noexcept +{ + m_value = std::move(x.m_value); + + return *this; +} + +bool GuidPrefix_s::operator ==( + const GuidPrefix_s& x) const +{ + return (m_value == x.m_value); +} + +bool GuidPrefix_s::operator !=( + const GuidPrefix_s& x) const +{ + return !(*this == x); +} + +size_t GuidPrefix_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; +} + +size_t GuidPrefix_s::getCdrSerializedSize( + const GuidPrefix_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((12)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void GuidPrefix_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_value; + + +} + +void GuidPrefix_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_value; + + +} + + +bool GuidPrefix_s::isKeyDefined() +{ + return false; +} + +void GuidPrefix_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void GuidPrefix_s::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void GuidPrefix_s::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& GuidPrefix_s::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& GuidPrefix_s::value() +{ + return m_value; +} + + + + + +GUID_s::GUID_s() +{ + // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix + + // eprosima::fastdds::statistics::detail::EntityId_s m_entityId + + +} + +GUID_s::~GUID_s() +{ +} + +GUID_s::GUID_s( + const GUID_s& x) +{ + m_guidPrefix = x.m_guidPrefix; + + + m_entityId = x.m_entityId; + +} + +GUID_s::GUID_s( + GUID_s&& x) noexcept +{ + m_guidPrefix = std::move(x.m_guidPrefix); + + + m_entityId = std::move(x.m_entityId); + +} + +GUID_s& GUID_s::operator =( + const GUID_s& x) +{ + m_guidPrefix = x.m_guidPrefix; + + + m_entityId = x.m_entityId; + + return *this; +} + +GUID_s& GUID_s::operator =( + GUID_s&& x) noexcept +{ + m_guidPrefix = std::move(x.m_guidPrefix); + + + m_entityId = std::move(x.m_entityId); + + return *this; +} + +bool GUID_s::operator ==( + const GUID_s& x) const +{ + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); +} + +bool GUID_s::operator !=( + const GUID_s& x) const +{ + return !(*this == x); +} + +size_t GUID_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; +} + +size_t GUID_s::getCdrSerializedSize( + const GUID_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize(data.guidPrefix(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize(data.entityId(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void GUID_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guidPrefix; + + scdr << m_entityId; + +} + +void GUID_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guidPrefix; + + + + dcdr >> m_entityId; + + +} + + +bool GUID_s::isKeyDefined() +{ + return false; +} + +void GUID_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void GUID_s::guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void GUID_s::guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() +{ + return m_guidPrefix; +} + + +/*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ +void GUID_s::entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) +{ + m_entityId = _entityId; +} + +/*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ +void GUID_s::entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) +{ + m_entityId = std::move(_entityId); +} + +/*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ +const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const +{ + return m_entityId; +} + +/*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ +eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() +{ + return m_entityId; +} + + + + + +SequenceNumber_s::SequenceNumber_s() +{ + // long m_high + m_high = 0; + // unsigned long m_low + m_low = 0; + +} + +SequenceNumber_s::~SequenceNumber_s() +{ +} + +SequenceNumber_s::SequenceNumber_s( + const SequenceNumber_s& x) +{ + m_high = x.m_high; + + + m_low = x.m_low; + +} + +SequenceNumber_s::SequenceNumber_s( + SequenceNumber_s&& x) noexcept +{ + m_high = x.m_high; + + + m_low = x.m_low; + +} + +SequenceNumber_s& SequenceNumber_s::operator =( + const SequenceNumber_s& x) +{ + m_high = x.m_high; + + + m_low = x.m_low; + + return *this; +} + +SequenceNumber_s& SequenceNumber_s::operator =( + SequenceNumber_s&& x) noexcept +{ + m_high = x.m_high; + + + m_low = x.m_low; + + return *this; +} + +bool SequenceNumber_s::operator ==( + const SequenceNumber_s& x) const +{ + return (m_high == x.m_high && + m_low == x.m_low); +} + +bool SequenceNumber_s::operator !=( + const SequenceNumber_s& x) const +{ + return !(*this == x); +} + +size_t SequenceNumber_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; +} + +size_t SequenceNumber_s::getCdrSerializedSize( + const SequenceNumber_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void SequenceNumber_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_high; + + scdr << m_low; + +} + +void SequenceNumber_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_high; + + + + dcdr >> m_low; + + +} + + +bool SequenceNumber_s::isKeyDefined() +{ + return false; +} + +void SequenceNumber_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ +void SequenceNumber_s::high( + int32_t _high) +{ + m_high = _high; +} + +/*! + * @brief This function returns the value of member high + * @return Value of member high + */ +int32_t SequenceNumber_s::high() const +{ + return m_high; +} + +/*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ +int32_t& SequenceNumber_s::high() +{ + return m_high; +} + + +/*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ +void SequenceNumber_s::low( + uint32_t _low) +{ + m_low = _low; +} + +/*! + * @brief This function returns the value of member low + * @return Value of member low + */ +uint32_t SequenceNumber_s::low() const +{ + return m_low; +} + +/*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ +uint32_t& SequenceNumber_s::low() +{ + return m_low; +} + + + + + +SampleIdentity_s::SampleIdentity_s() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid + + // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number + + +} + +SampleIdentity_s::~SampleIdentity_s() +{ +} + +SampleIdentity_s::SampleIdentity_s( + const SampleIdentity_s& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_sequence_number = x.m_sequence_number; + +} + +SampleIdentity_s::SampleIdentity_s( + SampleIdentity_s&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_sequence_number = std::move(x.m_sequence_number); + +} + +SampleIdentity_s& SampleIdentity_s::operator =( + const SampleIdentity_s& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_sequence_number = x.m_sequence_number; + + return *this; +} + +SampleIdentity_s& SampleIdentity_s::operator =( + SampleIdentity_s&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_sequence_number = std::move(x.m_sequence_number); + + return *this; +} + +bool SampleIdentity_s::operator ==( + const SampleIdentity_s& x) const +{ + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); +} + +bool SampleIdentity_s::operator !=( + const SampleIdentity_s& x) const +{ + return !(*this == x); +} + +size_t SampleIdentity_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; +} + +size_t SampleIdentity_s::getCdrSerializedSize( + const SampleIdentity_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize(data.sequence_number(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SampleIdentity_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_writer_guid; + + scdr << m_sequence_number; + +} + +void SampleIdentity_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_writer_guid; + + + + dcdr >> m_sequence_number; + + +} + + +bool SampleIdentity_s::isKeyDefined() +{ + return false; +} + +void SampleIdentity_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ +void SampleIdentity_s::writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) +{ + m_writer_guid = _writer_guid; +} + +/*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ +void SampleIdentity_s::writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) +{ + m_writer_guid = std::move(_writer_guid); +} + +/*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const +{ + return m_writer_guid; +} + +/*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() +{ + return m_writer_guid; +} + + +/*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ +void SampleIdentity_s::sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) +{ + m_sequence_number = _sequence_number; +} + +/*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ +void SampleIdentity_s::sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) +{ + m_sequence_number = std::move(_sequence_number); +} + +/*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ +const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const +{ + return m_sequence_number; +} + +/*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ +eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() +{ + return m_sequence_number; +} + + + + + +Locator_s::Locator_s() +{ + // long m_kind + m_kind = 0; + // unsigned long m_port + m_port = 0; + // octet m_address + memset(&m_address, 0, ((16)) * 1); + +} + +Locator_s::~Locator_s() +{ +} + +Locator_s::Locator_s( + const Locator_s& x) +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = x.m_address; + +} + +Locator_s::Locator_s( + Locator_s&& x) noexcept +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = std::move(x.m_address); + +} + +Locator_s& Locator_s::operator =( + const Locator_s& x) +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = x.m_address; + + return *this; +} + +Locator_s& Locator_s::operator =( + Locator_s&& x) noexcept +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = std::move(x.m_address); + + return *this; +} + +bool Locator_s::operator ==( + const Locator_s& x) const +{ + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); +} + +bool Locator_s::operator !=( + const Locator_s& x) const +{ + return !(*this == x); +} + +size_t Locator_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; +} + +size_t Locator_s::getCdrSerializedSize( + const Locator_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void Locator_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_kind; + + scdr << m_port; + + scdr << m_address; + + +} + +void Locator_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_kind; + + + + dcdr >> m_port; + + + + dcdr >> m_address; + + +} + + +bool Locator_s::isKeyDefined() +{ + return false; +} + +void Locator_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ +void Locator_s::kind( + int32_t _kind) +{ + m_kind = _kind; +} + +/*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ +int32_t Locator_s::kind() const +{ + return m_kind; +} + +/*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ +int32_t& Locator_s::kind() +{ + return m_kind; +} + + +/*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ +void Locator_s::port( + uint32_t _port) +{ + m_port = _port; +} + +/*! + * @brief This function returns the value of member port + * @return Value of member port + */ +uint32_t Locator_s::port() const +{ + return m_port; +} + +/*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ +uint32_t& Locator_s::port() +{ + return m_port; +} + + +/*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ +void Locator_s::address( + const std::array& _address) +{ + m_address = _address; +} + +/*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ +void Locator_s::address( + std::array&& _address) +{ + m_address = std::move(_address); +} + +/*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ +const std::array& Locator_s::address() const +{ + return m_address; +} + +/*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ +std::array& Locator_s::address() +{ + return m_address; +} + + + + + +} // namespace detail + + +DiscoveryTime::DiscoveryTime() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid + + // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid + + // unsigned long long m_time + m_time = 0; + // /type_d() m_host + + // /type_d() m_user + + // /type_d() m_process + + +} + +DiscoveryTime::~DiscoveryTime() +{ +} + +DiscoveryTime::DiscoveryTime( + const DiscoveryTime& x) +{ + m_local_participant_guid = x.m_local_participant_guid; + + + m_remote_entity_guid = x.m_remote_entity_guid; + + + m_time = x.m_time; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + +} + +DiscoveryTime::DiscoveryTime( + DiscoveryTime&& x) noexcept +{ + m_local_participant_guid = std::move(x.m_local_participant_guid); + + + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + + + m_time = x.m_time; + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + +} + +DiscoveryTime& DiscoveryTime::operator =( + const DiscoveryTime& x) +{ + m_local_participant_guid = x.m_local_participant_guid; + + + m_remote_entity_guid = x.m_remote_entity_guid; + + + m_time = x.m_time; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + + return *this; +} + +DiscoveryTime& DiscoveryTime::operator =( + DiscoveryTime&& x) noexcept +{ + m_local_participant_guid = std::move(x.m_local_participant_guid); + + + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + + + m_time = x.m_time; + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + + return *this; +} + +bool DiscoveryTime::operator ==( + const DiscoveryTime& x) const +{ + return (m_local_participant_guid == x.m_local_participant_guid && + m_remote_entity_guid == x.m_remote_entity_guid && + m_time == x.m_time && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); +} + +bool DiscoveryTime::operator !=( + const DiscoveryTime& x) const +{ + return !(*this == x); +} + +size_t DiscoveryTime::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; +} + +size_t DiscoveryTime::getCdrSerializedSize( + const DiscoveryTime& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_participant_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.remote_entity_guid(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void DiscoveryTime::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_local_participant_guid; + + scdr << m_remote_entity_guid; + + scdr << m_time; + + scdr << m_host.c_str(); + + scdr << m_user.c_str(); + + scdr << m_process.c_str(); + +} + +void DiscoveryTime::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_local_participant_guid; + + + + dcdr >> m_remote_entity_guid; + + + + dcdr >> m_time; + + + + dcdr >> m_host; + + + + dcdr >> m_user; + + + + dcdr >> m_process; + + +} + + +bool DiscoveryTime::isKeyDefined() +{ + return true; +} + +void DiscoveryTime::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_local_participant_guid.serialize(scdr); + m_remote_entity_guid.serialize(scdr); + + + + +} + +/*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ +void DiscoveryTime::local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) +{ + m_local_participant_guid = _local_participant_guid; +} + +/*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ +void DiscoveryTime::local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) +{ + m_local_participant_guid = std::move(_local_participant_guid); +} + +/*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const +{ + return m_local_participant_guid; +} + +/*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() +{ + return m_local_participant_guid; +} + + +/*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ +void DiscoveryTime::remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) +{ + m_remote_entity_guid = _remote_entity_guid; +} + +/*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ +void DiscoveryTime::remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) +{ + m_remote_entity_guid = std::move(_remote_entity_guid); +} + +/*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const +{ + return m_remote_entity_guid; +} + +/*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() +{ + return m_remote_entity_guid; +} + + +/*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ +void DiscoveryTime::time( + uint64_t _time) +{ + m_time = _time; +} + +/*! + * @brief This function returns the value of member time + * @return Value of member time + */ +uint64_t DiscoveryTime::time() const +{ + return m_time; +} + +/*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ +uint64_t& DiscoveryTime::time() +{ + return m_time; +} + + +/*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ +void DiscoveryTime::host( + const std::string& _host) +{ + m_host = _host; +} + +/*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ +void DiscoveryTime::host( + std::string&& _host) +{ + m_host = std::move(_host); +} + +/*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ +const std::string& DiscoveryTime::host() const +{ + return m_host; +} + +/*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ +std::string& DiscoveryTime::host() +{ + return m_host; +} + + +/*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ +void DiscoveryTime::user( + const std::string& _user) +{ + m_user = _user; +} + +/*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ +void DiscoveryTime::user( + std::string&& _user) +{ + m_user = std::move(_user); +} + +/*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ +const std::string& DiscoveryTime::user() const +{ + return m_user; +} + +/*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ +std::string& DiscoveryTime::user() +{ + return m_user; +} + + +/*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ +void DiscoveryTime::process( + const std::string& _process) +{ + m_process = _process; +} + +/*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ +void DiscoveryTime::process( + std::string&& _process) +{ + m_process = std::move(_process); +} + +/*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ +const std::string& DiscoveryTime::process() const +{ + return m_process; +} + +/*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ +std::string& DiscoveryTime::process() +{ + return m_process; +} + + + + + +EntityCount::EntityCount() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_guid + + // unsigned long long m_count + m_count = 0; + +} + +EntityCount::~EntityCount() +{ +} + +EntityCount::EntityCount( + const EntityCount& x) +{ + m_guid = x.m_guid; + + + m_count = x.m_count; + +} + +EntityCount::EntityCount( + EntityCount&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_count = x.m_count; + +} + +EntityCount& EntityCount::operator =( + const EntityCount& x) +{ + m_guid = x.m_guid; + + + m_count = x.m_count; + + return *this; +} + +EntityCount& EntityCount::operator =( + EntityCount&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_count = x.m_count; + + return *this; +} + +bool EntityCount::operator ==( + const EntityCount& x) const +{ + return (m_guid == x.m_guid && + m_count == x.m_count); +} + +bool EntityCount::operator !=( + const EntityCount& x) const +{ + return !(*this == x); +} + +size_t EntityCount::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; +} + +size_t EntityCount::getCdrSerializedSize( + const EntityCount& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void EntityCount::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guid; + + scdr << m_count; + +} + +void EntityCount::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guid; + + + + dcdr >> m_count; + + +} + + +bool EntityCount::isKeyDefined() +{ + return true; +} + +void EntityCount::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void EntityCount::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void EntityCount::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() +{ + return m_guid; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void EntityCount::count( + uint64_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint64_t EntityCount::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint64_t& EntityCount::count() +{ + return m_count; +} + + + + + +SampleIdentityCount::SampleIdentityCount() +{ + // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id + + // unsigned long long m_count + m_count = 0; + +} + +SampleIdentityCount::~SampleIdentityCount() +{ +} + +SampleIdentityCount::SampleIdentityCount( + const SampleIdentityCount& x) +{ + m_sample_id = x.m_sample_id; + + + m_count = x.m_count; + +} + +SampleIdentityCount::SampleIdentityCount( + SampleIdentityCount&& x) noexcept +{ + m_sample_id = std::move(x.m_sample_id); + + + m_count = x.m_count; + +} + +SampleIdentityCount& SampleIdentityCount::operator =( + const SampleIdentityCount& x) +{ + m_sample_id = x.m_sample_id; + + + m_count = x.m_count; + + return *this; +} + +SampleIdentityCount& SampleIdentityCount::operator =( + SampleIdentityCount&& x) noexcept +{ + m_sample_id = std::move(x.m_sample_id); + + + m_count = x.m_count; + + return *this; +} + +bool SampleIdentityCount::operator ==( + const SampleIdentityCount& x) const +{ + return (m_sample_id == x.m_sample_id && + m_count == x.m_count); +} + +bool SampleIdentityCount::operator !=( + const SampleIdentityCount& x) const +{ + return !(*this == x); +} + +size_t SampleIdentityCount::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; +} + +size_t SampleIdentityCount::getCdrSerializedSize( + const SampleIdentityCount& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize(data.sample_id(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void SampleIdentityCount::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sample_id; + + scdr << m_count; + +} + +void SampleIdentityCount::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sample_id; + + + + dcdr >> m_count; + + +} + + +bool SampleIdentityCount::isKeyDefined() +{ + return true; +} + +void SampleIdentityCount::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_sample_id.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ +void SampleIdentityCount::sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) +{ + m_sample_id = _sample_id; +} + +/*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ +void SampleIdentityCount::sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) +{ + m_sample_id = std::move(_sample_id); +} + +/*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ +const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const +{ + return m_sample_id; +} + +/*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ +eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() +{ + return m_sample_id; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void SampleIdentityCount::count( + uint64_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint64_t SampleIdentityCount::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint64_t& SampleIdentityCount::count() +{ + return m_count; +} + + + + + +Entity2LocatorTraffic::Entity2LocatorTraffic() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_src_guid + + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator + + // unsigned long long m_packet_count + m_packet_count = 0; + // unsigned long long m_byte_count + m_byte_count = 0; + // short m_byte_magnitude_order + m_byte_magnitude_order = 0; + +} + +Entity2LocatorTraffic::~Entity2LocatorTraffic() +{ +} + +Entity2LocatorTraffic::Entity2LocatorTraffic( + const Entity2LocatorTraffic& x) +{ + m_src_guid = x.m_src_guid; + + + m_dst_locator = x.m_dst_locator; + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + +} + +Entity2LocatorTraffic::Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept +{ + m_src_guid = std::move(x.m_src_guid); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + +} + +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( + const Entity2LocatorTraffic& x) +{ + m_src_guid = x.m_src_guid; + + + m_dst_locator = x.m_dst_locator; + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; +} + +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( + Entity2LocatorTraffic&& x) noexcept +{ + m_src_guid = std::move(x.m_src_guid); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; +} + +bool Entity2LocatorTraffic::operator ==( + const Entity2LocatorTraffic& x) const +{ + return (m_src_guid == x.m_src_guid && + m_dst_locator == x.m_dst_locator && + m_packet_count == x.m_packet_count && + m_byte_count == x.m_byte_count && + m_byte_magnitude_order == x.m_byte_magnitude_order); +} + +bool Entity2LocatorTraffic::operator !=( + const Entity2LocatorTraffic& x) const +{ + return !(*this == x); +} + +size_t Entity2LocatorTraffic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; +} + +size_t Entity2LocatorTraffic::getCdrSerializedSize( + const Entity2LocatorTraffic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.src_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + + +void Entity2LocatorTraffic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_src_guid; + + scdr << m_dst_locator; + + scdr << m_packet_count; + + scdr << m_byte_count; + + scdr << m_byte_magnitude_order; + +} + +void Entity2LocatorTraffic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_src_guid; + + + + dcdr >> m_dst_locator; + + + + dcdr >> m_packet_count; + + + + dcdr >> m_byte_count; + + + + dcdr >> m_byte_magnitude_order; + + +} + + +bool Entity2LocatorTraffic::isKeyDefined() +{ + return true; +} + +void Entity2LocatorTraffic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_src_guid.serialize(scdr); + m_dst_locator.serialize(scdr); + + + +} + +/*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ +void Entity2LocatorTraffic::src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) +{ + m_src_guid = _src_guid; +} + +/*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ +void Entity2LocatorTraffic::src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) +{ + m_src_guid = std::move(_src_guid); +} + +/*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const +{ + return m_src_guid; +} + +/*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() +{ + return m_src_guid; +} + + +/*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ +void Entity2LocatorTraffic::dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) +{ + m_dst_locator = _dst_locator; +} + +/*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ +void Entity2LocatorTraffic::dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) +{ + m_dst_locator = std::move(_dst_locator); +} + +/*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const +{ + return m_dst_locator; +} + +/*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() +{ + return m_dst_locator; +} + + +/*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ +void Entity2LocatorTraffic::packet_count( + uint64_t _packet_count) +{ + m_packet_count = _packet_count; +} + +/*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ +uint64_t Entity2LocatorTraffic::packet_count() const +{ + return m_packet_count; +} + +/*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ +uint64_t& Entity2LocatorTraffic::packet_count() +{ + return m_packet_count; +} + + +/*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ +void Entity2LocatorTraffic::byte_count( + uint64_t _byte_count) +{ + m_byte_count = _byte_count; +} + +/*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ +uint64_t Entity2LocatorTraffic::byte_count() const +{ + return m_byte_count; +} + +/*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ +uint64_t& Entity2LocatorTraffic::byte_count() +{ + return m_byte_count; +} + + +/*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ +void Entity2LocatorTraffic::byte_magnitude_order( + int16_t _byte_magnitude_order) +{ + m_byte_magnitude_order = _byte_magnitude_order; +} + +/*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ +int16_t Entity2LocatorTraffic::byte_magnitude_order() const +{ + return m_byte_magnitude_order; +} + +/*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ +int16_t& Entity2LocatorTraffic::byte_magnitude_order() +{ + return m_byte_magnitude_order; +} + + + + + +WriterReaderData::WriterReaderData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid + + // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid + + // float m_data + m_data = 0.0; + +} + +WriterReaderData::~WriterReaderData() +{ +} + +WriterReaderData::WriterReaderData( + const WriterReaderData& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_reader_guid = x.m_reader_guid; + + + m_data = x.m_data; + +} + +WriterReaderData::WriterReaderData( + WriterReaderData&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_reader_guid = std::move(x.m_reader_guid); + + + m_data = x.m_data; + +} + +WriterReaderData& WriterReaderData::operator =( + const WriterReaderData& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_reader_guid = x.m_reader_guid; + + + m_data = x.m_data; + + return *this; +} + +WriterReaderData& WriterReaderData::operator =( + WriterReaderData&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_reader_guid = std::move(x.m_reader_guid); + + + m_data = x.m_data; + + return *this; +} + +bool WriterReaderData::operator ==( + const WriterReaderData& x) const +{ + return (m_writer_guid == x.m_writer_guid && + m_reader_guid == x.m_reader_guid && + m_data == x.m_data); +} + +bool WriterReaderData::operator !=( + const WriterReaderData& x) const +{ + return !(*this == x); +} + +size_t WriterReaderData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; +} + +size_t WriterReaderData::getCdrSerializedSize( + const WriterReaderData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.reader_guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void WriterReaderData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_writer_guid; + + scdr << m_reader_guid; + + scdr << m_data; + +} + +void WriterReaderData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_writer_guid; + + + + dcdr >> m_reader_guid; + + + + dcdr >> m_data; + + +} + + +bool WriterReaderData::isKeyDefined() +{ + return true; +} + +void WriterReaderData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_writer_guid.serialize(scdr); + m_reader_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ +void WriterReaderData::writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) +{ + m_writer_guid = _writer_guid; +} + +/*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ +void WriterReaderData::writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) +{ + m_writer_guid = std::move(_writer_guid); +} + +/*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const +{ + return m_writer_guid; +} + +/*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() +{ + return m_writer_guid; +} + + +/*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ +void WriterReaderData::reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) +{ + m_reader_guid = _reader_guid; +} + +/*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ +void WriterReaderData::reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) +{ + m_reader_guid = std::move(_reader_guid); +} + +/*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const +{ + return m_reader_guid; +} + +/*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() +{ + return m_reader_guid; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void WriterReaderData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float WriterReaderData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& WriterReaderData::data() +{ + return m_data; +} + + + + + +Locator2LocatorData::Locator2LocatorData() +{ + // eprosima::fastdds::statistics::detail::Locator_s m_src_locator + + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator + + // float m_data + m_data = 0.0; + +} + +Locator2LocatorData::~Locator2LocatorData() +{ +} + +Locator2LocatorData::Locator2LocatorData( + const Locator2LocatorData& x) +{ + m_src_locator = x.m_src_locator; + + + m_dst_locator = x.m_dst_locator; + + + m_data = x.m_data; + +} + +Locator2LocatorData::Locator2LocatorData( + Locator2LocatorData&& x) noexcept +{ + m_src_locator = std::move(x.m_src_locator); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_data = x.m_data; + +} + +Locator2LocatorData& Locator2LocatorData::operator =( + const Locator2LocatorData& x) +{ + m_src_locator = x.m_src_locator; + + + m_dst_locator = x.m_dst_locator; + + + m_data = x.m_data; + + return *this; +} + +Locator2LocatorData& Locator2LocatorData::operator =( + Locator2LocatorData&& x) noexcept +{ + m_src_locator = std::move(x.m_src_locator); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_data = x.m_data; + + return *this; +} + +bool Locator2LocatorData::operator ==( + const Locator2LocatorData& x) const +{ + return (m_src_locator == x.m_src_locator && + m_dst_locator == x.m_dst_locator && + m_data == x.m_data); +} + +bool Locator2LocatorData::operator !=( + const Locator2LocatorData& x) const +{ + return !(*this == x); +} + +size_t Locator2LocatorData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; +} + +size_t Locator2LocatorData::getCdrSerializedSize( + const Locator2LocatorData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.src_locator(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void Locator2LocatorData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_src_locator; + + scdr << m_dst_locator; + + scdr << m_data; + +} + +void Locator2LocatorData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_src_locator; + + + + dcdr >> m_dst_locator; + + + + dcdr >> m_data; + + +} + + +bool Locator2LocatorData::isKeyDefined() +{ + return true; +} + +void Locator2LocatorData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_src_locator.serialize(scdr); + m_dst_locator.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ +void Locator2LocatorData::src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) +{ + m_src_locator = _src_locator; +} + +/*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ +void Locator2LocatorData::src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) +{ + m_src_locator = std::move(_src_locator); +} + +/*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const +{ + return m_src_locator; +} + +/*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() +{ + return m_src_locator; +} + + +/*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ +void Locator2LocatorData::dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) +{ + m_dst_locator = _dst_locator; +} + +/*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ +void Locator2LocatorData::dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) +{ + m_dst_locator = std::move(_dst_locator); +} + +/*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const +{ + return m_dst_locator; +} + +/*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() +{ + return m_dst_locator; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void Locator2LocatorData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float Locator2LocatorData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& Locator2LocatorData::data() +{ + return m_data; +} + + + + + +EntityData::EntityData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_guid + + // float m_data + m_data = 0.0; + +} + +EntityData::~EntityData() +{ +} + +EntityData::EntityData( + const EntityData& x) +{ + m_guid = x.m_guid; + + + m_data = x.m_data; + +} + +EntityData::EntityData( + EntityData&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_data = x.m_data; + +} + +EntityData& EntityData::operator =( + const EntityData& x) +{ + m_guid = x.m_guid; + + + m_data = x.m_data; + + return *this; +} + +EntityData& EntityData::operator =( + EntityData&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_data = x.m_data; + + return *this; +} + +bool EntityData::operator ==( + const EntityData& x) const +{ + return (m_guid == x.m_guid && + m_data == x.m_data); +} + +bool EntityData::operator !=( + const EntityData& x) const +{ + return !(*this == x); +} + +size_t EntityData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; +} + +size_t EntityData::getCdrSerializedSize( + const EntityData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void EntityData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guid; + + scdr << m_data; + +} + +void EntityData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guid; + + + + dcdr >> m_data; + + +} + + +bool EntityData::isKeyDefined() +{ + return true; +} + +void EntityData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void EntityData::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void EntityData::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() +{ + return m_guid; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void EntityData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float EntityData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& EntityData::data() +{ + return m_data; +} + + + + + +PhysicalData::PhysicalData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid + + // /type_d() m_host + + // /type_d() m_user + + // /type_d() m_process + + +} + +PhysicalData::~PhysicalData() +{ +} + +PhysicalData::PhysicalData( + const PhysicalData& x) +{ + m_participant_guid = x.m_participant_guid; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + +} + +PhysicalData::PhysicalData( + PhysicalData&& x) noexcept +{ + m_participant_guid = std::move(x.m_participant_guid); + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + +} + +PhysicalData& PhysicalData::operator =( + const PhysicalData& x) +{ + m_participant_guid = x.m_participant_guid; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + + return *this; +} + +PhysicalData& PhysicalData::operator =( + PhysicalData&& x) noexcept +{ + m_participant_guid = std::move(x.m_participant_guid); + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + + return *this; +} + +bool PhysicalData::operator ==( + const PhysicalData& x) const +{ + return (m_participant_guid == x.m_participant_guid && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); +} + +bool PhysicalData::operator !=( + const PhysicalData& x) const +{ + return !(*this == x); +} + +size_t PhysicalData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; +} + +size_t PhysicalData::getCdrSerializedSize( + const PhysicalData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.participant_guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void PhysicalData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_participant_guid; + + scdr << m_host.c_str(); + + scdr << m_user.c_str(); + + scdr << m_process.c_str(); + +} + +void PhysicalData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_participant_guid; + + + + dcdr >> m_host; + + + + dcdr >> m_user; + + + + dcdr >> m_process; + + +} + + +bool PhysicalData::isKeyDefined() +{ + return true; +} + +void PhysicalData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_participant_guid.serialize(scdr); + + + +} + +/*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ +void PhysicalData::participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) +{ + m_participant_guid = _participant_guid; +} + +/*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ +void PhysicalData::participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) +{ + m_participant_guid = std::move(_participant_guid); +} + +/*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const +{ + return m_participant_guid; +} + +/*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() +{ + return m_participant_guid; +} + + +/*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ +void PhysicalData::host( + const std::string& _host) +{ + m_host = _host; +} + +/*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ +void PhysicalData::host( + std::string&& _host) +{ + m_host = std::move(_host); +} + +/*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ +const std::string& PhysicalData::host() const +{ + return m_host; +} + +/*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ +std::string& PhysicalData::host() +{ + return m_host; +} + + +/*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ +void PhysicalData::user( + const std::string& _user) +{ + m_user = _user; +} + +/*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ +void PhysicalData::user( + std::string&& _user) +{ + m_user = std::move(_user); +} + +/*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ +const std::string& PhysicalData::user() const +{ + return m_user; +} + +/*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ +std::string& PhysicalData::user() +{ + return m_user; +} + + +/*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ +void PhysicalData::process( + const std::string& _process) +{ + m_process = _process; +} + +/*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ +void PhysicalData::process( + std::string&& _process) +{ + m_process = std::move(_process); +} + +/*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ +const std::string& PhysicalData::process() const +{ + return m_process; +} + +/*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ +std::string& PhysicalData::process() +{ + return m_process; +} + + + + + + +Data::Data() +{ + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data + + // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data + + // eprosima::fastdds::statistics::EntityData m_entity_data + + // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic + + // eprosima::fastdds::statistics::EntityCount m_entity_count + + // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time + + // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count + + // eprosima::fastdds::statistics::PhysicalData m_physical_data + +} + +Data::~Data() +{ +} + +Data::Data( + const Data& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; + + default: + break; + } +} + +Data::Data( + Data&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + + default: + break; + } +} + +Data& Data::operator =( + const Data& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; + + default: + break; + } + + return *this; +} + +Data& Data::operator =( + Data&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + + default: + break; + } + + return *this; +} + +bool Data::operator ==( + const Data& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + return (m_writer_reader_data == x.m_writer_reader_data); + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + return (m_locator2locator_data == x.m_locator2locator_data); + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + return (m_entity_data == x.m_entity_data); + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + return (m_entity2locator_traffic == x.m_entity2locator_traffic); + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + return (m_entity_count == x.m_entity_count); + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + return (m_discovery_time == x.m_discovery_time); + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + return (m_sample_identity_count == x.m_sample_identity_count); + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + return (m_physical_data == x.m_physical_data); + break; + + default: + break; + } + return false; +} + +bool Data::operator !=( + const Data& x) const +{ + return !(*this == x); +} + +void Data::_d( + eprosima::fastdds::statistics::EventKind __d) +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + switch(__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + switch(__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + switch(__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + switch(__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + switch(__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + switch(__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + switch(__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + switch(__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +eprosima::fastdds::statistics::EventKind Data::_d() const +{ + return m__d; +} + +eprosima::fastdds::statistics::EventKind& Data::_d() +{ + return m__d; +} + +void Data::writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) +{ + m_writer_reader_data = _writer_reader_data; + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + +} + +void Data::writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) +{ + m_writer_reader_data = std::move(_writer_reader_data); + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + +} + +const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; +} + +eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; +} + + +void Data::locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) +{ + m_locator2locator_data = _locator2locator_data; + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + +} + +void Data::locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) +{ + m_locator2locator_data = std::move(_locator2locator_data); + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + +} + +const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; +} + +eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; +} + + +void Data::entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data) +{ + m_entity_data = _entity_data; + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + +} + +void Data::entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data) +{ + m_entity_data = std::move(_entity_data); + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + +} + +const eprosima::fastdds::statistics::EntityData& Data::entity_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_data; +} + +eprosima::fastdds::statistics::EntityData& Data::entity_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_data; +} + + +void Data::entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) +{ + m_entity2locator_traffic = _entity2locator_traffic; + m__d = eprosima::fastdds::statistics::RTPS_SENT; + +} + +void Data::entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) +{ + m_entity2locator_traffic = std::move(_entity2locator_traffic); + m__d = eprosima::fastdds::statistics::RTPS_SENT; + +} + +const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; +} + +eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; +} + + +void Data::entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count) +{ + m_entity_count = _entity_count; + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + +} + +void Data::entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count) +{ + m_entity_count = std::move(_entity_count); + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + +} + +const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_count; +} + +eprosima::fastdds::statistics::EntityCount& Data::entity_count() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_count; +} + + +void Data::discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) +{ + m_discovery_time = _discovery_time; + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + +} + +void Data::discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) +{ + m_discovery_time = std::move(_discovery_time); + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + +} + +const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_discovery_time; +} + +eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_discovery_time; +} + + +void Data::sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) +{ + m_sample_identity_count = _sample_identity_count; + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + +} + +void Data::sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) +{ + m_sample_identity_count = std::move(_sample_identity_count); + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + +} + +const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; +} + +eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; +} + + +void Data::physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data) +{ + m_physical_data = _physical_data; + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + +} + +void Data::physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data) +{ + m_physical_data = std::move(_physical_data); + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + +} + +const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_physical_data; +} + +eprosima::fastdds::statistics::PhysicalData& Data::physical_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_physical_data; +} + + +// TODO(Ricardo) Review +size_t Data::getCdrSerializedSize( + const Data& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + switch(data.m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + current_alignment += eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize(data.writer_reader_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + current_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize(data.locator2locator_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + current_alignment += eprosima::fastdds::statistics::EntityData::getCdrSerializedSize(data.entity_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + current_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize(data.entity2locator_traffic(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + current_alignment += eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize(data.entity_count(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + current_alignment += eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize(data.discovery_time(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + current_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize(data.sample_identity_count(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + current_alignment += eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize(data.physical_data(), current_alignment); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void Data::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + scdr << m_writer_reader_data; + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + scdr << m_locator2locator_data; + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + scdr << m_entity_data; + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + scdr << m_entity2locator_traffic; + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + scdr << m_entity_count; + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + scdr << m_discovery_time; + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + scdr << m_sample_identity_count; + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + scdr << m_physical_data; + + break; + + default: + break; + } +} + +void Data::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t bitmask_value = 0; + dcdr >> bitmask_value; + m__d = (eprosima::fastdds::statistics::EventKind)bitmask_value; + } + + + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + dcdr >> m_writer_reader_data; + + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + dcdr >> m_locator2locator_data; + + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + dcdr >> m_entity_data; + + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + dcdr >> m_entity2locator_traffic; + + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + dcdr >> m_entity_count; + + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + dcdr >> m_discovery_time; + + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + dcdr >> m_sample_identity_count; + + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + dcdr >> m_physical_data; + + + break; + + default: + break; + } +} + + + + + +} // namespace statistics + + +} // namespace fastdds + + +} // namespace eprosima + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/src/cpp/statistics/types/typesv1.h b/src/cpp/statistics/types/typesv1.h new file mode 100644 index 00000000000..6880ab8c6ed --- /dev/null +++ b/src/cpp/statistics/types/typesv1.h @@ -0,0 +1,3092 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace eprosima { + namespace fastdds { + namespace statistics { + namespace detail { + + + /*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ + class EntityId_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::EntityId_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + std::array m_value; + + }; + + + + /*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ + class GuidPrefix_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + std::array m_value; + + }; + + + + /*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ + class GUID_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const; + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::GUID_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; + eprosima::fastdds::statistics::detail::EntityId_s m_entityId; + + }; + + + + /*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ + class SequenceNumber_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const; + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high); + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const; + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high(); + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low); + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const; + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_high; + uint32_t m_low; + + }; + + + + /*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ + class SampleIdentity_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; + + }; + + + + /*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ + class Locator_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const; + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind); + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const; + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind(); + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port); + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const; + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port(); + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address); + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address); + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const; + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::Locator_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_kind; + uint32_t m_port; + std::array m_address; + + }; + + } // namespace detail + + + /*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ + class DiscoveryTime + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const; + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time); + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const; + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::DiscoveryTime& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; + eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; + uint64_t m_time; + std::string m_host; + std::string m_user; + std::string m_process; + + }; + + + + /*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ + class EntityCount + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::EntityCount& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + uint64_t m_count; + + }; + + + + /*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ + class SampleIdentityCount + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const; + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::SampleIdentityCount& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; + uint64_t m_count; + + }; + + + + /*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ + class Entity2LocatorTraffic + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count); + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const; + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count(); + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count); + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const; + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count(); + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order); + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const; + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_src_guid; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + uint64_t m_packet_count; + uint64_t m_byte_count; + int16_t m_byte_magnitude_order; + + }; + + + + /*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ + class WriterReaderData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::WriterReaderData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ + class Locator2LocatorData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const; + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Locator2LocatorData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::Locator_s m_src_locator; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ + class EntityData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::EntityData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ + class PhysicalData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const; + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::PhysicalData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + + }; + + /*! + * @brief This class represents the bitmask EventKind defined by the user in the IDL file. + * @ingroup types + */ + enum EventKindBits : uint32_t + { + HISTORY2HISTORY_LATENCY = 0x01ull << 0, + NETWORK_LATENCY = 0x01ull << 1, + PUBLICATION_THROUGHPUT = 0x01ull << 2, + SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, + RTPS_SENT = 0x01ull << 4, + RTPS_LOST = 0x01ull << 5, + RESENT_DATAS = 0x01ull << 6, + HEARTBEAT_COUNT = 0x01ull << 7, + ACKNACK_COUNT = 0x01ull << 8, + NACKFRAG_COUNT = 0x01ull << 9, + GAP_COUNT = 0x01ull << 10, + DATA_COUNT = 0x01ull << 11, + PDP_PACKETS = 0x01ull << 12, + EDP_PACKETS = 0x01ull << 13, + DISCOVERED_ENTITY = 0x01ull << 14, + SAMPLE_DATAS = 0x01ull << 15, + PHYSICAL_DATA = 0x01ull << 16 + }; + typedef uint32_t EventKind; + + + /*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ + class Data + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::EventKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data); + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data); + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count); + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count); + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data); + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data); + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Data& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + + private: + + eprosima::fastdds::statistics::EventKind m__d; + + eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; + eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; + eprosima::fastdds::statistics::EntityData m_entity_data; + eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; + eprosima::fastdds::statistics::EntityCount m_entity_count; + eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; + eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; + eprosima::fastdds::statistics::PhysicalData m_physical_data; + }; + + } // namespace statistics + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index b2a77a93461..debfb27a600 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -243,19 +243,26 @@ endif() file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} types/HelloWorld.cxx + types/HelloWorldv1.cxx types/HelloWorldPubSubTypes.cxx types/HelloWorldTypeObject.cxx types/KeyedHelloWorld.cxx + types/KeyedHelloWorldv1.cxx types/KeyedHelloWorldPubSubTypes.cxx types/StringTest.cxx + types/StringTestv1.cxx types/StringTestPubSubTypes.cxx types/Data64kb.cxx + types/Data64kbv1.cxx types/Data64kbPubSubTypes.cxx types/Data1mb.cxx + types/Data1mbv1.cxx types/Data1mbPubSubTypes.cxx types/KeyedData1mb.cxx + types/KeyedData1mbv1.cxx types/KeyedData1mbPubSubTypes.cxx types/FixedSized.cxx + types/FixedSizedv1.cxx types/FixedSizedPubSubTypes.cxx utils/data_generators.cpp @@ -279,23 +286,32 @@ add_blackbox_gtest(BlackboxTests_RTPS SOURCES ${RTPS_BLACKBOXTESTS_TEST_SOURCE} file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} types/HelloWorld.cxx + types/HelloWorldv1.cxx types/HelloWorldPubSubTypes.cxx types/HelloWorldTypeObject.cxx types/KeyedHelloWorld.cxx + types/KeyedHelloWorldv1.cxx types/KeyedHelloWorldPubSubTypes.cxx types/StringTest.cxx + types/StringTestv1.cxx types/StringTestPubSubTypes.cxx types/Data64kb.cxx + types/Data64kbv1.cxx types/Data64kbPubSubTypes.cxx types/Data1mb.cxx + types/Data1mbv1.cxx types/Data1mbPubSubTypes.cxx types/KeyedData1mb.cxx + types/KeyedData1mbv1.cxx types/KeyedData1mbPubSubTypes.cxx types/FixedSized.cxx + types/FixedSizedv1.cxx types/FixedSizedPubSubTypes.cxx types/TestIncludeRegression3361.cxx + types/TestIncludeRegression3361v1.cxx types/TestIncludeRegression3361TypeObject.cxx types/TestRegression3361.cxx + types/TestRegression3361v1.cxx types/TestRegression3361PubSubTypes.cxx types/TestRegression3361TypeObject.cxx @@ -391,6 +407,7 @@ if(FASTDDS_PIM_API_TESTS) set(statistics_sources ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ) diff --git a/test/blackbox/common/RTPSAsSocketWriter.hpp b/test/blackbox/common/RTPSAsSocketWriter.hpp index 010cce25843..64a5ce63f84 100644 --- a/test/blackbox/common/RTPSAsSocketWriter.hpp +++ b/test/blackbox/common/RTPSAsSocketWriter.hpp @@ -136,10 +136,15 @@ class RTPSAsSocketWriter : public eprosima::fastrtps::rtps::WriterListener eprosima::fastrtps::rtps::CacheChange_t* ch = writer_->new_change([&]() -> uint32_t { size_t current_alignment = 4 + magicword_.size() + 1; +#if FASTCDR_VERSION_MAJOR == 1 + return (uint32_t)(current_alignment + type::getCdrSerializedSize(*it, + current_alignment)); +#else eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastdds::rtps:: DEFAULT_XCDR_VERSION); return (uint32_t)(current_alignment + calculator.calculate_serialized_size(*it, current_alignment)); +#endif // FASTCDR_VERSION_MAJOR == 1 } , eprosima::fastrtps::rtps::ALIVE); @@ -149,7 +154,11 @@ class RTPSAsSocketWriter : public eprosima::fastrtps::rtps::WriterListener cdr << magicword_; cdr << *it; +#if FASTCDR_VERSION_MAJOR == 1 + ch->serializedPayload.length = static_cast(cdr.getSerializedDataLength()); +#else ch->serializedPayload.length = static_cast(cdr.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 history_->add_change(ch); it = msgs.erase(it); diff --git a/test/blackbox/common/RTPSWithRegistrationReader.hpp b/test/blackbox/common/RTPSWithRegistrationReader.hpp index c19705df021..5b9603c1b3a 100644 --- a/test/blackbox/common/RTPSWithRegistrationReader.hpp +++ b/test/blackbox/common/RTPSWithRegistrationReader.hpp @@ -573,7 +573,12 @@ class RTPSWithRegistrationReader type data; eprosima::fastcdr::FastBuffer buffer((char*)change->serializedPayload.data, change->serializedPayload.length); - eprosima::fastcdr::Cdr cdr(buffer); + eprosima::fastcdr::Cdr cdr(buffer +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); cdr.read_encapsulation(); cdr >> data; diff --git a/test/blackbox/common/RTPSWithRegistrationWriter.hpp b/test/blackbox/common/RTPSWithRegistrationWriter.hpp index 1a8ddfba842..459f7223694 100644 --- a/test/blackbox/common/RTPSWithRegistrationWriter.hpp +++ b/test/blackbox/common/RTPSWithRegistrationWriter.hpp @@ -233,7 +233,11 @@ class RTPSWithRegistrationWriter cdr.serialize_encapsulation(); cdr << *it; +#if FASTCDR_VERSION_MAJOR == 1 + ch->serializedPayload.length = static_cast(cdr.getSerializedDataLength()); +#else ch->serializedPayload.length = static_cast(cdr.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 if (ch->serializedPayload.length > 65000u) { ch->setFragmentSize(65000u); @@ -256,7 +260,11 @@ class RTPSWithRegistrationWriter cdr.serialize_encapsulation(); cdr << msg; +#if FASTCDR_VERSION_MAJOR == 1 + ch->serializedPayload.length = static_cast(cdr.getSerializedDataLength()); +#else ch->serializedPayload.length = static_cast(cdr.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 if (ch->serializedPayload.length > 65000u) { ch->setFragmentSize(65000u); diff --git a/test/blackbox/types/Data1mb.cxx b/test/blackbox/types/Data1mb.cxx index 3c7e00ffef3..52b9748fed0 100644 --- a/test/blackbox/types/Data1mb.cxx +++ b/test/blackbox/types/Data1mb.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Data1mb.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,12 @@ using namespace eprosima::fastcdr::exception; #include + + + + Data1mb::Data1mb() { - } Data1mb::~Data1mb() @@ -62,7 +68,6 @@ Data1mb& Data1mb::operator =( { m_data = x.m_data; - return *this; } @@ -71,7 +76,6 @@ Data1mb& Data1mb::operator =( { m_data = std::move(x.m_data); - return *this; } @@ -128,3 +132,5 @@ std::vector& Data1mb::data() // Include auxiliary functions like for serializing/deserializing. #include "Data1mbCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data1mb.h b/test/blackbox/types/Data1mb.h index e7715973cb0..98f2d058f3f 100644 --- a/test/blackbox/types/Data1mb.h +++ b/test/blackbox/types/Data1mb.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Data1mbv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_DATA1MB_H_ #define _FAST_DDS_GENERATED_DATA1MB_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,10 @@ class CdrSizeCalculator; + + + + /*! * @brief This class represents the structure Data1mb defined by the user in the IDL file. * @ingroup Data1mb @@ -161,3 +171,6 @@ class Data1mb #endif // _FAST_DDS_GENERATED_DATA1MB_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data1mbCdrAux.hpp b/test/blackbox/types/Data1mbCdrAux.hpp index 08a20622704..63df7fdd02d 100644 --- a/test/blackbox/types/Data1mbCdrAux.hpp +++ b/test/blackbox/types/Data1mbCdrAux.hpp @@ -34,6 +34,10 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Data1mb& data); @@ -42,4 +46,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DATA1MBCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DATA1MBCDRAUX_HPP_ + diff --git a/test/blackbox/types/Data1mbCdrAux.ipp b/test/blackbox/types/Data1mbCdrAux.ipp index 396505534fb..13316beffae 100644 --- a/test/blackbox/types/Data1mbCdrAux.ipp +++ b/test/blackbox/types/Data1mbCdrAux.ipp @@ -34,6 +34,10 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +77,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +118,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DATA1MBCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DATA1MBCDRAUX_IPP_ + diff --git a/test/blackbox/types/Data1mbPubSubTypes.cxx b/test/blackbox/types/Data1mbPubSubTypes.cxx index 2e627881b38..0cbf598d813 100644 --- a/test/blackbox/types/Data1mbPubSubTypes.cxx +++ b/test/blackbox/types/Data1mbPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "Data1mbPubSubTypes.h" #include "Data1mbCdrAux.hpp" @@ -31,10 +29,19 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + + Data1mbPubSubType::Data1mbPubSubType() { setName("Data1mb"); - uint32_t type_size = Data1mb_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Data1mb::getMaxCdrSerializedSize()); +#else + Data1mb_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +72,12 @@ bool Data1mbPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +92,11 @@ bool Data1mbPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +113,11 @@ bool Data1mbPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +140,26 @@ std::function Data1mbPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +191,20 @@ bool Data1mbPubSubType::getKey( Data1mb_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Data1mb_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/Data1mbPubSubTypes.h b/test/blackbox/types/Data1mbPubSubTypes.h index 918f79fd867..a6ec2e9f983 100644 --- a/test/blackbox/types/Data1mbPubSubTypes.h +++ b/test/blackbox/types/Data1mbPubSubTypes.h @@ -38,6 +38,10 @@ #endif // GEN_API_VER + + + + /*! * @brief This class represents the TopicDataType of the type Data1mb defined by the user in the IDL file. * @ingroup Data1mb diff --git a/test/blackbox/types/Data1mbv1.cxx b/test/blackbox/types/Data1mbv1.cxx new file mode 100644 index 00000000000..c5a195c6f61 --- /dev/null +++ b/test/blackbox/types/Data1mbv1.cxx @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Data1mb.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Data1mb.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Data1mb_max_cdr_typesize 1024008ULL; + + + + + + +Data1mb::Data1mb() +{ + // sequence m_data + + +} + +Data1mb::~Data1mb() +{ +} + +Data1mb::Data1mb( + const Data1mb& x) +{ + m_data = x.m_data; + +} + +Data1mb::Data1mb( + Data1mb&& x) noexcept +{ + m_data = std::move(x.m_data); + +} + +Data1mb& Data1mb::operator =( + const Data1mb& x) +{ + m_data = x.m_data; + + return *this; +} + +Data1mb& Data1mb::operator =( + Data1mb&& x) noexcept +{ + m_data = std::move(x.m_data); + + return *this; +} + +bool Data1mb::operator ==( + const Data1mb& x) const +{ + return (m_data == x.m_data); +} + +bool Data1mb::operator !=( + const Data1mb& x) const +{ + return !(*this == x); +} + +size_t Data1mb::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Data1mb_max_cdr_typesize; +} + +size_t Data1mb::getCdrSerializedSize( + const Data1mb& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.data().size() > 0) + { + current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + return current_alignment - initial_alignment; +} + + +void Data1mb::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_data; + + +} + +void Data1mb::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_data; + + +} + + +bool Data1mb::isKeyDefined() +{ + return false; +} + +void Data1mb::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void Data1mb::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void Data1mb::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& Data1mb::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& Data1mb::data() +{ + return m_data; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data1mbv1.h b/test/blackbox/types/Data1mbv1.h new file mode 100644 index 00000000000..960ad6760b2 --- /dev/null +++ b/test/blackbox/types/Data1mbv1.h @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Data1mb.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_DATA1MB_H_ +#define _FAST_DDS_GENERATED_DATA1MB_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DATA1MB_SOURCE) +#define DATA1MB_DllAPI __declspec( dllexport ) +#else +#define DATA1MB_DllAPI __declspec( dllimport ) +#endif // DATA1MB_SOURCE +#else +#define DATA1MB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DATA1MB_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + + + +/*! + * @brief This class represents the structure Data1mb defined by the user in the IDL file. + * @ingroup Data1mb + */ +class Data1mb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data1mb(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data1mb(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb( + const Data1mb& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb( + Data1mb&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb& operator =( + const Data1mb& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Data1mb that will be copied. + */ + eProsima_user_DllExport Data1mb& operator =( + Data1mb&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Data1mb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data1mb& x) const; + + /*! + * @brief Comparison operator. + * @param x Data1mb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data1mb& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Data1mb& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_data; + +}; + + +#endif // _FAST_DDS_GENERATED_DATA1MB_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data64kb.cxx b/test/blackbox/types/Data64kb.cxx index b05ec82bd80..83b6759be62 100644 --- a/test/blackbox/types/Data64kb.cxx +++ b/test/blackbox/types/Data64kb.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Data64kb.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,12 @@ using namespace eprosima::fastcdr::exception; #include + + + + Data64kb::Data64kb() { - } Data64kb::~Data64kb() @@ -62,7 +68,6 @@ Data64kb& Data64kb::operator =( { m_data = x.m_data; - return *this; } @@ -71,7 +76,6 @@ Data64kb& Data64kb::operator =( { m_data = std::move(x.m_data); - return *this; } @@ -128,3 +132,5 @@ std::vector& Data64kb::data() // Include auxiliary functions like for serializing/deserializing. #include "Data64kbCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data64kb.h b/test/blackbox/types/Data64kb.h index a3cd93db559..0599f7e7f85 100644 --- a/test/blackbox/types/Data64kb.h +++ b/test/blackbox/types/Data64kb.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Data64kbv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_DATA64KB_H_ #define _FAST_DDS_GENERATED_DATA64KB_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,10 @@ class CdrSizeCalculator; + + + + /*! * @brief This class represents the structure Data64kb defined by the user in the IDL file. * @ingroup Data64kb @@ -161,3 +171,6 @@ class Data64kb #endif // _FAST_DDS_GENERATED_DATA64KB_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/Data64kbCdrAux.hpp b/test/blackbox/types/Data64kbCdrAux.hpp index 109997063fd..0b4ebbaab11 100644 --- a/test/blackbox/types/Data64kbCdrAux.hpp +++ b/test/blackbox/types/Data64kbCdrAux.hpp @@ -34,6 +34,10 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Data64kb& data); @@ -42,4 +46,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DATA64KBCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DATA64KBCDRAUX_HPP_ + diff --git a/test/blackbox/types/Data64kbCdrAux.ipp b/test/blackbox/types/Data64kbCdrAux.ipp index 43b6de13995..0d0bc58843a 100644 --- a/test/blackbox/types/Data64kbCdrAux.ipp +++ b/test/blackbox/types/Data64kbCdrAux.ipp @@ -34,6 +34,10 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +77,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +118,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_DATA64KBCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_DATA64KBCDRAUX_IPP_ + diff --git a/test/blackbox/types/Data64kbPubSubTypes.cxx b/test/blackbox/types/Data64kbPubSubTypes.cxx index d35de9f41ee..0b8d5772498 100644 --- a/test/blackbox/types/Data64kbPubSubTypes.cxx +++ b/test/blackbox/types/Data64kbPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "Data64kbPubSubTypes.h" #include "Data64kbCdrAux.hpp" @@ -31,10 +29,19 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + + Data64kbPubSubType::Data64kbPubSubType() { setName("Data64kb"); - uint32_t type_size = Data64kb_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(Data64kb::getMaxCdrSerializedSize()); +#else + Data64kb_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +72,12 @@ bool Data64kbPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +92,11 @@ bool Data64kbPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +113,11 @@ bool Data64kbPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +140,26 @@ std::function Data64kbPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +191,20 @@ bool Data64kbPubSubType::getKey( Data64kb_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || Data64kb_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/Data64kbPubSubTypes.h b/test/blackbox/types/Data64kbPubSubTypes.h index 9b96904f39b..18364f202c6 100644 --- a/test/blackbox/types/Data64kbPubSubTypes.h +++ b/test/blackbox/types/Data64kbPubSubTypes.h @@ -38,6 +38,10 @@ #endif // GEN_API_VER + + + + /*! * @brief This class represents the TopicDataType of the type Data64kb defined by the user in the IDL file. * @ingroup Data64kb diff --git a/test/blackbox/types/Data64kbv1.cxx b/test/blackbox/types/Data64kbv1.cxx new file mode 100644 index 00000000000..ee73e714a24 --- /dev/null +++ b/test/blackbox/types/Data64kbv1.cxx @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Data64kb.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Data64kb.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define Data64kb_max_cdr_typesize 64004ULL; + + + + + + +Data64kb::Data64kb() +{ + // sequence m_data + + +} + +Data64kb::~Data64kb() +{ +} + +Data64kb::Data64kb( + const Data64kb& x) +{ + m_data = x.m_data; + +} + +Data64kb::Data64kb( + Data64kb&& x) noexcept +{ + m_data = std::move(x.m_data); + +} + +Data64kb& Data64kb::operator =( + const Data64kb& x) +{ + m_data = x.m_data; + + return *this; +} + +Data64kb& Data64kb::operator =( + Data64kb&& x) noexcept +{ + m_data = std::move(x.m_data); + + return *this; +} + +bool Data64kb::operator ==( + const Data64kb& x) const +{ + return (m_data == x.m_data); +} + +bool Data64kb::operator !=( + const Data64kb& x) const +{ + return !(*this == x); +} + +size_t Data64kb::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return Data64kb_max_cdr_typesize; +} + +size_t Data64kb::getCdrSerializedSize( + const Data64kb& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.data().size() > 0) + { + current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + return current_alignment - initial_alignment; +} + + +void Data64kb::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_data; + + +} + +void Data64kb::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_data; + + +} + + +bool Data64kb::isKeyDefined() +{ + return false; +} + +void Data64kb::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void Data64kb::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void Data64kb::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& Data64kb::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& Data64kb::data() +{ + return m_data; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/Data64kbv1.h b/test/blackbox/types/Data64kbv1.h new file mode 100644 index 00000000000..e430b6a7bce --- /dev/null +++ b/test/blackbox/types/Data64kbv1.h @@ -0,0 +1,224 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Data64kb.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_DATA64KB_H_ +#define _FAST_DDS_GENERATED_DATA64KB_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DATA64KB_SOURCE) +#define DATA64KB_DllAPI __declspec( dllexport ) +#else +#define DATA64KB_DllAPI __declspec( dllimport ) +#endif // DATA64KB_SOURCE +#else +#define DATA64KB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DATA64KB_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + + + +/*! + * @brief This class represents the structure Data64kb defined by the user in the IDL file. + * @ingroup Data64kb + */ +class Data64kb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data64kb(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data64kb(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb( + const Data64kb& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb( + Data64kb&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb& operator =( + const Data64kb& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Data64kb that will be copied. + */ + eProsima_user_DllExport Data64kb& operator =( + Data64kb&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Data64kb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data64kb& x) const; + + /*! + * @brief Comparison operator. + * @param x Data64kb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data64kb& x) const; + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Data64kb& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_data; + +}; + + +#endif // _FAST_DDS_GENERATED_DATA64KB_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/FixedSized.cxx b/test/blackbox/types/FixedSized.cxx index 583831eab14..14f4255a658 100644 --- a/test/blackbox/types/FixedSized.cxx +++ b/test/blackbox/types/FixedSized.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "FixedSized.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + FixedSized::FixedSized() { - } FixedSized::~FixedSized() @@ -62,7 +66,6 @@ FixedSized& FixedSized::operator =( { m_index = x.m_index; - return *this; } @@ -71,7 +74,6 @@ FixedSized& FixedSized::operator =( { m_index = x.m_index; - return *this; } @@ -118,3 +120,5 @@ uint16_t& FixedSized::index() // Include auxiliary functions like for serializing/deserializing. #include "FixedSizedCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/FixedSized.h b/test/blackbox/types/FixedSized.h index 4c35728f18f..d4671fd3790 100644 --- a/test/blackbox/types/FixedSized.h +++ b/test/blackbox/types/FixedSized.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "FixedSizedv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_FIXEDSIZED_H_ #define _FAST_DDS_GENERATED_FIXEDSIZED_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure FixedSized defined by the user in the IDL file. * @ingroup FixedSized @@ -154,3 +162,6 @@ class FixedSized #endif // _FAST_DDS_GENERATED_FIXEDSIZED_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/FixedSizedCdrAux.hpp b/test/blackbox/types/FixedSizedCdrAux.hpp index 30f8ddf2c2d..b5a1996ed42 100644 --- a/test/blackbox/types/FixedSizedCdrAux.hpp +++ b/test/blackbox/types/FixedSizedCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FixedSized& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_HPP_ + diff --git a/test/blackbox/types/FixedSizedCdrAux.ipp b/test/blackbox/types/FixedSizedCdrAux.ipp index 30dae32688a..fb2c91ea5ab 100644 --- a/test/blackbox/types/FixedSizedCdrAux.ipp +++ b/test/blackbox/types/FixedSizedCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.index() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +116,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_FIXEDSIZEDCDRAUX_IPP_ + diff --git a/test/blackbox/types/FixedSizedPubSubTypes.cxx b/test/blackbox/types/FixedSizedPubSubTypes.cxx index 348103eeb3b..8a418964086 100644 --- a/test/blackbox/types/FixedSizedPubSubTypes.cxx +++ b/test/blackbox/types/FixedSizedPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "FixedSizedPubSubTypes.h" #include "FixedSizedCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + FixedSizedPubSubType::FixedSizedPubSubType() { setName("FixedSized"); - uint32_t type_size = FixedSized_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(FixedSized::getMaxCdrSerializedSize()); +#else + FixedSized_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool FixedSizedPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool FixedSizedPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool FixedSizedPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function FixedSizedPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool FixedSizedPubSubType::getKey( FixedSized_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || FixedSized_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/FixedSizedPubSubTypes.h b/test/blackbox/types/FixedSizedPubSubTypes.h index 97dbc47adc0..ce899fe78d5 100644 --- a/test/blackbox/types/FixedSizedPubSubTypes.h +++ b/test/blackbox/types/FixedSizedPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + #ifndef SWIG namespace detail { diff --git a/test/blackbox/types/FixedSizedv1.cxx b/test/blackbox/types/FixedSizedv1.cxx new file mode 100644 index 00000000000..1d28156bce2 --- /dev/null +++ b/test/blackbox/types/FixedSizedv1.cxx @@ -0,0 +1,223 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FixedSized.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "FixedSized.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define FixedSized_max_cdr_typesize 2ULL; + + + + +FixedSized::FixedSized() +{ + // unsigned short m_index + m_index = 0; + +} + +FixedSized::~FixedSized() +{ +} + +FixedSized::FixedSized( + const FixedSized& x) +{ + m_index = x.m_index; + +} + +FixedSized::FixedSized( + FixedSized&& x) noexcept +{ + m_index = x.m_index; + +} + +FixedSized& FixedSized::operator =( + const FixedSized& x) +{ + m_index = x.m_index; + + return *this; +} + +FixedSized& FixedSized::operator =( + FixedSized&& x) noexcept +{ + m_index = x.m_index; + + return *this; +} + +bool FixedSized::operator ==( + const FixedSized& x) const +{ + return (m_index == x.m_index); +} + +bool FixedSized::operator !=( + const FixedSized& x) const +{ + return !(*this == x); +} + +size_t FixedSized::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return FixedSized_max_cdr_typesize; +} + +size_t FixedSized::getCdrSerializedSize( + const FixedSized& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + + +void FixedSized::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + +} + +void FixedSized::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + +} + + +bool FixedSized::isKeyDefined() +{ + return false; +} + +void FixedSized::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void FixedSized::index( + uint16_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint16_t FixedSized::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint16_t& FixedSized::index() +{ + return m_index; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/FixedSizedv1.h b/test/blackbox/types/FixedSizedv1.h new file mode 100644 index 00000000000..f8b470ea656 --- /dev/null +++ b/test/blackbox/types/FixedSizedv1.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file FixedSized.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_FIXEDSIZED_H_ +#define _FAST_DDS_GENERATED_FIXEDSIZED_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(FIXEDSIZED_SOURCE) +#define FIXEDSIZED_DllAPI __declspec( dllexport ) +#else +#define FIXEDSIZED_DllAPI __declspec( dllimport ) +#endif // FIXEDSIZED_SOURCE +#else +#define FIXEDSIZED_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define FIXEDSIZED_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure FixedSized defined by the user in the IDL file. + * @ingroup FixedSized + */ +class FixedSized +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FixedSized(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FixedSized(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized( + const FixedSized& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized( + FixedSized&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized& operator =( + const FixedSized& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object FixedSized that will be copied. + */ + eProsima_user_DllExport FixedSized& operator =( + FixedSized&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x FixedSized object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FixedSized& x) const; + + /*! + * @brief Comparison operator. + * @param x FixedSized object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FixedSized& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const FixedSized& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_index; + +}; + + +#endif // _FAST_DDS_GENERATED_FIXEDSIZED_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/HelloWorld.cxx b/test/blackbox/types/HelloWorld.cxx index 1942e550a6a..92746fad458 100644 --- a/test/blackbox/types/HelloWorld.cxx +++ b/test/blackbox/types/HelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "HelloWorldTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + HelloWorld::HelloWorld() { - // Just to register all known types registerHelloWorldTypes(); } @@ -69,7 +73,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -79,7 +82,6 @@ HelloWorld& HelloWorld::operator =( m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -166,3 +168,5 @@ eprosima::fastcdr::fixed_string<128>& HelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/HelloWorld.h b/test/blackbox/types/HelloWorld.h index a3bfc645bfe..45a7a1ae125 100644 --- a/test/blackbox/types/HelloWorld.h +++ b/test/blackbox/types/HelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "HelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ #define _FAST_DDS_GENERATED_HELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -182,3 +190,6 @@ class HelloWorld #endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/HelloWorldCdrAux.hpp b/test/blackbox/types/HelloWorldCdrAux.hpp index 6a9fc4129ac..a357b5fc54f 100644 --- a/test/blackbox/types/HelloWorldCdrAux.hpp +++ b/test/blackbox/types/HelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ + diff --git a/test/blackbox/types/HelloWorldCdrAux.ipp b/test/blackbox/types/HelloWorldCdrAux.ipp index b9461ff5b6b..42e91f3cc38 100644 --- a/test/blackbox/types/HelloWorldCdrAux.ipp +++ b/test/blackbox/types/HelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +79,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.index() << eprosima::fastcdr::MemberId(1) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -123,4 +124,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_IPP_ + diff --git a/test/blackbox/types/HelloWorldPubSubTypes.cxx b/test/blackbox/types/HelloWorldPubSubTypes.cxx index f4a5ef511c2..85cb477896e 100644 --- a/test/blackbox/types/HelloWorldPubSubTypes.cxx +++ b/test/blackbox/types/HelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + HelloWorldPubSubType::HelloWorldPubSubType() { setName("HelloWorld"); - uint32_t type_size = HelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(HelloWorld::getMaxCdrSerializedSize()); +#else + HelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool HelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool HelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool HelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function HelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool HelloWorldPubSubType::getKey( HelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/HelloWorldPubSubTypes.h b/test/blackbox/types/HelloWorldPubSubTypes.h index f382d2212e5..ddbfbab5db6 100644 --- a/test/blackbox/types/HelloWorldPubSubTypes.h +++ b/test/blackbox/types/HelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld diff --git a/test/blackbox/types/HelloWorldTypeObject.cxx b/test/blackbox/types/HelloWorldTypeObject.cxx index 240e034efca..9163a2c402e 100644 --- a/test/blackbox/types/HelloWorldTypeObject.cxx +++ b/test/blackbox/types/HelloWorldTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -54,6 +52,8 @@ void registerHelloWorldTypes() }); } + + const TypeIdentifier* GetHelloWorldIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); @@ -142,7 +142,6 @@ const TypeObject* GetMinimalHelloWorldObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -158,7 +157,11 @@ const TypeObject* GetMinimalHelloWorldObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -226,7 +229,6 @@ const TypeObject* GetCompleteHelloWorldObject() // Header type_object->complete().struct_type().header().detail().type_name("HelloWorld"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -242,7 +244,11 @@ const TypeObject* GetCompleteHelloWorldObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/blackbox/types/HelloWorldTypeObject.h b/test/blackbox/types/HelloWorldTypeObject.h index c28779dbebb..76b2a621eb7 100644 --- a/test/blackbox/types/HelloWorldTypeObject.h +++ b/test/blackbox/types/HelloWorldTypeObject.h @@ -54,6 +54,8 @@ using namespace eprosima::fastrtps::types; eProsima_user_DllExport void registerHelloWorldTypes(); + + eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); diff --git a/test/blackbox/types/HelloWorldv1.cxx b/test/blackbox/types/HelloWorldv1.cxx new file mode 100644 index 00000000000..839599f3758 --- /dev/null +++ b/test/blackbox/types/HelloWorldv1.cxx @@ -0,0 +1,294 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "HelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "HelloWorldTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define HelloWorld_max_cdr_typesize 141ULL; + + + + +HelloWorld::HelloWorld() +{ + // unsigned short m_index + m_index = 0; + // /type_d() m_message + + + // Just to register all known types + registerHelloWorldTypes(); +} + +HelloWorld::~HelloWorld() +{ +} + +HelloWorld::HelloWorld( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + +} + +HelloWorld::HelloWorld( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +HelloWorld& HelloWorld::operator =( + const HelloWorld& x) +{ + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +HelloWorld& HelloWorld::operator =( + HelloWorld&& x) noexcept +{ + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool HelloWorld::operator ==( + const HelloWorld& x) const +{ + return (m_index == x.m_index && + m_message == x.m_message); +} + +bool HelloWorld::operator !=( + const HelloWorld& x) const +{ + return !(*this == x); +} + +size_t HelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return HelloWorld_max_cdr_typesize; +} + +size_t HelloWorld::getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void HelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void HelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + + + { + std::string aux; + dcdr >> aux; + m_message = aux.c_str(); + } + + +} + + +bool HelloWorld::isKeyDefined() +{ + return false; +} + +void HelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void HelloWorld::index( + uint16_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint16_t HelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint16_t& HelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void HelloWorld::message( + const eprosima::fastrtps::fixed_string<128>& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void HelloWorld::message( + eprosima::fastrtps::fixed_string<128>&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const eprosima::fastrtps::fixed_string<128>& HelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +eprosima::fastrtps::fixed_string<128>& HelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/HelloWorldv1.h b/test/blackbox/types/HelloWorldv1.h new file mode 100644 index 00000000000..908b021c239 --- /dev/null +++ b/test/blackbox/types/HelloWorldv1.h @@ -0,0 +1,243 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file HelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ +#define _FAST_DDS_GENERATED_HELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastrtps::fixed_string<128>& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastrtps::fixed_string<128>&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const HelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_index; + eprosima::fastrtps::fixed_string<128> m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedData1mb.cxx b/test/blackbox/types/KeyedData1mb.cxx index fe17709ea7b..80f10319227 100644 --- a/test/blackbox/types/KeyedData1mb.cxx +++ b/test/blackbox/types/KeyedData1mb.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "KeyedData1mb.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,12 @@ using namespace eprosima::fastcdr::exception; #include + + + + KeyedData1mb::KeyedData1mb() { - } KeyedData1mb::~KeyedData1mb() @@ -65,7 +71,6 @@ KeyedData1mb& KeyedData1mb::operator =( m_key = x.m_key; m_data = x.m_data; - return *this; } @@ -75,7 +80,6 @@ KeyedData1mb& KeyedData1mb::operator =( m_key = x.m_key; m_data = std::move(x.m_data); - return *this; } @@ -162,3 +166,5 @@ std::vector& KeyedData1mb::data() // Include auxiliary functions like for serializing/deserializing. #include "KeyedData1mbCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedData1mb.h b/test/blackbox/types/KeyedData1mb.h index b4b8ee6dd14..6437b546685 100644 --- a/test/blackbox/types/KeyedData1mb.h +++ b/test/blackbox/types/KeyedData1mb.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "KeyedData1mbv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ #define _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,10 @@ class CdrSizeCalculator; + + + + /*! * @brief This class represents the structure KeyedData1mb defined by the user in the IDL file. * @ingroup KeyedData1mb @@ -182,3 +192,6 @@ class KeyedData1mb #endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedData1mbCdrAux.hpp b/test/blackbox/types/KeyedData1mbCdrAux.hpp index 90ca3210886..ad9b32b1c7c 100644 --- a/test/blackbox/types/KeyedData1mbCdrAux.hpp +++ b/test/blackbox/types/KeyedData1mbCdrAux.hpp @@ -34,6 +34,10 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const KeyedData1mb& data); @@ -42,4 +46,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_HPP_ + diff --git a/test/blackbox/types/KeyedData1mbCdrAux.ipp b/test/blackbox/types/KeyedData1mbCdrAux.ipp index a2209b64c1d..d27be4015f7 100644 --- a/test/blackbox/types/KeyedData1mbCdrAux.ipp +++ b/test/blackbox/types/KeyedData1mbCdrAux.ipp @@ -34,6 +34,10 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -77,7 +81,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.key() << eprosima::fastcdr::MemberId(1) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -126,4 +129,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_KEYEDDATA1MBCDRAUX_IPP_ + diff --git a/test/blackbox/types/KeyedData1mbPubSubTypes.cxx b/test/blackbox/types/KeyedData1mbPubSubTypes.cxx index fbf9a3d065f..ba528f396c1 100644 --- a/test/blackbox/types/KeyedData1mbPubSubTypes.cxx +++ b/test/blackbox/types/KeyedData1mbPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "KeyedData1mbPubSubTypes.h" #include "KeyedData1mbCdrAux.hpp" @@ -31,10 +29,19 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + + KeyedData1mbPubSubType::KeyedData1mbPubSubType() { setName("KeyedData1mb"); - uint32_t type_size = KeyedData1mb_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyedData1mb::getMaxCdrSerializedSize()); +#else + KeyedData1mb_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +72,12 @@ bool KeyedData1mbPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +92,11 @@ bool KeyedData1mbPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +113,11 @@ bool KeyedData1mbPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +140,26 @@ std::function KeyedData1mbPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +191,20 @@ bool KeyedData1mbPubSubType::getKey( KeyedData1mb_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || KeyedData1mb_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/KeyedData1mbPubSubTypes.h b/test/blackbox/types/KeyedData1mbPubSubTypes.h index 1c97f695f44..caf92fbbfad 100644 --- a/test/blackbox/types/KeyedData1mbPubSubTypes.h +++ b/test/blackbox/types/KeyedData1mbPubSubTypes.h @@ -38,6 +38,10 @@ #endif // GEN_API_VER + + + + /*! * @brief This class represents the TopicDataType of the type KeyedData1mb defined by the user in the IDL file. * @ingroup KeyedData1mb diff --git a/test/blackbox/types/KeyedData1mbv1.cxx b/test/blackbox/types/KeyedData1mbv1.cxx new file mode 100644 index 00000000000..f7793295217 --- /dev/null +++ b/test/blackbox/types/KeyedData1mbv1.cxx @@ -0,0 +1,300 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file KeyedData1mb.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "KeyedData1mb.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define KeyedData1mb_max_cdr_typesize 1024008ULL; + + + + + + +KeyedData1mb::KeyedData1mb() +{ + // unsigned short m_key + m_key = 0; + // sequence m_data + + +} + +KeyedData1mb::~KeyedData1mb() +{ +} + +KeyedData1mb::KeyedData1mb( + const KeyedData1mb& x) +{ + m_key = x.m_key; + + + m_data = x.m_data; + +} + +KeyedData1mb::KeyedData1mb( + KeyedData1mb&& x) noexcept +{ + m_key = x.m_key; + + + m_data = std::move(x.m_data); + +} + +KeyedData1mb& KeyedData1mb::operator =( + const KeyedData1mb& x) +{ + m_key = x.m_key; + + + m_data = x.m_data; + + return *this; +} + +KeyedData1mb& KeyedData1mb::operator =( + KeyedData1mb&& x) noexcept +{ + m_key = x.m_key; + + + m_data = std::move(x.m_data); + + return *this; +} + +bool KeyedData1mb::operator ==( + const KeyedData1mb& x) const +{ + return (m_key == x.m_key && + m_data == x.m_data); +} + +bool KeyedData1mb::operator !=( + const KeyedData1mb& x) const +{ + return !(*this == x); +} + +size_t KeyedData1mb::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return KeyedData1mb_max_cdr_typesize; +} + +size_t KeyedData1mb::getCdrSerializedSize( + const KeyedData1mb& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.data().size() > 0) + { + current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + return current_alignment - initial_alignment; +} + + +void KeyedData1mb::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_key; + + scdr << m_data; + + +} + +void KeyedData1mb::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_key; + + + + dcdr >> m_data; + + +} + + +bool KeyedData1mb::isKeyDefined() +{ + return true; +} + +void KeyedData1mb::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + scdr << m_key; + + +} + +/*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ +void KeyedData1mb::key( + uint16_t _key) +{ + m_key = _key; +} + +/*! + * @brief This function returns the value of member key + * @return Value of member key + */ +uint16_t KeyedData1mb::key() const +{ + return m_key; +} + +/*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ +uint16_t& KeyedData1mb::key() +{ + return m_key; +} + + +/*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ +void KeyedData1mb::data( + const std::vector& _data) +{ + m_data = _data; +} + +/*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ +void KeyedData1mb::data( + std::vector&& _data) +{ + m_data = std::move(_data); +} + +/*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ +const std::vector& KeyedData1mb::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +std::vector& KeyedData1mb::data() +{ + return m_data; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedData1mbv1.h b/test/blackbox/types/KeyedData1mbv1.h new file mode 100644 index 00000000000..2cdefb542db --- /dev/null +++ b/test/blackbox/types/KeyedData1mbv1.h @@ -0,0 +1,245 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file KeyedData1mb.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ +#define _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(KEYEDDATA1MB_SOURCE) +#define KEYEDDATA1MB_DllAPI __declspec( dllexport ) +#else +#define KEYEDDATA1MB_DllAPI __declspec( dllimport ) +#endif // KEYEDDATA1MB_SOURCE +#else +#define KEYEDDATA1MB_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define KEYEDDATA1MB_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + + + +/*! + * @brief This class represents the structure KeyedData1mb defined by the user in the IDL file. + * @ingroup KeyedData1mb + */ +class KeyedData1mb +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyedData1mb(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyedData1mb(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb( + const KeyedData1mb& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb( + KeyedData1mb&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb& operator =( + const KeyedData1mb& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyedData1mb that will be copied. + */ + eProsima_user_DllExport KeyedData1mb& operator =( + KeyedData1mb&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x KeyedData1mb object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyedData1mb& x) const; + + /*! + * @brief Comparison operator. + * @param x KeyedData1mb object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyedData1mb& x) const; + + /*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ + eProsima_user_DllExport void key( + uint16_t _key); + + /*! + * @brief This function returns the value of member key + * @return Value of member key + */ + eProsima_user_DllExport uint16_t key() const; + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport uint16_t& key(); + + + /*! + * @brief This function copies the value in member data + * @param _data New value to be copied in member data + */ + eProsima_user_DllExport void data( + const std::vector& _data); + + /*! + * @brief This function moves the value in member data + * @param _data New value to be moved in member data + */ + eProsima_user_DllExport void data( + std::vector&& _data); + + /*! + * @brief This function returns a constant reference to member data + * @return Constant reference to member data + */ + eProsima_user_DllExport const std::vector& data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport std::vector& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const KeyedData1mb& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_key; + std::vector m_data; + +}; + + +#endif // _FAST_DDS_GENERATED_KEYEDDATA1MB_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedHelloWorld.cxx b/test/blackbox/types/KeyedHelloWorld.cxx index f8f77f92923..ed5211c6be4 100644 --- a/test/blackbox/types/KeyedHelloWorld.cxx +++ b/test/blackbox/types/KeyedHelloWorld.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "KeyedHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + KeyedHelloWorld::KeyedHelloWorld() { - } KeyedHelloWorld::~KeyedHelloWorld() @@ -68,7 +72,6 @@ KeyedHelloWorld& KeyedHelloWorld::operator =( m_key = x.m_key; m_index = x.m_index; m_message = x.m_message; - return *this; } @@ -79,7 +82,6 @@ KeyedHelloWorld& KeyedHelloWorld::operator =( m_key = x.m_key; m_index = x.m_index; m_message = std::move(x.m_message); - return *this; } @@ -196,3 +198,5 @@ eprosima::fastcdr::fixed_string<128>& KeyedHelloWorld::message() // Include auxiliary functions like for serializing/deserializing. #include "KeyedHelloWorldCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedHelloWorld.h b/test/blackbox/types/KeyedHelloWorld.h index 58339b078ed..0ec54f057b8 100644 --- a/test/blackbox/types/KeyedHelloWorld.h +++ b/test/blackbox/types/KeyedHelloWorld.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "KeyedHelloWorldv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ #define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure KeyedHelloWorld defined by the user in the IDL file. * @ingroup KeyedHelloWorld @@ -203,3 +211,6 @@ class KeyedHelloWorld #endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/KeyedHelloWorldCdrAux.hpp b/test/blackbox/types/KeyedHelloWorldCdrAux.hpp index 66e3503c104..d25e9dc8485 100644 --- a/test/blackbox/types/KeyedHelloWorldCdrAux.hpp +++ b/test/blackbox/types/KeyedHelloWorldCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const KeyedHelloWorld& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_HPP_ + diff --git a/test/blackbox/types/KeyedHelloWorldCdrAux.ipp b/test/blackbox/types/KeyedHelloWorldCdrAux.ipp index c37059c52aa..de20692e2cb 100644 --- a/test/blackbox/types/KeyedHelloWorldCdrAux.ipp +++ b/test/blackbox/types/KeyedHelloWorldCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -81,7 +83,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.index() << eprosima::fastcdr::MemberId(2) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -135,4 +136,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLDCDRAUX_IPP_ + diff --git a/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx b/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx index bfe19dede86..f5714a42c75 100644 --- a/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx +++ b/test/blackbox/types/KeyedHelloWorldPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "KeyedHelloWorldPubSubTypes.h" #include "KeyedHelloWorldCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + KeyedHelloWorldPubSubType::KeyedHelloWorldPubSubType() { setName("KeyedHelloWorld"); - uint32_t type_size = KeyedHelloWorld_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyedHelloWorld::getMaxCdrSerializedSize()); +#else + KeyedHelloWorld_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -65,10 +70,12 @@ bool KeyedHelloWorldPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool KeyedHelloWorldPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool KeyedHelloWorldPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function KeyedHelloWorldPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool KeyedHelloWorldPubSubType::getKey( KeyedHelloWorld_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || KeyedHelloWorld_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/KeyedHelloWorldPubSubTypes.h b/test/blackbox/types/KeyedHelloWorldPubSubTypes.h index cc83b23bbdf..827c99ed420 100644 --- a/test/blackbox/types/KeyedHelloWorldPubSubTypes.h +++ b/test/blackbox/types/KeyedHelloWorldPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type KeyedHelloWorld defined by the user in the IDL file. * @ingroup KeyedHelloWorld diff --git a/test/blackbox/types/KeyedHelloWorldv1.cxx b/test/blackbox/types/KeyedHelloWorldv1.cxx new file mode 100644 index 00000000000..3391af9cd87 --- /dev/null +++ b/test/blackbox/types/KeyedHelloWorldv1.cxx @@ -0,0 +1,348 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file KeyedHelloWorld.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "KeyedHelloWorld.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define KeyedHelloWorld_max_cdr_typesize 141ULL; + + + + +KeyedHelloWorld::KeyedHelloWorld() +{ + // unsigned short m_key + m_key = 0; + // unsigned short m_index + m_index = 0; + // /type_d() m_message + + +} + +KeyedHelloWorld::~KeyedHelloWorld() +{ +} + +KeyedHelloWorld::KeyedHelloWorld( + const KeyedHelloWorld& x) +{ + m_key = x.m_key; + + + m_index = x.m_index; + + + m_message = x.m_message; + +} + +KeyedHelloWorld::KeyedHelloWorld( + KeyedHelloWorld&& x) noexcept +{ + m_key = x.m_key; + + + m_index = x.m_index; + + + m_message = std::move(x.m_message); + +} + +KeyedHelloWorld& KeyedHelloWorld::operator =( + const KeyedHelloWorld& x) +{ + m_key = x.m_key; + + + m_index = x.m_index; + + + m_message = x.m_message; + + return *this; +} + +KeyedHelloWorld& KeyedHelloWorld::operator =( + KeyedHelloWorld&& x) noexcept +{ + m_key = x.m_key; + + + m_index = x.m_index; + + + m_message = std::move(x.m_message); + + return *this; +} + +bool KeyedHelloWorld::operator ==( + const KeyedHelloWorld& x) const +{ + return (m_key == x.m_key && + m_index == x.m_index && + m_message == x.m_message); +} + +bool KeyedHelloWorld::operator !=( + const KeyedHelloWorld& x) const +{ + return !(*this == x); +} + +size_t KeyedHelloWorld::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return KeyedHelloWorld_max_cdr_typesize; +} + +size_t KeyedHelloWorld::getCdrSerializedSize( + const KeyedHelloWorld& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void KeyedHelloWorld::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_key; + + scdr << m_index; + + scdr << m_message.c_str(); + +} + +void KeyedHelloWorld::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_key; + + + + dcdr >> m_index; + + + + { + std::string aux; + dcdr >> aux; + m_message = aux.c_str(); + } + + +} + + +bool KeyedHelloWorld::isKeyDefined() +{ + return true; +} + +void KeyedHelloWorld::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + scdr << m_key; + + + +} + +/*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ +void KeyedHelloWorld::key( + uint16_t _key) +{ + m_key = _key; +} + +/*! + * @brief This function returns the value of member key + * @return Value of member key + */ +uint16_t KeyedHelloWorld::key() const +{ + return m_key; +} + +/*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ +uint16_t& KeyedHelloWorld::key() +{ + return m_key; +} + + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void KeyedHelloWorld::index( + uint16_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint16_t KeyedHelloWorld::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint16_t& KeyedHelloWorld::index() +{ + return m_index; +} + + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void KeyedHelloWorld::message( + const eprosima::fastrtps::fixed_string<128>& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void KeyedHelloWorld::message( + eprosima::fastrtps::fixed_string<128>&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const eprosima::fastrtps::fixed_string<128>& KeyedHelloWorld::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +eprosima::fastrtps::fixed_string<128>& KeyedHelloWorld::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/KeyedHelloWorldv1.h b/test/blackbox/types/KeyedHelloWorldv1.h new file mode 100644 index 00000000000..ecb31c12b9f --- /dev/null +++ b/test/blackbox/types/KeyedHelloWorldv1.h @@ -0,0 +1,264 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file KeyedHelloWorld.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ +#define _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(KEYEDHELLOWORLD_SOURCE) +#define KEYEDHELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define KEYEDHELLOWORLD_DllAPI __declspec( dllimport ) +#endif // KEYEDHELLOWORLD_SOURCE +#else +#define KEYEDHELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define KEYEDHELLOWORLD_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure KeyedHelloWorld defined by the user in the IDL file. + * @ingroup KeyedHelloWorld + */ +class KeyedHelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyedHelloWorld(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyedHelloWorld(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld( + const KeyedHelloWorld& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld( + KeyedHelloWorld&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld& operator =( + const KeyedHelloWorld& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyedHelloWorld that will be copied. + */ + eProsima_user_DllExport KeyedHelloWorld& operator =( + KeyedHelloWorld&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x KeyedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyedHelloWorld& x) const; + + /*! + * @brief Comparison operator. + * @param x KeyedHelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyedHelloWorld& x) const; + + /*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ + eProsima_user_DllExport void key( + uint16_t _key); + + /*! + * @brief This function returns the value of member key + * @return Value of member key + */ + eProsima_user_DllExport uint16_t key() const; + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport uint16_t& key(); + + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint16_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint16_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint16_t& index(); + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastrtps::fixed_string<128>& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastrtps::fixed_string<128>&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const KeyedHelloWorld& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_key; + uint16_t m_index; + eprosima::fastrtps::fixed_string<128> m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_KEYEDHELLOWORLD_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/StringTest.cxx b/test/blackbox/types/StringTest.cxx index 4a2ae1fcbe7..6da9dd7d32e 100644 --- a/test/blackbox/types/StringTest.cxx +++ b/test/blackbox/types/StringTest.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "StringTest.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + StringTest::StringTest() { - } StringTest::~StringTest() @@ -62,7 +66,6 @@ StringTest& StringTest::operator =( { m_message = x.m_message; - return *this; } @@ -71,7 +74,6 @@ StringTest& StringTest::operator =( { m_message = std::move(x.m_message); - return *this; } @@ -128,3 +130,5 @@ eprosima::fastcdr::fixed_string<10000>& StringTest::message() // Include auxiliary functions like for serializing/deserializing. #include "StringTestCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/StringTest.h b/test/blackbox/types/StringTest.h index 50a82585678..6065acb5f13 100644 --- a/test/blackbox/types/StringTest.h +++ b/test/blackbox/types/StringTest.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "StringTestv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_STRINGTEST_H_ #define _FAST_DDS_GENERATED_STRINGTEST_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure StringTest defined by the user in the IDL file. * @ingroup StringTest @@ -161,3 +169,6 @@ class StringTest #endif // _FAST_DDS_GENERATED_STRINGTEST_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/StringTestCdrAux.hpp b/test/blackbox/types/StringTestCdrAux.hpp index df97be100c1..e823e199e62 100644 --- a/test/blackbox/types/StringTestCdrAux.hpp +++ b/test/blackbox/types/StringTestCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StringTest& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_STRINGTESTCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_STRINGTESTCDRAUX_HPP_ + diff --git a/test/blackbox/types/StringTestCdrAux.ipp b/test/blackbox/types/StringTestCdrAux.ipp index 1874fe2ab37..21ab156e2e3 100644 --- a/test/blackbox/types/StringTestCdrAux.ipp +++ b/test/blackbox/types/StringTestCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.message() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +116,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_STRINGTESTCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_STRINGTESTCDRAUX_IPP_ + diff --git a/test/blackbox/types/StringTestPubSubTypes.cxx b/test/blackbox/types/StringTestPubSubTypes.cxx index da4e58a383b..a030d2a9d40 100644 --- a/test/blackbox/types/StringTestPubSubTypes.cxx +++ b/test/blackbox/types/StringTestPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "StringTestPubSubTypes.h" #include "StringTestCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + StringTestPubSubType::StringTestPubSubType() { setName("StringTest"); - uint32_t type_size = StringTest_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringTest::getMaxCdrSerializedSize()); +#else + StringTest_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool StringTestPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool StringTestPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool StringTestPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function StringTestPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool StringTestPubSubType::getKey( StringTest_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StringTest_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/StringTestPubSubTypes.h b/test/blackbox/types/StringTestPubSubTypes.h index 5ed989eee32..51a448b7f62 100644 --- a/test/blackbox/types/StringTestPubSubTypes.h +++ b/test/blackbox/types/StringTestPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type StringTest defined by the user in the IDL file. * @ingroup StringTest diff --git a/test/blackbox/types/StringTestv1.cxx b/test/blackbox/types/StringTestv1.cxx new file mode 100644 index 00000000000..b5c46f9ae1c --- /dev/null +++ b/test/blackbox/types/StringTestv1.cxx @@ -0,0 +1,237 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file StringTest.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "StringTest.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define StringTest_max_cdr_typesize 10009ULL; + + + + +StringTest::StringTest() +{ + // /type_d() m_message + + +} + +StringTest::~StringTest() +{ +} + +StringTest::StringTest( + const StringTest& x) +{ + m_message = x.m_message; + +} + +StringTest::StringTest( + StringTest&& x) noexcept +{ + m_message = std::move(x.m_message); + +} + +StringTest& StringTest::operator =( + const StringTest& x) +{ + m_message = x.m_message; + + return *this; +} + +StringTest& StringTest::operator =( + StringTest&& x) noexcept +{ + m_message = std::move(x.m_message); + + return *this; +} + +bool StringTest::operator ==( + const StringTest& x) const +{ + return (m_message == x.m_message); +} + +bool StringTest::operator !=( + const StringTest& x) const +{ + return !(*this == x); +} + +size_t StringTest::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StringTest_max_cdr_typesize; +} + +size_t StringTest::getCdrSerializedSize( + const StringTest& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void StringTest::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_message.c_str(); + +} + +void StringTest::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + std::string aux; + dcdr >> aux; + m_message = aux.c_str(); + } + + +} + + +bool StringTest::isKeyDefined() +{ + return false; +} + +void StringTest::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ +void StringTest::message( + const eprosima::fastrtps::fixed_string<10000>& _message) +{ + m_message = _message; +} + +/*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ +void StringTest::message( + eprosima::fastrtps::fixed_string<10000>&& _message) +{ + m_message = std::move(_message); +} + +/*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ +const eprosima::fastrtps::fixed_string<10000>& StringTest::message() const +{ + return m_message; +} + +/*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ +eprosima::fastrtps::fixed_string<10000>& StringTest::message() +{ + return m_message; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/StringTestv1.h b/test/blackbox/types/StringTestv1.h new file mode 100644 index 00000000000..edbcc2cbb6c --- /dev/null +++ b/test/blackbox/types/StringTestv1.h @@ -0,0 +1,222 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file StringTest.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_STRINGTEST_H_ +#define _FAST_DDS_GENERATED_STRINGTEST_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(STRINGTEST_SOURCE) +#define STRINGTEST_DllAPI __declspec( dllexport ) +#else +#define STRINGTEST_DllAPI __declspec( dllimport ) +#endif // STRINGTEST_SOURCE +#else +#define STRINGTEST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define STRINGTEST_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure StringTest defined by the user in the IDL file. + * @ingroup StringTest + */ +class StringTest +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringTest(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringTest(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest( + const StringTest& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest( + StringTest&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest& operator =( + const StringTest& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StringTest that will be copied. + */ + eProsima_user_DllExport StringTest& operator =( + StringTest&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StringTest object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringTest& x) const; + + /*! + * @brief Comparison operator. + * @param x StringTest object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringTest& x) const; + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const eprosima::fastrtps::fixed_string<10000>& _message); + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + eprosima::fastrtps::fixed_string<10000>&& _message); + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<10000>& message() const; + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<10000>& message(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StringTest& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + eprosima::fastrtps::fixed_string<10000> m_message; + +}; + + +#endif // _FAST_DDS_GENERATED_STRINGTEST_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestIncludeRegression3361.cxx b/test/blackbox/types/TestIncludeRegression3361.cxx index 1390754b2d8..bd999acb638 100644 --- a/test/blackbox/types/TestIncludeRegression3361.cxx +++ b/test/blackbox/types/TestIncludeRegression3361.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "TestIncludeRegression3361.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "TestIncludeRegression3361TypeObject.h" #include @@ -38,3 +41,8 @@ using namespace eprosima::fastcdr::exception; #include +namespace TestModule { + + +} // namespace TestModule +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestIncludeRegression3361.h b/test/blackbox/types/TestIncludeRegression3361.h index e4873b40baf..9f0c54030ed 100644 --- a/test/blackbox/types/TestIncludeRegression3361.h +++ b/test/blackbox/types/TestIncludeRegression3361.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "TestIncludeRegression3361v1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ #define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -68,9 +74,14 @@ class CdrSizeCalculator; namespace TestModule { - typedef std::string MACHINEID; + +typedef std::string MACHINEID; + } // namespace TestModule #endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx b/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx index 5d446dab754..9fa90fe1008 100644 --- a/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx +++ b/test/blackbox/types/TestIncludeRegression3361TypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -145,7 +143,11 @@ namespace TestModule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -229,7 +231,11 @@ namespace TestModule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/blackbox/types/TestIncludeRegression3361v1.cxx b/test/blackbox/types/TestIncludeRegression3361v1.cxx new file mode 100644 index 00000000000..abc875d3a33 --- /dev/null +++ b/test/blackbox/types/TestIncludeRegression3361v1.cxx @@ -0,0 +1,95 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file TestIncludeRegression3361.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TestIncludeRegression3361.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "TestIncludeRegression3361TypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + + + +namespace TestModule { + + +} // namespace TestModule + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestIncludeRegression3361v1.h b/test/blackbox/types/TestIncludeRegression3361v1.h new file mode 100644 index 00000000000..fcc2b443cca --- /dev/null +++ b/test/blackbox/types/TestIncludeRegression3361v1.h @@ -0,0 +1,80 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file TestIncludeRegression3361.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ +#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TESTINCLUDEREGRESSION3361_SOURCE) +#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllexport ) +#else +#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllimport ) +#endif // TESTINCLUDEREGRESSION3361_SOURCE +#else +#define TESTINCLUDEREGRESSION3361_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TESTINCLUDEREGRESSION3361_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace TestModule { + typedef std::string MACHINEID; + +} // namespace TestModule + +#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestRegression3361.cxx b/test/blackbox/types/TestRegression3361.cxx index cac2063c79c..ecf625300da 100644 --- a/test/blackbox/types/TestRegression3361.cxx +++ b/test/blackbox/types/TestRegression3361.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "TestRegression3361.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "TestRegression3361TypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + TestRegression3361::TestRegression3361() { - // Just to register all known types registerTestRegression3361Types(); } @@ -66,7 +70,6 @@ TestRegression3361& TestRegression3361::operator =( { m_uuid = x.m_uuid; - return *this; } @@ -75,7 +78,6 @@ TestRegression3361& TestRegression3361::operator =( { m_uuid = std::move(x.m_uuid); - return *this; } @@ -132,3 +134,5 @@ TestModule::MACHINEID& TestRegression3361::uuid() // Include auxiliary functions like for serializing/deserializing. #include "TestRegression3361CdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestRegression3361.h b/test/blackbox/types/TestRegression3361.h index 910acdffdab..fd1ff797e05 100644 --- a/test/blackbox/types/TestRegression3361.h +++ b/test/blackbox/types/TestRegression3361.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "TestRegression3361v1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ #define _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ @@ -30,6 +35,7 @@ #include #include +#include #include #include "TestIncludeRegression3361.h" @@ -68,6 +74,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure TestRegression3361 defined by the user in the IDL file. * @ingroup TestRegression3361 @@ -162,3 +170,6 @@ class TestRegression3361 #endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/TestRegression3361CdrAux.hpp b/test/blackbox/types/TestRegression3361CdrAux.hpp index a98cba762ac..2f61ec53c58 100644 --- a/test/blackbox/types/TestRegression3361CdrAux.hpp +++ b/test/blackbox/types/TestRegression3361CdrAux.hpp @@ -35,6 +35,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const TestRegression3361& data); @@ -43,4 +45,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_HPP_ + diff --git a/test/blackbox/types/TestRegression3361CdrAux.ipp b/test/blackbox/types/TestRegression3361CdrAux.ipp index ebe5ccba5ed..95b1afdaf99 100644 --- a/test/blackbox/types/TestRegression3361CdrAux.ipp +++ b/test/blackbox/types/TestRegression3361CdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.uuid() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +116,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361CDRAUX_IPP_ + diff --git a/test/blackbox/types/TestRegression3361PubSubTypes.cxx b/test/blackbox/types/TestRegression3361PubSubTypes.cxx index 54291d43b5c..b43c12a14b5 100644 --- a/test/blackbox/types/TestRegression3361PubSubTypes.cxx +++ b/test/blackbox/types/TestRegression3361PubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TestRegression3361PubSubTypes.h" #include "TestRegression3361CdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + TestRegression3361PubSubType::TestRegression3361PubSubType() { setName("TestRegression3361"); - uint32_t type_size = TestRegression3361_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(TestRegression3361::getMaxCdrSerializedSize()); +#else + TestRegression3361_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool TestRegression3361PubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool TestRegression3361PubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool TestRegression3361PubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function TestRegression3361PubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool TestRegression3361PubSubType::getKey( TestRegression3361_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || TestRegression3361_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/blackbox/types/TestRegression3361PubSubTypes.h b/test/blackbox/types/TestRegression3361PubSubTypes.h index d0a549edbb2..a6c5be91dc5 100644 --- a/test/blackbox/types/TestRegression3361PubSubTypes.h +++ b/test/blackbox/types/TestRegression3361PubSubTypes.h @@ -39,6 +39,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type TestRegression3361 defined by the user in the IDL file. * @ingroup TestRegression3361 diff --git a/test/blackbox/types/TestRegression3361TypeObject.cxx b/test/blackbox/types/TestRegression3361TypeObject.cxx index c4ff927c7a6..39450c3c9fd 100644 --- a/test/blackbox/types/TestRegression3361TypeObject.cxx +++ b/test/blackbox/types/TestRegression3361TypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -61,6 +59,8 @@ void registerTestRegression3361Types() }); } + + const TypeIdentifier* GetTestRegression3361Identifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("TestRegression3361", complete); @@ -130,7 +130,6 @@ const TypeObject* GetMinimalTestRegression3361Object() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -146,7 +145,11 @@ const TypeObject* GetMinimalTestRegression3361Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -198,7 +201,6 @@ const TypeObject* GetCompleteTestRegression3361Object() // Header type_object->complete().struct_type().header().detail().type_name("TestRegression3361"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -214,7 +216,11 @@ const TypeObject* GetCompleteTestRegression3361Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/blackbox/types/TestRegression3361TypeObject.h b/test/blackbox/types/TestRegression3361TypeObject.h index 7b8e138f025..1f366454d99 100644 --- a/test/blackbox/types/TestRegression3361TypeObject.h +++ b/test/blackbox/types/TestRegression3361TypeObject.h @@ -55,6 +55,8 @@ using namespace eprosima::fastrtps::types; eProsima_user_DllExport void registerTestRegression3361Types(); + + eProsima_user_DllExport const TypeIdentifier* GetTestRegression3361Identifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetTestRegression3361Object(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalTestRegression3361Object(); diff --git a/test/blackbox/types/TestRegression3361v1.cxx b/test/blackbox/types/TestRegression3361v1.cxx new file mode 100644 index 00000000000..9ac400e6abb --- /dev/null +++ b/test/blackbox/types/TestRegression3361v1.cxx @@ -0,0 +1,238 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file TestRegression3361.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "TestRegression3361.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "TestRegression3361TypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define TestRegression3361_max_cdr_typesize 264ULL; + + + + + +TestRegression3361::TestRegression3361() +{ + // TestModule::MACHINEID m_uuid + + + // Just to register all known types + registerTestRegression3361Types(); +} + +TestRegression3361::~TestRegression3361() +{ +} + +TestRegression3361::TestRegression3361( + const TestRegression3361& x) +{ + m_uuid = x.m_uuid; + +} + +TestRegression3361::TestRegression3361( + TestRegression3361&& x) noexcept +{ + m_uuid = std::move(x.m_uuid); + +} + +TestRegression3361& TestRegression3361::operator =( + const TestRegression3361& x) +{ + m_uuid = x.m_uuid; + + return *this; +} + +TestRegression3361& TestRegression3361::operator =( + TestRegression3361&& x) noexcept +{ + m_uuid = std::move(x.m_uuid); + + return *this; +} + +bool TestRegression3361::operator ==( + const TestRegression3361& x) const +{ + return (m_uuid == x.m_uuid); +} + +bool TestRegression3361::operator !=( + const TestRegression3361& x) const +{ + return !(*this == x); +} + +size_t TestRegression3361::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return TestRegression3361_max_cdr_typesize; +} + +size_t TestRegression3361::getCdrSerializedSize( + const TestRegression3361& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.uuid().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void TestRegression3361::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_uuid.c_str(); + +} + +void TestRegression3361::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_uuid; + + +} + + +bool TestRegression3361::isKeyDefined() +{ + return false; +} + +void TestRegression3361::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member uuid + * @param _uuid New value to be copied in member uuid + */ +void TestRegression3361::uuid( + const TestModule::MACHINEID& _uuid) +{ + m_uuid = _uuid; +} + +/*! + * @brief This function moves the value in member uuid + * @param _uuid New value to be moved in member uuid + */ +void TestRegression3361::uuid( + TestModule::MACHINEID&& _uuid) +{ + m_uuid = std::move(_uuid); +} + +/*! + * @brief This function returns a constant reference to member uuid + * @return Constant reference to member uuid + */ +const TestModule::MACHINEID& TestRegression3361::uuid() const +{ + return m_uuid; +} + +/*! + * @brief This function returns a reference to member uuid + * @return Reference to member uuid + */ +TestModule::MACHINEID& TestRegression3361::uuid() +{ + return m_uuid; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/TestRegression3361v1.h b/test/blackbox/types/TestRegression3361v1.h new file mode 100644 index 00000000000..655f148ca89 --- /dev/null +++ b/test/blackbox/types/TestRegression3361v1.h @@ -0,0 +1,223 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file TestRegression3361.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ +#define _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ + +#include "TestIncludeRegression3361.h" + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TESTREGRESSION3361_SOURCE) +#define TESTREGRESSION3361_DllAPI __declspec( dllexport ) +#else +#define TESTREGRESSION3361_DllAPI __declspec( dllimport ) +#endif // TESTREGRESSION3361_SOURCE +#else +#define TESTREGRESSION3361_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TESTREGRESSION3361_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure TestRegression3361 defined by the user in the IDL file. + * @ingroup TestRegression3361 + */ +class TestRegression3361 +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TestRegression3361(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TestRegression3361(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361( + const TestRegression3361& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361( + TestRegression3361&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361& operator =( + const TestRegression3361& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object TestRegression3361 that will be copied. + */ + eProsima_user_DllExport TestRegression3361& operator =( + TestRegression3361&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x TestRegression3361 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TestRegression3361& x) const; + + /*! + * @brief Comparison operator. + * @param x TestRegression3361 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TestRegression3361& x) const; + + /*! + * @brief This function copies the value in member uuid + * @param _uuid New value to be copied in member uuid + */ + eProsima_user_DllExport void uuid( + const TestModule::MACHINEID& _uuid); + + /*! + * @brief This function moves the value in member uuid + * @param _uuid New value to be moved in member uuid + */ + eProsima_user_DllExport void uuid( + TestModule::MACHINEID&& _uuid); + + /*! + * @brief This function returns a constant reference to member uuid + * @return Constant reference to member uuid + */ + eProsima_user_DllExport const TestModule::MACHINEID& uuid() const; + + /*! + * @brief This function returns a reference to member uuid + * @return Reference to member uuid + */ + eProsima_user_DllExport TestModule::MACHINEID& uuid(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const TestRegression3361& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + TestModule::MACHINEID m_uuid; + +}; + + +#endif // _FAST_DDS_GENERATED_TESTREGRESSION3361_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/statistics/types.cxx b/test/blackbox/types/statistics/types.cxx index bf6b1c9ee78..9dcb86ef67b 100644 --- a/test/blackbox/types/statistics/types.cxx +++ b/test/blackbox/types/statistics/types.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "types.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,52 +39,59 @@ using namespace eprosima::fastcdr::exception; #include -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s() -{ +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + + +EntityId_s::EntityId_s() +{ } -eprosima::fastdds::statistics::detail::EntityId_s::~EntityId_s() +EntityId_s::~EntityId_s() { } -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( +EntityId_s::EntityId_s( const EntityId_s& x) { m_value = x.m_value; } -eprosima::fastdds::statistics::detail::EntityId_s::EntityId_s( +EntityId_s::EntityId_s( EntityId_s&& x) noexcept { m_value = std::move(x.m_value); } -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::EntityId_s::operator =( +EntityId_s& EntityId_s::operator =( const EntityId_s& x) { m_value = x.m_value; - return *this; } -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::EntityId_s::operator =( +EntityId_s& EntityId_s::operator =( EntityId_s&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool eprosima::fastdds::statistics::detail::EntityId_s::operator ==( +bool EntityId_s::operator ==( const EntityId_s& x) const { return (m_value == x.m_value); } -bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( +bool EntityId_s::operator !=( const EntityId_s& x) const { return !(*this == x); @@ -91,7 +101,7 @@ bool eprosima::fastdds::statistics::detail::EntityId_s::operator !=( * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void eprosima::fastdds::statistics::detail::EntityId_s::value( +void EntityId_s::value( const std::array& _value) { m_value = _value; @@ -101,7 +111,7 @@ void eprosima::fastdds::statistics::detail::EntityId_s::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void eprosima::fastdds::statistics::detail::EntityId_s::value( +void EntityId_s::value( std::array&& _value) { m_value = std::move(_value); @@ -111,7 +121,7 @@ void eprosima::fastdds::statistics::detail::EntityId_s::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::array& eprosima::fastdds::statistics::detail::EntityId_s::value() const +const std::array& EntityId_s::value() const { return m_value; } @@ -120,58 +130,57 @@ const std::array& eprosima::fastdds::statistics::detail::EntityId_s: * @brief This function returns a reference to member value * @return Reference to member value */ -std::array& eprosima::fastdds::statistics::detail::EntityId_s::value() +std::array& EntityId_s::value() { return m_value; } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s() -{ + +GuidPrefix_s::GuidPrefix_s() +{ } -eprosima::fastdds::statistics::detail::GuidPrefix_s::~GuidPrefix_s() +GuidPrefix_s::~GuidPrefix_s() { } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( +GuidPrefix_s::GuidPrefix_s( const GuidPrefix_s& x) { m_value = x.m_value; } -eprosima::fastdds::statistics::detail::GuidPrefix_s::GuidPrefix_s( +GuidPrefix_s::GuidPrefix_s( GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); } -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GuidPrefix_s::operator =( +GuidPrefix_s& GuidPrefix_s::operator =( const GuidPrefix_s& x) { m_value = x.m_value; - return *this; } -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GuidPrefix_s::operator =( +GuidPrefix_s& GuidPrefix_s::operator =( GuidPrefix_s&& x) noexcept { m_value = std::move(x.m_value); - return *this; } -bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator ==( +bool GuidPrefix_s::operator ==( const GuidPrefix_s& x) const { return (m_value == x.m_value); } -bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( +bool GuidPrefix_s::operator !=( const GuidPrefix_s& x) const { return !(*this == x); @@ -181,7 +190,7 @@ bool eprosima::fastdds::statistics::detail::GuidPrefix_s::operator !=( * @brief This function copies the value in member value * @param _value New value to be copied in member value */ -void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( +void GuidPrefix_s::value( const std::array& _value) { m_value = _value; @@ -191,7 +200,7 @@ void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( * @brief This function moves the value in member value * @param _value New value to be moved in member value */ -void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( +void GuidPrefix_s::value( std::array&& _value) { m_value = std::move(_value); @@ -201,7 +210,7 @@ void eprosima::fastdds::statistics::detail::GuidPrefix_s::value( * @brief This function returns a constant reference to member value * @return Constant reference to member value */ -const std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::value() const +const std::array& GuidPrefix_s::value() const { return m_value; } @@ -210,63 +219,62 @@ const std::array& eprosima::fastdds::statistics::detail::GuidPrefix * @brief This function returns a reference to member value * @return Reference to member value */ -std::array& eprosima::fastdds::statistics::detail::GuidPrefix_s::value() +std::array& GuidPrefix_s::value() { return m_value; } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s() -{ + +GUID_s::GUID_s() +{ } -eprosima::fastdds::statistics::detail::GUID_s::~GUID_s() +GUID_s::~GUID_s() { } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s( +GUID_s::GUID_s( const GUID_s& x) { m_guidPrefix = x.m_guidPrefix; m_entityId = x.m_entityId; } -eprosima::fastdds::statistics::detail::GUID_s::GUID_s( +GUID_s::GUID_s( GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); } -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::GUID_s::operator =( +GUID_s& GUID_s::operator =( const GUID_s& x) { m_guidPrefix = x.m_guidPrefix; m_entityId = x.m_entityId; - return *this; } -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::GUID_s::operator =( +GUID_s& GUID_s::operator =( GUID_s&& x) noexcept { m_guidPrefix = std::move(x.m_guidPrefix); m_entityId = std::move(x.m_entityId); - return *this; } -bool eprosima::fastdds::statistics::detail::GUID_s::operator ==( +bool GUID_s::operator ==( const GUID_s& x) const { return (m_guidPrefix == x.m_guidPrefix && m_entityId == x.m_entityId); } -bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( +bool GUID_s::operator !=( const GUID_s& x) const { return !(*this == x); @@ -276,7 +284,7 @@ bool eprosima::fastdds::statistics::detail::GUID_s::operator !=( * @brief This function copies the value in member guidPrefix * @param _guidPrefix New value to be copied in member guidPrefix */ -void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( +void GUID_s::guidPrefix( const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) { m_guidPrefix = _guidPrefix; @@ -286,7 +294,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( * @brief This function moves the value in member guidPrefix * @param _guidPrefix New value to be moved in member guidPrefix */ -void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( +void GUID_s::guidPrefix( eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) { m_guidPrefix = std::move(_guidPrefix); @@ -296,7 +304,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::guidPrefix( * @brief This function returns a constant reference to member guidPrefix * @return Constant reference to member guidPrefix */ -const eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GUID_s::guidPrefix() const +const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const { return m_guidPrefix; } @@ -305,7 +313,7 @@ const eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::st * @brief This function returns a reference to member guidPrefix * @return Reference to member guidPrefix */ -eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statistics::detail::GUID_s::guidPrefix() +eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() { return m_guidPrefix; } @@ -315,7 +323,7 @@ eprosima::fastdds::statistics::detail::GuidPrefix_s& eprosima::fastdds::statisti * @brief This function copies the value in member entityId * @param _entityId New value to be copied in member entityId */ -void eprosima::fastdds::statistics::detail::GUID_s::entityId( +void GUID_s::entityId( const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) { m_entityId = _entityId; @@ -325,7 +333,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::entityId( * @brief This function moves the value in member entityId * @param _entityId New value to be moved in member entityId */ -void eprosima::fastdds::statistics::detail::GUID_s::entityId( +void GUID_s::entityId( eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) { m_entityId = std::move(_entityId); @@ -335,7 +343,7 @@ void eprosima::fastdds::statistics::detail::GUID_s::entityId( * @brief This function returns a constant reference to member entityId * @return Constant reference to member entityId */ -const eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::GUID_s::entityId() const +const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const { return m_entityId; } @@ -344,63 +352,62 @@ const eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::stat * @brief This function returns a reference to member entityId * @return Reference to member entityId */ -eprosima::fastdds::statistics::detail::EntityId_s& eprosima::fastdds::statistics::detail::GUID_s::entityId() +eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() { return m_entityId; } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s() -{ + +SequenceNumber_s::SequenceNumber_s() +{ } -eprosima::fastdds::statistics::detail::SequenceNumber_s::~SequenceNumber_s() +SequenceNumber_s::~SequenceNumber_s() { } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( +SequenceNumber_s::SequenceNumber_s( const SequenceNumber_s& x) { m_high = x.m_high; m_low = x.m_low; } -eprosima::fastdds::statistics::detail::SequenceNumber_s::SequenceNumber_s( +SequenceNumber_s::SequenceNumber_s( SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; } -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SequenceNumber_s::operator =( +SequenceNumber_s& SequenceNumber_s::operator =( const SequenceNumber_s& x) { m_high = x.m_high; m_low = x.m_low; - return *this; } -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SequenceNumber_s::operator =( +SequenceNumber_s& SequenceNumber_s::operator =( SequenceNumber_s&& x) noexcept { m_high = x.m_high; m_low = x.m_low; - return *this; } -bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator ==( +bool SequenceNumber_s::operator ==( const SequenceNumber_s& x) const { return (m_high == x.m_high && m_low == x.m_low); } -bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( +bool SequenceNumber_s::operator !=( const SequenceNumber_s& x) const { return !(*this == x); @@ -410,7 +417,7 @@ bool eprosima::fastdds::statistics::detail::SequenceNumber_s::operator !=( * @brief This function sets a value in member high * @param _high New value for member high */ -void eprosima::fastdds::statistics::detail::SequenceNumber_s::high( +void SequenceNumber_s::high( int32_t _high) { m_high = _high; @@ -420,7 +427,7 @@ void eprosima::fastdds::statistics::detail::SequenceNumber_s::high( * @brief This function returns the value of member high * @return Value of member high */ -int32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::high() const +int32_t SequenceNumber_s::high() const { return m_high; } @@ -429,7 +436,7 @@ int32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::high() const * @brief This function returns a reference to member high * @return Reference to member high */ -int32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::high() +int32_t& SequenceNumber_s::high() { return m_high; } @@ -439,7 +446,7 @@ int32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::high() * @brief This function sets a value in member low * @param _low New value for member low */ -void eprosima::fastdds::statistics::detail::SequenceNumber_s::low( +void SequenceNumber_s::low( uint32_t _low) { m_low = _low; @@ -449,7 +456,7 @@ void eprosima::fastdds::statistics::detail::SequenceNumber_s::low( * @brief This function returns the value of member low * @return Value of member low */ -uint32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::low() const +uint32_t SequenceNumber_s::low() const { return m_low; } @@ -458,63 +465,62 @@ uint32_t eprosima::fastdds::statistics::detail::SequenceNumber_s::low() const * @brief This function returns a reference to member low * @return Reference to member low */ -uint32_t& eprosima::fastdds::statistics::detail::SequenceNumber_s::low() +uint32_t& SequenceNumber_s::low() { return m_low; } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s() -{ + +SampleIdentity_s::SampleIdentity_s() +{ } -eprosima::fastdds::statistics::detail::SampleIdentity_s::~SampleIdentity_s() +SampleIdentity_s::~SampleIdentity_s() { } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( +SampleIdentity_s::SampleIdentity_s( const SampleIdentity_s& x) { m_writer_guid = x.m_writer_guid; m_sequence_number = x.m_sequence_number; } -eprosima::fastdds::statistics::detail::SampleIdentity_s::SampleIdentity_s( +SampleIdentity_s::SampleIdentity_s( SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); } -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::operator =( +SampleIdentity_s& SampleIdentity_s::operator =( const SampleIdentity_s& x) { m_writer_guid = x.m_writer_guid; m_sequence_number = x.m_sequence_number; - return *this; } -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::operator =( +SampleIdentity_s& SampleIdentity_s::operator =( SampleIdentity_s&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_sequence_number = std::move(x.m_sequence_number); - return *this; } -bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator ==( +bool SampleIdentity_s::operator ==( const SampleIdentity_s& x) const { return (m_writer_guid == x.m_writer_guid && m_sequence_number == x.m_sequence_number); } -bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( +bool SampleIdentity_s::operator !=( const SampleIdentity_s& x) const { return !(*this == x); @@ -524,7 +530,7 @@ bool eprosima::fastdds::statistics::detail::SampleIdentity_s::operator !=( * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( +void SampleIdentity_s::writer_guid( const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) { m_writer_guid = _writer_guid; @@ -534,7 +540,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( * @brief This function moves the value in member writer_guid * @param _writer_guid New value to be moved in member writer_guid */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( +void SampleIdentity_s::writer_guid( eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) { m_writer_guid = std::move(_writer_guid); @@ -544,7 +550,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid( * @brief This function returns a constant reference to member writer_guid * @return Constant reference to member writer_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const { return m_writer_guid; } @@ -553,7 +559,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member writer_guid * @return Reference to member writer_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::writer_guid() +eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() { return m_writer_guid; } @@ -563,7 +569,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::de * @brief This function copies the value in member sequence_number * @param _sequence_number New value to be copied in member sequence_number */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( +void SampleIdentity_s::sequence_number( const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) { m_sequence_number = _sequence_number; @@ -573,7 +579,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( * @brief This function moves the value in member sequence_number * @param _sequence_number New value to be moved in member sequence_number */ -void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( +void SampleIdentity_s::sequence_number( eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) { m_sequence_number = std::move(_sequence_number); @@ -583,7 +589,7 @@ void eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number( * @brief This function returns a constant reference to member sequence_number * @return Constant reference to member sequence_number */ -const eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number() const +const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const { return m_sequence_number; } @@ -592,22 +598,23 @@ const eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds * @brief This function returns a reference to member sequence_number * @return Reference to member sequence_number */ -eprosima::fastdds::statistics::detail::SequenceNumber_s& eprosima::fastdds::statistics::detail::SampleIdentity_s::sequence_number() +eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() { return m_sequence_number; } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s() -{ + +Locator_s::Locator_s() +{ } -eprosima::fastdds::statistics::detail::Locator_s::~Locator_s() +Locator_s::~Locator_s() { } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s( +Locator_s::Locator_s( const Locator_s& x) { m_kind = x.m_kind; @@ -615,7 +622,7 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( m_address = x.m_address; } -eprosima::fastdds::statistics::detail::Locator_s::Locator_s( +Locator_s::Locator_s( Locator_s&& x) noexcept { m_kind = x.m_kind; @@ -623,29 +630,27 @@ eprosima::fastdds::statistics::detail::Locator_s::Locator_s( m_address = std::move(x.m_address); } -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::detail::Locator_s::operator =( +Locator_s& Locator_s::operator =( const Locator_s& x) { m_kind = x.m_kind; m_port = x.m_port; m_address = x.m_address; - return *this; } -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::detail::Locator_s::operator =( +Locator_s& Locator_s::operator =( Locator_s&& x) noexcept { m_kind = x.m_kind; m_port = x.m_port; m_address = std::move(x.m_address); - return *this; } -bool eprosima::fastdds::statistics::detail::Locator_s::operator ==( +bool Locator_s::operator ==( const Locator_s& x) const { return (m_kind == x.m_kind && @@ -653,7 +658,7 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator ==( m_address == x.m_address); } -bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( +bool Locator_s::operator !=( const Locator_s& x) const { return !(*this == x); @@ -663,7 +668,7 @@ bool eprosima::fastdds::statistics::detail::Locator_s::operator !=( * @brief This function sets a value in member kind * @param _kind New value for member kind */ -void eprosima::fastdds::statistics::detail::Locator_s::kind( +void Locator_s::kind( int32_t _kind) { m_kind = _kind; @@ -673,7 +678,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::kind( * @brief This function returns the value of member kind * @return Value of member kind */ -int32_t eprosima::fastdds::statistics::detail::Locator_s::kind() const +int32_t Locator_s::kind() const { return m_kind; } @@ -682,7 +687,7 @@ int32_t eprosima::fastdds::statistics::detail::Locator_s::kind() const * @brief This function returns a reference to member kind * @return Reference to member kind */ -int32_t& eprosima::fastdds::statistics::detail::Locator_s::kind() +int32_t& Locator_s::kind() { return m_kind; } @@ -692,7 +697,7 @@ int32_t& eprosima::fastdds::statistics::detail::Locator_s::kind() * @brief This function sets a value in member port * @param _port New value for member port */ -void eprosima::fastdds::statistics::detail::Locator_s::port( +void Locator_s::port( uint32_t _port) { m_port = _port; @@ -702,7 +707,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::port( * @brief This function returns the value of member port * @return Value of member port */ -uint32_t eprosima::fastdds::statistics::detail::Locator_s::port() const +uint32_t Locator_s::port() const { return m_port; } @@ -711,7 +716,7 @@ uint32_t eprosima::fastdds::statistics::detail::Locator_s::port() const * @brief This function returns a reference to member port * @return Reference to member port */ -uint32_t& eprosima::fastdds::statistics::detail::Locator_s::port() +uint32_t& Locator_s::port() { return m_port; } @@ -721,7 +726,7 @@ uint32_t& eprosima::fastdds::statistics::detail::Locator_s::port() * @brief This function copies the value in member address * @param _address New value to be copied in member address */ -void eprosima::fastdds::statistics::detail::Locator_s::address( +void Locator_s::address( const std::array& _address) { m_address = _address; @@ -731,7 +736,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::address( * @brief This function moves the value in member address * @param _address New value to be moved in member address */ -void eprosima::fastdds::statistics::detail::Locator_s::address( +void Locator_s::address( std::array&& _address) { m_address = std::move(_address); @@ -741,7 +746,7 @@ void eprosima::fastdds::statistics::detail::Locator_s::address( * @brief This function returns a constant reference to member address * @return Constant reference to member address */ -const std::array& eprosima::fastdds::statistics::detail::Locator_s::address() const +const std::array& Locator_s::address() const { return m_address; } @@ -750,23 +755,26 @@ const std::array& eprosima::fastdds::statistics::detail::Locator_s: * @brief This function returns a reference to member address * @return Reference to member address */ -std::array& eprosima::fastdds::statistics::detail::Locator_s::address() +std::array& Locator_s::address() { return m_address; } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime() -{ +} // namespace detail + + +DiscoveryTime::DiscoveryTime() +{ } -eprosima::fastdds::statistics::DiscoveryTime::~DiscoveryTime() +DiscoveryTime::~DiscoveryTime() { } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( +DiscoveryTime::DiscoveryTime( const DiscoveryTime& x) { m_local_participant_guid = x.m_local_participant_guid; @@ -777,7 +785,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( m_process = x.m_process; } -eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( +DiscoveryTime::DiscoveryTime( DiscoveryTime&& x) noexcept { m_local_participant_guid = std::move(x.m_local_participant_guid); @@ -788,7 +796,7 @@ eprosima::fastdds::statistics::DiscoveryTime::DiscoveryTime( m_process = std::move(x.m_process); } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::DiscoveryTime::operator =( +DiscoveryTime& DiscoveryTime::operator =( const DiscoveryTime& x) { @@ -798,11 +806,10 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dis m_host = x.m_host; m_user = x.m_user; m_process = x.m_process; - return *this; } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::DiscoveryTime::operator =( +DiscoveryTime& DiscoveryTime::operator =( DiscoveryTime&& x) noexcept { @@ -812,11 +819,10 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dis m_host = std::move(x.m_host); m_user = std::move(x.m_user); m_process = std::move(x.m_process); - return *this; } -bool eprosima::fastdds::statistics::DiscoveryTime::operator ==( +bool DiscoveryTime::operator ==( const DiscoveryTime& x) const { return (m_local_participant_guid == x.m_local_participant_guid && @@ -827,7 +833,7 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator ==( m_process == x.m_process); } -bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( +bool DiscoveryTime::operator !=( const DiscoveryTime& x) const { return !(*this == x); @@ -837,7 +843,7 @@ bool eprosima::fastdds::statistics::DiscoveryTime::operator !=( * @brief This function copies the value in member local_participant_guid * @param _local_participant_guid New value to be copied in member local_participant_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( +void DiscoveryTime::local_participant_guid( const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) { m_local_participant_guid = _local_participant_guid; @@ -847,7 +853,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( * @brief This function moves the value in member local_participant_guid * @param _local_participant_guid New value to be moved in member local_participant_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( +void DiscoveryTime::local_participant_guid( eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) { m_local_participant_guid = std::move(_local_participant_guid); @@ -857,7 +863,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid( * @brief This function returns a constant reference to member local_participant_guid * @return Constant reference to member local_participant_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const { return m_local_participant_guid; } @@ -866,7 +872,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member local_participant_guid * @return Reference to member local_participant_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::local_participant_guid() +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() { return m_local_participant_guid; } @@ -876,7 +882,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di * @brief This function copies the value in member remote_entity_guid * @param _remote_entity_guid New value to be copied in member remote_entity_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( +void DiscoveryTime::remote_entity_guid( const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) { m_remote_entity_guid = _remote_entity_guid; @@ -886,7 +892,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( * @brief This function moves the value in member remote_entity_guid * @param _remote_entity_guid New value to be moved in member remote_entity_guid */ -void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( +void DiscoveryTime::remote_entity_guid( eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) { m_remote_entity_guid = std::move(_remote_entity_guid); @@ -896,7 +902,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid( * @brief This function returns a constant reference to member remote_entity_guid * @return Constant reference to member remote_entity_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const { return m_remote_entity_guid; } @@ -905,7 +911,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member remote_entity_guid * @return Reference to member remote_entity_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::DiscoveryTime::remote_entity_guid() +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() { return m_remote_entity_guid; } @@ -915,7 +921,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Di * @brief This function sets a value in member time * @param _time New value for member time */ -void eprosima::fastdds::statistics::DiscoveryTime::time( +void DiscoveryTime::time( uint64_t _time) { m_time = _time; @@ -925,7 +931,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::time( * @brief This function returns the value of member time * @return Value of member time */ -uint64_t eprosima::fastdds::statistics::DiscoveryTime::time() const +uint64_t DiscoveryTime::time() const { return m_time; } @@ -934,7 +940,7 @@ uint64_t eprosima::fastdds::statistics::DiscoveryTime::time() const * @brief This function returns a reference to member time * @return Reference to member time */ -uint64_t& eprosima::fastdds::statistics::DiscoveryTime::time() +uint64_t& DiscoveryTime::time() { return m_time; } @@ -944,7 +950,7 @@ uint64_t& eprosima::fastdds::statistics::DiscoveryTime::time() * @brief This function copies the value in member host * @param _host New value to be copied in member host */ -void eprosima::fastdds::statistics::DiscoveryTime::host( +void DiscoveryTime::host( const std::string& _host) { m_host = _host; @@ -954,7 +960,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::host( * @brief This function moves the value in member host * @param _host New value to be moved in member host */ -void eprosima::fastdds::statistics::DiscoveryTime::host( +void DiscoveryTime::host( std::string&& _host) { m_host = std::move(_host); @@ -964,7 +970,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::host( * @brief This function returns a constant reference to member host * @return Constant reference to member host */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::host() const +const std::string& DiscoveryTime::host() const { return m_host; } @@ -973,7 +979,7 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::host() const * @brief This function returns a reference to member host * @return Reference to member host */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::host() +std::string& DiscoveryTime::host() { return m_host; } @@ -983,7 +989,7 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::host() * @brief This function copies the value in member user * @param _user New value to be copied in member user */ -void eprosima::fastdds::statistics::DiscoveryTime::user( +void DiscoveryTime::user( const std::string& _user) { m_user = _user; @@ -993,7 +999,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::user( * @brief This function moves the value in member user * @param _user New value to be moved in member user */ -void eprosima::fastdds::statistics::DiscoveryTime::user( +void DiscoveryTime::user( std::string&& _user) { m_user = std::move(_user); @@ -1003,7 +1009,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::user( * @brief This function returns a constant reference to member user * @return Constant reference to member user */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::user() const +const std::string& DiscoveryTime::user() const { return m_user; } @@ -1012,7 +1018,7 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::user() const * @brief This function returns a reference to member user * @return Reference to member user */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::user() +std::string& DiscoveryTime::user() { return m_user; } @@ -1022,7 +1028,7 @@ std::string& eprosima::fastdds::statistics::DiscoveryTime::user() * @brief This function copies the value in member process * @param _process New value to be copied in member process */ -void eprosima::fastdds::statistics::DiscoveryTime::process( +void DiscoveryTime::process( const std::string& _process) { m_process = _process; @@ -1032,7 +1038,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::process( * @brief This function moves the value in member process * @param _process New value to be moved in member process */ -void eprosima::fastdds::statistics::DiscoveryTime::process( +void DiscoveryTime::process( std::string&& _process) { m_process = std::move(_process); @@ -1042,7 +1048,7 @@ void eprosima::fastdds::statistics::DiscoveryTime::process( * @brief This function returns a constant reference to member process * @return Constant reference to member process */ -const std::string& eprosima::fastdds::statistics::DiscoveryTime::process() const +const std::string& DiscoveryTime::process() const { return m_process; } @@ -1051,63 +1057,62 @@ const std::string& eprosima::fastdds::statistics::DiscoveryTime::process() const * @brief This function returns a reference to member process * @return Reference to member process */ -std::string& eprosima::fastdds::statistics::DiscoveryTime::process() +std::string& DiscoveryTime::process() { return m_process; } -eprosima::fastdds::statistics::EntityCount::EntityCount() -{ + +EntityCount::EntityCount() +{ } -eprosima::fastdds::statistics::EntityCount::~EntityCount() +EntityCount::~EntityCount() { } -eprosima::fastdds::statistics::EntityCount::EntityCount( +EntityCount::EntityCount( const EntityCount& x) { m_guid = x.m_guid; m_count = x.m_count; } -eprosima::fastdds::statistics::EntityCount::EntityCount( +EntityCount::EntityCount( EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::EntityCount::operator =( +EntityCount& EntityCount::operator =( const EntityCount& x) { m_guid = x.m_guid; m_count = x.m_count; - return *this; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::EntityCount::operator =( +EntityCount& EntityCount::operator =( EntityCount&& x) noexcept { m_guid = std::move(x.m_guid); m_count = x.m_count; - return *this; } -bool eprosima::fastdds::statistics::EntityCount::operator ==( +bool EntityCount::operator ==( const EntityCount& x) const { return (m_guid == x.m_guid && m_count == x.m_count); } -bool eprosima::fastdds::statistics::EntityCount::operator !=( +bool EntityCount::operator !=( const EntityCount& x) const { return !(*this == x); @@ -1117,7 +1122,7 @@ bool eprosima::fastdds::statistics::EntityCount::operator !=( * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid */ -void eprosima::fastdds::statistics::EntityCount::guid( +void EntityCount::guid( const eprosima::fastdds::statistics::detail::GUID_s& _guid) { m_guid = _guid; @@ -1127,7 +1132,7 @@ void eprosima::fastdds::statistics::EntityCount::guid( * @brief This function moves the value in member guid * @param _guid New value to be moved in member guid */ -void eprosima::fastdds::statistics::EntityCount::guid( +void EntityCount::guid( eprosima::fastdds::statistics::detail::GUID_s&& _guid) { m_guid = std::move(_guid); @@ -1137,7 +1142,7 @@ void eprosima::fastdds::statistics::EntityCount::guid( * @brief This function returns a constant reference to member guid * @return Constant reference to member guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityCount::guid() const +const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const { return m_guid; } @@ -1146,7 +1151,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member guid * @return Reference to member guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityCount::guid() +eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() { return m_guid; } @@ -1156,7 +1161,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function sets a value in member count * @param _count New value for member count */ -void eprosima::fastdds::statistics::EntityCount::count( +void EntityCount::count( uint64_t _count) { m_count = _count; @@ -1166,7 +1171,7 @@ void eprosima::fastdds::statistics::EntityCount::count( * @brief This function returns the value of member count * @return Value of member count */ -uint64_t eprosima::fastdds::statistics::EntityCount::count() const +uint64_t EntityCount::count() const { return m_count; } @@ -1175,63 +1180,62 @@ uint64_t eprosima::fastdds::statistics::EntityCount::count() const * @brief This function returns a reference to member count * @return Reference to member count */ -uint64_t& eprosima::fastdds::statistics::EntityCount::count() +uint64_t& EntityCount::count() { return m_count; } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount() -{ + +SampleIdentityCount::SampleIdentityCount() +{ } -eprosima::fastdds::statistics::SampleIdentityCount::~SampleIdentityCount() +SampleIdentityCount::~SampleIdentityCount() { } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( +SampleIdentityCount::SampleIdentityCount( const SampleIdentityCount& x) { m_sample_id = x.m_sample_id; m_count = x.m_count; } -eprosima::fastdds::statistics::SampleIdentityCount::SampleIdentityCount( +SampleIdentityCount::SampleIdentityCount( SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::SampleIdentityCount::operator =( +SampleIdentityCount& SampleIdentityCount::operator =( const SampleIdentityCount& x) { m_sample_id = x.m_sample_id; m_count = x.m_count; - return *this; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::SampleIdentityCount::operator =( +SampleIdentityCount& SampleIdentityCount::operator =( SampleIdentityCount&& x) noexcept { m_sample_id = std::move(x.m_sample_id); m_count = x.m_count; - return *this; } -bool eprosima::fastdds::statistics::SampleIdentityCount::operator ==( +bool SampleIdentityCount::operator ==( const SampleIdentityCount& x) const { return (m_sample_id == x.m_sample_id && m_count == x.m_count); } -bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( +bool SampleIdentityCount::operator !=( const SampleIdentityCount& x) const { return !(*this == x); @@ -1241,7 +1245,7 @@ bool eprosima::fastdds::statistics::SampleIdentityCount::operator !=( * @brief This function copies the value in member sample_id * @param _sample_id New value to be copied in member sample_id */ -void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( +void SampleIdentityCount::sample_id( const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) { m_sample_id = _sample_id; @@ -1251,7 +1255,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( * @brief This function moves the value in member sample_id * @param _sample_id New value to be moved in member sample_id */ -void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( +void SampleIdentityCount::sample_id( eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) { m_sample_id = std::move(_sample_id); @@ -1261,7 +1265,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::sample_id( * @brief This function returns a constant reference to member sample_id * @return Constant reference to member sample_id */ -const eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::SampleIdentityCount::sample_id() const +const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const { return m_sample_id; } @@ -1270,7 +1274,7 @@ const eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds * @brief This function returns a reference to member sample_id * @return Reference to member sample_id */ -eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::statistics::SampleIdentityCount::sample_id() +eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() { return m_sample_id; } @@ -1280,7 +1284,7 @@ eprosima::fastdds::statistics::detail::SampleIdentity_s& eprosima::fastdds::stat * @brief This function sets a value in member count * @param _count New value for member count */ -void eprosima::fastdds::statistics::SampleIdentityCount::count( +void SampleIdentityCount::count( uint64_t _count) { m_count = _count; @@ -1290,7 +1294,7 @@ void eprosima::fastdds::statistics::SampleIdentityCount::count( * @brief This function returns the value of member count * @return Value of member count */ -uint64_t eprosima::fastdds::statistics::SampleIdentityCount::count() const +uint64_t SampleIdentityCount::count() const { return m_count; } @@ -1299,22 +1303,23 @@ uint64_t eprosima::fastdds::statistics::SampleIdentityCount::count() const * @brief This function returns a reference to member count * @return Reference to member count */ -uint64_t& eprosima::fastdds::statistics::SampleIdentityCount::count() +uint64_t& SampleIdentityCount::count() { return m_count; } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic() -{ + +Entity2LocatorTraffic::Entity2LocatorTraffic() +{ } -eprosima::fastdds::statistics::Entity2LocatorTraffic::~Entity2LocatorTraffic() +Entity2LocatorTraffic::~Entity2LocatorTraffic() { } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( +Entity2LocatorTraffic::Entity2LocatorTraffic( const Entity2LocatorTraffic& x) { m_src_guid = x.m_src_guid; @@ -1324,7 +1329,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( m_byte_magnitude_order = x.m_byte_magnitude_order; } -eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( +Entity2LocatorTraffic::Entity2LocatorTraffic( Entity2LocatorTraffic&& x) noexcept { m_src_guid = std::move(x.m_src_guid); @@ -1334,7 +1339,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic::Entity2LocatorTraffic( m_byte_magnitude_order = x.m_byte_magnitude_order; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Entity2LocatorTraffic::operator =( +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( const Entity2LocatorTraffic& x) { @@ -1343,11 +1348,10 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist m_packet_count = x.m_packet_count; m_byte_count = x.m_byte_count; m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Entity2LocatorTraffic::operator =( +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( Entity2LocatorTraffic&& x) noexcept { @@ -1356,11 +1360,10 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist m_packet_count = x.m_packet_count; m_byte_count = x.m_byte_count; m_byte_magnitude_order = x.m_byte_magnitude_order; - return *this; } -bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator ==( +bool Entity2LocatorTraffic::operator ==( const Entity2LocatorTraffic& x) const { return (m_src_guid == x.m_src_guid && @@ -1370,7 +1373,7 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator ==( m_byte_magnitude_order == x.m_byte_magnitude_order); } -bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( +bool Entity2LocatorTraffic::operator !=( const Entity2LocatorTraffic& x) const { return !(*this == x); @@ -1380,7 +1383,7 @@ bool eprosima::fastdds::statistics::Entity2LocatorTraffic::operator !=( * @brief This function copies the value in member src_guid * @param _src_guid New value to be copied in member src_guid */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( +void Entity2LocatorTraffic::src_guid( const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) { m_src_guid = _src_guid; @@ -1390,7 +1393,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( * @brief This function moves the value in member src_guid * @param _src_guid New value to be moved in member src_guid */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( +void Entity2LocatorTraffic::src_guid( eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) { m_src_guid = std::move(_src_guid); @@ -1400,7 +1403,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid( * @brief This function returns a constant reference to member src_guid * @return Constant reference to member src_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const { return m_src_guid; } @@ -1409,7 +1412,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member src_guid * @return Reference to member src_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::src_guid() +eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() { return m_src_guid; } @@ -1419,7 +1422,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( +void Entity2LocatorTraffic::dst_locator( const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) { m_dst_locator = _dst_locator; @@ -1429,7 +1432,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( * @brief This function moves the value in member dst_locator * @param _dst_locator New value to be moved in member dst_locator */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( +void Entity2LocatorTraffic::dst_locator( eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) { m_dst_locator = std::move(_dst_locator); @@ -1439,7 +1442,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator( * @brief This function returns a constant reference to member dst_locator * @return Constant reference to member dst_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const { return m_dst_locator; } @@ -1448,7 +1451,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member dst_locator * @return Reference to member dst_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Entity2LocatorTraffic::dst_locator() +eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() { return m_dst_locator; } @@ -1458,7 +1461,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function sets a value in member packet_count * @param _packet_count New value for member packet_count */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count( +void Entity2LocatorTraffic::packet_count( uint64_t _packet_count) { m_packet_count = _packet_count; @@ -1468,7 +1471,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count( * @brief This function returns the value of member packet_count * @return Value of member packet_count */ -uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() const +uint64_t Entity2LocatorTraffic::packet_count() const { return m_packet_count; } @@ -1477,7 +1480,7 @@ uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() co * @brief This function returns a reference to member packet_count * @return Reference to member packet_count */ -uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() +uint64_t& Entity2LocatorTraffic::packet_count() { return m_packet_count; } @@ -1487,7 +1490,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::packet_count() * @brief This function sets a value in member byte_count * @param _byte_count New value for member byte_count */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count( +void Entity2LocatorTraffic::byte_count( uint64_t _byte_count) { m_byte_count = _byte_count; @@ -1497,7 +1500,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count( * @brief This function returns the value of member byte_count * @return Value of member byte_count */ -uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() const +uint64_t Entity2LocatorTraffic::byte_count() const { return m_byte_count; } @@ -1506,7 +1509,7 @@ uint64_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() cons * @brief This function returns a reference to member byte_count * @return Reference to member byte_count */ -uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() +uint64_t& Entity2LocatorTraffic::byte_count() { return m_byte_count; } @@ -1516,7 +1519,7 @@ uint64_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_count() * @brief This function sets a value in member byte_magnitude_order * @param _byte_magnitude_order New value for member byte_magnitude_order */ -void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order( +void Entity2LocatorTraffic::byte_magnitude_order( int16_t _byte_magnitude_order) { m_byte_magnitude_order = _byte_magnitude_order; @@ -1526,7 +1529,7 @@ void eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order( * @brief This function returns the value of member byte_magnitude_order * @return Value of member byte_magnitude_order */ -int16_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order() const +int16_t Entity2LocatorTraffic::byte_magnitude_order() const { return m_byte_magnitude_order; } @@ -1535,22 +1538,23 @@ int16_t eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_ord * @brief This function returns a reference to member byte_magnitude_order * @return Reference to member byte_magnitude_order */ -int16_t& eprosima::fastdds::statistics::Entity2LocatorTraffic::byte_magnitude_order() +int16_t& Entity2LocatorTraffic::byte_magnitude_order() { return m_byte_magnitude_order; } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData() -{ + +WriterReaderData::WriterReaderData() +{ } -eprosima::fastdds::statistics::WriterReaderData::~WriterReaderData() +WriterReaderData::~WriterReaderData() { } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( +WriterReaderData::WriterReaderData( const WriterReaderData& x) { m_writer_guid = x.m_writer_guid; @@ -1558,7 +1562,7 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( m_data = x.m_data; } -eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( +WriterReaderData::WriterReaderData( WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); @@ -1566,29 +1570,27 @@ eprosima::fastdds::statistics::WriterReaderData::WriterReaderData( m_data = x.m_data; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::WriterReaderData::operator =( +WriterReaderData& WriterReaderData::operator =( const WriterReaderData& x) { m_writer_guid = x.m_writer_guid; m_reader_guid = x.m_reader_guid; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::WriterReaderData::operator =( +WriterReaderData& WriterReaderData::operator =( WriterReaderData&& x) noexcept { m_writer_guid = std::move(x.m_writer_guid); m_reader_guid = std::move(x.m_reader_guid); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::WriterReaderData::operator ==( +bool WriterReaderData::operator ==( const WriterReaderData& x) const { return (m_writer_guid == x.m_writer_guid && @@ -1596,7 +1598,7 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator ==( m_data == x.m_data); } -bool eprosima::fastdds::statistics::WriterReaderData::operator !=( +bool WriterReaderData::operator !=( const WriterReaderData& x) const { return !(*this == x); @@ -1606,7 +1608,7 @@ bool eprosima::fastdds::statistics::WriterReaderData::operator !=( * @brief This function copies the value in member writer_guid * @param _writer_guid New value to be copied in member writer_guid */ -void eprosima::fastdds::statistics::WriterReaderData::writer_guid( +void WriterReaderData::writer_guid( const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) { m_writer_guid = _writer_guid; @@ -1616,7 +1618,7 @@ void eprosima::fastdds::statistics::WriterReaderData::writer_guid( * @brief This function moves the value in member writer_guid * @param _writer_guid New value to be moved in member writer_guid */ -void eprosima::fastdds::statistics::WriterReaderData::writer_guid( +void WriterReaderData::writer_guid( eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) { m_writer_guid = std::move(_writer_guid); @@ -1626,7 +1628,7 @@ void eprosima::fastdds::statistics::WriterReaderData::writer_guid( * @brief This function returns a constant reference to member writer_guid * @return Constant reference to member writer_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::writer_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const { return m_writer_guid; } @@ -1635,7 +1637,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member writer_guid * @return Reference to member writer_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::writer_guid() +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() { return m_writer_guid; } @@ -1645,7 +1647,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr * @brief This function copies the value in member reader_guid * @param _reader_guid New value to be copied in member reader_guid */ -void eprosima::fastdds::statistics::WriterReaderData::reader_guid( +void WriterReaderData::reader_guid( const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) { m_reader_guid = _reader_guid; @@ -1655,7 +1657,7 @@ void eprosima::fastdds::statistics::WriterReaderData::reader_guid( * @brief This function moves the value in member reader_guid * @param _reader_guid New value to be moved in member reader_guid */ -void eprosima::fastdds::statistics::WriterReaderData::reader_guid( +void WriterReaderData::reader_guid( eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) { m_reader_guid = std::move(_reader_guid); @@ -1665,7 +1667,7 @@ void eprosima::fastdds::statistics::WriterReaderData::reader_guid( * @brief This function returns a constant reference to member reader_guid * @return Constant reference to member reader_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::reader_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const { return m_reader_guid; } @@ -1674,7 +1676,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member reader_guid * @return Reference to member reader_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::WriterReaderData::reader_guid() +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() { return m_reader_guid; } @@ -1684,7 +1686,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Wr * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::WriterReaderData::data( +void WriterReaderData::data( float _data) { m_data = _data; @@ -1694,7 +1696,7 @@ void eprosima::fastdds::statistics::WriterReaderData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::WriterReaderData::data() const +float WriterReaderData::data() const { return m_data; } @@ -1703,22 +1705,23 @@ float eprosima::fastdds::statistics::WriterReaderData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::WriterReaderData::data() +float& WriterReaderData::data() { return m_data; } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData() -{ + +Locator2LocatorData::Locator2LocatorData() +{ } -eprosima::fastdds::statistics::Locator2LocatorData::~Locator2LocatorData() +Locator2LocatorData::~Locator2LocatorData() { } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( +Locator2LocatorData::Locator2LocatorData( const Locator2LocatorData& x) { m_src_locator = x.m_src_locator; @@ -1726,7 +1729,7 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( m_data = x.m_data; } -eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( +Locator2LocatorData::Locator2LocatorData( Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); @@ -1734,29 +1737,27 @@ eprosima::fastdds::statistics::Locator2LocatorData::Locator2LocatorData( m_data = x.m_data; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Locator2LocatorData::operator =( +Locator2LocatorData& Locator2LocatorData::operator =( const Locator2LocatorData& x) { m_src_locator = x.m_src_locator; m_dst_locator = x.m_dst_locator; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Locator2LocatorData::operator =( +Locator2LocatorData& Locator2LocatorData::operator =( Locator2LocatorData&& x) noexcept { m_src_locator = std::move(x.m_src_locator); m_dst_locator = std::move(x.m_dst_locator); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::Locator2LocatorData::operator ==( +bool Locator2LocatorData::operator ==( const Locator2LocatorData& x) const { return (m_src_locator == x.m_src_locator && @@ -1764,7 +1765,7 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator ==( m_data == x.m_data); } -bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( +bool Locator2LocatorData::operator !=( const Locator2LocatorData& x) const { return !(*this == x); @@ -1774,7 +1775,7 @@ bool eprosima::fastdds::statistics::Locator2LocatorData::operator !=( * @brief This function copies the value in member src_locator * @param _src_locator New value to be copied in member src_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( +void Locator2LocatorData::src_locator( const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) { m_src_locator = _src_locator; @@ -1784,7 +1785,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( * @brief This function moves the value in member src_locator * @param _src_locator New value to be moved in member src_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( +void Locator2LocatorData::src_locator( eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) { m_src_locator = std::move(_src_locator); @@ -1794,7 +1795,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::src_locator( * @brief This function returns a constant reference to member src_locator * @return Constant reference to member src_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::src_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const { return m_src_locator; } @@ -1803,7 +1804,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member src_locator * @return Reference to member src_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::src_locator() +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() { return m_src_locator; } @@ -1813,7 +1814,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function copies the value in member dst_locator * @param _dst_locator New value to be copied in member dst_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( +void Locator2LocatorData::dst_locator( const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) { m_dst_locator = _dst_locator; @@ -1823,7 +1824,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( * @brief This function moves the value in member dst_locator * @param _dst_locator New value to be moved in member dst_locator */ -void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( +void Locator2LocatorData::dst_locator( eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) { m_dst_locator = std::move(_dst_locator); @@ -1833,7 +1834,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::dst_locator( * @brief This function returns a constant reference to member dst_locator * @return Constant reference to member dst_locator */ -const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::dst_locator() const +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const { return m_dst_locator; } @@ -1842,7 +1843,7 @@ const eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::stati * @brief This function returns a reference to member dst_locator * @return Reference to member dst_locator */ -eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics::Locator2LocatorData::dst_locator() +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() { return m_dst_locator; } @@ -1852,7 +1853,7 @@ eprosima::fastdds::statistics::detail::Locator_s& eprosima::fastdds::statistics: * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::Locator2LocatorData::data( +void Locator2LocatorData::data( float _data) { m_data = _data; @@ -1862,7 +1863,7 @@ void eprosima::fastdds::statistics::Locator2LocatorData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::Locator2LocatorData::data() const +float Locator2LocatorData::data() const { return m_data; } @@ -1871,63 +1872,62 @@ float eprosima::fastdds::statistics::Locator2LocatorData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::Locator2LocatorData::data() +float& Locator2LocatorData::data() { return m_data; } -eprosima::fastdds::statistics::EntityData::EntityData() -{ + +EntityData::EntityData() +{ } -eprosima::fastdds::statistics::EntityData::~EntityData() +EntityData::~EntityData() { } -eprosima::fastdds::statistics::EntityData::EntityData( +EntityData::EntityData( const EntityData& x) { m_guid = x.m_guid; m_data = x.m_data; } -eprosima::fastdds::statistics::EntityData::EntityData( +EntityData::EntityData( EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::EntityData::operator =( +EntityData& EntityData::operator =( const EntityData& x) { m_guid = x.m_guid; m_data = x.m_data; - return *this; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::EntityData::operator =( +EntityData& EntityData::operator =( EntityData&& x) noexcept { m_guid = std::move(x.m_guid); m_data = x.m_data; - return *this; } -bool eprosima::fastdds::statistics::EntityData::operator ==( +bool EntityData::operator ==( const EntityData& x) const { return (m_guid == x.m_guid && m_data == x.m_data); } -bool eprosima::fastdds::statistics::EntityData::operator !=( +bool EntityData::operator !=( const EntityData& x) const { return !(*this == x); @@ -1937,7 +1937,7 @@ bool eprosima::fastdds::statistics::EntityData::operator !=( * @brief This function copies the value in member guid * @param _guid New value to be copied in member guid */ -void eprosima::fastdds::statistics::EntityData::guid( +void EntityData::guid( const eprosima::fastdds::statistics::detail::GUID_s& _guid) { m_guid = _guid; @@ -1947,7 +1947,7 @@ void eprosima::fastdds::statistics::EntityData::guid( * @brief This function moves the value in member guid * @param _guid New value to be moved in member guid */ -void eprosima::fastdds::statistics::EntityData::guid( +void EntityData::guid( eprosima::fastdds::statistics::detail::GUID_s&& _guid) { m_guid = std::move(_guid); @@ -1957,7 +1957,7 @@ void eprosima::fastdds::statistics::EntityData::guid( * @brief This function returns a constant reference to member guid * @return Constant reference to member guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityData::guid() const +const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const { return m_guid; } @@ -1966,7 +1966,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member guid * @return Reference to member guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::EntityData::guid() +eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() { return m_guid; } @@ -1976,7 +1976,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::En * @brief This function sets a value in member data * @param _data New value for member data */ -void eprosima::fastdds::statistics::EntityData::data( +void EntityData::data( float _data) { m_data = _data; @@ -1986,7 +1986,7 @@ void eprosima::fastdds::statistics::EntityData::data( * @brief This function returns the value of member data * @return Value of member data */ -float eprosima::fastdds::statistics::EntityData::data() const +float EntityData::data() const { return m_data; } @@ -1995,22 +1995,23 @@ float eprosima::fastdds::statistics::EntityData::data() const * @brief This function returns a reference to member data * @return Reference to member data */ -float& eprosima::fastdds::statistics::EntityData::data() +float& EntityData::data() { return m_data; } -eprosima::fastdds::statistics::PhysicalData::PhysicalData() -{ + +PhysicalData::PhysicalData() +{ } -eprosima::fastdds::statistics::PhysicalData::~PhysicalData() +PhysicalData::~PhysicalData() { } -eprosima::fastdds::statistics::PhysicalData::PhysicalData( +PhysicalData::PhysicalData( const PhysicalData& x) { m_participant_guid = x.m_participant_guid; @@ -2019,7 +2020,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( m_process = x.m_process; } -eprosima::fastdds::statistics::PhysicalData::PhysicalData( +PhysicalData::PhysicalData( PhysicalData&& x) noexcept { m_participant_guid = std::move(x.m_participant_guid); @@ -2028,7 +2029,7 @@ eprosima::fastdds::statistics::PhysicalData::PhysicalData( m_process = std::move(x.m_process); } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::PhysicalData::operator =( +PhysicalData& PhysicalData::operator =( const PhysicalData& x) { @@ -2036,11 +2037,10 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Phys m_host = x.m_host; m_user = x.m_user; m_process = x.m_process; - return *this; } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::PhysicalData::operator =( +PhysicalData& PhysicalData::operator =( PhysicalData&& x) noexcept { @@ -2048,11 +2048,10 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Phys m_host = std::move(x.m_host); m_user = std::move(x.m_user); m_process = std::move(x.m_process); - return *this; } -bool eprosima::fastdds::statistics::PhysicalData::operator ==( +bool PhysicalData::operator ==( const PhysicalData& x) const { return (m_participant_guid == x.m_participant_guid && @@ -2061,7 +2060,7 @@ bool eprosima::fastdds::statistics::PhysicalData::operator ==( m_process == x.m_process); } -bool eprosima::fastdds::statistics::PhysicalData::operator !=( +bool PhysicalData::operator !=( const PhysicalData& x) const { return !(*this == x); @@ -2071,7 +2070,7 @@ bool eprosima::fastdds::statistics::PhysicalData::operator !=( * @brief This function copies the value in member participant_guid * @param _participant_guid New value to be copied in member participant_guid */ -void eprosima::fastdds::statistics::PhysicalData::participant_guid( +void PhysicalData::participant_guid( const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) { m_participant_guid = _participant_guid; @@ -2081,7 +2080,7 @@ void eprosima::fastdds::statistics::PhysicalData::participant_guid( * @brief This function moves the value in member participant_guid * @param _participant_guid New value to be moved in member participant_guid */ -void eprosima::fastdds::statistics::PhysicalData::participant_guid( +void PhysicalData::participant_guid( eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) { m_participant_guid = std::move(_participant_guid); @@ -2091,7 +2090,7 @@ void eprosima::fastdds::statistics::PhysicalData::participant_guid( * @brief This function returns a constant reference to member participant_guid * @return Constant reference to member participant_guid */ -const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::PhysicalData::participant_guid() const +const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const { return m_participant_guid; } @@ -2100,7 +2099,7 @@ const eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statisti * @brief This function returns a reference to member participant_guid * @return Reference to member participant_guid */ -eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::PhysicalData::participant_guid() +eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() { return m_participant_guid; } @@ -2110,7 +2109,7 @@ eprosima::fastdds::statistics::detail::GUID_s& eprosima::fastdds::statistics::Ph * @brief This function copies the value in member host * @param _host New value to be copied in member host */ -void eprosima::fastdds::statistics::PhysicalData::host( +void PhysicalData::host( const std::string& _host) { m_host = _host; @@ -2120,7 +2119,7 @@ void eprosima::fastdds::statistics::PhysicalData::host( * @brief This function moves the value in member host * @param _host New value to be moved in member host */ -void eprosima::fastdds::statistics::PhysicalData::host( +void PhysicalData::host( std::string&& _host) { m_host = std::move(_host); @@ -2130,7 +2129,7 @@ void eprosima::fastdds::statistics::PhysicalData::host( * @brief This function returns a constant reference to member host * @return Constant reference to member host */ -const std::string& eprosima::fastdds::statistics::PhysicalData::host() const +const std::string& PhysicalData::host() const { return m_host; } @@ -2139,7 +2138,7 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::host() const * @brief This function returns a reference to member host * @return Reference to member host */ -std::string& eprosima::fastdds::statistics::PhysicalData::host() +std::string& PhysicalData::host() { return m_host; } @@ -2149,7 +2148,7 @@ std::string& eprosima::fastdds::statistics::PhysicalData::host() * @brief This function copies the value in member user * @param _user New value to be copied in member user */ -void eprosima::fastdds::statistics::PhysicalData::user( +void PhysicalData::user( const std::string& _user) { m_user = _user; @@ -2159,7 +2158,7 @@ void eprosima::fastdds::statistics::PhysicalData::user( * @brief This function moves the value in member user * @param _user New value to be moved in member user */ -void eprosima::fastdds::statistics::PhysicalData::user( +void PhysicalData::user( std::string&& _user) { m_user = std::move(_user); @@ -2169,7 +2168,7 @@ void eprosima::fastdds::statistics::PhysicalData::user( * @brief This function returns a constant reference to member user * @return Constant reference to member user */ -const std::string& eprosima::fastdds::statistics::PhysicalData::user() const +const std::string& PhysicalData::user() const { return m_user; } @@ -2178,7 +2177,7 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::user() const * @brief This function returns a reference to member user * @return Reference to member user */ -std::string& eprosima::fastdds::statistics::PhysicalData::user() +std::string& PhysicalData::user() { return m_user; } @@ -2188,7 +2187,7 @@ std::string& eprosima::fastdds::statistics::PhysicalData::user() * @brief This function copies the value in member process * @param _process New value to be copied in member process */ -void eprosima::fastdds::statistics::PhysicalData::process( +void PhysicalData::process( const std::string& _process) { m_process = _process; @@ -2198,7 +2197,7 @@ void eprosima::fastdds::statistics::PhysicalData::process( * @brief This function moves the value in member process * @param _process New value to be moved in member process */ -void eprosima::fastdds::statistics::PhysicalData::process( +void PhysicalData::process( std::string&& _process) { m_process = std::move(_process); @@ -2208,7 +2207,7 @@ void eprosima::fastdds::statistics::PhysicalData::process( * @brief This function returns a constant reference to member process * @return Constant reference to member process */ -const std::string& eprosima::fastdds::statistics::PhysicalData::process() const +const std::string& PhysicalData::process() const { return m_process; } @@ -2217,23 +2216,25 @@ const std::string& eprosima::fastdds::statistics::PhysicalData::process() const * @brief This function returns a reference to member process * @return Reference to member process */ -std::string& eprosima::fastdds::statistics::PhysicalData::process() +std::string& PhysicalData::process() { return m_process; } -eprosima::fastdds::statistics::Data::Data() + + +Data::Data() { m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; } -eprosima::fastdds::statistics::Data::~Data() +Data::~Data() { } -eprosima::fastdds::statistics::Data::Data( +Data::Data( const Data& x) { m__d = x.m__d; @@ -2293,7 +2294,7 @@ eprosima::fastdds::statistics::Data::Data( } } -eprosima::fastdds::statistics::Data::Data( +Data::Data( Data&& x) noexcept { m__d = x.m__d; @@ -2361,7 +2362,7 @@ eprosima::fastdds::statistics::Data::Data( } } -eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operator =( +Data& Data::operator =( const Data& x) { m__d = x.m__d; @@ -2423,7 +2424,7 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat return *this; } -eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operator =( +Data& Data::operator =( Data&& x) noexcept { m__d = x.m__d; @@ -2493,7 +2494,7 @@ eprosima::fastdds::statistics::Data& eprosima::fastdds::statistics::Data::operat return *this; } -bool eprosima::fastdds::statistics::Data::operator ==( +bool Data::operator ==( const Data& x) const { if (m__d != x.m__d) @@ -2557,13 +2558,13 @@ bool eprosima::fastdds::statistics::Data::operator ==( return false; } -bool eprosima::fastdds::statistics::Data::operator !=( +bool Data::operator !=( const Data& x) const { return !(*this == x); } -void eprosima::fastdds::statistics::Data::_d( +void Data::_d( eprosima::fastdds::statistics::EventKind __d) { bool b = false; @@ -2683,6 +2684,8 @@ void eprosima::fastdds::statistics::Data::_d( } break; + default: + break; } if (!b) @@ -2693,17 +2696,17 @@ void eprosima::fastdds::statistics::Data::_d( m__d = __d; } -eprosima::fastdds::statistics::EventKind eprosima::fastdds::statistics::Data::_d() const +eprosima::fastdds::statistics::EventKind Data::_d() const { return m__d; } -eprosima::fastdds::statistics::EventKind& eprosima::fastdds::statistics::Data::_d() +eprosima::fastdds::statistics::EventKind& Data::_d() { return m__d; } -void eprosima::fastdds::statistics::Data::writer_reader_data( +void Data::writer_reader_data( const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) { m_writer_reader_data = _writer_reader_data; @@ -2711,7 +2714,7 @@ void eprosima::fastdds::statistics::Data::writer_reader_data( } -void eprosima::fastdds::statistics::Data::writer_reader_data( +void Data::writer_reader_data( eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) { m_writer_reader_data = std::move(_writer_reader_data); @@ -2719,7 +2722,7 @@ void eprosima::fastdds::statistics::Data::writer_reader_data( } -const eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::Data::writer_reader_data() const +const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const { bool b = false; @@ -2740,7 +2743,7 @@ const eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statis return m_writer_reader_data; } -eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics::Data::writer_reader_data() +eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() { bool b = false; @@ -2762,7 +2765,7 @@ eprosima::fastdds::statistics::WriterReaderData& eprosima::fastdds::statistics:: } -void eprosima::fastdds::statistics::Data::locator2locator_data( +void Data::locator2locator_data( const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) { m_locator2locator_data = _locator2locator_data; @@ -2770,7 +2773,7 @@ void eprosima::fastdds::statistics::Data::locator2locator_data( } -void eprosima::fastdds::statistics::Data::locator2locator_data( +void Data::locator2locator_data( eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) { m_locator2locator_data = std::move(_locator2locator_data); @@ -2778,7 +2781,7 @@ void eprosima::fastdds::statistics::Data::locator2locator_data( } -const eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Data::locator2locator_data() const +const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const { bool b = false; @@ -2799,7 +2802,7 @@ const eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::sta return m_locator2locator_data; } -eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistics::Data::locator2locator_data() +eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() { bool b = false; @@ -2821,7 +2824,7 @@ eprosima::fastdds::statistics::Locator2LocatorData& eprosima::fastdds::statistic } -void eprosima::fastdds::statistics::Data::entity_data( +void Data::entity_data( const eprosima::fastdds::statistics::EntityData& _entity_data) { m_entity_data = _entity_data; @@ -2829,7 +2832,7 @@ void eprosima::fastdds::statistics::Data::entity_data( } -void eprosima::fastdds::statistics::Data::entity_data( +void Data::entity_data( eprosima::fastdds::statistics::EntityData&& _entity_data) { m_entity_data = std::move(_entity_data); @@ -2837,7 +2840,7 @@ void eprosima::fastdds::statistics::Data::entity_data( } -const eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data::entity_data() const +const eprosima::fastdds::statistics::EntityData& Data::entity_data() const { bool b = false; @@ -2859,7 +2862,7 @@ const eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics:: return m_entity_data; } -eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data::entity_data() +eprosima::fastdds::statistics::EntityData& Data::entity_data() { bool b = false; @@ -2882,7 +2885,7 @@ eprosima::fastdds::statistics::EntityData& eprosima::fastdds::statistics::Data:: } -void eprosima::fastdds::statistics::Data::entity2locator_traffic( +void Data::entity2locator_traffic( const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) { m_entity2locator_traffic = _entity2locator_traffic; @@ -2890,7 +2893,7 @@ void eprosima::fastdds::statistics::Data::entity2locator_traffic( } -void eprosima::fastdds::statistics::Data::entity2locator_traffic( +void Data::entity2locator_traffic( eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) { m_entity2locator_traffic = std::move(_entity2locator_traffic); @@ -2898,7 +2901,7 @@ void eprosima::fastdds::statistics::Data::entity2locator_traffic( } -const eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Data::entity2locator_traffic() const +const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const { bool b = false; @@ -2920,7 +2923,7 @@ const eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::s return m_entity2locator_traffic; } -eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statistics::Data::entity2locator_traffic() +eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() { bool b = false; @@ -2943,7 +2946,7 @@ eprosima::fastdds::statistics::Entity2LocatorTraffic& eprosima::fastdds::statist } -void eprosima::fastdds::statistics::Data::entity_count( +void Data::entity_count( const eprosima::fastdds::statistics::EntityCount& _entity_count) { m_entity_count = _entity_count; @@ -2951,7 +2954,7 @@ void eprosima::fastdds::statistics::Data::entity_count( } -void eprosima::fastdds::statistics::Data::entity_count( +void Data::entity_count( eprosima::fastdds::statistics::EntityCount&& _entity_count) { m_entity_count = std::move(_entity_count); @@ -2959,7 +2962,7 @@ void eprosima::fastdds::statistics::Data::entity_count( } -const eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data::entity_count() const +const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const { bool b = false; @@ -2987,7 +2990,7 @@ const eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics: return m_entity_count; } -eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data::entity_count() +eprosima::fastdds::statistics::EntityCount& Data::entity_count() { bool b = false; @@ -3016,7 +3019,7 @@ eprosima::fastdds::statistics::EntityCount& eprosima::fastdds::statistics::Data: } -void eprosima::fastdds::statistics::Data::discovery_time( +void Data::discovery_time( const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) { m_discovery_time = _discovery_time; @@ -3024,7 +3027,7 @@ void eprosima::fastdds::statistics::Data::discovery_time( } -void eprosima::fastdds::statistics::Data::discovery_time( +void Data::discovery_time( eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) { m_discovery_time = std::move(_discovery_time); @@ -3032,7 +3035,7 @@ void eprosima::fastdds::statistics::Data::discovery_time( } -const eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Data::discovery_time() const +const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const { bool b = false; @@ -3053,7 +3056,7 @@ const eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistic return m_discovery_time; } -eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Data::discovery_time() +eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() { bool b = false; @@ -3075,7 +3078,7 @@ eprosima::fastdds::statistics::DiscoveryTime& eprosima::fastdds::statistics::Dat } -void eprosima::fastdds::statistics::Data::sample_identity_count( +void Data::sample_identity_count( const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) { m_sample_identity_count = _sample_identity_count; @@ -3083,7 +3086,7 @@ void eprosima::fastdds::statistics::Data::sample_identity_count( } -void eprosima::fastdds::statistics::Data::sample_identity_count( +void Data::sample_identity_count( eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) { m_sample_identity_count = std::move(_sample_identity_count); @@ -3091,7 +3094,7 @@ void eprosima::fastdds::statistics::Data::sample_identity_count( } -const eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::Data::sample_identity_count() const +const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const { bool b = false; @@ -3112,7 +3115,7 @@ const eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::sta return m_sample_identity_count; } -eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistics::Data::sample_identity_count() +eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() { bool b = false; @@ -3134,7 +3137,7 @@ eprosima::fastdds::statistics::SampleIdentityCount& eprosima::fastdds::statistic } -void eprosima::fastdds::statistics::Data::physical_data( +void Data::physical_data( const eprosima::fastdds::statistics::PhysicalData& _physical_data) { m_physical_data = _physical_data; @@ -3142,7 +3145,7 @@ void eprosima::fastdds::statistics::Data::physical_data( } -void eprosima::fastdds::statistics::Data::physical_data( +void Data::physical_data( eprosima::fastdds::statistics::PhysicalData&& _physical_data) { m_physical_data = std::move(_physical_data); @@ -3150,7 +3153,7 @@ void eprosima::fastdds::statistics::Data::physical_data( } -const eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data::physical_data() const +const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const { bool b = false; @@ -3171,7 +3174,7 @@ const eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics return m_physical_data; } -eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data::physical_data() +eprosima::fastdds::statistics::PhysicalData& Data::physical_data() { bool b = false; @@ -3195,6 +3198,14 @@ eprosima::fastdds::statistics::PhysicalData& eprosima::fastdds::statistics::Data +} // namespace statistics + + +} // namespace fastdds + +} // namespace eprosima // Include auxiliary functions like for serializing/deserializing. #include "typesCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/types.h b/test/blackbox/types/statistics/types.h index fe4fbc1123d..c51a79f2044 100644 --- a/test/blackbox/types/statistics/types.h +++ b/test/blackbox/types/statistics/types.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "typesv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ #define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -68,2217 +74,2258 @@ class CdrSizeCalculator; namespace eprosima { - namespace fastdds { - namespace statistics { - namespace detail { - /*! - * @brief This class represents the structure EntityId_s defined by the user in the IDL file. - * @ingroup types - */ - class EntityId_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityId_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityId_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - const EntityId_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s( - EntityId_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - const EntityId_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. - */ - eProsima_user_DllExport EntityId_s& operator =( - EntityId_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityId_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityId_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - private: - - std::array m_value{0}; - - }; - /*! - * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. - * @ingroup types - */ - class GuidPrefix_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GuidPrefix_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GuidPrefix_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - const GuidPrefix_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - const GuidPrefix_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. - */ - eProsima_user_DllExport GuidPrefix_s& operator =( - GuidPrefix_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GuidPrefix_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GuidPrefix_s& x) const; - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - eProsima_user_DllExport void value( - const std::array& _value); - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - eProsima_user_DllExport void value( - std::array&& _value); - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - eProsima_user_DllExport const std::array& value() const; - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - eProsima_user_DllExport std::array& value(); - - private: - - std::array m_value{0}; - - }; - /*! - * @brief This class represents the structure GUID_s defined by the user in the IDL file. - * @ingroup types - */ - class GUID_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport GUID_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~GUID_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - const GUID_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s( - GUID_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - const GUID_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. - */ - eProsima_user_DllExport GUID_s& operator =( - GUID_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const GUID_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const GUID_s& x) const; - - /*! - * @brief This function copies the value in member guidPrefix - * @param _guidPrefix New value to be copied in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); - - /*! - * @brief This function moves the value in member guidPrefix - * @param _guidPrefix New value to be moved in member guidPrefix - */ - eProsima_user_DllExport void guidPrefix( - eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); - - /*! - * @brief This function returns a constant reference to member guidPrefix - * @return Constant reference to member guidPrefix - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; - - /*! - * @brief This function returns a reference to member guidPrefix - * @return Reference to member guidPrefix - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); - - - /*! - * @brief This function copies the value in member entityId - * @param _entityId New value to be copied in member entityId - */ - eProsima_user_DllExport void entityId( - const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); - - /*! - * @brief This function moves the value in member entityId - * @param _entityId New value to be moved in member entityId - */ - eProsima_user_DllExport void entityId( - eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); - - /*! - * @brief This function returns a constant reference to member entityId - * @return Constant reference to member entityId - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; - - /*! - * @brief This function returns a reference to member entityId - * @return Reference to member entityId - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); - - private: - - eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; - eprosima::fastdds::statistics::detail::EntityId_s m_entityId; - - }; - /*! - * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. - * @ingroup types - */ - class SequenceNumber_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceNumber_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceNumber_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - const SequenceNumber_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - const SequenceNumber_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. - */ - eProsima_user_DllExport SequenceNumber_s& operator =( - SequenceNumber_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceNumber_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceNumber_s& x) const; - - /*! - * @brief This function sets a value in member high - * @param _high New value for member high - */ - eProsima_user_DllExport void high( - int32_t _high); - - /*! - * @brief This function returns the value of member high - * @return Value of member high - */ - eProsima_user_DllExport int32_t high() const; - - /*! - * @brief This function returns a reference to member high - * @return Reference to member high - */ - eProsima_user_DllExport int32_t& high(); - - - /*! - * @brief This function sets a value in member low - * @param _low New value for member low - */ - eProsima_user_DllExport void low( - uint32_t _low); - - /*! - * @brief This function returns the value of member low - * @return Value of member low - */ - eProsima_user_DllExport uint32_t low() const; - - /*! - * @brief This function returns a reference to member low - * @return Reference to member low - */ - eProsima_user_DllExport uint32_t& low(); - - private: - - int32_t m_high{0}; - uint32_t m_low{0}; - - }; - /*! - * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentity_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentity_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentity_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - const SampleIdentity_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - const SampleIdentity_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. - */ - eProsima_user_DllExport SampleIdentity_s& operator =( - SampleIdentity_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentity_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentity_s& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member sequence_number - * @param _sequence_number New value to be copied in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); - - /*! - * @brief This function moves the value in member sequence_number - * @param _sequence_number New value to be moved in member sequence_number - */ - eProsima_user_DllExport void sequence_number( - eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); - - /*! - * @brief This function returns a constant reference to member sequence_number - * @return Constant reference to member sequence_number - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; - - /*! - * @brief This function returns a reference to member sequence_number - * @return Reference to member sequence_number - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; - - }; - /*! - * @brief This class represents the structure Locator_s defined by the user in the IDL file. - * @ingroup types - */ - class Locator_s - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator_s(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator_s(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - const Locator_s& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s( - Locator_s&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - const Locator_s& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. - */ - eProsima_user_DllExport Locator_s& operator =( - Locator_s&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator_s& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator_s& x) const; - - /*! - * @brief This function sets a value in member kind - * @param _kind New value for member kind - */ - eProsima_user_DllExport void kind( - int32_t _kind); - - /*! - * @brief This function returns the value of member kind - * @return Value of member kind - */ - eProsima_user_DllExport int32_t kind() const; - - /*! - * @brief This function returns a reference to member kind - * @return Reference to member kind - */ - eProsima_user_DllExport int32_t& kind(); - - - /*! - * @brief This function sets a value in member port - * @param _port New value for member port - */ - eProsima_user_DllExport void port( - uint32_t _port); - - /*! - * @brief This function returns the value of member port - * @return Value of member port - */ - eProsima_user_DllExport uint32_t port() const; - - /*! - * @brief This function returns a reference to member port - * @return Reference to member port - */ - eProsima_user_DllExport uint32_t& port(); - - - /*! - * @brief This function copies the value in member address - * @param _address New value to be copied in member address - */ - eProsima_user_DllExport void address( - const std::array& _address); - - /*! - * @brief This function moves the value in member address - * @param _address New value to be moved in member address - */ - eProsima_user_DllExport void address( - std::array&& _address); - - /*! - * @brief This function returns a constant reference to member address - * @return Constant reference to member address - */ - eProsima_user_DllExport const std::array& address() const; - - /*! - * @brief This function returns a reference to member address - * @return Reference to member address - */ - eProsima_user_DllExport std::array& address(); - - private: - - int32_t m_kind{0}; - uint32_t m_port{0}; - std::array m_address{0}; - - }; - } // namespace detail - /*! - * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. - * @ingroup types - */ - class DiscoveryTime - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport DiscoveryTime(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~DiscoveryTime(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - const DiscoveryTime& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - const DiscoveryTime& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. - */ - eProsima_user_DllExport DiscoveryTime& operator =( - DiscoveryTime&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator ==( - const DiscoveryTime& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. - */ - eProsima_user_DllExport bool operator !=( - const DiscoveryTime& x) const; - - /*! - * @brief This function copies the value in member local_participant_guid - * @param _local_participant_guid New value to be copied in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); - - /*! - * @brief This function moves the value in member local_participant_guid - * @param _local_participant_guid New value to be moved in member local_participant_guid - */ - eProsima_user_DllExport void local_participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); - - /*! - * @brief This function returns a constant reference to member local_participant_guid - * @return Constant reference to member local_participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; - - /*! - * @brief This function returns a reference to member local_participant_guid - * @return Reference to member local_participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); - - - /*! - * @brief This function copies the value in member remote_entity_guid - * @param _remote_entity_guid New value to be copied in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); - - /*! - * @brief This function moves the value in member remote_entity_guid - * @param _remote_entity_guid New value to be moved in member remote_entity_guid - */ - eProsima_user_DllExport void remote_entity_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); - - /*! - * @brief This function returns a constant reference to member remote_entity_guid - * @return Constant reference to member remote_entity_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; - - /*! - * @brief This function returns a reference to member remote_entity_guid - * @return Reference to member remote_entity_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); - - - /*! - * @brief This function sets a value in member time - * @param _time New value for member time - */ - eProsima_user_DllExport void time( - uint64_t _time); - - /*! - * @brief This function returns the value of member time - * @return Value of member time - */ - eProsima_user_DllExport uint64_t time() const; - - /*! - * @brief This function returns a reference to member time - * @return Reference to member time - */ - eProsima_user_DllExport uint64_t& time(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; - eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; - uint64_t m_time{0}; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - /*! - * @brief This class represents the structure EntityCount defined by the user in the IDL file. - * @ingroup types - */ - class EntityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - const EntityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount( - EntityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - const EntityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. - */ - eProsima_user_DllExport EntityCount& operator =( - EntityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityCount& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - uint64_t m_count{0}; - - }; - /*! - * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. - * @ingroup types - */ - class SampleIdentityCount - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SampleIdentityCount(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SampleIdentityCount(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - const SampleIdentityCount& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - const SampleIdentityCount& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. - */ - eProsima_user_DllExport SampleIdentityCount& operator =( - SampleIdentityCount&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SampleIdentityCount& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SampleIdentityCount& x) const; - - /*! - * @brief This function copies the value in member sample_id - * @param _sample_id New value to be copied in member sample_id - */ - eProsima_user_DllExport void sample_id( - const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); - - /*! - * @brief This function moves the value in member sample_id - * @param _sample_id New value to be moved in member sample_id - */ - eProsima_user_DllExport void sample_id( - eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); - - /*! - * @brief This function returns a constant reference to member sample_id - * @return Constant reference to member sample_id - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; - - /*! - * @brief This function returns a reference to member sample_id - * @return Reference to member sample_id - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); - - - /*! - * @brief This function sets a value in member count - * @param _count New value for member count - */ - eProsima_user_DllExport void count( - uint64_t _count); - - /*! - * @brief This function returns the value of member count - * @return Value of member count - */ - eProsima_user_DllExport uint64_t count() const; - - /*! - * @brief This function returns a reference to member count - * @return Reference to member count - */ - eProsima_user_DllExport uint64_t& count(); - - private: - - eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; - uint64_t m_count{0}; - - }; - /*! - * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. - * @ingroup types - */ - class Entity2LocatorTraffic - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Entity2LocatorTraffic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Entity2LocatorTraffic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - const Entity2LocatorTraffic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. - */ - eProsima_user_DllExport Entity2LocatorTraffic& operator =( - Entity2LocatorTraffic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Entity2LocatorTraffic& x) const; - - /*! - * @brief This function copies the value in member src_guid - * @param _src_guid New value to be copied in member src_guid - */ - eProsima_user_DllExport void src_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); - - /*! - * @brief This function moves the value in member src_guid - * @param _src_guid New value to be moved in member src_guid - */ - eProsima_user_DllExport void src_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); - - /*! - * @brief This function returns a constant reference to member src_guid - * @return Constant reference to member src_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; - - /*! - * @brief This function returns a reference to member src_guid - * @return Reference to member src_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member packet_count - * @param _packet_count New value for member packet_count - */ - eProsima_user_DllExport void packet_count( - uint64_t _packet_count); - - /*! - * @brief This function returns the value of member packet_count - * @return Value of member packet_count - */ - eProsima_user_DllExport uint64_t packet_count() const; - - /*! - * @brief This function returns a reference to member packet_count - * @return Reference to member packet_count - */ - eProsima_user_DllExport uint64_t& packet_count(); - - - /*! - * @brief This function sets a value in member byte_count - * @param _byte_count New value for member byte_count - */ - eProsima_user_DllExport void byte_count( - uint64_t _byte_count); - - /*! - * @brief This function returns the value of member byte_count - * @return Value of member byte_count - */ - eProsima_user_DllExport uint64_t byte_count() const; - - /*! - * @brief This function returns a reference to member byte_count - * @return Reference to member byte_count - */ - eProsima_user_DllExport uint64_t& byte_count(); - - - /*! - * @brief This function sets a value in member byte_magnitude_order - * @param _byte_magnitude_order New value for member byte_magnitude_order - */ - eProsima_user_DllExport void byte_magnitude_order( - int16_t _byte_magnitude_order); - - /*! - * @brief This function returns the value of member byte_magnitude_order - * @return Value of member byte_magnitude_order - */ - eProsima_user_DllExport int16_t byte_magnitude_order() const; - - /*! - * @brief This function returns a reference to member byte_magnitude_order - * @return Reference to member byte_magnitude_order - */ - eProsima_user_DllExport int16_t& byte_magnitude_order(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_src_guid; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - uint64_t m_packet_count{0}; - uint64_t m_byte_count{0}; - int16_t m_byte_magnitude_order{0}; - - }; - /*! - * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. - * @ingroup types - */ - class WriterReaderData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WriterReaderData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WriterReaderData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - const WriterReaderData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData( - WriterReaderData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - const WriterReaderData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. - */ - eProsima_user_DllExport WriterReaderData& operator =( - WriterReaderData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WriterReaderData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WriterReaderData& x) const; - - /*! - * @brief This function copies the value in member writer_guid - * @param _writer_guid New value to be copied in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); - - /*! - * @brief This function moves the value in member writer_guid - * @param _writer_guid New value to be moved in member writer_guid - */ - eProsima_user_DllExport void writer_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); - - /*! - * @brief This function returns a constant reference to member writer_guid - * @return Constant reference to member writer_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; - - /*! - * @brief This function returns a reference to member writer_guid - * @return Reference to member writer_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); - - - /*! - * @brief This function copies the value in member reader_guid - * @param _reader_guid New value to be copied in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); - - /*! - * @brief This function moves the value in member reader_guid - * @param _reader_guid New value to be moved in member reader_guid - */ - eProsima_user_DllExport void reader_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); - - /*! - * @brief This function returns a constant reference to member reader_guid - * @return Constant reference to member reader_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; - - /*! - * @brief This function returns a reference to member reader_guid - * @return Reference to member reader_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; - eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. - * @ingroup types - */ - class Locator2LocatorData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Locator2LocatorData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Locator2LocatorData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - const Locator2LocatorData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - const Locator2LocatorData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. - */ - eProsima_user_DllExport Locator2LocatorData& operator =( - Locator2LocatorData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Locator2LocatorData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Locator2LocatorData& x) const; - - /*! - * @brief This function copies the value in member src_locator - * @param _src_locator New value to be copied in member src_locator - */ - eProsima_user_DllExport void src_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); - - /*! - * @brief This function moves the value in member src_locator - * @param _src_locator New value to be moved in member src_locator - */ - eProsima_user_DllExport void src_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); - - /*! - * @brief This function returns a constant reference to member src_locator - * @return Constant reference to member src_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; - - /*! - * @brief This function returns a reference to member src_locator - * @return Reference to member src_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); - - - /*! - * @brief This function copies the value in member dst_locator - * @param _dst_locator New value to be copied in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); - - /*! - * @brief This function moves the value in member dst_locator - * @param _dst_locator New value to be moved in member dst_locator - */ - eProsima_user_DllExport void dst_locator( - eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); - - /*! - * @brief This function returns a constant reference to member dst_locator - * @return Constant reference to member dst_locator - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; - - /*! - * @brief This function returns a reference to member dst_locator - * @return Reference to member dst_locator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::Locator_s m_src_locator; - eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure EntityData defined by the user in the IDL file. - * @ingroup types - */ - class EntityData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport EntityData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~EntityData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - const EntityData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData( - EntityData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - const EntityData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. - */ - eProsima_user_DllExport EntityData& operator =( - EntityData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const EntityData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::EntityData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const EntityData& x) const; - - /*! - * @brief This function copies the value in member guid - * @param _guid New value to be copied in member guid - */ - eProsima_user_DllExport void guid( - const eprosima::fastdds::statistics::detail::GUID_s& _guid); - - /*! - * @brief This function moves the value in member guid - * @param _guid New value to be moved in member guid - */ - eProsima_user_DllExport void guid( - eprosima::fastdds::statistics::detail::GUID_s&& _guid); - - /*! - * @brief This function returns a constant reference to member guid - * @return Constant reference to member guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; - - /*! - * @brief This function returns a reference to member guid - * @return Reference to member guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); - - - /*! - * @brief This function sets a value in member data - * @param _data New value for member data - */ - eProsima_user_DllExport void data( - float _data); - - /*! - * @brief This function returns the value of member data - * @return Value of member data - */ - eProsima_user_DllExport float data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport float& data(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_guid; - float m_data{0.0}; - - }; - /*! - * @brief This class represents the structure PhysicalData defined by the user in the IDL file. - * @ingroup types - */ - class PhysicalData - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport PhysicalData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~PhysicalData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - const PhysicalData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData( - PhysicalData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - const PhysicalData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. - */ - eProsima_user_DllExport PhysicalData& operator =( - PhysicalData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const PhysicalData& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::PhysicalData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const PhysicalData& x) const; - - /*! - * @brief This function copies the value in member participant_guid - * @param _participant_guid New value to be copied in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); - - /*! - * @brief This function moves the value in member participant_guid - * @param _participant_guid New value to be moved in member participant_guid - */ - eProsima_user_DllExport void participant_guid( - eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); - - /*! - * @brief This function returns a constant reference to member participant_guid - * @return Constant reference to member participant_guid - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; - - /*! - * @brief This function returns a reference to member participant_guid - * @return Reference to member participant_guid - */ - eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); - - - /*! - * @brief This function copies the value in member host - * @param _host New value to be copied in member host - */ - eProsima_user_DllExport void host( - const std::string& _host); - - /*! - * @brief This function moves the value in member host - * @param _host New value to be moved in member host - */ - eProsima_user_DllExport void host( - std::string&& _host); - - /*! - * @brief This function returns a constant reference to member host - * @return Constant reference to member host - */ - eProsima_user_DllExport const std::string& host() const; - - /*! - * @brief This function returns a reference to member host - * @return Reference to member host - */ - eProsima_user_DllExport std::string& host(); - - - /*! - * @brief This function copies the value in member user - * @param _user New value to be copied in member user - */ - eProsima_user_DllExport void user( - const std::string& _user); - - /*! - * @brief This function moves the value in member user - * @param _user New value to be moved in member user - */ - eProsima_user_DllExport void user( - std::string&& _user); - - /*! - * @brief This function returns a constant reference to member user - * @return Constant reference to member user - */ - eProsima_user_DllExport const std::string& user() const; - - /*! - * @brief This function returns a reference to member user - * @return Reference to member user - */ - eProsima_user_DllExport std::string& user(); - - - /*! - * @brief This function copies the value in member process - * @param _process New value to be copied in member process - */ - eProsima_user_DllExport void process( - const std::string& _process); - - /*! - * @brief This function moves the value in member process - * @param _process New value to be moved in member process - */ - eProsima_user_DllExport void process( - std::string&& _process); - - /*! - * @brief This function returns a constant reference to member process - * @return Constant reference to member process - */ - eProsima_user_DllExport const std::string& process() const; - - /*! - * @brief This function returns a reference to member process - * @return Reference to member process - */ - eProsima_user_DllExport std::string& process(); - - private: - - eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; - std::string m_host; - std::string m_user; - std::string m_process; - - }; - /*! - * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. - * @ingroup types - */ - enum EventKindBits : uint32_t - { - HISTORY2HISTORY_LATENCY = 0x01ull << 0, - NETWORK_LATENCY = 0x01ull << 1, - PUBLICATION_THROUGHPUT = 0x01ull << 2, - SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, - RTPS_SENT = 0x01ull << 4, - RTPS_LOST = 0x01ull << 5, - RESENT_DATAS = 0x01ull << 6, - HEARTBEAT_COUNT = 0x01ull << 7, - ACKNACK_COUNT = 0x01ull << 8, - NACKFRAG_COUNT = 0x01ull << 9, - GAP_COUNT = 0x01ull << 10, - DATA_COUNT = 0x01ull << 11, - PDP_PACKETS = 0x01ull << 12, - EDP_PACKETS = 0x01ull << 13, - DISCOVERED_ENTITY = 0x01ull << 14, - SAMPLE_DATAS = 0x01ull << 15, - PHYSICAL_DATA = 0x01ull << 16 - }; - typedef uint32_t EventKind; - /*! - * @brief This class represents the union Data defined by the user in the IDL file. - * @ingroup types - */ - class Data - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Data(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Data(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - const Data& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data( - Data&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - const Data& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. - */ - eProsima_user_DllExport Data& operator =( - Data&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Data& x) const; - - /*! - * @brief Comparison operator. - * @param x eprosima::fastdds::statistics::Data object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Data& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - eprosima::fastdds::statistics::EventKind __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); - - /*! - * @brief This function copies the value in member writer_reader_data - * @param _writer_reader_data New value to be copied in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); - - /*! - * @brief This function moves the value in member writer_reader_data - * @param _writer_reader_data New value to be moved in member writer_reader_data - */ - eProsima_user_DllExport void writer_reader_data( - eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); - - /*! - * @brief This function returns a constant reference to member writer_reader_data - * @return Constant reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; - - /*! - * @brief This function returns a reference to member writer_reader_data - * @return Reference to member writer_reader_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); - - - /*! - * @brief This function copies the value in member locator2locator_data - * @param _locator2locator_data New value to be copied in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); - - /*! - * @brief This function moves the value in member locator2locator_data - * @param _locator2locator_data New value to be moved in member locator2locator_data - */ - eProsima_user_DllExport void locator2locator_data( - eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); - - /*! - * @brief This function returns a constant reference to member locator2locator_data - * @return Constant reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; - - /*! - * @brief This function returns a reference to member locator2locator_data - * @return Reference to member locator2locator_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); - - - /*! - * @brief This function copies the value in member entity_data - * @param _entity_data New value to be copied in member entity_data - */ - eProsima_user_DllExport void entity_data( - const eprosima::fastdds::statistics::EntityData& _entity_data); - - /*! - * @brief This function moves the value in member entity_data - * @param _entity_data New value to be moved in member entity_data - */ - eProsima_user_DllExport void entity_data( - eprosima::fastdds::statistics::EntityData&& _entity_data); - - /*! - * @brief This function returns a constant reference to member entity_data - * @return Constant reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; - - /*! - * @brief This function returns a reference to member entity_data - * @return Reference to member entity_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); - - - /*! - * @brief This function copies the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); - - /*! - * @brief This function moves the value in member entity2locator_traffic - * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic - */ - eProsima_user_DllExport void entity2locator_traffic( - eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); - - /*! - * @brief This function returns a constant reference to member entity2locator_traffic - * @return Constant reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; - - /*! - * @brief This function returns a reference to member entity2locator_traffic - * @return Reference to member entity2locator_traffic - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); - - - /*! - * @brief This function copies the value in member entity_count - * @param _entity_count New value to be copied in member entity_count - */ - eProsima_user_DllExport void entity_count( - const eprosima::fastdds::statistics::EntityCount& _entity_count); - - /*! - * @brief This function moves the value in member entity_count - * @param _entity_count New value to be moved in member entity_count - */ - eProsima_user_DllExport void entity_count( - eprosima::fastdds::statistics::EntityCount&& _entity_count); - - /*! - * @brief This function returns a constant reference to member entity_count - * @return Constant reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; - - /*! - * @brief This function returns a reference to member entity_count - * @return Reference to member entity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); - - - /*! - * @brief This function copies the value in member discovery_time - * @param _discovery_time New value to be copied in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); - - /*! - * @brief This function moves the value in member discovery_time - * @param _discovery_time New value to be moved in member discovery_time - */ - eProsima_user_DllExport void discovery_time( - eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); - - /*! - * @brief This function returns a constant reference to member discovery_time - * @return Constant reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; - - /*! - * @brief This function returns a reference to member discovery_time - * @return Reference to member discovery_time - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); - - - /*! - * @brief This function copies the value in member sample_identity_count - * @param _sample_identity_count New value to be copied in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); - - /*! - * @brief This function moves the value in member sample_identity_count - * @param _sample_identity_count New value to be moved in member sample_identity_count - */ - eProsima_user_DllExport void sample_identity_count( - eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); - - /*! - * @brief This function returns a constant reference to member sample_identity_count - * @return Constant reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; - - /*! - * @brief This function returns a reference to member sample_identity_count - * @return Reference to member sample_identity_count - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); - - - /*! - * @brief This function copies the value in member physical_data - * @param _physical_data New value to be copied in member physical_data - */ - eProsima_user_DllExport void physical_data( - const eprosima::fastdds::statistics::PhysicalData& _physical_data); - - /*! - * @brief This function moves the value in member physical_data - * @param _physical_data New value to be moved in member physical_data - */ - eProsima_user_DllExport void physical_data( - eprosima::fastdds::statistics::PhysicalData&& _physical_data); - - /*! - * @brief This function returns a constant reference to member physical_data - * @return Constant reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; - - /*! - * @brief This function returns a reference to member physical_data - * @return Reference to member physical_data - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); - - private: - - eprosima::fastdds::statistics::EventKind m__d; - - eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; - eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; - eprosima::fastdds::statistics::EntityData m_entity_data; - eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; - eprosima::fastdds::statistics::EntityCount m_entity_count; - eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; - eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; - eprosima::fastdds::statistics::PhysicalData m_physical_data; - }; - } // namespace statistics - } // namespace fastdds + +namespace fastdds { + +namespace statistics { + +namespace detail { + + + +/*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ +class EntityId_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ +class GuidPrefix_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + +private: + + std::array m_value{0}; + +}; + + +/*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ +class GUID_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const; + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); + +private: + + eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; + eprosima::fastdds::statistics::detail::EntityId_s m_entityId; + +}; + + +/*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ +class SequenceNumber_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const; + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high); + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const; + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high(); + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low); + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const; + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low(); + +private: + + int32_t m_high{0}; + uint32_t m_low{0}; + +}; + + +/*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentity_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; + +}; + + +/*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ +class Locator_s +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const; + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind); + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const; + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind(); + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port); + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const; + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port(); + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address); + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address); + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const; + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address(); + +private: + + int32_t m_kind{0}; + uint32_t m_port{0}; + std::array m_address{0}; + +}; + +} // namespace detail + + +/*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ +class DiscoveryTime +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const; + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time); + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const; + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; + eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; + uint64_t m_time{0}; + std::string m_host; + std::string m_user; + std::string m_process; + +}; + + +/*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ +class EntityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + uint64_t m_count{0}; + +}; + + +/*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ +class SampleIdentityCount +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const; + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + +private: + + eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; + uint64_t m_count{0}; + +}; + + +/*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ +class Entity2LocatorTraffic +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count); + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const; + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count(); + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count); + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const; + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count(); + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order); + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const; + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_src_guid; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + uint64_t m_packet_count{0}; + uint64_t m_byte_count{0}; + int16_t m_byte_magnitude_order{0}; + +}; + + +/*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ +class WriterReaderData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ +class Locator2LocatorData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const; + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::Locator_s m_src_locator; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ +class EntityData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + float m_data{0.0}; + +}; + + +/*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ +class PhysicalData +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const; + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + +private: + + eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + +}; +/*! + * @brief This enumeration represents the EventKind bitflags defined by the user in the IDL file. + * @ingroup types + */ +enum EventKindBits : uint32_t +{ + HISTORY2HISTORY_LATENCY = 0x01ull << 0, + NETWORK_LATENCY = 0x01ull << 1, + PUBLICATION_THROUGHPUT = 0x01ull << 2, + SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, + RTPS_SENT = 0x01ull << 4, + RTPS_LOST = 0x01ull << 5, + RESENT_DATAS = 0x01ull << 6, + HEARTBEAT_COUNT = 0x01ull << 7, + ACKNACK_COUNT = 0x01ull << 8, + NACKFRAG_COUNT = 0x01ull << 9, + GAP_COUNT = 0x01ull << 10, + DATA_COUNT = 0x01ull << 11, + PDP_PACKETS = 0x01ull << 12, + EDP_PACKETS = 0x01ull << 13, + DISCOVERED_ENTITY = 0x01ull << 14, + SAMPLE_DATAS = 0x01ull << 15, + PHYSICAL_DATA = 0x01ull << 16 +}; +typedef uint32_t EventKind; + + +/*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ +class Data +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::EventKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data); + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data); + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count); + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count); + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data); + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data); + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); + +private: + + eprosima::fastdds::statistics::EventKind m__d; + + eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; + eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; + eprosima::fastdds::statistics::EntityData m_entity_data; + eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; + eprosima::fastdds::statistics::EntityCount m_entity_count; + eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; + eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; + eprosima::fastdds::statistics::PhysicalData m_physical_data; +}; + +} // namespace statistics + +} // namespace fastdds + } // namespace eprosima #endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/blackbox/types/statistics/typesCdrAux.hpp b/test/blackbox/types/statistics/typesCdrAux.hpp index 274084a335c..92b36ffa689 100644 --- a/test/blackbox/types/statistics/typesCdrAux.hpp +++ b/test/blackbox/types/statistics/typesCdrAux.hpp @@ -75,59 +75,87 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data); @@ -138,7 +166,11 @@ eProsima_user_DllExport void serialize_key( + + + } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_HPP_ + diff --git a/test/blackbox/types/statistics/typesCdrAux.ipp b/test/blackbox/types/statistics/typesCdrAux.ipp index 4fddae426c7..feec2a39a65 100644 --- a/test/blackbox/types/statistics/typesCdrAux.ipp +++ b/test/blackbox/types/statistics/typesCdrAux.ipp @@ -34,12 +34,16 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::EntityId_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -64,6 +68,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -73,7 +79,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.value() ; - scdr.end_serialize_type(current_state); } @@ -82,6 +87,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -106,17 +113,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::EntityId_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -141,6 +154,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -150,7 +165,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.value() ; - scdr.end_serialize_type(current_state); } @@ -159,6 +173,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -183,17 +199,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GuidPrefix_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::GUID_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -221,6 +243,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -231,7 +255,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guidPrefix() << eprosima::fastcdr::MemberId(1) << data.entityId() ; - scdr.end_serialize_type(current_state); } @@ -240,6 +263,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -268,17 +293,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::GUID_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -306,6 +337,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -316,7 +349,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.high() << eprosima::fastcdr::MemberId(1) << data.low() ; - scdr.end_serialize_type(current_state); } @@ -325,6 +357,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -353,17 +387,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SequenceNumber_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -391,6 +431,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -401,7 +443,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.writer_guid() << eprosima::fastcdr::MemberId(1) << data.sequence_number() ; - scdr.end_serialize_type(current_state); } @@ -410,6 +451,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -438,17 +481,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::SampleIdentity_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::detail::Locator_s& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -479,6 +528,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -490,7 +541,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.port() << eprosima::fastcdr::MemberId(2) << data.address() ; - scdr.end_serialize_type(current_state); } @@ -499,6 +549,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -531,18 +583,24 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::detail::Locator_s& data) { + using namespace eprosima::fastdds::statistics::detail; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::DiscoveryTime& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -582,6 +640,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -596,7 +656,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(4) << data.user() << eprosima::fastcdr::MemberId(5) << data.process() ; - scdr.end_serialize_type(current_state); } @@ -605,6 +664,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -649,6 +710,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::DiscoveryTime& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.local_participant_guid(); @@ -662,12 +725,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::EntityCount& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -695,6 +762,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -705,7 +774,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guid() << eprosima::fastcdr::MemberId(1) << data.count() ; - scdr.end_serialize_type(current_state); } @@ -714,6 +782,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -742,6 +812,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityCount& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.guid(); @@ -750,12 +822,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::SampleIdentityCount& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -783,6 +859,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -793,7 +871,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.sample_id() << eprosima::fastcdr::MemberId(1) << data.count() ; - scdr.end_serialize_type(current_state); } @@ -802,6 +879,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -830,6 +909,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::SampleIdentityCount& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.sample_id(); @@ -838,12 +919,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -880,6 +965,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -893,7 +980,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.byte_count() << eprosima::fastcdr::MemberId(4) << data.byte_magnitude_order() ; - scdr.end_serialize_type(current_state); } @@ -902,6 +988,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -942,6 +1030,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Entity2LocatorTraffic& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.src_guid(); @@ -954,12 +1044,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::WriterReaderData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -990,6 +1084,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1001,7 +1097,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.reader_guid() << eprosima::fastcdr::MemberId(2) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1010,6 +1105,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1042,6 +1139,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::WriterReaderData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.writer_guid(); @@ -1052,12 +1151,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Locator2LocatorData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1088,6 +1191,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1099,7 +1204,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.dst_locator() << eprosima::fastcdr::MemberId(2) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1108,6 +1212,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1140,6 +1246,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Locator2LocatorData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.src_locator(); @@ -1150,12 +1258,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::EntityData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1183,6 +1295,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1193,7 +1307,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.guid() << eprosima::fastcdr::MemberId(1) << data.data() ; - scdr.end_serialize_type(current_state); } @@ -1202,6 +1315,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1230,6 +1345,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::EntityData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.guid(); @@ -1238,12 +1355,16 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::PhysicalData& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1277,6 +1398,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1289,7 +1412,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(2) << data.user() << eprosima::fastcdr::MemberId(3) << data.process() ; - scdr.end_serialize_type(current_state); } @@ -1298,6 +1420,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1334,6 +1458,8 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::PhysicalData& data) { + using namespace eprosima::fastdds::statistics; + static_cast(scdr); static_cast(data); scdr << data.participant_guid(); @@ -1345,12 +1471,16 @@ void serialize_key( + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const eprosima::fastdds::statistics::Data& data, size_t& current_alignment) { + using namespace eprosima::fastdds::statistics; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -1414,6 +1544,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.physical_data(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -1427,6 +1559,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const eprosima::fastdds::statistics::Data& data) { + using namespace eprosima::fastdds::statistics; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -1478,6 +1612,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(7) << data.physical_data(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -1488,6 +1624,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, eprosima::fastdds::statistics::Data& data) { + using namespace eprosima::fastdds::statistics; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -1543,6 +1681,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.physical_data(); break; + default: + break; } ret_value = false; break; @@ -1558,4 +1698,5 @@ eProsima_user_DllExport void deserialize( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPESCDRAUX_IPP_ + diff --git a/test/blackbox/types/statistics/typesPubSubTypes.cxx b/test/blackbox/types/statistics/typesPubSubTypes.cxx index 70cf4e48131..5d92b732491 100644 --- a/test/blackbox/types/statistics/typesPubSubTypes.cxx +++ b/test/blackbox/types/statistics/typesPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "typesPubSubTypes.h" #include "typesCdrAux.hpp" @@ -35,10 +33,17 @@ namespace eprosima { namespace fastdds { namespace statistics { namespace detail { + + EntityId_sPubSubType::EntityId_sPubSubType() { setName("eprosima::fastdds::statistics::detail::EntityId_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityId_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -69,10 +74,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -87,7 +94,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -104,7 +115,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -127,13 +142,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -165,12 +193,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_EntityId_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -187,10 +223,17 @@ namespace eprosima { return true; } + + GuidPrefix_sPubSubType::GuidPrefix_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GuidPrefix_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GuidPrefix_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -221,10 +264,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -239,7 +284,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -256,7 +305,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -279,13 +332,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -317,12 +383,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_GuidPrefix_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -339,10 +413,17 @@ namespace eprosima { return true; } + + GUID_sPubSubType::GUID_sPubSubType() { setName("eprosima::fastdds::statistics::detail::GUID_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(GUID_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -373,10 +454,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -391,7 +474,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -408,7 +495,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -431,13 +522,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -469,12 +573,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_GUID_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -491,10 +603,17 @@ namespace eprosima { return true; } + + SequenceNumber_sPubSubType::SequenceNumber_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SequenceNumber_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceNumber_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -525,10 +644,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -543,7 +664,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -560,7 +685,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -583,13 +712,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -621,12 +763,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_SequenceNumber_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -643,10 +793,17 @@ namespace eprosima { return true; } + + SampleIdentity_sPubSubType::SampleIdentity_sPubSubType() { setName("eprosima::fastdds::statistics::detail::SampleIdentity_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SampleIdentity_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -677,10 +834,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -695,7 +854,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -712,7 +875,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -735,13 +902,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -773,12 +953,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_SampleIdentity_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -795,10 +983,17 @@ namespace eprosima { return true; } + + Locator_sPubSubType::Locator_sPubSubType() { setName("eprosima::fastdds::statistics::detail::Locator_s"); - uint32_t type_size = eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Locator_s::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -829,10 +1024,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -847,7 +1044,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -864,7 +1065,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -887,13 +1092,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -925,12 +1143,20 @@ namespace eprosima { eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_detail_Locator_s_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -950,10 +1176,17 @@ namespace eprosima { } //End of namespace detail + + DiscoveryTimePubSubType::DiscoveryTimePubSubType() { setName("eprosima::fastdds::statistics::DiscoveryTime"); - uint32_t type_size = eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(DiscoveryTime::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -984,10 +1217,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1002,7 +1237,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1019,7 +1258,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1042,13 +1285,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1080,12 +1336,20 @@ namespace eprosima { eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_DiscoveryTime_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1102,10 +1366,17 @@ namespace eprosima { return true; } + + EntityCountPubSubType::EntityCountPubSubType() { setName("eprosima::fastdds::statistics::EntityCount"); - uint32_t type_size = eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityCount::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1136,10 +1407,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1154,7 +1427,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1171,7 +1448,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1194,13 +1475,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1232,12 +1526,20 @@ namespace eprosima { eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_EntityCount_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1254,10 +1556,17 @@ namespace eprosima { return true; } + + SampleIdentityCountPubSubType::SampleIdentityCountPubSubType() { setName("eprosima::fastdds::statistics::SampleIdentityCount"); - uint32_t type_size = eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(SampleIdentityCount::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1288,10 +1597,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1306,7 +1617,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1323,7 +1638,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1346,13 +1665,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1384,12 +1716,20 @@ namespace eprosima { eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_SampleIdentityCount_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1406,10 +1746,17 @@ namespace eprosima { return true; } + + Entity2LocatorTrafficPubSubType::Entity2LocatorTrafficPubSubType() { setName("eprosima::fastdds::statistics::Entity2LocatorTraffic"); - uint32_t type_size = eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Entity2LocatorTraffic::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1440,10 +1787,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1458,7 +1807,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1475,7 +1828,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1498,13 +1855,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1536,12 +1906,20 @@ namespace eprosima { eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_Entity2LocatorTraffic_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1558,10 +1936,17 @@ namespace eprosima { return true; } + + WriterReaderDataPubSubType::WriterReaderDataPubSubType() { setName("eprosima::fastdds::statistics::WriterReaderData"); - uint32_t type_size = eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(WriterReaderData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1592,10 +1977,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1610,7 +1997,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1627,7 +2018,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1650,13 +2045,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1688,12 +2096,20 @@ namespace eprosima { eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_WriterReaderData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1710,10 +2126,17 @@ namespace eprosima { return true; } + + Locator2LocatorDataPubSubType::Locator2LocatorDataPubSubType() { setName("eprosima::fastdds::statistics::Locator2LocatorData"); - uint32_t type_size = eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(Locator2LocatorData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1744,10 +2167,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1762,7 +2187,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1779,7 +2208,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1802,13 +2235,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1840,12 +2286,20 @@ namespace eprosima { eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_Locator2LocatorData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1862,10 +2316,17 @@ namespace eprosima { return true; } + + EntityDataPubSubType::EntityDataPubSubType() { setName("eprosima::fastdds::statistics::EntityData"); - uint32_t type_size = eprosima_fastdds_statistics_EntityData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(EntityData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_EntityData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -1896,10 +2357,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1914,7 +2377,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1931,7 +2398,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1954,13 +2425,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1992,12 +2476,20 @@ namespace eprosima { eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_EntityData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2014,10 +2506,17 @@ namespace eprosima { return true; } + + PhysicalDataPubSubType::PhysicalDataPubSubType() { setName("eprosima::fastdds::statistics::PhysicalData"); - uint32_t type_size = eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(PhysicalData::getMaxCdrSerializedSize()); + #else + eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -2048,10 +2547,12 @@ namespace eprosima { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2066,7 +2567,11 @@ namespace eprosima { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2083,7 +2588,11 @@ namespace eprosima { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2106,13 +2615,26 @@ namespace eprosima { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2144,12 +2666,20 @@ namespace eprosima { eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || eprosima_fastdds_statistics_PhysicalData_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2169,6 +2699,9 @@ namespace eprosima { + + + } //End of namespace statistics diff --git a/test/blackbox/types/statistics/typesPubSubTypes.h b/test/blackbox/types/statistics/typesPubSubTypes.h index 70a533940bb..33e545416c8 100644 --- a/test/blackbox/types/statistics/typesPubSubTypes.h +++ b/test/blackbox/types/statistics/typesPubSubTypes.h @@ -46,6 +46,8 @@ namespace eprosima namespace detail { + + /*! * @brief This class represents the TopicDataType of the type EntityId_s defined by the user in the IDL file. * @ingroup types @@ -134,6 +136,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type GuidPrefix_s defined by the user in the IDL file. * @ingroup types @@ -222,6 +226,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type GUID_s defined by the user in the IDL file. * @ingroup types @@ -310,6 +316,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SequenceNumber_s defined by the user in the IDL file. * @ingroup types @@ -398,6 +406,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SampleIdentity_s defined by the user in the IDL file. * @ingroup types @@ -486,6 +496,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Locator_s defined by the user in the IDL file. * @ingroup types @@ -575,6 +587,8 @@ namespace eprosima }; } + + /*! * @brief This class represents the TopicDataType of the type DiscoveryTime defined by the user in the IDL file. * @ingroup types @@ -663,6 +677,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type EntityCount defined by the user in the IDL file. * @ingroup types @@ -751,6 +767,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type SampleIdentityCount defined by the user in the IDL file. * @ingroup types @@ -839,6 +857,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Entity2LocatorTraffic defined by the user in the IDL file. * @ingroup types @@ -927,6 +947,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type WriterReaderData defined by the user in the IDL file. * @ingroup types @@ -1015,6 +1037,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type Locator2LocatorData defined by the user in the IDL file. * @ingroup types @@ -1103,6 +1127,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type EntityData defined by the user in the IDL file. * @ingroup types @@ -1191,6 +1217,8 @@ namespace eprosima }; + + /*! * @brief This class represents the TopicDataType of the type PhysicalData defined by the user in the IDL file. * @ingroup types @@ -1280,6 +1308,9 @@ namespace eprosima }; + + + } } } diff --git a/test/blackbox/types/statistics/typesv1.cxx b/test/blackbox/types/statistics/typesv1.cxx new file mode 100644 index 00000000000..80c55edc2e6 --- /dev/null +++ b/test/blackbox/types/statistics/typesv1.cxx @@ -0,0 +1,4757 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "types.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize 852ULL; +#define eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize 812ULL; + +#define eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize 28ULL; + +#define eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize 16ULL; +#define eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize 44ULL; +#define eprosima_fastdds_statistics_EntityData_max_cdr_typesize 36ULL; +#define eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize 82ULL; +#define eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize 8ULL; +#define eprosima_fastdds_statistics_EntityCount_max_cdr_typesize 40ULL; +#define eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize 56ULL; +#define eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize 64ULL; +#define eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize 28ULL; +#define eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize 12ULL; + + +namespace eprosima { + +namespace fastdds { + +namespace statistics { + +namespace detail { + + + +EntityId_s::EntityId_s() +{ + // octet m_value + memset(&m_value, 0, ((4)) * 1); + +} + +EntityId_s::~EntityId_s() +{ +} + +EntityId_s::EntityId_s( + const EntityId_s& x) +{ + m_value = x.m_value; + +} + +EntityId_s::EntityId_s( + EntityId_s&& x) noexcept +{ + m_value = std::move(x.m_value); + +} + +EntityId_s& EntityId_s::operator =( + const EntityId_s& x) +{ + m_value = x.m_value; + + return *this; +} + +EntityId_s& EntityId_s::operator =( + EntityId_s&& x) noexcept +{ + m_value = std::move(x.m_value); + + return *this; +} + +bool EntityId_s::operator ==( + const EntityId_s& x) const +{ + return (m_value == x.m_value); +} + +bool EntityId_s::operator !=( + const EntityId_s& x) const +{ + return !(*this == x); +} + +size_t EntityId_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_EntityId_s_max_cdr_typesize; +} + +size_t EntityId_s::getCdrSerializedSize( + const EntityId_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void EntityId_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_value; + + +} + +void EntityId_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_value; + + +} + + +bool EntityId_s::isKeyDefined() +{ + return false; +} + +void EntityId_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void EntityId_s::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void EntityId_s::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& EntityId_s::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& EntityId_s::value() +{ + return m_value; +} + + + + + +GuidPrefix_s::GuidPrefix_s() +{ + // octet m_value + memset(&m_value, 0, ((12)) * 1); + +} + +GuidPrefix_s::~GuidPrefix_s() +{ +} + +GuidPrefix_s::GuidPrefix_s( + const GuidPrefix_s& x) +{ + m_value = x.m_value; + +} + +GuidPrefix_s::GuidPrefix_s( + GuidPrefix_s&& x) noexcept +{ + m_value = std::move(x.m_value); + +} + +GuidPrefix_s& GuidPrefix_s::operator =( + const GuidPrefix_s& x) +{ + m_value = x.m_value; + + return *this; +} + +GuidPrefix_s& GuidPrefix_s::operator =( + GuidPrefix_s&& x) noexcept +{ + m_value = std::move(x.m_value); + + return *this; +} + +bool GuidPrefix_s::operator ==( + const GuidPrefix_s& x) const +{ + return (m_value == x.m_value); +} + +bool GuidPrefix_s::operator !=( + const GuidPrefix_s& x) const +{ + return !(*this == x); +} + +size_t GuidPrefix_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GuidPrefix_s_max_cdr_typesize; +} + +size_t GuidPrefix_s::getCdrSerializedSize( + const GuidPrefix_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((12)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void GuidPrefix_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_value; + + +} + +void GuidPrefix_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_value; + + +} + + +bool GuidPrefix_s::isKeyDefined() +{ + return false; +} + +void GuidPrefix_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ +void GuidPrefix_s::value( + const std::array& _value) +{ + m_value = _value; +} + +/*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ +void GuidPrefix_s::value( + std::array&& _value) +{ + m_value = std::move(_value); +} + +/*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ +const std::array& GuidPrefix_s::value() const +{ + return m_value; +} + +/*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ +std::array& GuidPrefix_s::value() +{ + return m_value; +} + + + + + +GUID_s::GUID_s() +{ + // eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix + + // eprosima::fastdds::statistics::detail::EntityId_s m_entityId + + +} + +GUID_s::~GUID_s() +{ +} + +GUID_s::GUID_s( + const GUID_s& x) +{ + m_guidPrefix = x.m_guidPrefix; + + + m_entityId = x.m_entityId; + +} + +GUID_s::GUID_s( + GUID_s&& x) noexcept +{ + m_guidPrefix = std::move(x.m_guidPrefix); + + + m_entityId = std::move(x.m_entityId); + +} + +GUID_s& GUID_s::operator =( + const GUID_s& x) +{ + m_guidPrefix = x.m_guidPrefix; + + + m_entityId = x.m_entityId; + + return *this; +} + +GUID_s& GUID_s::operator =( + GUID_s&& x) noexcept +{ + m_guidPrefix = std::move(x.m_guidPrefix); + + + m_entityId = std::move(x.m_entityId); + + return *this; +} + +bool GUID_s::operator ==( + const GUID_s& x) const +{ + return (m_guidPrefix == x.m_guidPrefix && + m_entityId == x.m_entityId); +} + +bool GUID_s::operator !=( + const GUID_s& x) const +{ + return !(*this == x); +} + +size_t GUID_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_GUID_s_max_cdr_typesize; +} + +size_t GUID_s::getCdrSerializedSize( + const GUID_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GuidPrefix_s::getCdrSerializedSize(data.guidPrefix(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::EntityId_s::getCdrSerializedSize(data.entityId(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void GUID_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guidPrefix; + + scdr << m_entityId; + +} + +void GUID_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guidPrefix; + + + + dcdr >> m_entityId; + + +} + + +bool GUID_s::isKeyDefined() +{ + return false; +} + +void GUID_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ +void GUID_s::guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix) +{ + m_guidPrefix = _guidPrefix; +} + +/*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ +void GUID_s::guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix) +{ + m_guidPrefix = std::move(_guidPrefix); +} + +/*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ +const eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() const +{ + return m_guidPrefix; +} + +/*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ +eprosima::fastdds::statistics::detail::GuidPrefix_s& GUID_s::guidPrefix() +{ + return m_guidPrefix; +} + + +/*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ +void GUID_s::entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId) +{ + m_entityId = _entityId; +} + +/*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ +void GUID_s::entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId) +{ + m_entityId = std::move(_entityId); +} + +/*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ +const eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() const +{ + return m_entityId; +} + +/*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ +eprosima::fastdds::statistics::detail::EntityId_s& GUID_s::entityId() +{ + return m_entityId; +} + + + + + +SequenceNumber_s::SequenceNumber_s() +{ + // long m_high + m_high = 0; + // unsigned long m_low + m_low = 0; + +} + +SequenceNumber_s::~SequenceNumber_s() +{ +} + +SequenceNumber_s::SequenceNumber_s( + const SequenceNumber_s& x) +{ + m_high = x.m_high; + + + m_low = x.m_low; + +} + +SequenceNumber_s::SequenceNumber_s( + SequenceNumber_s&& x) noexcept +{ + m_high = x.m_high; + + + m_low = x.m_low; + +} + +SequenceNumber_s& SequenceNumber_s::operator =( + const SequenceNumber_s& x) +{ + m_high = x.m_high; + + + m_low = x.m_low; + + return *this; +} + +SequenceNumber_s& SequenceNumber_s::operator =( + SequenceNumber_s&& x) noexcept +{ + m_high = x.m_high; + + + m_low = x.m_low; + + return *this; +} + +bool SequenceNumber_s::operator ==( + const SequenceNumber_s& x) const +{ + return (m_high == x.m_high && + m_low == x.m_low); +} + +bool SequenceNumber_s::operator !=( + const SequenceNumber_s& x) const +{ + return !(*this == x); +} + +size_t SequenceNumber_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SequenceNumber_s_max_cdr_typesize; +} + +size_t SequenceNumber_s::getCdrSerializedSize( + const SequenceNumber_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void SequenceNumber_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_high; + + scdr << m_low; + +} + +void SequenceNumber_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_high; + + + + dcdr >> m_low; + + +} + + +bool SequenceNumber_s::isKeyDefined() +{ + return false; +} + +void SequenceNumber_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ +void SequenceNumber_s::high( + int32_t _high) +{ + m_high = _high; +} + +/*! + * @brief This function returns the value of member high + * @return Value of member high + */ +int32_t SequenceNumber_s::high() const +{ + return m_high; +} + +/*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ +int32_t& SequenceNumber_s::high() +{ + return m_high; +} + + +/*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ +void SequenceNumber_s::low( + uint32_t _low) +{ + m_low = _low; +} + +/*! + * @brief This function returns the value of member low + * @return Value of member low + */ +uint32_t SequenceNumber_s::low() const +{ + return m_low; +} + +/*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ +uint32_t& SequenceNumber_s::low() +{ + return m_low; +} + + + + + +SampleIdentity_s::SampleIdentity_s() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid + + // eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number + + +} + +SampleIdentity_s::~SampleIdentity_s() +{ +} + +SampleIdentity_s::SampleIdentity_s( + const SampleIdentity_s& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_sequence_number = x.m_sequence_number; + +} + +SampleIdentity_s::SampleIdentity_s( + SampleIdentity_s&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_sequence_number = std::move(x.m_sequence_number); + +} + +SampleIdentity_s& SampleIdentity_s::operator =( + const SampleIdentity_s& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_sequence_number = x.m_sequence_number; + + return *this; +} + +SampleIdentity_s& SampleIdentity_s::operator =( + SampleIdentity_s&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_sequence_number = std::move(x.m_sequence_number); + + return *this; +} + +bool SampleIdentity_s::operator ==( + const SampleIdentity_s& x) const +{ + return (m_writer_guid == x.m_writer_guid && + m_sequence_number == x.m_sequence_number); +} + +bool SampleIdentity_s::operator !=( + const SampleIdentity_s& x) const +{ + return !(*this == x); +} + +size_t SampleIdentity_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_SampleIdentity_s_max_cdr_typesize; +} + +size_t SampleIdentity_s::getCdrSerializedSize( + const SampleIdentity_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::SequenceNumber_s::getCdrSerializedSize(data.sequence_number(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SampleIdentity_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_writer_guid; + + scdr << m_sequence_number; + +} + +void SampleIdentity_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_writer_guid; + + + + dcdr >> m_sequence_number; + + +} + + +bool SampleIdentity_s::isKeyDefined() +{ + return false; +} + +void SampleIdentity_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ +void SampleIdentity_s::writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) +{ + m_writer_guid = _writer_guid; +} + +/*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ +void SampleIdentity_s::writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) +{ + m_writer_guid = std::move(_writer_guid); +} + +/*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() const +{ + return m_writer_guid; +} + +/*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& SampleIdentity_s::writer_guid() +{ + return m_writer_guid; +} + + +/*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ +void SampleIdentity_s::sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number) +{ + m_sequence_number = _sequence_number; +} + +/*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ +void SampleIdentity_s::sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number) +{ + m_sequence_number = std::move(_sequence_number); +} + +/*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ +const eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() const +{ + return m_sequence_number; +} + +/*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ +eprosima::fastdds::statistics::detail::SequenceNumber_s& SampleIdentity_s::sequence_number() +{ + return m_sequence_number; +} + + + + + +Locator_s::Locator_s() +{ + // long m_kind + m_kind = 0; + // unsigned long m_port + m_port = 0; + // octet m_address + memset(&m_address, 0, ((16)) * 1); + +} + +Locator_s::~Locator_s() +{ +} + +Locator_s::Locator_s( + const Locator_s& x) +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = x.m_address; + +} + +Locator_s::Locator_s( + Locator_s&& x) noexcept +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = std::move(x.m_address); + +} + +Locator_s& Locator_s::operator =( + const Locator_s& x) +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = x.m_address; + + return *this; +} + +Locator_s& Locator_s::operator =( + Locator_s&& x) noexcept +{ + m_kind = x.m_kind; + + + m_port = x.m_port; + + + m_address = std::move(x.m_address); + + return *this; +} + +bool Locator_s::operator ==( + const Locator_s& x) const +{ + return (m_kind == x.m_kind && + m_port == x.m_port && + m_address == x.m_address); +} + +bool Locator_s::operator !=( + const Locator_s& x) const +{ + return !(*this == x); +} + +size_t Locator_s::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_detail_Locator_s_max_cdr_typesize; +} + +size_t Locator_s::getCdrSerializedSize( + const Locator_s& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += (((16)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void Locator_s::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_kind; + + scdr << m_port; + + scdr << m_address; + + +} + +void Locator_s::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_kind; + + + + dcdr >> m_port; + + + + dcdr >> m_address; + + +} + + +bool Locator_s::isKeyDefined() +{ + return false; +} + +void Locator_s::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ +void Locator_s::kind( + int32_t _kind) +{ + m_kind = _kind; +} + +/*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ +int32_t Locator_s::kind() const +{ + return m_kind; +} + +/*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ +int32_t& Locator_s::kind() +{ + return m_kind; +} + + +/*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ +void Locator_s::port( + uint32_t _port) +{ + m_port = _port; +} + +/*! + * @brief This function returns the value of member port + * @return Value of member port + */ +uint32_t Locator_s::port() const +{ + return m_port; +} + +/*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ +uint32_t& Locator_s::port() +{ + return m_port; +} + + +/*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ +void Locator_s::address( + const std::array& _address) +{ + m_address = _address; +} + +/*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ +void Locator_s::address( + std::array&& _address) +{ + m_address = std::move(_address); +} + +/*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ +const std::array& Locator_s::address() const +{ + return m_address; +} + +/*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ +std::array& Locator_s::address() +{ + return m_address; +} + + + + + +} // namespace detail + + +DiscoveryTime::DiscoveryTime() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid + + // eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid + + // unsigned long long m_time + m_time = 0; + // /type_d() m_host + + // /type_d() m_user + + // /type_d() m_process + + +} + +DiscoveryTime::~DiscoveryTime() +{ +} + +DiscoveryTime::DiscoveryTime( + const DiscoveryTime& x) +{ + m_local_participant_guid = x.m_local_participant_guid; + + + m_remote_entity_guid = x.m_remote_entity_guid; + + + m_time = x.m_time; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + +} + +DiscoveryTime::DiscoveryTime( + DiscoveryTime&& x) noexcept +{ + m_local_participant_guid = std::move(x.m_local_participant_guid); + + + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + + + m_time = x.m_time; + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + +} + +DiscoveryTime& DiscoveryTime::operator =( + const DiscoveryTime& x) +{ + m_local_participant_guid = x.m_local_participant_guid; + + + m_remote_entity_guid = x.m_remote_entity_guid; + + + m_time = x.m_time; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + + return *this; +} + +DiscoveryTime& DiscoveryTime::operator =( + DiscoveryTime&& x) noexcept +{ + m_local_participant_guid = std::move(x.m_local_participant_guid); + + + m_remote_entity_guid = std::move(x.m_remote_entity_guid); + + + m_time = x.m_time; + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + + return *this; +} + +bool DiscoveryTime::operator ==( + const DiscoveryTime& x) const +{ + return (m_local_participant_guid == x.m_local_participant_guid && + m_remote_entity_guid == x.m_remote_entity_guid && + m_time == x.m_time && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); +} + +bool DiscoveryTime::operator !=( + const DiscoveryTime& x) const +{ + return !(*this == x); +} + +size_t DiscoveryTime::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_DiscoveryTime_max_cdr_typesize; +} + +size_t DiscoveryTime::getCdrSerializedSize( + const DiscoveryTime& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.local_participant_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.remote_entity_guid(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void DiscoveryTime::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_local_participant_guid; + + scdr << m_remote_entity_guid; + + scdr << m_time; + + scdr << m_host.c_str(); + + scdr << m_user.c_str(); + + scdr << m_process.c_str(); + +} + +void DiscoveryTime::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_local_participant_guid; + + + + dcdr >> m_remote_entity_guid; + + + + dcdr >> m_time; + + + + dcdr >> m_host; + + + + dcdr >> m_user; + + + + dcdr >> m_process; + + +} + + +bool DiscoveryTime::isKeyDefined() +{ + return true; +} + +void DiscoveryTime::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_local_participant_guid.serialize(scdr); + m_remote_entity_guid.serialize(scdr); + + + + +} + +/*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ +void DiscoveryTime::local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid) +{ + m_local_participant_guid = _local_participant_guid; +} + +/*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ +void DiscoveryTime::local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid) +{ + m_local_participant_guid = std::move(_local_participant_guid); +} + +/*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() const +{ + return m_local_participant_guid; +} + +/*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::local_participant_guid() +{ + return m_local_participant_guid; +} + + +/*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ +void DiscoveryTime::remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid) +{ + m_remote_entity_guid = _remote_entity_guid; +} + +/*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ +void DiscoveryTime::remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid) +{ + m_remote_entity_guid = std::move(_remote_entity_guid); +} + +/*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() const +{ + return m_remote_entity_guid; +} + +/*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& DiscoveryTime::remote_entity_guid() +{ + return m_remote_entity_guid; +} + + +/*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ +void DiscoveryTime::time( + uint64_t _time) +{ + m_time = _time; +} + +/*! + * @brief This function returns the value of member time + * @return Value of member time + */ +uint64_t DiscoveryTime::time() const +{ + return m_time; +} + +/*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ +uint64_t& DiscoveryTime::time() +{ + return m_time; +} + + +/*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ +void DiscoveryTime::host( + const std::string& _host) +{ + m_host = _host; +} + +/*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ +void DiscoveryTime::host( + std::string&& _host) +{ + m_host = std::move(_host); +} + +/*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ +const std::string& DiscoveryTime::host() const +{ + return m_host; +} + +/*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ +std::string& DiscoveryTime::host() +{ + return m_host; +} + + +/*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ +void DiscoveryTime::user( + const std::string& _user) +{ + m_user = _user; +} + +/*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ +void DiscoveryTime::user( + std::string&& _user) +{ + m_user = std::move(_user); +} + +/*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ +const std::string& DiscoveryTime::user() const +{ + return m_user; +} + +/*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ +std::string& DiscoveryTime::user() +{ + return m_user; +} + + +/*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ +void DiscoveryTime::process( + const std::string& _process) +{ + m_process = _process; +} + +/*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ +void DiscoveryTime::process( + std::string&& _process) +{ + m_process = std::move(_process); +} + +/*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ +const std::string& DiscoveryTime::process() const +{ + return m_process; +} + +/*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ +std::string& DiscoveryTime::process() +{ + return m_process; +} + + + + + +EntityCount::EntityCount() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_guid + + // unsigned long long m_count + m_count = 0; + +} + +EntityCount::~EntityCount() +{ +} + +EntityCount::EntityCount( + const EntityCount& x) +{ + m_guid = x.m_guid; + + + m_count = x.m_count; + +} + +EntityCount::EntityCount( + EntityCount&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_count = x.m_count; + +} + +EntityCount& EntityCount::operator =( + const EntityCount& x) +{ + m_guid = x.m_guid; + + + m_count = x.m_count; + + return *this; +} + +EntityCount& EntityCount::operator =( + EntityCount&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_count = x.m_count; + + return *this; +} + +bool EntityCount::operator ==( + const EntityCount& x) const +{ + return (m_guid == x.m_guid && + m_count == x.m_count); +} + +bool EntityCount::operator !=( + const EntityCount& x) const +{ + return !(*this == x); +} + +size_t EntityCount::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityCount_max_cdr_typesize; +} + +size_t EntityCount::getCdrSerializedSize( + const EntityCount& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void EntityCount::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guid; + + scdr << m_count; + +} + +void EntityCount::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guid; + + + + dcdr >> m_count; + + +} + + +bool EntityCount::isKeyDefined() +{ + return true; +} + +void EntityCount::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void EntityCount::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void EntityCount::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& EntityCount::guid() +{ + return m_guid; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void EntityCount::count( + uint64_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint64_t EntityCount::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint64_t& EntityCount::count() +{ + return m_count; +} + + + + + +SampleIdentityCount::SampleIdentityCount() +{ + // eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id + + // unsigned long long m_count + m_count = 0; + +} + +SampleIdentityCount::~SampleIdentityCount() +{ +} + +SampleIdentityCount::SampleIdentityCount( + const SampleIdentityCount& x) +{ + m_sample_id = x.m_sample_id; + + + m_count = x.m_count; + +} + +SampleIdentityCount::SampleIdentityCount( + SampleIdentityCount&& x) noexcept +{ + m_sample_id = std::move(x.m_sample_id); + + + m_count = x.m_count; + +} + +SampleIdentityCount& SampleIdentityCount::operator =( + const SampleIdentityCount& x) +{ + m_sample_id = x.m_sample_id; + + + m_count = x.m_count; + + return *this; +} + +SampleIdentityCount& SampleIdentityCount::operator =( + SampleIdentityCount&& x) noexcept +{ + m_sample_id = std::move(x.m_sample_id); + + + m_count = x.m_count; + + return *this; +} + +bool SampleIdentityCount::operator ==( + const SampleIdentityCount& x) const +{ + return (m_sample_id == x.m_sample_id && + m_count == x.m_count); +} + +bool SampleIdentityCount::operator !=( + const SampleIdentityCount& x) const +{ + return !(*this == x); +} + +size_t SampleIdentityCount::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_SampleIdentityCount_max_cdr_typesize; +} + +size_t SampleIdentityCount::getCdrSerializedSize( + const SampleIdentityCount& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::SampleIdentity_s::getCdrSerializedSize(data.sample_id(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void SampleIdentityCount::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_sample_id; + + scdr << m_count; + +} + +void SampleIdentityCount::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_sample_id; + + + + dcdr >> m_count; + + +} + + +bool SampleIdentityCount::isKeyDefined() +{ + return true; +} + +void SampleIdentityCount::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_sample_id.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ +void SampleIdentityCount::sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id) +{ + m_sample_id = _sample_id; +} + +/*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ +void SampleIdentityCount::sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id) +{ + m_sample_id = std::move(_sample_id); +} + +/*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ +const eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() const +{ + return m_sample_id; +} + +/*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ +eprosima::fastdds::statistics::detail::SampleIdentity_s& SampleIdentityCount::sample_id() +{ + return m_sample_id; +} + + +/*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ +void SampleIdentityCount::count( + uint64_t _count) +{ + m_count = _count; +} + +/*! + * @brief This function returns the value of member count + * @return Value of member count + */ +uint64_t SampleIdentityCount::count() const +{ + return m_count; +} + +/*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ +uint64_t& SampleIdentityCount::count() +{ + return m_count; +} + + + + + +Entity2LocatorTraffic::Entity2LocatorTraffic() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_src_guid + + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator + + // unsigned long long m_packet_count + m_packet_count = 0; + // unsigned long long m_byte_count + m_byte_count = 0; + // short m_byte_magnitude_order + m_byte_magnitude_order = 0; + +} + +Entity2LocatorTraffic::~Entity2LocatorTraffic() +{ +} + +Entity2LocatorTraffic::Entity2LocatorTraffic( + const Entity2LocatorTraffic& x) +{ + m_src_guid = x.m_src_guid; + + + m_dst_locator = x.m_dst_locator; + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + +} + +Entity2LocatorTraffic::Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept +{ + m_src_guid = std::move(x.m_src_guid); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + +} + +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( + const Entity2LocatorTraffic& x) +{ + m_src_guid = x.m_src_guid; + + + m_dst_locator = x.m_dst_locator; + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; +} + +Entity2LocatorTraffic& Entity2LocatorTraffic::operator =( + Entity2LocatorTraffic&& x) noexcept +{ + m_src_guid = std::move(x.m_src_guid); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_packet_count = x.m_packet_count; + + + m_byte_count = x.m_byte_count; + + + m_byte_magnitude_order = x.m_byte_magnitude_order; + + return *this; +} + +bool Entity2LocatorTraffic::operator ==( + const Entity2LocatorTraffic& x) const +{ + return (m_src_guid == x.m_src_guid && + m_dst_locator == x.m_dst_locator && + m_packet_count == x.m_packet_count && + m_byte_count == x.m_byte_count && + m_byte_magnitude_order == x.m_byte_magnitude_order); +} + +bool Entity2LocatorTraffic::operator !=( + const Entity2LocatorTraffic& x) const +{ + return !(*this == x); +} + +size_t Entity2LocatorTraffic::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_Entity2LocatorTraffic_max_cdr_typesize; +} + +size_t Entity2LocatorTraffic::getCdrSerializedSize( + const Entity2LocatorTraffic& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.src_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + + +void Entity2LocatorTraffic::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_src_guid; + + scdr << m_dst_locator; + + scdr << m_packet_count; + + scdr << m_byte_count; + + scdr << m_byte_magnitude_order; + +} + +void Entity2LocatorTraffic::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_src_guid; + + + + dcdr >> m_dst_locator; + + + + dcdr >> m_packet_count; + + + + dcdr >> m_byte_count; + + + + dcdr >> m_byte_magnitude_order; + + +} + + +bool Entity2LocatorTraffic::isKeyDefined() +{ + return true; +} + +void Entity2LocatorTraffic::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_src_guid.serialize(scdr); + m_dst_locator.serialize(scdr); + + + +} + +/*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ +void Entity2LocatorTraffic::src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid) +{ + m_src_guid = _src_guid; +} + +/*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ +void Entity2LocatorTraffic::src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid) +{ + m_src_guid = std::move(_src_guid); +} + +/*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() const +{ + return m_src_guid; +} + +/*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& Entity2LocatorTraffic::src_guid() +{ + return m_src_guid; +} + + +/*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ +void Entity2LocatorTraffic::dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) +{ + m_dst_locator = _dst_locator; +} + +/*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ +void Entity2LocatorTraffic::dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) +{ + m_dst_locator = std::move(_dst_locator); +} + +/*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() const +{ + return m_dst_locator; +} + +/*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Entity2LocatorTraffic::dst_locator() +{ + return m_dst_locator; +} + + +/*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ +void Entity2LocatorTraffic::packet_count( + uint64_t _packet_count) +{ + m_packet_count = _packet_count; +} + +/*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ +uint64_t Entity2LocatorTraffic::packet_count() const +{ + return m_packet_count; +} + +/*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ +uint64_t& Entity2LocatorTraffic::packet_count() +{ + return m_packet_count; +} + + +/*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ +void Entity2LocatorTraffic::byte_count( + uint64_t _byte_count) +{ + m_byte_count = _byte_count; +} + +/*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ +uint64_t Entity2LocatorTraffic::byte_count() const +{ + return m_byte_count; +} + +/*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ +uint64_t& Entity2LocatorTraffic::byte_count() +{ + return m_byte_count; +} + + +/*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ +void Entity2LocatorTraffic::byte_magnitude_order( + int16_t _byte_magnitude_order) +{ + m_byte_magnitude_order = _byte_magnitude_order; +} + +/*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ +int16_t Entity2LocatorTraffic::byte_magnitude_order() const +{ + return m_byte_magnitude_order; +} + +/*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ +int16_t& Entity2LocatorTraffic::byte_magnitude_order() +{ + return m_byte_magnitude_order; +} + + + + + +WriterReaderData::WriterReaderData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_writer_guid + + // eprosima::fastdds::statistics::detail::GUID_s m_reader_guid + + // float m_data + m_data = 0.0; + +} + +WriterReaderData::~WriterReaderData() +{ +} + +WriterReaderData::WriterReaderData( + const WriterReaderData& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_reader_guid = x.m_reader_guid; + + + m_data = x.m_data; + +} + +WriterReaderData::WriterReaderData( + WriterReaderData&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_reader_guid = std::move(x.m_reader_guid); + + + m_data = x.m_data; + +} + +WriterReaderData& WriterReaderData::operator =( + const WriterReaderData& x) +{ + m_writer_guid = x.m_writer_guid; + + + m_reader_guid = x.m_reader_guid; + + + m_data = x.m_data; + + return *this; +} + +WriterReaderData& WriterReaderData::operator =( + WriterReaderData&& x) noexcept +{ + m_writer_guid = std::move(x.m_writer_guid); + + + m_reader_guid = std::move(x.m_reader_guid); + + + m_data = x.m_data; + + return *this; +} + +bool WriterReaderData::operator ==( + const WriterReaderData& x) const +{ + return (m_writer_guid == x.m_writer_guid && + m_reader_guid == x.m_reader_guid && + m_data == x.m_data); +} + +bool WriterReaderData::operator !=( + const WriterReaderData& x) const +{ + return !(*this == x); +} + +size_t WriterReaderData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_WriterReaderData_max_cdr_typesize; +} + +size_t WriterReaderData::getCdrSerializedSize( + const WriterReaderData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.writer_guid(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.reader_guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void WriterReaderData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_writer_guid; + + scdr << m_reader_guid; + + scdr << m_data; + +} + +void WriterReaderData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_writer_guid; + + + + dcdr >> m_reader_guid; + + + + dcdr >> m_data; + + +} + + +bool WriterReaderData::isKeyDefined() +{ + return true; +} + +void WriterReaderData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_writer_guid.serialize(scdr); + m_reader_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ +void WriterReaderData::writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid) +{ + m_writer_guid = _writer_guid; +} + +/*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ +void WriterReaderData::writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid) +{ + m_writer_guid = std::move(_writer_guid); +} + +/*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() const +{ + return m_writer_guid; +} + +/*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::writer_guid() +{ + return m_writer_guid; +} + + +/*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ +void WriterReaderData::reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid) +{ + m_reader_guid = _reader_guid; +} + +/*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ +void WriterReaderData::reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid) +{ + m_reader_guid = std::move(_reader_guid); +} + +/*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() const +{ + return m_reader_guid; +} + +/*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& WriterReaderData::reader_guid() +{ + return m_reader_guid; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void WriterReaderData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float WriterReaderData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& WriterReaderData::data() +{ + return m_data; +} + + + + + +Locator2LocatorData::Locator2LocatorData() +{ + // eprosima::fastdds::statistics::detail::Locator_s m_src_locator + + // eprosima::fastdds::statistics::detail::Locator_s m_dst_locator + + // float m_data + m_data = 0.0; + +} + +Locator2LocatorData::~Locator2LocatorData() +{ +} + +Locator2LocatorData::Locator2LocatorData( + const Locator2LocatorData& x) +{ + m_src_locator = x.m_src_locator; + + + m_dst_locator = x.m_dst_locator; + + + m_data = x.m_data; + +} + +Locator2LocatorData::Locator2LocatorData( + Locator2LocatorData&& x) noexcept +{ + m_src_locator = std::move(x.m_src_locator); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_data = x.m_data; + +} + +Locator2LocatorData& Locator2LocatorData::operator =( + const Locator2LocatorData& x) +{ + m_src_locator = x.m_src_locator; + + + m_dst_locator = x.m_dst_locator; + + + m_data = x.m_data; + + return *this; +} + +Locator2LocatorData& Locator2LocatorData::operator =( + Locator2LocatorData&& x) noexcept +{ + m_src_locator = std::move(x.m_src_locator); + + + m_dst_locator = std::move(x.m_dst_locator); + + + m_data = x.m_data; + + return *this; +} + +bool Locator2LocatorData::operator ==( + const Locator2LocatorData& x) const +{ + return (m_src_locator == x.m_src_locator && + m_dst_locator == x.m_dst_locator && + m_data == x.m_data); +} + +bool Locator2LocatorData::operator !=( + const Locator2LocatorData& x) const +{ + return !(*this == x); +} + +size_t Locator2LocatorData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_Locator2LocatorData_max_cdr_typesize; +} + +size_t Locator2LocatorData::getCdrSerializedSize( + const Locator2LocatorData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.src_locator(), current_alignment); + + + current_alignment += eprosima::fastdds::statistics::detail::Locator_s::getCdrSerializedSize(data.dst_locator(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void Locator2LocatorData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_src_locator; + + scdr << m_dst_locator; + + scdr << m_data; + +} + +void Locator2LocatorData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_src_locator; + + + + dcdr >> m_dst_locator; + + + + dcdr >> m_data; + + +} + + +bool Locator2LocatorData::isKeyDefined() +{ + return true; +} + +void Locator2LocatorData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_src_locator.serialize(scdr); + m_dst_locator.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ +void Locator2LocatorData::src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator) +{ + m_src_locator = _src_locator; +} + +/*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ +void Locator2LocatorData::src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator) +{ + m_src_locator = std::move(_src_locator); +} + +/*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() const +{ + return m_src_locator; +} + +/*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::src_locator() +{ + return m_src_locator; +} + + +/*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ +void Locator2LocatorData::dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator) +{ + m_dst_locator = _dst_locator; +} + +/*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ +void Locator2LocatorData::dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator) +{ + m_dst_locator = std::move(_dst_locator); +} + +/*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ +const eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() const +{ + return m_dst_locator; +} + +/*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ +eprosima::fastdds::statistics::detail::Locator_s& Locator2LocatorData::dst_locator() +{ + return m_dst_locator; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void Locator2LocatorData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float Locator2LocatorData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& Locator2LocatorData::data() +{ + return m_data; +} + + + + + +EntityData::EntityData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_guid + + // float m_data + m_data = 0.0; + +} + +EntityData::~EntityData() +{ +} + +EntityData::EntityData( + const EntityData& x) +{ + m_guid = x.m_guid; + + + m_data = x.m_data; + +} + +EntityData::EntityData( + EntityData&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_data = x.m_data; + +} + +EntityData& EntityData::operator =( + const EntityData& x) +{ + m_guid = x.m_guid; + + + m_data = x.m_data; + + return *this; +} + +EntityData& EntityData::operator =( + EntityData&& x) noexcept +{ + m_guid = std::move(x.m_guid); + + + m_data = x.m_data; + + return *this; +} + +bool EntityData::operator ==( + const EntityData& x) const +{ + return (m_guid == x.m_guid && + m_data == x.m_data); +} + +bool EntityData::operator !=( + const EntityData& x) const +{ + return !(*this == x); +} + +size_t EntityData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_EntityData_max_cdr_typesize; +} + +size_t EntityData::getCdrSerializedSize( + const EntityData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void EntityData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_guid; + + scdr << m_data; + +} + +void EntityData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_guid; + + + + dcdr >> m_data; + + +} + + +bool EntityData::isKeyDefined() +{ + return true; +} + +void EntityData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_guid.serialize(scdr); + +} + +/*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ +void EntityData::guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid) +{ + m_guid = _guid; +} + +/*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ +void EntityData::guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid) +{ + m_guid = std::move(_guid); +} + +/*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() const +{ + return m_guid; +} + +/*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ +eprosima::fastdds::statistics::detail::GUID_s& EntityData::guid() +{ + return m_guid; +} + + +/*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ +void EntityData::data( + float _data) +{ + m_data = _data; +} + +/*! + * @brief This function returns the value of member data + * @return Value of member data + */ +float EntityData::data() const +{ + return m_data; +} + +/*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ +float& EntityData::data() +{ + return m_data; +} + + + + + +PhysicalData::PhysicalData() +{ + // eprosima::fastdds::statistics::detail::GUID_s m_participant_guid + + // /type_d() m_host + + // /type_d() m_user + + // /type_d() m_process + + +} + +PhysicalData::~PhysicalData() +{ +} + +PhysicalData::PhysicalData( + const PhysicalData& x) +{ + m_participant_guid = x.m_participant_guid; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + +} + +PhysicalData::PhysicalData( + PhysicalData&& x) noexcept +{ + m_participant_guid = std::move(x.m_participant_guid); + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + +} + +PhysicalData& PhysicalData::operator =( + const PhysicalData& x) +{ + m_participant_guid = x.m_participant_guid; + + + m_host = x.m_host; + + + m_user = x.m_user; + + + m_process = x.m_process; + + return *this; +} + +PhysicalData& PhysicalData::operator =( + PhysicalData&& x) noexcept +{ + m_participant_guid = std::move(x.m_participant_guid); + + + m_host = std::move(x.m_host); + + + m_user = std::move(x.m_user); + + + m_process = std::move(x.m_process); + + return *this; +} + +bool PhysicalData::operator ==( + const PhysicalData& x) const +{ + return (m_participant_guid == x.m_participant_guid && + m_host == x.m_host && + m_user == x.m_user && + m_process == x.m_process); +} + +bool PhysicalData::operator !=( + const PhysicalData& x) const +{ + return !(*this == x); +} + +size_t PhysicalData::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return eprosima_fastdds_statistics_PhysicalData_max_cdr_typesize; +} + +size_t PhysicalData::getCdrSerializedSize( + const PhysicalData& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += eprosima::fastdds::statistics::detail::GUID_s::getCdrSerializedSize(data.participant_guid(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.host().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.user().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.process().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void PhysicalData::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_participant_guid; + + scdr << m_host.c_str(); + + scdr << m_user.c_str(); + + scdr << m_process.c_str(); + +} + +void PhysicalData::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_participant_guid; + + + + dcdr >> m_host; + + + + dcdr >> m_user; + + + + dcdr >> m_process; + + +} + + +bool PhysicalData::isKeyDefined() +{ + return true; +} + +void PhysicalData::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + m_participant_guid.serialize(scdr); + + + +} + +/*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ +void PhysicalData::participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid) +{ + m_participant_guid = _participant_guid; +} + +/*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ +void PhysicalData::participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid) +{ + m_participant_guid = std::move(_participant_guid); +} + +/*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ +const eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() const +{ + return m_participant_guid; +} + +/*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ +eprosima::fastdds::statistics::detail::GUID_s& PhysicalData::participant_guid() +{ + return m_participant_guid; +} + + +/*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ +void PhysicalData::host( + const std::string& _host) +{ + m_host = _host; +} + +/*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ +void PhysicalData::host( + std::string&& _host) +{ + m_host = std::move(_host); +} + +/*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ +const std::string& PhysicalData::host() const +{ + return m_host; +} + +/*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ +std::string& PhysicalData::host() +{ + return m_host; +} + + +/*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ +void PhysicalData::user( + const std::string& _user) +{ + m_user = _user; +} + +/*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ +void PhysicalData::user( + std::string&& _user) +{ + m_user = std::move(_user); +} + +/*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ +const std::string& PhysicalData::user() const +{ + return m_user; +} + +/*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ +std::string& PhysicalData::user() +{ + return m_user; +} + + +/*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ +void PhysicalData::process( + const std::string& _process) +{ + m_process = _process; +} + +/*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ +void PhysicalData::process( + std::string&& _process) +{ + m_process = std::move(_process); +} + +/*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ +const std::string& PhysicalData::process() const +{ + return m_process; +} + +/*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ +std::string& PhysicalData::process() +{ + return m_process; +} + + + + + + +Data::Data() +{ + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + // eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data + + // eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data + + // eprosima::fastdds::statistics::EntityData m_entity_data + + // eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic + + // eprosima::fastdds::statistics::EntityCount m_entity_count + + // eprosima::fastdds::statistics::DiscoveryTime m_discovery_time + + // eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count + + // eprosima::fastdds::statistics::PhysicalData m_physical_data + +} + +Data::~Data() +{ +} + +Data::Data( + const Data& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; + + default: + break; + } +} + +Data::Data( + Data&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + + default: + break; + } +} + +Data& Data::operator =( + const Data& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = x.m_writer_reader_data; + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = x.m_locator2locator_data; + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = x.m_entity_data; + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = x.m_entity2locator_traffic; + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = x.m_entity_count; + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = x.m_discovery_time; + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = x.m_sample_identity_count; + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = x.m_physical_data; + break; + + default: + break; + } + + return *this; +} + +Data& Data::operator =( + Data&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + m_writer_reader_data = std::move(x.m_writer_reader_data); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + m_locator2locator_data = std::move(x.m_locator2locator_data); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + m_entity_data = std::move(x.m_entity_data); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + m_entity2locator_traffic = std::move(x.m_entity2locator_traffic); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + m_entity_count = std::move(x.m_entity_count); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + m_discovery_time = std::move(x.m_discovery_time); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + m_sample_identity_count = std::move(x.m_sample_identity_count); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + m_physical_data = std::move(x.m_physical_data); + + break; + + default: + break; + } + + return *this; +} + +bool Data::operator ==( + const Data& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + return (m_writer_reader_data == x.m_writer_reader_data); + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + return (m_locator2locator_data == x.m_locator2locator_data); + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + return (m_entity_data == x.m_entity_data); + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + return (m_entity2locator_traffic == x.m_entity2locator_traffic); + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + return (m_entity_count == x.m_entity_count); + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + return (m_discovery_time == x.m_discovery_time); + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + return (m_sample_identity_count == x.m_sample_identity_count); + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + return (m_physical_data == x.m_physical_data); + break; + + default: + break; + } + return false; +} + +bool Data::operator !=( + const Data& x) const +{ + return !(*this == x); +} + +void Data::_d( + eprosima::fastdds::statistics::EventKind __d) +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + switch(__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + switch(__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + switch(__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + switch(__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + switch(__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + switch(__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + switch(__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + switch(__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +eprosima::fastdds::statistics::EventKind Data::_d() const +{ + return m__d; +} + +eprosima::fastdds::statistics::EventKind& Data::_d() +{ + return m__d; +} + +void Data::writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data) +{ + m_writer_reader_data = _writer_reader_data; + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + +} + +void Data::writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data) +{ + m_writer_reader_data = std::move(_writer_reader_data); + m__d = eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY; + +} + +const eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; +} + +eprosima::fastdds::statistics::WriterReaderData& Data::writer_reader_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_writer_reader_data; +} + + +void Data::locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data) +{ + m_locator2locator_data = _locator2locator_data; + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + +} + +void Data::locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data) +{ + m_locator2locator_data = std::move(_locator2locator_data); + m__d = eprosima::fastdds::statistics::NETWORK_LATENCY; + +} + +const eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; +} + +eprosima::fastdds::statistics::Locator2LocatorData& Data::locator2locator_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::NETWORK_LATENCY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_locator2locator_data; +} + + +void Data::entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data) +{ + m_entity_data = _entity_data; + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + +} + +void Data::entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data) +{ + m_entity_data = std::move(_entity_data); + m__d = eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT; + +} + +const eprosima::fastdds::statistics::EntityData& Data::entity_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_data; +} + +eprosima::fastdds::statistics::EntityData& Data::entity_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_data; +} + + +void Data::entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic) +{ + m_entity2locator_traffic = _entity2locator_traffic; + m__d = eprosima::fastdds::statistics::RTPS_SENT; + +} + +void Data::entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic) +{ + m_entity2locator_traffic = std::move(_entity2locator_traffic); + m__d = eprosima::fastdds::statistics::RTPS_SENT; + +} + +const eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; +} + +eprosima::fastdds::statistics::Entity2LocatorTraffic& Data::entity2locator_traffic() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity2locator_traffic; +} + + +void Data::entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count) +{ + m_entity_count = _entity_count; + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + +} + +void Data::entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count) +{ + m_entity_count = std::move(_entity_count); + m__d = eprosima::fastdds::statistics::RESENT_DATAS; + +} + +const eprosima::fastdds::statistics::EntityCount& Data::entity_count() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_count; +} + +eprosima::fastdds::statistics::EntityCount& Data::entity_count() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_entity_count; +} + + +void Data::discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time) +{ + m_discovery_time = _discovery_time; + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + +} + +void Data::discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time) +{ + m_discovery_time = std::move(_discovery_time); + m__d = eprosima::fastdds::statistics::DISCOVERED_ENTITY; + +} + +const eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_discovery_time; +} + +eprosima::fastdds::statistics::DiscoveryTime& Data::discovery_time() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_discovery_time; +} + + +void Data::sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count) +{ + m_sample_identity_count = _sample_identity_count; + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + +} + +void Data::sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count) +{ + m_sample_identity_count = std::move(_sample_identity_count); + m__d = eprosima::fastdds::statistics::SAMPLE_DATAS; + +} + +const eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; +} + +eprosima::fastdds::statistics::SampleIdentityCount& Data::sample_identity_count() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::SAMPLE_DATAS: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_sample_identity_count; +} + + +void Data::physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data) +{ + m_physical_data = _physical_data; + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + +} + +void Data::physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data) +{ + m_physical_data = std::move(_physical_data); + m__d = eprosima::fastdds::statistics::PHYSICAL_DATA; + +} + +const eprosima::fastdds::statistics::PhysicalData& Data::physical_data() const +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_physical_data; +} + +eprosima::fastdds::statistics::PhysicalData& Data::physical_data() +{ + bool b = false; + + switch(m__d) + { + case eprosima::fastdds::statistics::PHYSICAL_DATA: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_physical_data; +} + + +// TODO(Ricardo) Review +size_t Data::getCdrSerializedSize( + const Data& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + switch(data.m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + current_alignment += eprosima::fastdds::statistics::WriterReaderData::getCdrSerializedSize(data.writer_reader_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + current_alignment += eprosima::fastdds::statistics::Locator2LocatorData::getCdrSerializedSize(data.locator2locator_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + current_alignment += eprosima::fastdds::statistics::EntityData::getCdrSerializedSize(data.entity_data(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + current_alignment += eprosima::fastdds::statistics::Entity2LocatorTraffic::getCdrSerializedSize(data.entity2locator_traffic(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + current_alignment += eprosima::fastdds::statistics::EntityCount::getCdrSerializedSize(data.entity_count(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + current_alignment += eprosima::fastdds::statistics::DiscoveryTime::getCdrSerializedSize(data.discovery_time(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + current_alignment += eprosima::fastdds::statistics::SampleIdentityCount::getCdrSerializedSize(data.sample_identity_count(), current_alignment); + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + current_alignment += eprosima::fastdds::statistics::PhysicalData::getCdrSerializedSize(data.physical_data(), current_alignment); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void Data::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m__d; + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + scdr << m_writer_reader_data; + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + scdr << m_locator2locator_data; + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + scdr << m_entity_data; + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + scdr << m_entity2locator_traffic; + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + scdr << m_entity_count; + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + scdr << m_discovery_time; + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + scdr << m_sample_identity_count; + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + scdr << m_physical_data; + + break; + + default: + break; + } +} + +void Data::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t bitmask_value = 0; + dcdr >> bitmask_value; + m__d = (eprosima::fastdds::statistics::EventKind)bitmask_value; + } + + + + switch(m__d) + { + case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY: + dcdr >> m_writer_reader_data; + + + break; + + + case eprosima::fastdds::statistics::NETWORK_LATENCY: + dcdr >> m_locator2locator_data; + + + break; + + + case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT: + case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT: + dcdr >> m_entity_data; + + + break; + + + case eprosima::fastdds::statistics::RTPS_SENT: + case eprosima::fastdds::statistics::RTPS_LOST: + dcdr >> m_entity2locator_traffic; + + + break; + + + case eprosima::fastdds::statistics::RESENT_DATAS: + case eprosima::fastdds::statistics::HEARTBEAT_COUNT: + case eprosima::fastdds::statistics::ACKNACK_COUNT: + case eprosima::fastdds::statistics::NACKFRAG_COUNT: + case eprosima::fastdds::statistics::GAP_COUNT: + case eprosima::fastdds::statistics::DATA_COUNT: + case eprosima::fastdds::statistics::PDP_PACKETS: + case eprosima::fastdds::statistics::EDP_PACKETS: + dcdr >> m_entity_count; + + + break; + + + case eprosima::fastdds::statistics::DISCOVERED_ENTITY: + dcdr >> m_discovery_time; + + + break; + + + case eprosima::fastdds::statistics::SAMPLE_DATAS: + dcdr >> m_sample_identity_count; + + + break; + + + case eprosima::fastdds::statistics::PHYSICAL_DATA: + dcdr >> m_physical_data; + + + break; + + default: + break; + } +} + + + + + +} // namespace statistics + + +} // namespace fastdds + + +} // namespace eprosima + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/blackbox/types/statistics/typesv1.h b/test/blackbox/types/statistics/typesv1.h new file mode 100644 index 00000000000..6880ab8c6ed --- /dev/null +++ b/test/blackbox/types/statistics/typesv1.h @@ -0,0 +1,3092 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +namespace eprosima { + namespace fastdds { + namespace statistics { + namespace detail { + + + /*! + * @brief This class represents the structure EntityId_s defined by the user in the IDL file. + * @ingroup types + */ + class EntityId_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityId_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityId_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + const EntityId_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s( + EntityId_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + const EntityId_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::EntityId_s that will be copied. + */ + eProsima_user_DllExport EntityId_s& operator =( + EntityId_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityId_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::EntityId_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityId_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::EntityId_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + std::array m_value; + + }; + + + + /*! + * @brief This class represents the structure GuidPrefix_s defined by the user in the IDL file. + * @ingroup types + */ + class GuidPrefix_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GuidPrefix_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GuidPrefix_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + const GuidPrefix_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + const GuidPrefix_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GuidPrefix_s that will be copied. + */ + eProsima_user_DllExport GuidPrefix_s& operator =( + GuidPrefix_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GuidPrefix_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GuidPrefix_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GuidPrefix_s& x) const; + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const std::array& _value); + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + std::array&& _value); + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const std::array& value() const; + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport std::array& value(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + std::array m_value; + + }; + + + + /*! + * @brief This class represents the structure GUID_s defined by the user in the IDL file. + * @ingroup types + */ + class GUID_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport GUID_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~GUID_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + const GUID_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s( + GUID_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + const GUID_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::GUID_s that will be copied. + */ + eProsima_user_DllExport GUID_s& operator =( + GUID_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const GUID_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::GUID_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const GUID_s& x) const; + + /*! + * @brief This function copies the value in member guidPrefix + * @param _guidPrefix New value to be copied in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + const eprosima::fastdds::statistics::detail::GuidPrefix_s& _guidPrefix); + + /*! + * @brief This function moves the value in member guidPrefix + * @param _guidPrefix New value to be moved in member guidPrefix + */ + eProsima_user_DllExport void guidPrefix( + eprosima::fastdds::statistics::detail::GuidPrefix_s&& _guidPrefix); + + /*! + * @brief This function returns a constant reference to member guidPrefix + * @return Constant reference to member guidPrefix + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix() const; + + /*! + * @brief This function returns a reference to member guidPrefix + * @return Reference to member guidPrefix + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GuidPrefix_s& guidPrefix(); + + + /*! + * @brief This function copies the value in member entityId + * @param _entityId New value to be copied in member entityId + */ + eProsima_user_DllExport void entityId( + const eprosima::fastdds::statistics::detail::EntityId_s& _entityId); + + /*! + * @brief This function moves the value in member entityId + * @param _entityId New value to be moved in member entityId + */ + eProsima_user_DllExport void entityId( + eprosima::fastdds::statistics::detail::EntityId_s&& _entityId); + + /*! + * @brief This function returns a constant reference to member entityId + * @return Constant reference to member entityId + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::EntityId_s& entityId() const; + + /*! + * @brief This function returns a reference to member entityId + * @return Reference to member entityId + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::EntityId_s& entityId(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::GUID_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GuidPrefix_s m_guidPrefix; + eprosima::fastdds::statistics::detail::EntityId_s m_entityId; + + }; + + + + /*! + * @brief This class represents the structure SequenceNumber_s defined by the user in the IDL file. + * @ingroup types + */ + class SequenceNumber_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceNumber_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceNumber_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + const SequenceNumber_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + const SequenceNumber_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SequenceNumber_s that will be copied. + */ + eProsima_user_DllExport SequenceNumber_s& operator =( + SequenceNumber_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceNumber_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SequenceNumber_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceNumber_s& x) const; + + /*! + * @brief This function sets a value in member high + * @param _high New value for member high + */ + eProsima_user_DllExport void high( + int32_t _high); + + /*! + * @brief This function returns the value of member high + * @return Value of member high + */ + eProsima_user_DllExport int32_t high() const; + + /*! + * @brief This function returns a reference to member high + * @return Reference to member high + */ + eProsima_user_DllExport int32_t& high(); + + + /*! + * @brief This function sets a value in member low + * @param _low New value for member low + */ + eProsima_user_DllExport void low( + uint32_t _low); + + /*! + * @brief This function returns the value of member low + * @return Value of member low + */ + eProsima_user_DllExport uint32_t low() const; + + /*! + * @brief This function returns a reference to member low + * @return Reference to member low + */ + eProsima_user_DllExport uint32_t& low(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_high; + uint32_t m_low; + + }; + + + + /*! + * @brief This class represents the structure SampleIdentity_s defined by the user in the IDL file. + * @ingroup types + */ + class SampleIdentity_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentity_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentity_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + const SampleIdentity_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + const SampleIdentity_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::SampleIdentity_s that will be copied. + */ + eProsima_user_DllExport SampleIdentity_s& operator =( + SampleIdentity_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentity_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::SampleIdentity_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentity_s& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member sequence_number + * @param _sequence_number New value to be copied in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + const eprosima::fastdds::statistics::detail::SequenceNumber_s& _sequence_number); + + /*! + * @brief This function moves the value in member sequence_number + * @param _sequence_number New value to be moved in member sequence_number + */ + eProsima_user_DllExport void sequence_number( + eprosima::fastdds::statistics::detail::SequenceNumber_s&& _sequence_number); + + /*! + * @brief This function returns a constant reference to member sequence_number + * @return Constant reference to member sequence_number + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number() const; + + /*! + * @brief This function returns a reference to member sequence_number + * @return Reference to member sequence_number + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SequenceNumber_s& sequence_number(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::SequenceNumber_s m_sequence_number; + + }; + + + + /*! + * @brief This class represents the structure Locator_s defined by the user in the IDL file. + * @ingroup types + */ + class Locator_s + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator_s(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator_s(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + const Locator_s& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s( + Locator_s&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + const Locator_s& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::detail::Locator_s that will be copied. + */ + eProsima_user_DllExport Locator_s& operator =( + Locator_s&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator_s& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::detail::Locator_s object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator_s& x) const; + + /*! + * @brief This function sets a value in member kind + * @param _kind New value for member kind + */ + eProsima_user_DllExport void kind( + int32_t _kind); + + /*! + * @brief This function returns the value of member kind + * @return Value of member kind + */ + eProsima_user_DllExport int32_t kind() const; + + /*! + * @brief This function returns a reference to member kind + * @return Reference to member kind + */ + eProsima_user_DllExport int32_t& kind(); + + + /*! + * @brief This function sets a value in member port + * @param _port New value for member port + */ + eProsima_user_DllExport void port( + uint32_t _port); + + /*! + * @brief This function returns the value of member port + * @return Value of member port + */ + eProsima_user_DllExport uint32_t port() const; + + /*! + * @brief This function returns a reference to member port + * @return Reference to member port + */ + eProsima_user_DllExport uint32_t& port(); + + + /*! + * @brief This function copies the value in member address + * @param _address New value to be copied in member address + */ + eProsima_user_DllExport void address( + const std::array& _address); + + /*! + * @brief This function moves the value in member address + * @param _address New value to be moved in member address + */ + eProsima_user_DllExport void address( + std::array&& _address); + + /*! + * @brief This function returns a constant reference to member address + * @return Constant reference to member address + */ + eProsima_user_DllExport const std::array& address() const; + + /*! + * @brief This function returns a reference to member address + * @return Reference to member address + */ + eProsima_user_DllExport std::array& address(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::detail::Locator_s& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + int32_t m_kind; + uint32_t m_port; + std::array m_address; + + }; + + } // namespace detail + + + /*! + * @brief This class represents the structure DiscoveryTime defined by the user in the IDL file. + * @ingroup types + */ + class DiscoveryTime + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DiscoveryTime(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DiscoveryTime(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + const DiscoveryTime& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + const DiscoveryTime& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::DiscoveryTime that will be copied. + */ + eProsima_user_DllExport DiscoveryTime& operator =( + DiscoveryTime&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DiscoveryTime& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::DiscoveryTime object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DiscoveryTime& x) const; + + /*! + * @brief This function copies the value in member local_participant_guid + * @param _local_participant_guid New value to be copied in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _local_participant_guid); + + /*! + * @brief This function moves the value in member local_participant_guid + * @param _local_participant_guid New value to be moved in member local_participant_guid + */ + eProsima_user_DllExport void local_participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _local_participant_guid); + + /*! + * @brief This function returns a constant reference to member local_participant_guid + * @return Constant reference to member local_participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid() const; + + /*! + * @brief This function returns a reference to member local_participant_guid + * @return Reference to member local_participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& local_participant_guid(); + + + /*! + * @brief This function copies the value in member remote_entity_guid + * @param _remote_entity_guid New value to be copied in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _remote_entity_guid); + + /*! + * @brief This function moves the value in member remote_entity_guid + * @param _remote_entity_guid New value to be moved in member remote_entity_guid + */ + eProsima_user_DllExport void remote_entity_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _remote_entity_guid); + + /*! + * @brief This function returns a constant reference to member remote_entity_guid + * @return Constant reference to member remote_entity_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid() const; + + /*! + * @brief This function returns a reference to member remote_entity_guid + * @return Reference to member remote_entity_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& remote_entity_guid(); + + + /*! + * @brief This function sets a value in member time + * @param _time New value for member time + */ + eProsima_user_DllExport void time( + uint64_t _time); + + /*! + * @brief This function returns the value of member time + * @return Value of member time + */ + eProsima_user_DllExport uint64_t time() const; + + /*! + * @brief This function returns a reference to member time + * @return Reference to member time + */ + eProsima_user_DllExport uint64_t& time(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::DiscoveryTime& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_local_participant_guid; + eprosima::fastdds::statistics::detail::GUID_s m_remote_entity_guid; + uint64_t m_time; + std::string m_host; + std::string m_user; + std::string m_process; + + }; + + + + /*! + * @brief This class represents the structure EntityCount defined by the user in the IDL file. + * @ingroup types + */ + class EntityCount + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + const EntityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount( + EntityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + const EntityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityCount that will be copied. + */ + eProsima_user_DllExport EntityCount& operator =( + EntityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityCount& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::EntityCount& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + uint64_t m_count; + + }; + + + + /*! + * @brief This class represents the structure SampleIdentityCount defined by the user in the IDL file. + * @ingroup types + */ + class SampleIdentityCount + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SampleIdentityCount(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SampleIdentityCount(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + const SampleIdentityCount& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + const SampleIdentityCount& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::SampleIdentityCount that will be copied. + */ + eProsima_user_DllExport SampleIdentityCount& operator =( + SampleIdentityCount&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SampleIdentityCount& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::SampleIdentityCount object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SampleIdentityCount& x) const; + + /*! + * @brief This function copies the value in member sample_id + * @param _sample_id New value to be copied in member sample_id + */ + eProsima_user_DllExport void sample_id( + const eprosima::fastdds::statistics::detail::SampleIdentity_s& _sample_id); + + /*! + * @brief This function moves the value in member sample_id + * @param _sample_id New value to be moved in member sample_id + */ + eProsima_user_DllExport void sample_id( + eprosima::fastdds::statistics::detail::SampleIdentity_s&& _sample_id); + + /*! + * @brief This function returns a constant reference to member sample_id + * @return Constant reference to member sample_id + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id() const; + + /*! + * @brief This function returns a reference to member sample_id + * @return Reference to member sample_id + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::SampleIdentity_s& sample_id(); + + + /*! + * @brief This function sets a value in member count + * @param _count New value for member count + */ + eProsima_user_DllExport void count( + uint64_t _count); + + /*! + * @brief This function returns the value of member count + * @return Value of member count + */ + eProsima_user_DllExport uint64_t count() const; + + /*! + * @brief This function returns a reference to member count + * @return Reference to member count + */ + eProsima_user_DllExport uint64_t& count(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::SampleIdentityCount& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::SampleIdentity_s m_sample_id; + uint64_t m_count; + + }; + + + + /*! + * @brief This class represents the structure Entity2LocatorTraffic defined by the user in the IDL file. + * @ingroup types + */ + class Entity2LocatorTraffic + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Entity2LocatorTraffic(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Entity2LocatorTraffic(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + const Entity2LocatorTraffic& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Entity2LocatorTraffic that will be copied. + */ + eProsima_user_DllExport Entity2LocatorTraffic& operator =( + Entity2LocatorTraffic&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Entity2LocatorTraffic object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Entity2LocatorTraffic& x) const; + + /*! + * @brief This function copies the value in member src_guid + * @param _src_guid New value to be copied in member src_guid + */ + eProsima_user_DllExport void src_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _src_guid); + + /*! + * @brief This function moves the value in member src_guid + * @param _src_guid New value to be moved in member src_guid + */ + eProsima_user_DllExport void src_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _src_guid); + + /*! + * @brief This function returns a constant reference to member src_guid + * @return Constant reference to member src_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& src_guid() const; + + /*! + * @brief This function returns a reference to member src_guid + * @return Reference to member src_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& src_guid(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member packet_count + * @param _packet_count New value for member packet_count + */ + eProsima_user_DllExport void packet_count( + uint64_t _packet_count); + + /*! + * @brief This function returns the value of member packet_count + * @return Value of member packet_count + */ + eProsima_user_DllExport uint64_t packet_count() const; + + /*! + * @brief This function returns a reference to member packet_count + * @return Reference to member packet_count + */ + eProsima_user_DllExport uint64_t& packet_count(); + + + /*! + * @brief This function sets a value in member byte_count + * @param _byte_count New value for member byte_count + */ + eProsima_user_DllExport void byte_count( + uint64_t _byte_count); + + /*! + * @brief This function returns the value of member byte_count + * @return Value of member byte_count + */ + eProsima_user_DllExport uint64_t byte_count() const; + + /*! + * @brief This function returns a reference to member byte_count + * @return Reference to member byte_count + */ + eProsima_user_DllExport uint64_t& byte_count(); + + + /*! + * @brief This function sets a value in member byte_magnitude_order + * @param _byte_magnitude_order New value for member byte_magnitude_order + */ + eProsima_user_DllExport void byte_magnitude_order( + int16_t _byte_magnitude_order); + + /*! + * @brief This function returns the value of member byte_magnitude_order + * @return Value of member byte_magnitude_order + */ + eProsima_user_DllExport int16_t byte_magnitude_order() const; + + /*! + * @brief This function returns a reference to member byte_magnitude_order + * @return Reference to member byte_magnitude_order + */ + eProsima_user_DllExport int16_t& byte_magnitude_order(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_src_guid; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + uint64_t m_packet_count; + uint64_t m_byte_count; + int16_t m_byte_magnitude_order; + + }; + + + + /*! + * @brief This class represents the structure WriterReaderData defined by the user in the IDL file. + * @ingroup types + */ + class WriterReaderData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WriterReaderData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WriterReaderData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + const WriterReaderData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData( + WriterReaderData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + const WriterReaderData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::WriterReaderData that will be copied. + */ + eProsima_user_DllExport WriterReaderData& operator =( + WriterReaderData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WriterReaderData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::WriterReaderData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WriterReaderData& x) const; + + /*! + * @brief This function copies the value in member writer_guid + * @param _writer_guid New value to be copied in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _writer_guid); + + /*! + * @brief This function moves the value in member writer_guid + * @param _writer_guid New value to be moved in member writer_guid + */ + eProsima_user_DllExport void writer_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _writer_guid); + + /*! + * @brief This function returns a constant reference to member writer_guid + * @return Constant reference to member writer_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& writer_guid() const; + + /*! + * @brief This function returns a reference to member writer_guid + * @return Reference to member writer_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& writer_guid(); + + + /*! + * @brief This function copies the value in member reader_guid + * @param _reader_guid New value to be copied in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _reader_guid); + + /*! + * @brief This function moves the value in member reader_guid + * @param _reader_guid New value to be moved in member reader_guid + */ + eProsima_user_DllExport void reader_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _reader_guid); + + /*! + * @brief This function returns a constant reference to member reader_guid + * @return Constant reference to member reader_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& reader_guid() const; + + /*! + * @brief This function returns a reference to member reader_guid + * @return Reference to member reader_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& reader_guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::WriterReaderData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_writer_guid; + eprosima::fastdds::statistics::detail::GUID_s m_reader_guid; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure Locator2LocatorData defined by the user in the IDL file. + * @ingroup types + */ + class Locator2LocatorData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Locator2LocatorData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Locator2LocatorData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + const Locator2LocatorData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + const Locator2LocatorData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Locator2LocatorData that will be copied. + */ + eProsima_user_DllExport Locator2LocatorData& operator =( + Locator2LocatorData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Locator2LocatorData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Locator2LocatorData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Locator2LocatorData& x) const; + + /*! + * @brief This function copies the value in member src_locator + * @param _src_locator New value to be copied in member src_locator + */ + eProsima_user_DllExport void src_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _src_locator); + + /*! + * @brief This function moves the value in member src_locator + * @param _src_locator New value to be moved in member src_locator + */ + eProsima_user_DllExport void src_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _src_locator); + + /*! + * @brief This function returns a constant reference to member src_locator + * @return Constant reference to member src_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& src_locator() const; + + /*! + * @brief This function returns a reference to member src_locator + * @return Reference to member src_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& src_locator(); + + + /*! + * @brief This function copies the value in member dst_locator + * @param _dst_locator New value to be copied in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + const eprosima::fastdds::statistics::detail::Locator_s& _dst_locator); + + /*! + * @brief This function moves the value in member dst_locator + * @param _dst_locator New value to be moved in member dst_locator + */ + eProsima_user_DllExport void dst_locator( + eprosima::fastdds::statistics::detail::Locator_s&& _dst_locator); + + /*! + * @brief This function returns a constant reference to member dst_locator + * @return Constant reference to member dst_locator + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::Locator_s& dst_locator() const; + + /*! + * @brief This function returns a reference to member dst_locator + * @return Reference to member dst_locator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::Locator_s& dst_locator(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Locator2LocatorData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::Locator_s m_src_locator; + eprosima::fastdds::statistics::detail::Locator_s m_dst_locator; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure EntityData defined by the user in the IDL file. + * @ingroup types + */ + class EntityData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EntityData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EntityData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + const EntityData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData( + EntityData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + const EntityData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::EntityData that will be copied. + */ + eProsima_user_DllExport EntityData& operator =( + EntityData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EntityData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::EntityData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EntityData& x) const; + + /*! + * @brief This function copies the value in member guid + * @param _guid New value to be copied in member guid + */ + eProsima_user_DllExport void guid( + const eprosima::fastdds::statistics::detail::GUID_s& _guid); + + /*! + * @brief This function moves the value in member guid + * @param _guid New value to be moved in member guid + */ + eProsima_user_DllExport void guid( + eprosima::fastdds::statistics::detail::GUID_s&& _guid); + + /*! + * @brief This function returns a constant reference to member guid + * @return Constant reference to member guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& guid() const; + + /*! + * @brief This function returns a reference to member guid + * @return Reference to member guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& guid(); + + + /*! + * @brief This function sets a value in member data + * @param _data New value for member data + */ + eProsima_user_DllExport void data( + float _data); + + /*! + * @brief This function returns the value of member data + * @return Value of member data + */ + eProsima_user_DllExport float data() const; + + /*! + * @brief This function returns a reference to member data + * @return Reference to member data + */ + eProsima_user_DllExport float& data(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::EntityData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_guid; + float m_data; + + }; + + + + /*! + * @brief This class represents the structure PhysicalData defined by the user in the IDL file. + * @ingroup types + */ + class PhysicalData + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PhysicalData(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PhysicalData(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + const PhysicalData& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData( + PhysicalData&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + const PhysicalData& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::PhysicalData that will be copied. + */ + eProsima_user_DllExport PhysicalData& operator =( + PhysicalData&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PhysicalData& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::PhysicalData object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PhysicalData& x) const; + + /*! + * @brief This function copies the value in member participant_guid + * @param _participant_guid New value to be copied in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + const eprosima::fastdds::statistics::detail::GUID_s& _participant_guid); + + /*! + * @brief This function moves the value in member participant_guid + * @param _participant_guid New value to be moved in member participant_guid + */ + eProsima_user_DllExport void participant_guid( + eprosima::fastdds::statistics::detail::GUID_s&& _participant_guid); + + /*! + * @brief This function returns a constant reference to member participant_guid + * @return Constant reference to member participant_guid + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::detail::GUID_s& participant_guid() const; + + /*! + * @brief This function returns a reference to member participant_guid + * @return Reference to member participant_guid + */ + eProsima_user_DllExport eprosima::fastdds::statistics::detail::GUID_s& participant_guid(); + + + /*! + * @brief This function copies the value in member host + * @param _host New value to be copied in member host + */ + eProsima_user_DllExport void host( + const std::string& _host); + + /*! + * @brief This function moves the value in member host + * @param _host New value to be moved in member host + */ + eProsima_user_DllExport void host( + std::string&& _host); + + /*! + * @brief This function returns a constant reference to member host + * @return Constant reference to member host + */ + eProsima_user_DllExport const std::string& host() const; + + /*! + * @brief This function returns a reference to member host + * @return Reference to member host + */ + eProsima_user_DllExport std::string& host(); + + + /*! + * @brief This function copies the value in member user + * @param _user New value to be copied in member user + */ + eProsima_user_DllExport void user( + const std::string& _user); + + /*! + * @brief This function moves the value in member user + * @param _user New value to be moved in member user + */ + eProsima_user_DllExport void user( + std::string&& _user); + + /*! + * @brief This function returns a constant reference to member user + * @return Constant reference to member user + */ + eProsima_user_DllExport const std::string& user() const; + + /*! + * @brief This function returns a reference to member user + * @return Reference to member user + */ + eProsima_user_DllExport std::string& user(); + + + /*! + * @brief This function copies the value in member process + * @param _process New value to be copied in member process + */ + eProsima_user_DllExport void process( + const std::string& _process); + + /*! + * @brief This function moves the value in member process + * @param _process New value to be moved in member process + */ + eProsima_user_DllExport void process( + std::string&& _process); + + /*! + * @brief This function returns a constant reference to member process + * @return Constant reference to member process + */ + eProsima_user_DllExport const std::string& process() const; + + /*! + * @brief This function returns a reference to member process + * @return Reference to member process + */ + eProsima_user_DllExport std::string& process(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::PhysicalData& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + eprosima::fastdds::statistics::detail::GUID_s m_participant_guid; + std::string m_host; + std::string m_user; + std::string m_process; + + }; + + /*! + * @brief This class represents the bitmask EventKind defined by the user in the IDL file. + * @ingroup types + */ + enum EventKindBits : uint32_t + { + HISTORY2HISTORY_LATENCY = 0x01ull << 0, + NETWORK_LATENCY = 0x01ull << 1, + PUBLICATION_THROUGHPUT = 0x01ull << 2, + SUBSCRIPTION_THROUGHPUT = 0x01ull << 3, + RTPS_SENT = 0x01ull << 4, + RTPS_LOST = 0x01ull << 5, + RESENT_DATAS = 0x01ull << 6, + HEARTBEAT_COUNT = 0x01ull << 7, + ACKNACK_COUNT = 0x01ull << 8, + NACKFRAG_COUNT = 0x01ull << 9, + GAP_COUNT = 0x01ull << 10, + DATA_COUNT = 0x01ull << 11, + PDP_PACKETS = 0x01ull << 12, + EDP_PACKETS = 0x01ull << 13, + DISCOVERED_ENTITY = 0x01ull << 14, + SAMPLE_DATAS = 0x01ull << 15, + PHYSICAL_DATA = 0x01ull << 16 + }; + typedef uint32_t EventKind; + + + /*! + * @brief This class represents the union Data defined by the user in the IDL file. + * @ingroup types + */ + class Data + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Data(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Data(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + const Data& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data( + Data&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + const Data& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object eprosima::fastdds::statistics::Data that will be copied. + */ + eProsima_user_DllExport Data& operator =( + Data&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Data& x) const; + + /*! + * @brief Comparison operator. + * @param x eprosima::fastdds::statistics::Data object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Data& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + eprosima::fastdds::statistics::EventKind __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EventKind& _d(); + + /*! + * @brief This function copies the value in member writer_reader_data + * @param _writer_reader_data New value to be copied in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + const eprosima::fastdds::statistics::WriterReaderData& _writer_reader_data); + + /*! + * @brief This function moves the value in member writer_reader_data + * @param _writer_reader_data New value to be moved in member writer_reader_data + */ + eProsima_user_DllExport void writer_reader_data( + eprosima::fastdds::statistics::WriterReaderData&& _writer_reader_data); + + /*! + * @brief This function returns a constant reference to member writer_reader_data + * @return Constant reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::WriterReaderData& writer_reader_data() const; + + /*! + * @brief This function returns a reference to member writer_reader_data + * @return Reference to member writer_reader_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::WriterReaderData& writer_reader_data(); + + + /*! + * @brief This function copies the value in member locator2locator_data + * @param _locator2locator_data New value to be copied in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + const eprosima::fastdds::statistics::Locator2LocatorData& _locator2locator_data); + + /*! + * @brief This function moves the value in member locator2locator_data + * @param _locator2locator_data New value to be moved in member locator2locator_data + */ + eProsima_user_DllExport void locator2locator_data( + eprosima::fastdds::statistics::Locator2LocatorData&& _locator2locator_data); + + /*! + * @brief This function returns a constant reference to member locator2locator_data + * @return Constant reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data() const; + + /*! + * @brief This function returns a reference to member locator2locator_data + * @return Reference to member locator2locator_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Locator2LocatorData& locator2locator_data(); + + + /*! + * @brief This function copies the value in member entity_data + * @param _entity_data New value to be copied in member entity_data + */ + eProsima_user_DllExport void entity_data( + const eprosima::fastdds::statistics::EntityData& _entity_data); + + /*! + * @brief This function moves the value in member entity_data + * @param _entity_data New value to be moved in member entity_data + */ + eProsima_user_DllExport void entity_data( + eprosima::fastdds::statistics::EntityData&& _entity_data); + + /*! + * @brief This function returns a constant reference to member entity_data + * @return Constant reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityData& entity_data() const; + + /*! + * @brief This function returns a reference to member entity_data + * @return Reference to member entity_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityData& entity_data(); + + + /*! + * @brief This function copies the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be copied in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + const eprosima::fastdds::statistics::Entity2LocatorTraffic& _entity2locator_traffic); + + /*! + * @brief This function moves the value in member entity2locator_traffic + * @param _entity2locator_traffic New value to be moved in member entity2locator_traffic + */ + eProsima_user_DllExport void entity2locator_traffic( + eprosima::fastdds::statistics::Entity2LocatorTraffic&& _entity2locator_traffic); + + /*! + * @brief This function returns a constant reference to member entity2locator_traffic + * @return Constant reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic() const; + + /*! + * @brief This function returns a reference to member entity2locator_traffic + * @return Reference to member entity2locator_traffic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::Entity2LocatorTraffic& entity2locator_traffic(); + + + /*! + * @brief This function copies the value in member entity_count + * @param _entity_count New value to be copied in member entity_count + */ + eProsima_user_DllExport void entity_count( + const eprosima::fastdds::statistics::EntityCount& _entity_count); + + /*! + * @brief This function moves the value in member entity_count + * @param _entity_count New value to be moved in member entity_count + */ + eProsima_user_DllExport void entity_count( + eprosima::fastdds::statistics::EntityCount&& _entity_count); + + /*! + * @brief This function returns a constant reference to member entity_count + * @return Constant reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::EntityCount& entity_count() const; + + /*! + * @brief This function returns a reference to member entity_count + * @return Reference to member entity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::EntityCount& entity_count(); + + + /*! + * @brief This function copies the value in member discovery_time + * @param _discovery_time New value to be copied in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + const eprosima::fastdds::statistics::DiscoveryTime& _discovery_time); + + /*! + * @brief This function moves the value in member discovery_time + * @param _discovery_time New value to be moved in member discovery_time + */ + eProsima_user_DllExport void discovery_time( + eprosima::fastdds::statistics::DiscoveryTime&& _discovery_time); + + /*! + * @brief This function returns a constant reference to member discovery_time + * @return Constant reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::DiscoveryTime& discovery_time() const; + + /*! + * @brief This function returns a reference to member discovery_time + * @return Reference to member discovery_time + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::DiscoveryTime& discovery_time(); + + + /*! + * @brief This function copies the value in member sample_identity_count + * @param _sample_identity_count New value to be copied in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + const eprosima::fastdds::statistics::SampleIdentityCount& _sample_identity_count); + + /*! + * @brief This function moves the value in member sample_identity_count + * @param _sample_identity_count New value to be moved in member sample_identity_count + */ + eProsima_user_DllExport void sample_identity_count( + eprosima::fastdds::statistics::SampleIdentityCount&& _sample_identity_count); + + /*! + * @brief This function returns a constant reference to member sample_identity_count + * @return Constant reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count() const; + + /*! + * @brief This function returns a reference to member sample_identity_count + * @return Reference to member sample_identity_count + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::SampleIdentityCount& sample_identity_count(); + + + /*! + * @brief This function copies the value in member physical_data + * @param _physical_data New value to be copied in member physical_data + */ + eProsima_user_DllExport void physical_data( + const eprosima::fastdds::statistics::PhysicalData& _physical_data); + + /*! + * @brief This function moves the value in member physical_data + * @param _physical_data New value to be moved in member physical_data + */ + eProsima_user_DllExport void physical_data( + eprosima::fastdds::statistics::PhysicalData&& _physical_data); + + /*! + * @brief This function returns a constant reference to member physical_data + * @return Constant reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastdds::statistics::PhysicalData& physical_data() const; + + /*! + * @brief This function returns a reference to member physical_data + * @return Reference to member physical_data + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastdds::statistics::PhysicalData& physical_data(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const eprosima::fastdds::statistics::Data& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + + private: + + eprosima::fastdds::statistics::EventKind m__d; + + eprosima::fastdds::statistics::WriterReaderData m_writer_reader_data; + eprosima::fastdds::statistics::Locator2LocatorData m_locator2locator_data; + eprosima::fastdds::statistics::EntityData m_entity_data; + eprosima::fastdds::statistics::Entity2LocatorTraffic m_entity2locator_traffic; + eprosima::fastdds::statistics::EntityCount m_entity_count; + eprosima::fastdds::statistics::DiscoveryTime m_discovery_time; + eprosima::fastdds::statistics::SampleIdentityCount m_sample_identity_count; + eprosima::fastdds::statistics::PhysicalData m_physical_data; + }; + + } // namespace statistics + } // namespace fastdds +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_STATISTICS_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/communication/CMakeLists.txt b/test/communication/CMakeLists.txt index d138f274a38..e19db25df79 100644 --- a/test/communication/CMakeLists.txt +++ b/test/communication/CMakeLists.txt @@ -17,10 +17,13 @@ find_package(PythonInterp 3) ############################################################################### # Binaries ############################################################################### -set(COMMON_SOURCE ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx +set(COMMON_SOURCE + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObject.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSized.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedPubSubTypes.cxx ) diff --git a/test/dds/communication/CMakeLists.txt b/test/dds/communication/CMakeLists.txt index 2e9dc8a2224..ac69ac6d8ba 100644 --- a/test/dds/communication/CMakeLists.txt +++ b/test/dds/communication/CMakeLists.txt @@ -47,10 +47,13 @@ target_compile_definitions(DDSSimpleCommunicationDynamicSubscriber PRIVATE target_link_libraries(DDSSimpleCommunicationDynamicSubscriber fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) # Standar tests -set(COMMON_SOURCE ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx +set(COMMON_SOURCE + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorld.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/HelloWorldTypeObject.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSized.cxx + ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedv1.cxx ${PROJECT_SOURCE_DIR}/test/blackbox/types/FixedSizedPubSubTypes.cxx ) diff --git a/test/profiling/allocations/AllocTestType.cxx b/test/profiling/allocations/AllocTestType.cxx index d3f001c8b61..58cc317296f 100644 --- a/test/profiling/allocations/AllocTestType.cxx +++ b/test/profiling/allocations/AllocTestType.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "AllocTestType.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include @@ -36,9 +39,10 @@ using namespace eprosima::fastcdr::exception; #include + + AllocTestType::AllocTestType() { - } AllocTestType::~AllocTestType() @@ -62,7 +66,6 @@ AllocTestType& AllocTestType::operator =( { m_index = x.m_index; - return *this; } @@ -71,7 +74,6 @@ AllocTestType& AllocTestType::operator =( { m_index = x.m_index; - return *this; } @@ -118,3 +120,5 @@ uint32_t& AllocTestType::index() // Include auxiliary functions like for serializing/deserializing. #include "AllocTestTypeCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/profiling/allocations/AllocTestType.h b/test/profiling/allocations/AllocTestType.h index 4c5003d340b..e823f9360d1 100644 --- a/test/profiling/allocations/AllocTestType.h +++ b/test/profiling/allocations/AllocTestType.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "AllocTestTypev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ #define _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure AllocTestType defined by the user in the IDL file. * @ingroup AllocTestType @@ -154,3 +162,6 @@ class AllocTestType #endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/profiling/allocations/AllocTestTypeCdrAux.hpp b/test/profiling/allocations/AllocTestTypeCdrAux.hpp index e83ce2e352a..9c9494f96d2 100644 --- a/test/profiling/allocations/AllocTestTypeCdrAux.hpp +++ b/test/profiling/allocations/AllocTestTypeCdrAux.hpp @@ -34,6 +34,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AllocTestType& data); @@ -42,4 +44,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_HPP_ + diff --git a/test/profiling/allocations/AllocTestTypeCdrAux.ipp b/test/profiling/allocations/AllocTestTypeCdrAux.ipp index 1ce69cec20c..42e4029739a 100644 --- a/test/profiling/allocations/AllocTestTypeCdrAux.ipp +++ b/test/profiling/allocations/AllocTestTypeCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.index() ; - scdr.end_serialize_type(current_state); } @@ -115,4 +116,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPECDRAUX_IPP_ + diff --git a/test/profiling/allocations/AllocTestTypePubSubTypes.cxx b/test/profiling/allocations/AllocTestTypePubSubTypes.cxx index 37f61a25665..3aa18060dc2 100644 --- a/test/profiling/allocations/AllocTestTypePubSubTypes.cxx +++ b/test/profiling/allocations/AllocTestTypePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "AllocTestTypePubSubTypes.h" #include "AllocTestTypeCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + AllocTestTypePubSubType::AllocTestTypePubSubType() { setName("AllocTestType"); - uint32_t type_size = AllocTestType_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AllocTestType::getMaxCdrSerializedSize()); +#else + AllocTestType_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool AllocTestTypePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool AllocTestTypePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool AllocTestTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function AllocTestTypePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool AllocTestTypePubSubType::getKey( AllocTestType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || AllocTestType_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/profiling/allocations/AllocTestTypePubSubTypes.h b/test/profiling/allocations/AllocTestTypePubSubTypes.h index 5d6d57cfaf8..80298136ea2 100644 --- a/test/profiling/allocations/AllocTestTypePubSubTypes.h +++ b/test/profiling/allocations/AllocTestTypePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type AllocTestType defined by the user in the IDL file. * @ingroup AllocTestType diff --git a/test/profiling/allocations/AllocTestTypev1.cxx b/test/profiling/allocations/AllocTestTypev1.cxx new file mode 100644 index 00000000000..5d4e51b63a9 --- /dev/null +++ b/test/profiling/allocations/AllocTestTypev1.cxx @@ -0,0 +1,223 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file AllocTestType.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "AllocTestType.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define AllocTestType_max_cdr_typesize 8ULL; + + + + +AllocTestType::AllocTestType() +{ + // unsigned long m_index + m_index = 0; + +} + +AllocTestType::~AllocTestType() +{ +} + +AllocTestType::AllocTestType( + const AllocTestType& x) +{ + m_index = x.m_index; + +} + +AllocTestType::AllocTestType( + AllocTestType&& x) noexcept +{ + m_index = x.m_index; + +} + +AllocTestType& AllocTestType::operator =( + const AllocTestType& x) +{ + m_index = x.m_index; + + return *this; +} + +AllocTestType& AllocTestType::operator =( + AllocTestType&& x) noexcept +{ + m_index = x.m_index; + + return *this; +} + +bool AllocTestType::operator ==( + const AllocTestType& x) const +{ + return (m_index == x.m_index); +} + +bool AllocTestType::operator !=( + const AllocTestType& x) const +{ + return !(*this == x); +} + +size_t AllocTestType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return AllocTestType_max_cdr_typesize; +} + +size_t AllocTestType::getCdrSerializedSize( + const AllocTestType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void AllocTestType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_index; + +} + +void AllocTestType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_index; + + +} + + +bool AllocTestType::isKeyDefined() +{ + return false; +} + +void AllocTestType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ +void AllocTestType::index( + uint32_t _index) +{ + m_index = _index; +} + +/*! + * @brief This function returns the value of member index + * @return Value of member index + */ +uint32_t AllocTestType::index() const +{ + return m_index; +} + +/*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ +uint32_t& AllocTestType::index() +{ + return m_index; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/profiling/allocations/AllocTestTypev1.h b/test/profiling/allocations/AllocTestTypev1.h new file mode 100644 index 00000000000..7fbced57c4c --- /dev/null +++ b/test/profiling/allocations/AllocTestTypev1.h @@ -0,0 +1,215 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file AllocTestType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ +#define _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(ALLOCTESTTYPE_SOURCE) +#define ALLOCTESTTYPE_DllAPI __declspec( dllexport ) +#else +#define ALLOCTESTTYPE_DllAPI __declspec( dllimport ) +#endif // ALLOCTESTTYPE_SOURCE +#else +#define ALLOCTESTTYPE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define ALLOCTESTTYPE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure AllocTestType defined by the user in the IDL file. + * @ingroup AllocTestType + */ +class AllocTestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AllocTestType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AllocTestType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType( + const AllocTestType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType( + AllocTestType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType& operator =( + const AllocTestType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object AllocTestType that will be copied. + */ + eProsima_user_DllExport AllocTestType& operator =( + AllocTestType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x AllocTestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AllocTestType& x) const; + + /*! + * @brief Comparison operator. + * @param x AllocTestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AllocTestType& x) const; + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index); + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const; + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const AllocTestType& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_index; + +}; + + +#endif // _FAST_DDS_GENERATED_ALLOCTESTTYPE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/realtime/UserThreadNonBlockedTest.cpp b/test/realtime/UserThreadNonBlockedTest.cpp index 06bb32d75d1..d450672bea9 100644 --- a/test/realtime/UserThreadNonBlockedTest.cpp +++ b/test/realtime/UserThreadNonBlockedTest.cpp @@ -76,7 +76,12 @@ class DummyType : public eprosima::fastdds::dds::TopicDataType // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer((char*)payload->data, payload->length); // Object that serializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer); // Deserialize encapsulation. + eprosima::fastcdr::Cdr deser(fastbuffer // Deserialize encapsulation. +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); deser.read_encapsulation(); payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; //serialize the object: diff --git a/test/unittest/dds/publisher/CMakeLists.txt b/test/unittest/dds/publisher/CMakeLists.txt index 5153df653aa..7cceabdc612 100644 --- a/test/unittest/dds/publisher/CMakeLists.txt +++ b/test/unittest/dds/publisher/CMakeLists.txt @@ -222,6 +222,7 @@ set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ) diff --git a/test/unittest/dds/status/CMakeLists.txt b/test/unittest/dds/status/CMakeLists.txt index 80d2d823545..4b03f13a0ef 100644 --- a/test/unittest/dds/status/CMakeLists.txt +++ b/test/unittest/dds/status/CMakeLists.txt @@ -111,6 +111,7 @@ if (FASTDDS_STATISTICS) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ) @@ -206,4 +207,4 @@ add_gtest(ListenerTests SOURCES ${LISTENERTESTS_SOURCE}) if(ANDROID) set_property(TARGET ListenerTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&") -endif() \ No newline at end of file +endif() diff --git a/test/unittest/dds/subscriber/FooBoundedTypeSupport.hpp b/test/unittest/dds/subscriber/FooBoundedTypeSupport.hpp index c5608414ad6..1dfa477d983 100644 --- a/test/unittest/dds/subscriber/FooBoundedTypeSupport.hpp +++ b/test/unittest/dds/subscriber/FooBoundedTypeSupport.hpp @@ -65,7 +65,11 @@ class FooBoundedTypeSupport : public TopicDataType } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -80,7 +84,12 @@ class FooBoundedTypeSupport : public TopicDataType eprosima::fastcdr::FastBuffer fb(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fb); + eprosima::fastcdr::Cdr deser(fb +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); diff --git a/test/unittest/dds/subscriber/FooTypeSupport.hpp b/test/unittest/dds/subscriber/FooTypeSupport.hpp index 37565f89501..1d9b66e6f02 100644 --- a/test/unittest/dds/subscriber/FooTypeSupport.hpp +++ b/test/unittest/dds/subscriber/FooTypeSupport.hpp @@ -15,9 +15,9 @@ #ifndef _TEST_UNITTEST_DDS_SUBSCRIBER_FOOTYPESUPPORT_HPP_ #define _TEST_UNITTEST_DDS_SUBSCRIBER_FOOTYPESUPPORT_HPP_ -#include #include +#include #include "./FooType.hpp" @@ -46,7 +46,8 @@ class FooTypeSupport : public TopicDataType // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fb(reinterpret_cast(payload->data), payload->max_size); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fb, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastdds::rtps::DEFAULT_XCDR_VERSION); + eprosima::fastcdr::Cdr ser(fb, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + eprosima::fastdds::rtps::DEFAULT_XCDR_VERSION); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; // Serialize encapsulation ser.serialize_encapsulation(); @@ -62,7 +63,11 @@ class FooTypeSupport : public TopicDataType } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -77,7 +82,12 @@ class FooTypeSupport : public TopicDataType eprosima::fastcdr::FastBuffer fb(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fb); + eprosima::fastcdr::Cdr deser(fb +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -135,7 +145,11 @@ class FooTypeSupport : public TopicDataType { MD5 md5; md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + md5.update(key_buf, static_cast(ser.getSerializedDataLength())); +#else md5.update(key_buf, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx index e3f23f605c9..78827cf683c 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "ContentFilterTestType.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "ContentFilterTestTypeTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + StructType::StructType() { - // Just to register all known types registerContentFilterTestTypeTypes(); } @@ -108,7 +112,6 @@ StructType& StructType::operator =( m_string_field = x.m_string_field; m_enum_field = x.m_enum_field; m_enum2_field = x.m_enum2_field; - return *this; } @@ -131,7 +134,6 @@ StructType& StructType::operator =( m_string_field = std::move(x.m_string_field); m_enum_field = x.m_enum_field; m_enum2_field = x.m_enum2_field; - return *this; } @@ -608,9 +610,12 @@ Material& StructType::enum2_field() + + + + ContentFilterTestType::ContentFilterTestType() { - // Just to register all known types registerContentFilterTestTypeTypes(); } @@ -825,7 +830,6 @@ ContentFilterTestType& ContentFilterTestType::operator =( m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; - return *this; } @@ -897,7 +901,6 @@ ContentFilterTestType& ContentFilterTestType::operator =( m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); - return *this; } @@ -1465,7 +1468,7 @@ StructType& ContentFilterTestType::struct_field() * @param _array_char_field New value to be copied in member array_char_field */ void ContentFilterTestType::array_char_field( - const std::array& _array_char_field) + const std::array& _array_char_field) { m_array_char_field = _array_char_field; } @@ -1475,7 +1478,7 @@ void ContentFilterTestType::array_char_field( * @param _array_char_field New value to be moved in member array_char_field */ void ContentFilterTestType::array_char_field( - std::array&& _array_char_field) + std::array&& _array_char_field) { m_array_char_field = std::move(_array_char_field); } @@ -1484,7 +1487,7 @@ void ContentFilterTestType::array_char_field( * @brief This function returns a constant reference to member array_char_field * @return Constant reference to member array_char_field */ -const std::array& ContentFilterTestType::array_char_field() const +const std::array& ContentFilterTestType::array_char_field() const { return m_array_char_field; } @@ -1493,7 +1496,7 @@ const std::array& ContentFilterTestType::array_char_field() const * @brief This function returns a reference to member array_char_field * @return Reference to member array_char_field */ -std::array& ContentFilterTestType::array_char_field() +std::array& ContentFilterTestType::array_char_field() { return m_array_char_field; } @@ -1504,7 +1507,7 @@ std::array& ContentFilterTestType::array_char_field() * @param _array_uint8_field New value to be copied in member array_uint8_field */ void ContentFilterTestType::array_uint8_field( - const std::array& _array_uint8_field) + const std::array& _array_uint8_field) { m_array_uint8_field = _array_uint8_field; } @@ -1514,7 +1517,7 @@ void ContentFilterTestType::array_uint8_field( * @param _array_uint8_field New value to be moved in member array_uint8_field */ void ContentFilterTestType::array_uint8_field( - std::array&& _array_uint8_field) + std::array&& _array_uint8_field) { m_array_uint8_field = std::move(_array_uint8_field); } @@ -1523,7 +1526,7 @@ void ContentFilterTestType::array_uint8_field( * @brief This function returns a constant reference to member array_uint8_field * @return Constant reference to member array_uint8_field */ -const std::array& ContentFilterTestType::array_uint8_field() const +const std::array& ContentFilterTestType::array_uint8_field() const { return m_array_uint8_field; } @@ -1532,7 +1535,7 @@ const std::array& ContentFilterTestType::array_uint8_field() const * @brief This function returns a reference to member array_uint8_field * @return Reference to member array_uint8_field */ -std::array& ContentFilterTestType::array_uint8_field() +std::array& ContentFilterTestType::array_uint8_field() { return m_array_uint8_field; } @@ -1543,7 +1546,7 @@ std::array& ContentFilterTestType::array_uint8_field() * @param _array_int16_field New value to be copied in member array_int16_field */ void ContentFilterTestType::array_int16_field( - const std::array& _array_int16_field) + const std::array& _array_int16_field) { m_array_int16_field = _array_int16_field; } @@ -1553,7 +1556,7 @@ void ContentFilterTestType::array_int16_field( * @param _array_int16_field New value to be moved in member array_int16_field */ void ContentFilterTestType::array_int16_field( - std::array&& _array_int16_field) + std::array&& _array_int16_field) { m_array_int16_field = std::move(_array_int16_field); } @@ -1562,7 +1565,7 @@ void ContentFilterTestType::array_int16_field( * @brief This function returns a constant reference to member array_int16_field * @return Constant reference to member array_int16_field */ -const std::array& ContentFilterTestType::array_int16_field() const +const std::array& ContentFilterTestType::array_int16_field() const { return m_array_int16_field; } @@ -1571,7 +1574,7 @@ const std::array& ContentFilterTestType::array_int16_field() const * @brief This function returns a reference to member array_int16_field * @return Reference to member array_int16_field */ -std::array& ContentFilterTestType::array_int16_field() +std::array& ContentFilterTestType::array_int16_field() { return m_array_int16_field; } @@ -1582,7 +1585,7 @@ std::array& ContentFilterTestType::array_int16_field() * @param _array_uint16_field New value to be copied in member array_uint16_field */ void ContentFilterTestType::array_uint16_field( - const std::array& _array_uint16_field) + const std::array& _array_uint16_field) { m_array_uint16_field = _array_uint16_field; } @@ -1592,7 +1595,7 @@ void ContentFilterTestType::array_uint16_field( * @param _array_uint16_field New value to be moved in member array_uint16_field */ void ContentFilterTestType::array_uint16_field( - std::array&& _array_uint16_field) + std::array&& _array_uint16_field) { m_array_uint16_field = std::move(_array_uint16_field); } @@ -1601,7 +1604,7 @@ void ContentFilterTestType::array_uint16_field( * @brief This function returns a constant reference to member array_uint16_field * @return Constant reference to member array_uint16_field */ -const std::array& ContentFilterTestType::array_uint16_field() const +const std::array& ContentFilterTestType::array_uint16_field() const { return m_array_uint16_field; } @@ -1610,7 +1613,7 @@ const std::array& ContentFilterTestType::array_uint16_field() const * @brief This function returns a reference to member array_uint16_field * @return Reference to member array_uint16_field */ -std::array& ContentFilterTestType::array_uint16_field() +std::array& ContentFilterTestType::array_uint16_field() { return m_array_uint16_field; } @@ -1621,7 +1624,7 @@ std::array& ContentFilterTestType::array_uint16_field() * @param _array_int32_field New value to be copied in member array_int32_field */ void ContentFilterTestType::array_int32_field( - const std::array& _array_int32_field) + const std::array& _array_int32_field) { m_array_int32_field = _array_int32_field; } @@ -1631,7 +1634,7 @@ void ContentFilterTestType::array_int32_field( * @param _array_int32_field New value to be moved in member array_int32_field */ void ContentFilterTestType::array_int32_field( - std::array&& _array_int32_field) + std::array&& _array_int32_field) { m_array_int32_field = std::move(_array_int32_field); } @@ -1640,7 +1643,7 @@ void ContentFilterTestType::array_int32_field( * @brief This function returns a constant reference to member array_int32_field * @return Constant reference to member array_int32_field */ -const std::array& ContentFilterTestType::array_int32_field() const +const std::array& ContentFilterTestType::array_int32_field() const { return m_array_int32_field; } @@ -1649,7 +1652,7 @@ const std::array& ContentFilterTestType::array_int32_field() const * @brief This function returns a reference to member array_int32_field * @return Reference to member array_int32_field */ -std::array& ContentFilterTestType::array_int32_field() +std::array& ContentFilterTestType::array_int32_field() { return m_array_int32_field; } @@ -1660,7 +1663,7 @@ std::array& ContentFilterTestType::array_int32_field() * @param _array_uint32_field New value to be copied in member array_uint32_field */ void ContentFilterTestType::array_uint32_field( - const std::array& _array_uint32_field) + const std::array& _array_uint32_field) { m_array_uint32_field = _array_uint32_field; } @@ -1670,7 +1673,7 @@ void ContentFilterTestType::array_uint32_field( * @param _array_uint32_field New value to be moved in member array_uint32_field */ void ContentFilterTestType::array_uint32_field( - std::array&& _array_uint32_field) + std::array&& _array_uint32_field) { m_array_uint32_field = std::move(_array_uint32_field); } @@ -1679,7 +1682,7 @@ void ContentFilterTestType::array_uint32_field( * @brief This function returns a constant reference to member array_uint32_field * @return Constant reference to member array_uint32_field */ -const std::array& ContentFilterTestType::array_uint32_field() const +const std::array& ContentFilterTestType::array_uint32_field() const { return m_array_uint32_field; } @@ -1688,7 +1691,7 @@ const std::array& ContentFilterTestType::array_uint32_field() const * @brief This function returns a reference to member array_uint32_field * @return Reference to member array_uint32_field */ -std::array& ContentFilterTestType::array_uint32_field() +std::array& ContentFilterTestType::array_uint32_field() { return m_array_uint32_field; } @@ -1699,7 +1702,7 @@ std::array& ContentFilterTestType::array_uint32_field() * @param _array_int64_field New value to be copied in member array_int64_field */ void ContentFilterTestType::array_int64_field( - const std::array& _array_int64_field) + const std::array& _array_int64_field) { m_array_int64_field = _array_int64_field; } @@ -1709,7 +1712,7 @@ void ContentFilterTestType::array_int64_field( * @param _array_int64_field New value to be moved in member array_int64_field */ void ContentFilterTestType::array_int64_field( - std::array&& _array_int64_field) + std::array&& _array_int64_field) { m_array_int64_field = std::move(_array_int64_field); } @@ -1718,7 +1721,7 @@ void ContentFilterTestType::array_int64_field( * @brief This function returns a constant reference to member array_int64_field * @return Constant reference to member array_int64_field */ -const std::array& ContentFilterTestType::array_int64_field() const +const std::array& ContentFilterTestType::array_int64_field() const { return m_array_int64_field; } @@ -1727,7 +1730,7 @@ const std::array& ContentFilterTestType::array_int64_field() const * @brief This function returns a reference to member array_int64_field * @return Reference to member array_int64_field */ -std::array& ContentFilterTestType::array_int64_field() +std::array& ContentFilterTestType::array_int64_field() { return m_array_int64_field; } @@ -1738,7 +1741,7 @@ std::array& ContentFilterTestType::array_int64_field() * @param _array_uint64_field New value to be copied in member array_uint64_field */ void ContentFilterTestType::array_uint64_field( - const std::array& _array_uint64_field) + const std::array& _array_uint64_field) { m_array_uint64_field = _array_uint64_field; } @@ -1748,7 +1751,7 @@ void ContentFilterTestType::array_uint64_field( * @param _array_uint64_field New value to be moved in member array_uint64_field */ void ContentFilterTestType::array_uint64_field( - std::array&& _array_uint64_field) + std::array&& _array_uint64_field) { m_array_uint64_field = std::move(_array_uint64_field); } @@ -1757,7 +1760,7 @@ void ContentFilterTestType::array_uint64_field( * @brief This function returns a constant reference to member array_uint64_field * @return Constant reference to member array_uint64_field */ -const std::array& ContentFilterTestType::array_uint64_field() const +const std::array& ContentFilterTestType::array_uint64_field() const { return m_array_uint64_field; } @@ -1766,7 +1769,7 @@ const std::array& ContentFilterTestType::array_uint64_field() const * @brief This function returns a reference to member array_uint64_field * @return Reference to member array_uint64_field */ -std::array& ContentFilterTestType::array_uint64_field() +std::array& ContentFilterTestType::array_uint64_field() { return m_array_uint64_field; } @@ -1777,7 +1780,7 @@ std::array& ContentFilterTestType::array_uint64_field() * @param _array_float_field New value to be copied in member array_float_field */ void ContentFilterTestType::array_float_field( - const std::array& _array_float_field) + const std::array& _array_float_field) { m_array_float_field = _array_float_field; } @@ -1787,7 +1790,7 @@ void ContentFilterTestType::array_float_field( * @param _array_float_field New value to be moved in member array_float_field */ void ContentFilterTestType::array_float_field( - std::array&& _array_float_field) + std::array&& _array_float_field) { m_array_float_field = std::move(_array_float_field); } @@ -1796,7 +1799,7 @@ void ContentFilterTestType::array_float_field( * @brief This function returns a constant reference to member array_float_field * @return Constant reference to member array_float_field */ -const std::array& ContentFilterTestType::array_float_field() const +const std::array& ContentFilterTestType::array_float_field() const { return m_array_float_field; } @@ -1805,7 +1808,7 @@ const std::array& ContentFilterTestType::array_float_field() const * @brief This function returns a reference to member array_float_field * @return Reference to member array_float_field */ -std::array& ContentFilterTestType::array_float_field() +std::array& ContentFilterTestType::array_float_field() { return m_array_float_field; } @@ -1816,7 +1819,7 @@ std::array& ContentFilterTestType::array_float_field() * @param _array_double_field New value to be copied in member array_double_field */ void ContentFilterTestType::array_double_field( - const std::array& _array_double_field) + const std::array& _array_double_field) { m_array_double_field = _array_double_field; } @@ -1826,7 +1829,7 @@ void ContentFilterTestType::array_double_field( * @param _array_double_field New value to be moved in member array_double_field */ void ContentFilterTestType::array_double_field( - std::array&& _array_double_field) + std::array&& _array_double_field) { m_array_double_field = std::move(_array_double_field); } @@ -1835,7 +1838,7 @@ void ContentFilterTestType::array_double_field( * @brief This function returns a constant reference to member array_double_field * @return Constant reference to member array_double_field */ -const std::array& ContentFilterTestType::array_double_field() const +const std::array& ContentFilterTestType::array_double_field() const { return m_array_double_field; } @@ -1844,7 +1847,7 @@ const std::array& ContentFilterTestType::array_double_field() const * @brief This function returns a reference to member array_double_field * @return Reference to member array_double_field */ -std::array& ContentFilterTestType::array_double_field() +std::array& ContentFilterTestType::array_double_field() { return m_array_double_field; } @@ -1855,7 +1858,7 @@ std::array& ContentFilterTestType::array_double_field() * @param _array_long_double_field New value to be copied in member array_long_double_field */ void ContentFilterTestType::array_long_double_field( - const std::array& _array_long_double_field) + const std::array& _array_long_double_field) { m_array_long_double_field = _array_long_double_field; } @@ -1865,7 +1868,7 @@ void ContentFilterTestType::array_long_double_field( * @param _array_long_double_field New value to be moved in member array_long_double_field */ void ContentFilterTestType::array_long_double_field( - std::array&& _array_long_double_field) + std::array&& _array_long_double_field) { m_array_long_double_field = std::move(_array_long_double_field); } @@ -1874,7 +1877,7 @@ void ContentFilterTestType::array_long_double_field( * @brief This function returns a constant reference to member array_long_double_field * @return Constant reference to member array_long_double_field */ -const std::array& ContentFilterTestType::array_long_double_field() const +const std::array& ContentFilterTestType::array_long_double_field() const { return m_array_long_double_field; } @@ -1883,7 +1886,7 @@ const std::array& ContentFilterTestType::array_long_double_field * @brief This function returns a reference to member array_long_double_field * @return Reference to member array_long_double_field */ -std::array& ContentFilterTestType::array_long_double_field() +std::array& ContentFilterTestType::array_long_double_field() { return m_array_long_double_field; } @@ -1894,7 +1897,7 @@ std::array& ContentFilterTestType::array_long_double_field() * @param _array_bool_field New value to be copied in member array_bool_field */ void ContentFilterTestType::array_bool_field( - const std::array& _array_bool_field) + const std::array& _array_bool_field) { m_array_bool_field = _array_bool_field; } @@ -1904,7 +1907,7 @@ void ContentFilterTestType::array_bool_field( * @param _array_bool_field New value to be moved in member array_bool_field */ void ContentFilterTestType::array_bool_field( - std::array&& _array_bool_field) + std::array&& _array_bool_field) { m_array_bool_field = std::move(_array_bool_field); } @@ -1913,7 +1916,7 @@ void ContentFilterTestType::array_bool_field( * @brief This function returns a constant reference to member array_bool_field * @return Constant reference to member array_bool_field */ -const std::array& ContentFilterTestType::array_bool_field() const +const std::array& ContentFilterTestType::array_bool_field() const { return m_array_bool_field; } @@ -1922,7 +1925,7 @@ const std::array& ContentFilterTestType::array_bool_field() const * @brief This function returns a reference to member array_bool_field * @return Reference to member array_bool_field */ -std::array& ContentFilterTestType::array_bool_field() +std::array& ContentFilterTestType::array_bool_field() { return m_array_bool_field; } @@ -1933,7 +1936,7 @@ std::array& ContentFilterTestType::array_bool_field() * @param _array_string_field New value to be copied in member array_string_field */ void ContentFilterTestType::array_string_field( - const std::array& _array_string_field) + const std::array& _array_string_field) { m_array_string_field = _array_string_field; } @@ -1943,7 +1946,7 @@ void ContentFilterTestType::array_string_field( * @param _array_string_field New value to be moved in member array_string_field */ void ContentFilterTestType::array_string_field( - std::array&& _array_string_field) + std::array&& _array_string_field) { m_array_string_field = std::move(_array_string_field); } @@ -1952,7 +1955,7 @@ void ContentFilterTestType::array_string_field( * @brief This function returns a constant reference to member array_string_field * @return Constant reference to member array_string_field */ -const std::array& ContentFilterTestType::array_string_field() const +const std::array& ContentFilterTestType::array_string_field() const { return m_array_string_field; } @@ -1961,7 +1964,7 @@ const std::array& ContentFilterTestType::array_string_field() co * @brief This function returns a reference to member array_string_field * @return Reference to member array_string_field */ -std::array& ContentFilterTestType::array_string_field() +std::array& ContentFilterTestType::array_string_field() { return m_array_string_field; } @@ -1972,7 +1975,7 @@ std::array& ContentFilterTestType::array_string_field() * @param _array_enum_field New value to be copied in member array_enum_field */ void ContentFilterTestType::array_enum_field( - const std::array& _array_enum_field) + const std::array& _array_enum_field) { m_array_enum_field = _array_enum_field; } @@ -1982,7 +1985,7 @@ void ContentFilterTestType::array_enum_field( * @param _array_enum_field New value to be moved in member array_enum_field */ void ContentFilterTestType::array_enum_field( - std::array&& _array_enum_field) + std::array&& _array_enum_field) { m_array_enum_field = std::move(_array_enum_field); } @@ -1991,7 +1994,7 @@ void ContentFilterTestType::array_enum_field( * @brief This function returns a constant reference to member array_enum_field * @return Constant reference to member array_enum_field */ -const std::array& ContentFilterTestType::array_enum_field() const +const std::array& ContentFilterTestType::array_enum_field() const { return m_array_enum_field; } @@ -2000,7 +2003,7 @@ const std::array& ContentFilterTestType::array_enum_field() const * @brief This function returns a reference to member array_enum_field * @return Reference to member array_enum_field */ -std::array& ContentFilterTestType::array_enum_field() +std::array& ContentFilterTestType::array_enum_field() { return m_array_enum_field; } @@ -2011,7 +2014,7 @@ std::array& ContentFilterTestType::array_enum_field() * @param _array_enum2_field New value to be copied in member array_enum2_field */ void ContentFilterTestType::array_enum2_field( - const std::array& _array_enum2_field) + const std::array& _array_enum2_field) { m_array_enum2_field = _array_enum2_field; } @@ -2021,7 +2024,7 @@ void ContentFilterTestType::array_enum2_field( * @param _array_enum2_field New value to be moved in member array_enum2_field */ void ContentFilterTestType::array_enum2_field( - std::array&& _array_enum2_field) + std::array&& _array_enum2_field) { m_array_enum2_field = std::move(_array_enum2_field); } @@ -2030,7 +2033,7 @@ void ContentFilterTestType::array_enum2_field( * @brief This function returns a constant reference to member array_enum2_field * @return Constant reference to member array_enum2_field */ -const std::array& ContentFilterTestType::array_enum2_field() const +const std::array& ContentFilterTestType::array_enum2_field() const { return m_array_enum2_field; } @@ -2039,7 +2042,7 @@ const std::array& ContentFilterTestType::array_enum2_field() const * @brief This function returns a reference to member array_enum2_field * @return Reference to member array_enum2_field */ -std::array& ContentFilterTestType::array_enum2_field() +std::array& ContentFilterTestType::array_enum2_field() { return m_array_enum2_field; } @@ -2050,7 +2053,7 @@ std::array& ContentFilterTestType::array_enum2_field() * @param _array_struct_field New value to be copied in member array_struct_field */ void ContentFilterTestType::array_struct_field( - const std::array& _array_struct_field) + const std::array& _array_struct_field) { m_array_struct_field = _array_struct_field; } @@ -2060,7 +2063,7 @@ void ContentFilterTestType::array_struct_field( * @param _array_struct_field New value to be moved in member array_struct_field */ void ContentFilterTestType::array_struct_field( - std::array&& _array_struct_field) + std::array&& _array_struct_field) { m_array_struct_field = std::move(_array_struct_field); } @@ -2069,7 +2072,7 @@ void ContentFilterTestType::array_struct_field( * @brief This function returns a constant reference to member array_struct_field * @return Constant reference to member array_struct_field */ -const std::array& ContentFilterTestType::array_struct_field() const +const std::array& ContentFilterTestType::array_struct_field() const { return m_array_struct_field; } @@ -2078,7 +2081,7 @@ const std::array& ContentFilterTestType::array_struct_field() con * @brief This function returns a reference to member array_struct_field * @return Reference to member array_struct_field */ -std::array& ContentFilterTestType::array_struct_field() +std::array& ContentFilterTestType::array_struct_field() { return m_array_struct_field; } @@ -3334,3 +3337,5 @@ std::vector& ContentFilterTestType::unbounded_sequence_struct_field( // Include auxiliary functions like for serializing/deserializing. #include "ContentFilterTestTypeCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h index 261e823c6db..898fe5080b4 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "ContentFilterTestTypev1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ #define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -91,6 +97,8 @@ enum Material : uint32_t CONCRETE, STONE }; + + /*! * @brief This class represents the structure StructType defined by the user in the IDL file. * @ingroup ContentFilterTestType @@ -478,6 +486,10 @@ class StructType }; const uint32_t max_array_size = 3; const uint32_t max_seq_size = 5; + + + + /*! * @brief This class represents the structure ContentFilterTestType defined by the user in the IDL file. * @ingroup ContentFilterTestType @@ -877,26 +889,26 @@ class ContentFilterTestType * @param _array_char_field New value to be copied in member array_char_field */ eProsima_user_DllExport void array_char_field( - const std::array& _array_char_field); + const std::array& _array_char_field); /*! * @brief This function moves the value in member array_char_field * @param _array_char_field New value to be moved in member array_char_field */ eProsima_user_DllExport void array_char_field( - std::array&& _array_char_field); + std::array&& _array_char_field); /*! * @brief This function returns a constant reference to member array_char_field * @return Constant reference to member array_char_field */ - eProsima_user_DllExport const std::array& array_char_field() const; + eProsima_user_DllExport const std::array& array_char_field() const; /*! * @brief This function returns a reference to member array_char_field * @return Reference to member array_char_field */ - eProsima_user_DllExport std::array& array_char_field(); + eProsima_user_DllExport std::array& array_char_field(); /*! @@ -904,26 +916,26 @@ class ContentFilterTestType * @param _array_uint8_field New value to be copied in member array_uint8_field */ eProsima_user_DllExport void array_uint8_field( - const std::array& _array_uint8_field); + const std::array& _array_uint8_field); /*! * @brief This function moves the value in member array_uint8_field * @param _array_uint8_field New value to be moved in member array_uint8_field */ eProsima_user_DllExport void array_uint8_field( - std::array&& _array_uint8_field); + std::array&& _array_uint8_field); /*! * @brief This function returns a constant reference to member array_uint8_field * @return Constant reference to member array_uint8_field */ - eProsima_user_DllExport const std::array& array_uint8_field() const; + eProsima_user_DllExport const std::array& array_uint8_field() const; /*! * @brief This function returns a reference to member array_uint8_field * @return Reference to member array_uint8_field */ - eProsima_user_DllExport std::array& array_uint8_field(); + eProsima_user_DllExport std::array& array_uint8_field(); /*! @@ -931,26 +943,26 @@ class ContentFilterTestType * @param _array_int16_field New value to be copied in member array_int16_field */ eProsima_user_DllExport void array_int16_field( - const std::array& _array_int16_field); + const std::array& _array_int16_field); /*! * @brief This function moves the value in member array_int16_field * @param _array_int16_field New value to be moved in member array_int16_field */ eProsima_user_DllExport void array_int16_field( - std::array&& _array_int16_field); + std::array&& _array_int16_field); /*! * @brief This function returns a constant reference to member array_int16_field * @return Constant reference to member array_int16_field */ - eProsima_user_DllExport const std::array& array_int16_field() const; + eProsima_user_DllExport const std::array& array_int16_field() const; /*! * @brief This function returns a reference to member array_int16_field * @return Reference to member array_int16_field */ - eProsima_user_DllExport std::array& array_int16_field(); + eProsima_user_DllExport std::array& array_int16_field(); /*! @@ -958,26 +970,26 @@ class ContentFilterTestType * @param _array_uint16_field New value to be copied in member array_uint16_field */ eProsima_user_DllExport void array_uint16_field( - const std::array& _array_uint16_field); + const std::array& _array_uint16_field); /*! * @brief This function moves the value in member array_uint16_field * @param _array_uint16_field New value to be moved in member array_uint16_field */ eProsima_user_DllExport void array_uint16_field( - std::array&& _array_uint16_field); + std::array&& _array_uint16_field); /*! * @brief This function returns a constant reference to member array_uint16_field * @return Constant reference to member array_uint16_field */ - eProsima_user_DllExport const std::array& array_uint16_field() const; + eProsima_user_DllExport const std::array& array_uint16_field() const; /*! * @brief This function returns a reference to member array_uint16_field * @return Reference to member array_uint16_field */ - eProsima_user_DllExport std::array& array_uint16_field(); + eProsima_user_DllExport std::array& array_uint16_field(); /*! @@ -985,26 +997,26 @@ class ContentFilterTestType * @param _array_int32_field New value to be copied in member array_int32_field */ eProsima_user_DllExport void array_int32_field( - const std::array& _array_int32_field); + const std::array& _array_int32_field); /*! * @brief This function moves the value in member array_int32_field * @param _array_int32_field New value to be moved in member array_int32_field */ eProsima_user_DllExport void array_int32_field( - std::array&& _array_int32_field); + std::array&& _array_int32_field); /*! * @brief This function returns a constant reference to member array_int32_field * @return Constant reference to member array_int32_field */ - eProsima_user_DllExport const std::array& array_int32_field() const; + eProsima_user_DllExport const std::array& array_int32_field() const; /*! * @brief This function returns a reference to member array_int32_field * @return Reference to member array_int32_field */ - eProsima_user_DllExport std::array& array_int32_field(); + eProsima_user_DllExport std::array& array_int32_field(); /*! @@ -1012,26 +1024,26 @@ class ContentFilterTestType * @param _array_uint32_field New value to be copied in member array_uint32_field */ eProsima_user_DllExport void array_uint32_field( - const std::array& _array_uint32_field); + const std::array& _array_uint32_field); /*! * @brief This function moves the value in member array_uint32_field * @param _array_uint32_field New value to be moved in member array_uint32_field */ eProsima_user_DllExport void array_uint32_field( - std::array&& _array_uint32_field); + std::array&& _array_uint32_field); /*! * @brief This function returns a constant reference to member array_uint32_field * @return Constant reference to member array_uint32_field */ - eProsima_user_DllExport const std::array& array_uint32_field() const; + eProsima_user_DllExport const std::array& array_uint32_field() const; /*! * @brief This function returns a reference to member array_uint32_field * @return Reference to member array_uint32_field */ - eProsima_user_DllExport std::array& array_uint32_field(); + eProsima_user_DllExport std::array& array_uint32_field(); /*! @@ -1039,26 +1051,26 @@ class ContentFilterTestType * @param _array_int64_field New value to be copied in member array_int64_field */ eProsima_user_DllExport void array_int64_field( - const std::array& _array_int64_field); + const std::array& _array_int64_field); /*! * @brief This function moves the value in member array_int64_field * @param _array_int64_field New value to be moved in member array_int64_field */ eProsima_user_DllExport void array_int64_field( - std::array&& _array_int64_field); + std::array&& _array_int64_field); /*! * @brief This function returns a constant reference to member array_int64_field * @return Constant reference to member array_int64_field */ - eProsima_user_DllExport const std::array& array_int64_field() const; + eProsima_user_DllExport const std::array& array_int64_field() const; /*! * @brief This function returns a reference to member array_int64_field * @return Reference to member array_int64_field */ - eProsima_user_DllExport std::array& array_int64_field(); + eProsima_user_DllExport std::array& array_int64_field(); /*! @@ -1066,26 +1078,26 @@ class ContentFilterTestType * @param _array_uint64_field New value to be copied in member array_uint64_field */ eProsima_user_DllExport void array_uint64_field( - const std::array& _array_uint64_field); + const std::array& _array_uint64_field); /*! * @brief This function moves the value in member array_uint64_field * @param _array_uint64_field New value to be moved in member array_uint64_field */ eProsima_user_DllExport void array_uint64_field( - std::array&& _array_uint64_field); + std::array&& _array_uint64_field); /*! * @brief This function returns a constant reference to member array_uint64_field * @return Constant reference to member array_uint64_field */ - eProsima_user_DllExport const std::array& array_uint64_field() const; + eProsima_user_DllExport const std::array& array_uint64_field() const; /*! * @brief This function returns a reference to member array_uint64_field * @return Reference to member array_uint64_field */ - eProsima_user_DllExport std::array& array_uint64_field(); + eProsima_user_DllExport std::array& array_uint64_field(); /*! @@ -1093,26 +1105,26 @@ class ContentFilterTestType * @param _array_float_field New value to be copied in member array_float_field */ eProsima_user_DllExport void array_float_field( - const std::array& _array_float_field); + const std::array& _array_float_field); /*! * @brief This function moves the value in member array_float_field * @param _array_float_field New value to be moved in member array_float_field */ eProsima_user_DllExport void array_float_field( - std::array&& _array_float_field); + std::array&& _array_float_field); /*! * @brief This function returns a constant reference to member array_float_field * @return Constant reference to member array_float_field */ - eProsima_user_DllExport const std::array& array_float_field() const; + eProsima_user_DllExport const std::array& array_float_field() const; /*! * @brief This function returns a reference to member array_float_field * @return Reference to member array_float_field */ - eProsima_user_DllExport std::array& array_float_field(); + eProsima_user_DllExport std::array& array_float_field(); /*! @@ -1120,26 +1132,26 @@ class ContentFilterTestType * @param _array_double_field New value to be copied in member array_double_field */ eProsima_user_DllExport void array_double_field( - const std::array& _array_double_field); + const std::array& _array_double_field); /*! * @brief This function moves the value in member array_double_field * @param _array_double_field New value to be moved in member array_double_field */ eProsima_user_DllExport void array_double_field( - std::array&& _array_double_field); + std::array&& _array_double_field); /*! * @brief This function returns a constant reference to member array_double_field * @return Constant reference to member array_double_field */ - eProsima_user_DllExport const std::array& array_double_field() const; + eProsima_user_DllExport const std::array& array_double_field() const; /*! * @brief This function returns a reference to member array_double_field * @return Reference to member array_double_field */ - eProsima_user_DllExport std::array& array_double_field(); + eProsima_user_DllExport std::array& array_double_field(); /*! @@ -1147,26 +1159,26 @@ class ContentFilterTestType * @param _array_long_double_field New value to be copied in member array_long_double_field */ eProsima_user_DllExport void array_long_double_field( - const std::array& _array_long_double_field); + const std::array& _array_long_double_field); /*! * @brief This function moves the value in member array_long_double_field * @param _array_long_double_field New value to be moved in member array_long_double_field */ eProsima_user_DllExport void array_long_double_field( - std::array&& _array_long_double_field); + std::array&& _array_long_double_field); /*! * @brief This function returns a constant reference to member array_long_double_field * @return Constant reference to member array_long_double_field */ - eProsima_user_DllExport const std::array& array_long_double_field() const; + eProsima_user_DllExport const std::array& array_long_double_field() const; /*! * @brief This function returns a reference to member array_long_double_field * @return Reference to member array_long_double_field */ - eProsima_user_DllExport std::array& array_long_double_field(); + eProsima_user_DllExport std::array& array_long_double_field(); /*! @@ -1174,26 +1186,26 @@ class ContentFilterTestType * @param _array_bool_field New value to be copied in member array_bool_field */ eProsima_user_DllExport void array_bool_field( - const std::array& _array_bool_field); + const std::array& _array_bool_field); /*! * @brief This function moves the value in member array_bool_field * @param _array_bool_field New value to be moved in member array_bool_field */ eProsima_user_DllExport void array_bool_field( - std::array&& _array_bool_field); + std::array&& _array_bool_field); /*! * @brief This function returns a constant reference to member array_bool_field * @return Constant reference to member array_bool_field */ - eProsima_user_DllExport const std::array& array_bool_field() const; + eProsima_user_DllExport const std::array& array_bool_field() const; /*! * @brief This function returns a reference to member array_bool_field * @return Reference to member array_bool_field */ - eProsima_user_DllExport std::array& array_bool_field(); + eProsima_user_DllExport std::array& array_bool_field(); /*! @@ -1201,26 +1213,26 @@ class ContentFilterTestType * @param _array_string_field New value to be copied in member array_string_field */ eProsima_user_DllExport void array_string_field( - const std::array& _array_string_field); + const std::array& _array_string_field); /*! * @brief This function moves the value in member array_string_field * @param _array_string_field New value to be moved in member array_string_field */ eProsima_user_DllExport void array_string_field( - std::array&& _array_string_field); + std::array&& _array_string_field); /*! * @brief This function returns a constant reference to member array_string_field * @return Constant reference to member array_string_field */ - eProsima_user_DllExport const std::array& array_string_field() const; + eProsima_user_DllExport const std::array& array_string_field() const; /*! * @brief This function returns a reference to member array_string_field * @return Reference to member array_string_field */ - eProsima_user_DllExport std::array& array_string_field(); + eProsima_user_DllExport std::array& array_string_field(); /*! @@ -1228,26 +1240,26 @@ class ContentFilterTestType * @param _array_enum_field New value to be copied in member array_enum_field */ eProsima_user_DllExport void array_enum_field( - const std::array& _array_enum_field); + const std::array& _array_enum_field); /*! * @brief This function moves the value in member array_enum_field * @param _array_enum_field New value to be moved in member array_enum_field */ eProsima_user_DllExport void array_enum_field( - std::array&& _array_enum_field); + std::array&& _array_enum_field); /*! * @brief This function returns a constant reference to member array_enum_field * @return Constant reference to member array_enum_field */ - eProsima_user_DllExport const std::array& array_enum_field() const; + eProsima_user_DllExport const std::array& array_enum_field() const; /*! * @brief This function returns a reference to member array_enum_field * @return Reference to member array_enum_field */ - eProsima_user_DllExport std::array& array_enum_field(); + eProsima_user_DllExport std::array& array_enum_field(); /*! @@ -1255,26 +1267,26 @@ class ContentFilterTestType * @param _array_enum2_field New value to be copied in member array_enum2_field */ eProsima_user_DllExport void array_enum2_field( - const std::array& _array_enum2_field); + const std::array& _array_enum2_field); /*! * @brief This function moves the value in member array_enum2_field * @param _array_enum2_field New value to be moved in member array_enum2_field */ eProsima_user_DllExport void array_enum2_field( - std::array&& _array_enum2_field); + std::array&& _array_enum2_field); /*! * @brief This function returns a constant reference to member array_enum2_field * @return Constant reference to member array_enum2_field */ - eProsima_user_DllExport const std::array& array_enum2_field() const; + eProsima_user_DllExport const std::array& array_enum2_field() const; /*! * @brief This function returns a reference to member array_enum2_field * @return Reference to member array_enum2_field */ - eProsima_user_DllExport std::array& array_enum2_field(); + eProsima_user_DllExport std::array& array_enum2_field(); /*! @@ -1282,26 +1294,26 @@ class ContentFilterTestType * @param _array_struct_field New value to be copied in member array_struct_field */ eProsima_user_DllExport void array_struct_field( - const std::array& _array_struct_field); + const std::array& _array_struct_field); /*! * @brief This function moves the value in member array_struct_field * @param _array_struct_field New value to be moved in member array_struct_field */ eProsima_user_DllExport void array_struct_field( - std::array&& _array_struct_field); + std::array&& _array_struct_field); /*! * @brief This function returns a constant reference to member array_struct_field * @return Constant reference to member array_struct_field */ - eProsima_user_DllExport const std::array& array_struct_field() const; + eProsima_user_DllExport const std::array& array_struct_field() const; /*! * @brief This function returns a reference to member array_struct_field * @return Reference to member array_struct_field */ - eProsima_user_DllExport std::array& array_struct_field(); + eProsima_user_DllExport std::array& array_struct_field(); /*! @@ -2185,22 +2197,22 @@ class ContentFilterTestType Color m_enum_field{::RED}; Material m_enum2_field{::WOOD}; StructType m_struct_field; - std::array m_array_char_field{0}; - std::array m_array_uint8_field{0}; - std::array m_array_int16_field{0}; - std::array m_array_uint16_field{0}; - std::array m_array_int32_field{0}; - std::array m_array_uint32_field{0}; - std::array m_array_int64_field{0}; - std::array m_array_uint64_field{0}; - std::array m_array_float_field{0.0}; - std::array m_array_double_field{0.0}; - std::array m_array_long_double_field{0.0}; - std::array m_array_bool_field{false}; - std::array m_array_string_field; - std::array m_array_enum_field{::RED}; - std::array m_array_enum2_field{::WOOD}; - std::array m_array_struct_field; + std::array m_array_char_field{0}; + std::array m_array_uint8_field{0}; + std::array m_array_int16_field{0}; + std::array m_array_uint16_field{0}; + std::array m_array_int32_field{0}; + std::array m_array_uint32_field{0}; + std::array m_array_int64_field{0}; + std::array m_array_uint64_field{0}; + std::array m_array_float_field{0.0}; + std::array m_array_double_field{0.0}; + std::array m_array_long_double_field{0.0}; + std::array m_array_bool_field{false}; + std::array m_array_string_field; + std::array m_array_enum_field{::RED}; + std::array m_array_enum2_field{::WOOD}; + std::array m_array_struct_field; std::vector m_bounded_sequence_char_field; std::vector m_bounded_sequence_uint8_field; std::vector m_bounded_sequence_int16_field; @@ -2238,3 +2250,6 @@ class ContentFilterTestType #endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp index ed679a6dfac..f1ae8c42f15 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.hpp @@ -39,12 +39,20 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StructType& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ContentFilterTestType& data); @@ -53,4 +61,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_HPP_ + diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp index 45bec9e86c9..6e0b9053b9d 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -129,7 +131,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(13) << data.enum_field() << eprosima::fastcdr::MemberId(14) << data.enum2_field() ; - scdr.end_serialize_type(current_state); } @@ -225,6 +226,12 @@ void serialize_key( + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -516,7 +523,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(62) << data.unbounded_sequence_enum2_field() << eprosima::fastcdr::MemberId(63) << data.unbounded_sequence_struct_field() ; - scdr.end_serialize_type(current_state); } @@ -810,4 +816,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPECDRAUX_IPP_ + diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx index 8339398a756..c4bd34e1232 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "ContentFilterTestTypePubSubTypes.h" #include "ContentFilterTestTypeCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + StructTypePubSubType::StructTypePubSubType() { setName("StructType"); - uint32_t type_size = StructType_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructType::getMaxCdrSerializedSize()); +#else + StructType_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool StructTypePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool StructTypePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool StructTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function StructTypePubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool StructTypePubSubType::getKey( StructType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StructType_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -185,10 +221,21 @@ bool StructTypePubSubType::getKey( + + + + + + ContentFilterTestTypePubSubType::ContentFilterTestTypePubSubType() { setName("ContentFilterTestType"); - uint32_t type_size = ContentFilterTestType_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ContentFilterTestType::getMaxCdrSerializedSize()); +#else + ContentFilterTestType_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -219,10 +266,12 @@ bool ContentFilterTestTypePubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -237,7 +286,11 @@ bool ContentFilterTestTypePubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -254,7 +307,11 @@ bool ContentFilterTestTypePubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -277,13 +334,26 @@ std::function ContentFilterTestTypePubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -315,12 +385,20 @@ bool ContentFilterTestTypePubSubType::getKey( ContentFilterTestType_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ContentFilterTestType_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h index 3245cbfe920..776f184b73e 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypePubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type StructType defined by the user in the IDL file. * @ingroup ContentFilterTestType @@ -128,6 +130,12 @@ class StructTypePubSubType : public eprosima::fastdds::dds::TopicDataType + + + + + + /*! * @brief This class represents the TopicDataType of the type ContentFilterTestType defined by the user in the IDL file. * @ingroup ContentFilterTestType diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx index f59b204fdd0..c9ec87ccb80 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -219,7 +217,11 @@ const TypeObject* GetMinimalColorObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -337,7 +339,11 @@ const TypeObject* GetCompleteColorObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -496,7 +502,11 @@ const TypeObject* GetMinimalMaterialObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -614,7 +624,11 @@ const TypeObject* GetCompleteMaterialObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -628,6 +642,8 @@ const TypeObject* GetCompleteMaterialObject() return TypeObjectFactory::get_instance()->get_type_object("Material", true); } + + const TypeIdentifier* GetStructTypeIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructType", complete); @@ -961,7 +977,6 @@ const TypeObject* GetMinimalStructTypeObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -977,7 +992,11 @@ const TypeObject* GetMinimalStructTypeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1251,7 +1270,6 @@ const TypeObject* GetCompleteStructTypeObject() // Header type_object->complete().struct_type().header().detail().type_name("StructType"); // TODO inheritance - { AppliedAnnotation ann; //ann.annotation_typeid(GetnestedIdentifier(true)); @@ -1289,7 +1307,11 @@ const TypeObject* GetCompleteStructTypeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1305,6 +1327,12 @@ const TypeObject* GetCompleteStructTypeObject() + + + + + + const TypeIdentifier* GetContentFilterTestTypeIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ContentFilterTestType", complete); @@ -1660,7 +1688,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_char_field.common().member_flags().IS_KEY(false); mst_array_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {3}, false)); + mst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {max_array_size}, false)); MD5 array_char_field_hash("array_char_field"); for(int i = 0; i < 4; ++i) @@ -1678,7 +1706,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_uint8_field.common().member_flags().IS_KEY(false); mst_array_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {3}, false)); + mst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {max_array_size}, false)); MD5 array_uint8_field_hash("array_uint8_field"); for(int i = 0; i < 4; ++i) @@ -1696,7 +1724,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_int16_field.common().member_flags().IS_KEY(false); mst_array_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {3}, false)); + mst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {max_array_size}, false)); MD5 array_int16_field_hash("array_int16_field"); for(int i = 0; i < 4; ++i) @@ -1714,7 +1742,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_uint16_field.common().member_flags().IS_KEY(false); mst_array_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {3}, false)); + mst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {max_array_size}, false)); MD5 array_uint16_field_hash("array_uint16_field"); for(int i = 0; i < 4; ++i) @@ -1732,7 +1760,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_int32_field.common().member_flags().IS_KEY(false); mst_array_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {3}, false)); + mst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {max_array_size}, false)); MD5 array_int32_field_hash("array_int32_field"); for(int i = 0; i < 4; ++i) @@ -1750,7 +1778,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_uint32_field.common().member_flags().IS_KEY(false); mst_array_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {3}, false)); + mst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {max_array_size}, false)); MD5 array_uint32_field_hash("array_uint32_field"); for(int i = 0; i < 4; ++i) @@ -1768,7 +1796,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_int64_field.common().member_flags().IS_KEY(false); mst_array_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {3}, false)); + mst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {max_array_size}, false)); MD5 array_int64_field_hash("array_int64_field"); for(int i = 0; i < 4; ++i) @@ -1786,7 +1814,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_uint64_field.common().member_flags().IS_KEY(false); mst_array_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {3}, false)); + mst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {max_array_size}, false)); MD5 array_uint64_field_hash("array_uint64_field"); for(int i = 0; i < 4; ++i) @@ -1804,7 +1832,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_float_field.common().member_flags().IS_KEY(false); mst_array_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {3}, false)); + mst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {max_array_size}, false)); MD5 array_float_field_hash("array_float_field"); for(int i = 0; i < 4; ++i) @@ -1822,7 +1850,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_double_field.common().member_flags().IS_KEY(false); mst_array_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {3}, false)); + mst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {max_array_size}, false)); MD5 array_double_field_hash("array_double_field"); for(int i = 0; i < 4; ++i) @@ -1840,7 +1868,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_long_double_field.common().member_flags().IS_KEY(false); mst_array_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {3}, false)); + mst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {max_array_size}, false)); MD5 array_long_double_field_hash("array_long_double_field"); for(int i = 0; i < 4; ++i) @@ -1858,7 +1886,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_bool_field.common().member_flags().IS_KEY(false); mst_array_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {3}, false)); + mst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {max_array_size}, false)); MD5 array_bool_field_hash("array_bool_field"); for(int i = 0; i < 4; ++i) @@ -1876,7 +1904,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_string_field.common().member_flags().IS_KEY(false); mst_array_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {3}, false)); + mst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {max_array_size}, false)); MD5 array_string_field_hash("array_string_field"); for(int i = 0; i < 4; ++i) @@ -1894,7 +1922,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_enum_field.common().member_flags().IS_KEY(false); mst_array_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {3}, false)); + mst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {max_array_size}, false)); MD5 array_enum_field_hash("array_enum_field"); for(int i = 0; i < 4; ++i) @@ -1912,7 +1940,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_enum2_field.common().member_flags().IS_KEY(false); mst_array_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {3}, false)); + mst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {max_array_size}, false)); MD5 array_enum2_field_hash("array_enum2_field"); for(int i = 0; i < 4; ++i) @@ -1930,7 +1958,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_array_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_array_struct_field.common().member_flags().IS_KEY(false); mst_array_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {3}, false)); + mst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {max_array_size}, false)); MD5 array_struct_field_hash("array_struct_field"); for(int i = 0; i < 4; ++i) @@ -1948,7 +1976,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_char_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", 5, false)); + mst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", max_seq_size, false)); MD5 bounded_sequence_char_field_hash("bounded_sequence_char_field"); for(int i = 0; i < 4; ++i) @@ -1966,7 +1994,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_uint8_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 5, false)); + mst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", max_seq_size, false)); MD5 bounded_sequence_uint8_field_hash("bounded_sequence_uint8_field"); for(int i = 0; i < 4; ++i) @@ -1984,7 +2012,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_int16_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", 5, false)); + mst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", max_seq_size, false)); MD5 bounded_sequence_int16_field_hash("bounded_sequence_int16_field"); for(int i = 0; i < 4; ++i) @@ -2002,7 +2030,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_uint16_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", 5, false)); + mst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", max_seq_size, false)); MD5 bounded_sequence_uint16_field_hash("bounded_sequence_uint16_field"); for(int i = 0; i < 4; ++i) @@ -2020,7 +2048,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_int32_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 5, false)); + mst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", max_seq_size, false)); MD5 bounded_sequence_int32_field_hash("bounded_sequence_int32_field"); for(int i = 0; i < 4; ++i) @@ -2038,7 +2066,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_uint32_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", 5, false)); + mst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", max_seq_size, false)); MD5 bounded_sequence_uint32_field_hash("bounded_sequence_uint32_field"); for(int i = 0; i < 4; ++i) @@ -2056,7 +2084,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_int64_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", 5, false)); + mst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", max_seq_size, false)); MD5 bounded_sequence_int64_field_hash("bounded_sequence_int64_field"); for(int i = 0; i < 4; ++i) @@ -2074,7 +2102,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_uint64_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", 5, false)); + mst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", max_seq_size, false)); MD5 bounded_sequence_uint64_field_hash("bounded_sequence_uint64_field"); for(int i = 0; i < 4; ++i) @@ -2092,7 +2120,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_float_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", 5, false)); + mst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", max_seq_size, false)); MD5 bounded_sequence_float_field_hash("bounded_sequence_float_field"); for(int i = 0; i < 4; ++i) @@ -2110,7 +2138,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_double_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", 5, false)); + mst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", max_seq_size, false)); MD5 bounded_sequence_double_field_hash("bounded_sequence_double_field"); for(int i = 0; i < 4; ++i) @@ -2128,7 +2156,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_long_double_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", 5, false)); + mst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", max_seq_size, false)); MD5 bounded_sequence_long_double_field_hash("bounded_sequence_long_double_field"); for(int i = 0; i < 4; ++i) @@ -2146,7 +2174,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_bool_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", 5, false)); + mst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", max_seq_size, false)); MD5 bounded_sequence_bool_field_hash("bounded_sequence_bool_field"); for(int i = 0; i < 4; ++i) @@ -2164,7 +2192,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_string_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), 5, false)); + mst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), max_seq_size, false)); MD5 bounded_sequence_string_field_hash("bounded_sequence_string_field"); for(int i = 0; i < 4; ++i) @@ -2182,7 +2210,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_enum_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", 5, false)); + mst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", max_seq_size, false)); MD5 bounded_sequence_enum_field_hash("bounded_sequence_enum_field"); for(int i = 0; i < 4; ++i) @@ -2200,7 +2228,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_enum2_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", 5, false)); + mst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", max_seq_size, false)); MD5 bounded_sequence_enum2_field_hash("bounded_sequence_enum2_field"); for(int i = 0; i < 4; ++i) @@ -2218,7 +2246,7 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() mst_bounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); mst_bounded_sequence_struct_field.common().member_flags().IS_KEY(false); mst_bounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", 5, false)); + mst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", max_seq_size, false)); MD5 bounded_sequence_struct_field_hash("bounded_sequence_struct_field"); for(int i = 0; i < 4; ++i) @@ -2520,7 +2548,6 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2536,7 +2563,11 @@ const TypeObject* GetMinimalContentFilterTestTypeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2830,7 +2861,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_char_field.common().member_flags().IS_KEY(false); cst_array_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {3}, true)); + cst_array_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("char", {max_array_size}, true)); cst_array_char_field.detail().name("array_char_field"); @@ -2845,7 +2876,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_uint8_field.common().member_flags().IS_KEY(false); cst_array_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {3}, true)); + cst_array_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {max_array_size}, true)); cst_array_uint8_field.detail().name("array_uint8_field"); @@ -2860,7 +2891,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_int16_field.common().member_flags().IS_KEY(false); cst_array_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {3}, true)); + cst_array_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int16_t", {max_array_size}, true)); cst_array_int16_field.detail().name("array_int16_field"); @@ -2875,7 +2906,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_uint16_field.common().member_flags().IS_KEY(false); cst_array_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {3}, true)); + cst_array_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint16_t", {max_array_size}, true)); cst_array_uint16_field.detail().name("array_uint16_field"); @@ -2890,7 +2921,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_int32_field.common().member_flags().IS_KEY(false); cst_array_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {3}, true)); + cst_array_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {max_array_size}, true)); cst_array_int32_field.detail().name("array_int32_field"); @@ -2905,7 +2936,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_uint32_field.common().member_flags().IS_KEY(false); cst_array_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {3}, true)); + cst_array_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint32_t", {max_array_size}, true)); cst_array_uint32_field.detail().name("array_uint32_field"); @@ -2920,7 +2951,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_int64_field.common().member_flags().IS_KEY(false); cst_array_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {3}, true)); + cst_array_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int64_t", {max_array_size}, true)); cst_array_int64_field.detail().name("array_int64_field"); @@ -2935,7 +2966,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_uint64_field.common().member_flags().IS_KEY(false); cst_array_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {3}, true)); + cst_array_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint64_t", {max_array_size}, true)); cst_array_uint64_field.detail().name("array_uint64_field"); @@ -2950,7 +2981,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_float_field.common().member_flags().IS_KEY(false); cst_array_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {3}, true)); + cst_array_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("float", {max_array_size}, true)); cst_array_float_field.detail().name("array_float_field"); @@ -2965,7 +2996,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_double_field.common().member_flags().IS_KEY(false); cst_array_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {3}, true)); + cst_array_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("double", {max_array_size}, true)); cst_array_double_field.detail().name("array_double_field"); @@ -2980,7 +3011,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_long_double_field.common().member_flags().IS_KEY(false); cst_array_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {3}, true)); + cst_array_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("longdouble", {max_array_size}, true)); cst_array_long_double_field.detail().name("array_long_double_field"); @@ -2995,7 +3026,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_bool_field.common().member_flags().IS_KEY(false); cst_array_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {3}, true)); + cst_array_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("bool", {max_array_size}, true)); cst_array_bool_field.detail().name("array_bool_field"); @@ -3010,7 +3041,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_string_field.common().member_flags().IS_KEY(false); cst_array_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {3}, true)); + cst_array_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier(TypeNamesGenerator::get_string_type_name(255, false), {max_array_size}, true)); cst_array_string_field.detail().name("array_string_field"); @@ -3025,7 +3056,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_enum_field.common().member_flags().IS_KEY(false); cst_array_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {3}, true)); + cst_array_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Color", {max_array_size}, true)); cst_array_enum_field.detail().name("array_enum_field"); @@ -3040,7 +3071,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_enum2_field.common().member_flags().IS_KEY(false); cst_array_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {3}, true)); + cst_array_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("Material", {max_array_size}, true)); cst_array_enum2_field.detail().name("array_enum2_field"); @@ -3055,7 +3086,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_array_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_array_struct_field.common().member_flags().IS_KEY(false); cst_array_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {3}, true)); + cst_array_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("StructType", {max_array_size}, true)); cst_array_struct_field.detail().name("array_struct_field"); @@ -3070,7 +3101,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_char_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_char_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_char_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", 5, true)); + cst_bounded_sequence_char_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("char", max_seq_size, true)); cst_bounded_sequence_char_field.detail().name("bounded_sequence_char_field"); @@ -3085,7 +3116,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_uint8_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_uint8_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_uint8_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 5, true)); + cst_bounded_sequence_uint8_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", max_seq_size, true)); cst_bounded_sequence_uint8_field.detail().name("bounded_sequence_uint8_field"); @@ -3100,7 +3131,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_int16_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_int16_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_int16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", 5, true)); + cst_bounded_sequence_int16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int16_t", max_seq_size, true)); cst_bounded_sequence_int16_field.detail().name("bounded_sequence_int16_field"); @@ -3115,7 +3146,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_uint16_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_uint16_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_uint16_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", 5, true)); + cst_bounded_sequence_uint16_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint16_t", max_seq_size, true)); cst_bounded_sequence_uint16_field.detail().name("bounded_sequence_uint16_field"); @@ -3130,7 +3161,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_int32_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_int32_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_int32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 5, true)); + cst_bounded_sequence_int32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", max_seq_size, true)); cst_bounded_sequence_int32_field.detail().name("bounded_sequence_int32_field"); @@ -3145,7 +3176,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_uint32_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_uint32_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_uint32_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", 5, true)); + cst_bounded_sequence_uint32_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint32_t", max_seq_size, true)); cst_bounded_sequence_uint32_field.detail().name("bounded_sequence_uint32_field"); @@ -3160,7 +3191,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_int64_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_int64_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_int64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", 5, true)); + cst_bounded_sequence_int64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int64_t", max_seq_size, true)); cst_bounded_sequence_int64_field.detail().name("bounded_sequence_int64_field"); @@ -3175,7 +3206,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_uint64_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_uint64_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_uint64_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", 5, true)); + cst_bounded_sequence_uint64_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint64_t", max_seq_size, true)); cst_bounded_sequence_uint64_field.detail().name("bounded_sequence_uint64_field"); @@ -3190,7 +3221,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_float_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_float_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_float_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", 5, true)); + cst_bounded_sequence_float_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("float", max_seq_size, true)); cst_bounded_sequence_float_field.detail().name("bounded_sequence_float_field"); @@ -3205,7 +3236,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_double_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", 5, true)); + cst_bounded_sequence_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("double", max_seq_size, true)); cst_bounded_sequence_double_field.detail().name("bounded_sequence_double_field"); @@ -3220,7 +3251,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_long_double_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_long_double_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_long_double_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", 5, true)); + cst_bounded_sequence_long_double_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("longdouble", max_seq_size, true)); cst_bounded_sequence_long_double_field.detail().name("bounded_sequence_long_double_field"); @@ -3235,7 +3266,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_bool_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_bool_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_bool_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", 5, true)); + cst_bounded_sequence_bool_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("bool", max_seq_size, true)); cst_bounded_sequence_bool_field.detail().name("bounded_sequence_bool_field"); @@ -3250,7 +3281,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_string_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_string_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_string_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), 5, true)); + cst_bounded_sequence_string_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_string_type_name(255, false), max_seq_size, true)); cst_bounded_sequence_string_field.detail().name("bounded_sequence_string_field"); @@ -3265,7 +3296,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_enum_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_enum_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_enum_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", 5, true)); + cst_bounded_sequence_enum_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Color", max_seq_size, true)); cst_bounded_sequence_enum_field.detail().name("bounded_sequence_enum_field"); @@ -3280,7 +3311,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_enum2_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_enum2_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_enum2_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", 5, true)); + cst_bounded_sequence_enum2_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("Material", max_seq_size, true)); cst_bounded_sequence_enum2_field.detail().name("bounded_sequence_enum2_field"); @@ -3295,7 +3326,7 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() cst_bounded_sequence_struct_field.common().member_flags().IS_MUST_UNDERSTAND(false); cst_bounded_sequence_struct_field.common().member_flags().IS_KEY(false); cst_bounded_sequence_struct_field.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", 5, true)); + cst_bounded_sequence_struct_field.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("StructType", max_seq_size, true)); cst_bounded_sequence_struct_field.detail().name("bounded_sequence_struct_field"); @@ -3545,7 +3576,6 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() // Header type_object->complete().struct_type().header().detail().type_name("ContentFilterTestType"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3561,7 +3591,11 @@ const TypeObject* GetCompleteContentFilterTestTypeObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h index a881fa89854..f9d5ec3dc0f 100644 --- a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypeTypeObject.h @@ -64,6 +64,8 @@ eProsima_user_DllExport const TypeObject* GetMaterialObject(bool complete = fals eProsima_user_DllExport const TypeObject* GetMinimalMaterialObject(); eProsima_user_DllExport const TypeObject* GetCompleteMaterialObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStructTypeIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStructTypeObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStructTypeObject(); @@ -71,6 +73,12 @@ eProsima_user_DllExport const TypeObject* GetCompleteStructTypeObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetContentFilterTestTypeIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetContentFilterTestTypeObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalContentFilterTestTypeObject(); diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx new file mode 100644 index 00000000000..6b2d8da6280 --- /dev/null +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.cxx @@ -0,0 +1,5318 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file ContentFilterTestType.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "ContentFilterTestType.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "ContentFilterTestTypeTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define StructType_max_cdr_typesize 344ULL; +#define ContentFilterTestType_max_cdr_typesize 73360ULL; + + + + + + +StructType::StructType() +{ + // char m_char_field + m_char_field = 0; + // octet m_uint8_field + m_uint8_field = 0; + // short m_int16_field + m_int16_field = 0; + // unsigned short m_uint16_field + m_uint16_field = 0; + // long m_int32_field + m_int32_field = 0; + // unsigned long m_uint32_field + m_uint32_field = 0; + // long long m_int64_field + m_int64_field = 0; + // unsigned long long m_uint64_field + m_uint64_field = 0; + // float m_float_field + m_float_field = 0.0; + // double m_double_field + m_double_field = 0.0; + // long double m_long_double_field + m_long_double_field = 0.0; + // boolean m_bool_field + m_bool_field = false; + // /type_d() m_string_field + + // Color m_enum_field + m_enum_field = ::RED; + // Material m_enum2_field + m_enum2_field = ::WOOD; + + // Just to register all known types + registerContentFilterTestTypeTypes(); +} + +StructType::~StructType() +{ +} + +StructType::StructType( + const StructType& x) +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = x.m_string_field; + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + +} + +StructType::StructType( + StructType&& x) noexcept +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = std::move(x.m_string_field); + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + +} + +StructType& StructType::operator =( + const StructType& x) +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = x.m_string_field; + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + return *this; +} + +StructType& StructType::operator =( + StructType&& x) noexcept +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = std::move(x.m_string_field); + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + return *this; +} + +bool StructType::operator ==( + const StructType& x) const +{ + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_long_double_field == x.m_long_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field); +} + +bool StructType::operator !=( + const StructType& x) const +{ + return !(*this == x); +} + +size_t StructType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StructType_max_cdr_typesize; +} + +size_t StructType::getCdrSerializedSize( + const StructType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void StructType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_char_field; + + scdr << m_uint8_field; + + scdr << m_int16_field; + + scdr << m_uint16_field; + + scdr << m_int32_field; + + scdr << m_uint32_field; + + scdr << m_int64_field; + + scdr << m_uint64_field; + + scdr << m_float_field; + + scdr << m_double_field; + + scdr << m_long_double_field; + + scdr << m_bool_field; + + scdr << m_string_field.c_str(); + + scdr << (uint32_t)m_enum_field; + + scdr << (uint32_t)m_enum2_field; + +} + +void StructType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_char_field; + + + + dcdr >> m_uint8_field; + + + + dcdr >> m_int16_field; + + + + dcdr >> m_uint16_field; + + + + dcdr >> m_int32_field; + + + + dcdr >> m_uint32_field; + + + + dcdr >> m_int64_field; + + + + dcdr >> m_uint64_field; + + + + dcdr >> m_float_field; + + + + dcdr >> m_double_field; + + + + dcdr >> m_long_double_field; + + + + dcdr >> m_bool_field; + + + + dcdr >> m_string_field; + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_enum_field = (Color)enum_value; + } + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_enum2_field = (Material)enum_value; + } + + +} + + +bool StructType::isKeyDefined() +{ + return false; +} + +void StructType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ +void StructType::char_field( + char _char_field) +{ + m_char_field = _char_field; +} + +/*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ +char StructType::char_field() const +{ + return m_char_field; +} + +/*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ +char& StructType::char_field() +{ + return m_char_field; +} + + +/*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ +void StructType::uint8_field( + uint8_t _uint8_field) +{ + m_uint8_field = _uint8_field; +} + +/*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ +uint8_t StructType::uint8_field() const +{ + return m_uint8_field; +} + +/*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ +uint8_t& StructType::uint8_field() +{ + return m_uint8_field; +} + + +/*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ +void StructType::int16_field( + int16_t _int16_field) +{ + m_int16_field = _int16_field; +} + +/*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ +int16_t StructType::int16_field() const +{ + return m_int16_field; +} + +/*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ +int16_t& StructType::int16_field() +{ + return m_int16_field; +} + + +/*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ +void StructType::uint16_field( + uint16_t _uint16_field) +{ + m_uint16_field = _uint16_field; +} + +/*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ +uint16_t StructType::uint16_field() const +{ + return m_uint16_field; +} + +/*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ +uint16_t& StructType::uint16_field() +{ + return m_uint16_field; +} + + +/*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ +void StructType::int32_field( + int32_t _int32_field) +{ + m_int32_field = _int32_field; +} + +/*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ +int32_t StructType::int32_field() const +{ + return m_int32_field; +} + +/*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ +int32_t& StructType::int32_field() +{ + return m_int32_field; +} + + +/*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ +void StructType::uint32_field( + uint32_t _uint32_field) +{ + m_uint32_field = _uint32_field; +} + +/*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ +uint32_t StructType::uint32_field() const +{ + return m_uint32_field; +} + +/*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ +uint32_t& StructType::uint32_field() +{ + return m_uint32_field; +} + + +/*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ +void StructType::int64_field( + int64_t _int64_field) +{ + m_int64_field = _int64_field; +} + +/*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ +int64_t StructType::int64_field() const +{ + return m_int64_field; +} + +/*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ +int64_t& StructType::int64_field() +{ + return m_int64_field; +} + + +/*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ +void StructType::uint64_field( + uint64_t _uint64_field) +{ + m_uint64_field = _uint64_field; +} + +/*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ +uint64_t StructType::uint64_field() const +{ + return m_uint64_field; +} + +/*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ +uint64_t& StructType::uint64_field() +{ + return m_uint64_field; +} + + +/*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ +void StructType::float_field( + float _float_field) +{ + m_float_field = _float_field; +} + +/*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ +float StructType::float_field() const +{ + return m_float_field; +} + +/*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ +float& StructType::float_field() +{ + return m_float_field; +} + + +/*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ +void StructType::double_field( + double _double_field) +{ + m_double_field = _double_field; +} + +/*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ +double StructType::double_field() const +{ + return m_double_field; +} + +/*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ +double& StructType::double_field() +{ + return m_double_field; +} + + +/*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ +void StructType::long_double_field( + long double _long_double_field) +{ + m_long_double_field = _long_double_field; +} + +/*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ +long double StructType::long_double_field() const +{ + return m_long_double_field; +} + +/*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ +long double& StructType::long_double_field() +{ + return m_long_double_field; +} + + +/*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ +void StructType::bool_field( + bool _bool_field) +{ + m_bool_field = _bool_field; +} + +/*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ +bool StructType::bool_field() const +{ + return m_bool_field; +} + +/*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ +bool& StructType::bool_field() +{ + return m_bool_field; +} + + +/*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ +void StructType::string_field( + const std::string& _string_field) +{ + m_string_field = _string_field; +} + +/*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ +void StructType::string_field( + std::string&& _string_field) +{ + m_string_field = std::move(_string_field); +} + +/*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ +const std::string& StructType::string_field() const +{ + return m_string_field; +} + +/*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ +std::string& StructType::string_field() +{ + return m_string_field; +} + + +/*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ +void StructType::enum_field( + Color _enum_field) +{ + m_enum_field = _enum_field; +} + +/*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ +Color StructType::enum_field() const +{ + return m_enum_field; +} + +/*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ +Color& StructType::enum_field() +{ + return m_enum_field; +} + + +/*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ +void StructType::enum2_field( + Material _enum2_field) +{ + m_enum2_field = _enum2_field; +} + +/*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ +Material StructType::enum2_field() const +{ + return m_enum2_field; +} + +/*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ +Material& StructType::enum2_field() +{ + return m_enum2_field; +} + + + + + + + + + +ContentFilterTestType::ContentFilterTestType() +{ + // char m_char_field + m_char_field = 0; + // octet m_uint8_field + m_uint8_field = 0; + // short m_int16_field + m_int16_field = 0; + // unsigned short m_uint16_field + m_uint16_field = 0; + // long m_int32_field + m_int32_field = 0; + // unsigned long m_uint32_field + m_uint32_field = 0; + // long long m_int64_field + m_int64_field = 0; + // unsigned long long m_uint64_field + m_uint64_field = 0; + // float m_float_field + m_float_field = 0.0; + // double m_double_field + m_double_field = 0.0; + // long double m_long_double_field + m_long_double_field = 0.0; + // boolean m_bool_field + m_bool_field = false; + // /type_d() m_string_field + + // Color m_enum_field + m_enum_field = ::RED; + // Material m_enum2_field + m_enum2_field = ::WOOD; + // StructType m_struct_field + + // char m_array_char_field + memset(&m_array_char_field, 0, ((max_array_size)) * 1); + // octet m_array_uint8_field + memset(&m_array_uint8_field, 0, ((max_array_size)) * 1); + // short m_array_int16_field + memset(&m_array_int16_field, 0, ((max_array_size)) * 2); + // unsigned short m_array_uint16_field + memset(&m_array_uint16_field, 0, ((max_array_size)) * 2); + // long m_array_int32_field + memset(&m_array_int32_field, 0, ((max_array_size)) * 4); + // unsigned long m_array_uint32_field + memset(&m_array_uint32_field, 0, ((max_array_size)) * 4); + // long long m_array_int64_field + memset(&m_array_int64_field, 0, ((max_array_size)) * 8); + // unsigned long long m_array_uint64_field + memset(&m_array_uint64_field, 0, ((max_array_size)) * 8); + // float m_array_float_field + memset(&m_array_float_field, 0, ((max_array_size)) * 4); + // double m_array_double_field + memset(&m_array_double_field, 0, ((max_array_size)) * 8); + // long double m_array_long_double_field + memset(&m_array_long_double_field, 0, ((max_array_size)) * 16); + // boolean m_array_bool_field + memset(&m_array_bool_field, 0, ((max_array_size)) * 1); + // /type_d() m_array_string_field + + // Color m_array_enum_field + memset(&m_array_enum_field, 0, ((max_array_size)) * 4); + // Material m_array_enum2_field + memset(&m_array_enum2_field, 0, ((max_array_size)) * 4); + // StructType m_array_struct_field + + // sequence m_bounded_sequence_char_field + + // sequence m_bounded_sequence_uint8_field + + // sequence m_bounded_sequence_int16_field + + // sequence m_bounded_sequence_uint16_field + + // sequence m_bounded_sequence_int32_field + + // sequence m_bounded_sequence_uint32_field + + // sequence m_bounded_sequence_int64_field + + // sequence m_bounded_sequence_uint64_field + + // sequence m_bounded_sequence_float_field + + // sequence m_bounded_sequence_double_field + + // sequence m_bounded_sequence_long_double_field + + // sequence m_bounded_sequence_bool_field + + // sequence m_bounded_sequence_string_field + + // sequence m_bounded_sequence_enum_field + + // sequence m_bounded_sequence_enum2_field + + // sequence m_bounded_sequence_struct_field + + // sequence m_unbounded_sequence_char_field + + // sequence m_unbounded_sequence_uint8_field + + // sequence m_unbounded_sequence_int16_field + + // sequence m_unbounded_sequence_uint16_field + + // sequence m_unbounded_sequence_int32_field + + // sequence m_unbounded_sequence_uint32_field + + // sequence m_unbounded_sequence_int64_field + + // sequence m_unbounded_sequence_uint64_field + + // sequence m_unbounded_sequence_float_field + + // sequence m_unbounded_sequence_double_field + + // sequence m_unbounded_sequence_long_double_field + + // sequence m_unbounded_sequence_bool_field + + // sequence m_unbounded_sequence_string_field + + // sequence m_unbounded_sequence_enum_field + + // sequence m_unbounded_sequence_enum2_field + + // sequence m_unbounded_sequence_struct_field + + + // Just to register all known types + registerContentFilterTestTypeTypes(); +} + +ContentFilterTestType::~ContentFilterTestType() +{ +} + +ContentFilterTestType::ContentFilterTestType( + const ContentFilterTestType& x) +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = x.m_string_field; + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + + m_struct_field = x.m_struct_field; + + + m_array_char_field = x.m_array_char_field; + + + m_array_uint8_field = x.m_array_uint8_field; + + + m_array_int16_field = x.m_array_int16_field; + + + m_array_uint16_field = x.m_array_uint16_field; + + + m_array_int32_field = x.m_array_int32_field; + + + m_array_uint32_field = x.m_array_uint32_field; + + + m_array_int64_field = x.m_array_int64_field; + + + m_array_uint64_field = x.m_array_uint64_field; + + + m_array_float_field = x.m_array_float_field; + + + m_array_double_field = x.m_array_double_field; + + + m_array_long_double_field = x.m_array_long_double_field; + + + m_array_bool_field = x.m_array_bool_field; + + + m_array_string_field = x.m_array_string_field; + + + m_array_enum_field = x.m_array_enum_field; + + + m_array_enum2_field = x.m_array_enum2_field; + + + m_array_struct_field = x.m_array_struct_field; + + + m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; + + + m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; + + + m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; + + + m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; + + + m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; + + + m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; + + + m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; + + + m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; + + + m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; + + + m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; + + + m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; + + + m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; + + + m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; + + + m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; + + + m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; + + + m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; + + + m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; + + + m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; + + + m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; + + + m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; + + + m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; + + + m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; + + + m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; + + + m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; + + + m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; + + + m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; + + + m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; + + + m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; + + + m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; + + + m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; + + + m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; + + + m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; + +} + +ContentFilterTestType::ContentFilterTestType( + ContentFilterTestType&& x) noexcept +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = std::move(x.m_string_field); + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + + m_struct_field = std::move(x.m_struct_field); + + + m_array_char_field = std::move(x.m_array_char_field); + + + m_array_uint8_field = std::move(x.m_array_uint8_field); + + + m_array_int16_field = std::move(x.m_array_int16_field); + + + m_array_uint16_field = std::move(x.m_array_uint16_field); + + + m_array_int32_field = std::move(x.m_array_int32_field); + + + m_array_uint32_field = std::move(x.m_array_uint32_field); + + + m_array_int64_field = std::move(x.m_array_int64_field); + + + m_array_uint64_field = std::move(x.m_array_uint64_field); + + + m_array_float_field = std::move(x.m_array_float_field); + + + m_array_double_field = std::move(x.m_array_double_field); + + + m_array_long_double_field = std::move(x.m_array_long_double_field); + + + m_array_bool_field = std::move(x.m_array_bool_field); + + + m_array_string_field = std::move(x.m_array_string_field); + + + m_array_enum_field = std::move(x.m_array_enum_field); + + + m_array_enum2_field = std::move(x.m_array_enum2_field); + + + m_array_struct_field = std::move(x.m_array_struct_field); + + + m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); + + + m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); + + + m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); + + + m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); + + + m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); + + + m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); + + + m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); + + + m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); + + + m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); + + + m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); + + + m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); + + + m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); + + + m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); + + + m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); + + + m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); + + + m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); + + + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + + + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + + + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + + + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + + + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + + + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + + + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + + + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + + + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + + + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + + + m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); + + + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + + + m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); + + + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + + + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + + + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); + +} + +ContentFilterTestType& ContentFilterTestType::operator =( + const ContentFilterTestType& x) +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = x.m_string_field; + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + + m_struct_field = x.m_struct_field; + + + m_array_char_field = x.m_array_char_field; + + + m_array_uint8_field = x.m_array_uint8_field; + + + m_array_int16_field = x.m_array_int16_field; + + + m_array_uint16_field = x.m_array_uint16_field; + + + m_array_int32_field = x.m_array_int32_field; + + + m_array_uint32_field = x.m_array_uint32_field; + + + m_array_int64_field = x.m_array_int64_field; + + + m_array_uint64_field = x.m_array_uint64_field; + + + m_array_float_field = x.m_array_float_field; + + + m_array_double_field = x.m_array_double_field; + + + m_array_long_double_field = x.m_array_long_double_field; + + + m_array_bool_field = x.m_array_bool_field; + + + m_array_string_field = x.m_array_string_field; + + + m_array_enum_field = x.m_array_enum_field; + + + m_array_enum2_field = x.m_array_enum2_field; + + + m_array_struct_field = x.m_array_struct_field; + + + m_bounded_sequence_char_field = x.m_bounded_sequence_char_field; + + + m_bounded_sequence_uint8_field = x.m_bounded_sequence_uint8_field; + + + m_bounded_sequence_int16_field = x.m_bounded_sequence_int16_field; + + + m_bounded_sequence_uint16_field = x.m_bounded_sequence_uint16_field; + + + m_bounded_sequence_int32_field = x.m_bounded_sequence_int32_field; + + + m_bounded_sequence_uint32_field = x.m_bounded_sequence_uint32_field; + + + m_bounded_sequence_int64_field = x.m_bounded_sequence_int64_field; + + + m_bounded_sequence_uint64_field = x.m_bounded_sequence_uint64_field; + + + m_bounded_sequence_float_field = x.m_bounded_sequence_float_field; + + + m_bounded_sequence_double_field = x.m_bounded_sequence_double_field; + + + m_bounded_sequence_long_double_field = x.m_bounded_sequence_long_double_field; + + + m_bounded_sequence_bool_field = x.m_bounded_sequence_bool_field; + + + m_bounded_sequence_string_field = x.m_bounded_sequence_string_field; + + + m_bounded_sequence_enum_field = x.m_bounded_sequence_enum_field; + + + m_bounded_sequence_enum2_field = x.m_bounded_sequence_enum2_field; + + + m_bounded_sequence_struct_field = x.m_bounded_sequence_struct_field; + + + m_unbounded_sequence_char_field = x.m_unbounded_sequence_char_field; + + + m_unbounded_sequence_uint8_field = x.m_unbounded_sequence_uint8_field; + + + m_unbounded_sequence_int16_field = x.m_unbounded_sequence_int16_field; + + + m_unbounded_sequence_uint16_field = x.m_unbounded_sequence_uint16_field; + + + m_unbounded_sequence_int32_field = x.m_unbounded_sequence_int32_field; + + + m_unbounded_sequence_uint32_field = x.m_unbounded_sequence_uint32_field; + + + m_unbounded_sequence_int64_field = x.m_unbounded_sequence_int64_field; + + + m_unbounded_sequence_uint64_field = x.m_unbounded_sequence_uint64_field; + + + m_unbounded_sequence_float_field = x.m_unbounded_sequence_float_field; + + + m_unbounded_sequence_double_field = x.m_unbounded_sequence_double_field; + + + m_unbounded_sequence_long_double_field = x.m_unbounded_sequence_long_double_field; + + + m_unbounded_sequence_bool_field = x.m_unbounded_sequence_bool_field; + + + m_unbounded_sequence_string_field = x.m_unbounded_sequence_string_field; + + + m_unbounded_sequence_enum_field = x.m_unbounded_sequence_enum_field; + + + m_unbounded_sequence_enum2_field = x.m_unbounded_sequence_enum2_field; + + + m_unbounded_sequence_struct_field = x.m_unbounded_sequence_struct_field; + + return *this; +} + +ContentFilterTestType& ContentFilterTestType::operator =( + ContentFilterTestType&& x) noexcept +{ + m_char_field = x.m_char_field; + + + m_uint8_field = x.m_uint8_field; + + + m_int16_field = x.m_int16_field; + + + m_uint16_field = x.m_uint16_field; + + + m_int32_field = x.m_int32_field; + + + m_uint32_field = x.m_uint32_field; + + + m_int64_field = x.m_int64_field; + + + m_uint64_field = x.m_uint64_field; + + + m_float_field = x.m_float_field; + + + m_double_field = x.m_double_field; + + + m_long_double_field = x.m_long_double_field; + + + m_bool_field = x.m_bool_field; + + + m_string_field = std::move(x.m_string_field); + + + m_enum_field = x.m_enum_field; + + + m_enum2_field = x.m_enum2_field; + + + m_struct_field = std::move(x.m_struct_field); + + + m_array_char_field = std::move(x.m_array_char_field); + + + m_array_uint8_field = std::move(x.m_array_uint8_field); + + + m_array_int16_field = std::move(x.m_array_int16_field); + + + m_array_uint16_field = std::move(x.m_array_uint16_field); + + + m_array_int32_field = std::move(x.m_array_int32_field); + + + m_array_uint32_field = std::move(x.m_array_uint32_field); + + + m_array_int64_field = std::move(x.m_array_int64_field); + + + m_array_uint64_field = std::move(x.m_array_uint64_field); + + + m_array_float_field = std::move(x.m_array_float_field); + + + m_array_double_field = std::move(x.m_array_double_field); + + + m_array_long_double_field = std::move(x.m_array_long_double_field); + + + m_array_bool_field = std::move(x.m_array_bool_field); + + + m_array_string_field = std::move(x.m_array_string_field); + + + m_array_enum_field = std::move(x.m_array_enum_field); + + + m_array_enum2_field = std::move(x.m_array_enum2_field); + + + m_array_struct_field = std::move(x.m_array_struct_field); + + + m_bounded_sequence_char_field = std::move(x.m_bounded_sequence_char_field); + + + m_bounded_sequence_uint8_field = std::move(x.m_bounded_sequence_uint8_field); + + + m_bounded_sequence_int16_field = std::move(x.m_bounded_sequence_int16_field); + + + m_bounded_sequence_uint16_field = std::move(x.m_bounded_sequence_uint16_field); + + + m_bounded_sequence_int32_field = std::move(x.m_bounded_sequence_int32_field); + + + m_bounded_sequence_uint32_field = std::move(x.m_bounded_sequence_uint32_field); + + + m_bounded_sequence_int64_field = std::move(x.m_bounded_sequence_int64_field); + + + m_bounded_sequence_uint64_field = std::move(x.m_bounded_sequence_uint64_field); + + + m_bounded_sequence_float_field = std::move(x.m_bounded_sequence_float_field); + + + m_bounded_sequence_double_field = std::move(x.m_bounded_sequence_double_field); + + + m_bounded_sequence_long_double_field = std::move(x.m_bounded_sequence_long_double_field); + + + m_bounded_sequence_bool_field = std::move(x.m_bounded_sequence_bool_field); + + + m_bounded_sequence_string_field = std::move(x.m_bounded_sequence_string_field); + + + m_bounded_sequence_enum_field = std::move(x.m_bounded_sequence_enum_field); + + + m_bounded_sequence_enum2_field = std::move(x.m_bounded_sequence_enum2_field); + + + m_bounded_sequence_struct_field = std::move(x.m_bounded_sequence_struct_field); + + + m_unbounded_sequence_char_field = std::move(x.m_unbounded_sequence_char_field); + + + m_unbounded_sequence_uint8_field = std::move(x.m_unbounded_sequence_uint8_field); + + + m_unbounded_sequence_int16_field = std::move(x.m_unbounded_sequence_int16_field); + + + m_unbounded_sequence_uint16_field = std::move(x.m_unbounded_sequence_uint16_field); + + + m_unbounded_sequence_int32_field = std::move(x.m_unbounded_sequence_int32_field); + + + m_unbounded_sequence_uint32_field = std::move(x.m_unbounded_sequence_uint32_field); + + + m_unbounded_sequence_int64_field = std::move(x.m_unbounded_sequence_int64_field); + + + m_unbounded_sequence_uint64_field = std::move(x.m_unbounded_sequence_uint64_field); + + + m_unbounded_sequence_float_field = std::move(x.m_unbounded_sequence_float_field); + + + m_unbounded_sequence_double_field = std::move(x.m_unbounded_sequence_double_field); + + + m_unbounded_sequence_long_double_field = std::move(x.m_unbounded_sequence_long_double_field); + + + m_unbounded_sequence_bool_field = std::move(x.m_unbounded_sequence_bool_field); + + + m_unbounded_sequence_string_field = std::move(x.m_unbounded_sequence_string_field); + + + m_unbounded_sequence_enum_field = std::move(x.m_unbounded_sequence_enum_field); + + + m_unbounded_sequence_enum2_field = std::move(x.m_unbounded_sequence_enum2_field); + + + m_unbounded_sequence_struct_field = std::move(x.m_unbounded_sequence_struct_field); + + return *this; +} + +bool ContentFilterTestType::operator ==( + const ContentFilterTestType& x) const +{ + return (m_char_field == x.m_char_field && + m_uint8_field == x.m_uint8_field && + m_int16_field == x.m_int16_field && + m_uint16_field == x.m_uint16_field && + m_int32_field == x.m_int32_field && + m_uint32_field == x.m_uint32_field && + m_int64_field == x.m_int64_field && + m_uint64_field == x.m_uint64_field && + m_float_field == x.m_float_field && + m_double_field == x.m_double_field && + m_long_double_field == x.m_long_double_field && + m_bool_field == x.m_bool_field && + m_string_field == x.m_string_field && + m_enum_field == x.m_enum_field && + m_enum2_field == x.m_enum2_field && + m_struct_field == x.m_struct_field && + m_array_char_field == x.m_array_char_field && + m_array_uint8_field == x.m_array_uint8_field && + m_array_int16_field == x.m_array_int16_field && + m_array_uint16_field == x.m_array_uint16_field && + m_array_int32_field == x.m_array_int32_field && + m_array_uint32_field == x.m_array_uint32_field && + m_array_int64_field == x.m_array_int64_field && + m_array_uint64_field == x.m_array_uint64_field && + m_array_float_field == x.m_array_float_field && + m_array_double_field == x.m_array_double_field && + m_array_long_double_field == x.m_array_long_double_field && + m_array_bool_field == x.m_array_bool_field && + m_array_string_field == x.m_array_string_field && + m_array_enum_field == x.m_array_enum_field && + m_array_enum2_field == x.m_array_enum2_field && + m_array_struct_field == x.m_array_struct_field && + m_bounded_sequence_char_field == x.m_bounded_sequence_char_field && + m_bounded_sequence_uint8_field == x.m_bounded_sequence_uint8_field && + m_bounded_sequence_int16_field == x.m_bounded_sequence_int16_field && + m_bounded_sequence_uint16_field == x.m_bounded_sequence_uint16_field && + m_bounded_sequence_int32_field == x.m_bounded_sequence_int32_field && + m_bounded_sequence_uint32_field == x.m_bounded_sequence_uint32_field && + m_bounded_sequence_int64_field == x.m_bounded_sequence_int64_field && + m_bounded_sequence_uint64_field == x.m_bounded_sequence_uint64_field && + m_bounded_sequence_float_field == x.m_bounded_sequence_float_field && + m_bounded_sequence_double_field == x.m_bounded_sequence_double_field && + m_bounded_sequence_long_double_field == x.m_bounded_sequence_long_double_field && + m_bounded_sequence_bool_field == x.m_bounded_sequence_bool_field && + m_bounded_sequence_string_field == x.m_bounded_sequence_string_field && + m_bounded_sequence_enum_field == x.m_bounded_sequence_enum_field && + m_bounded_sequence_enum2_field == x.m_bounded_sequence_enum2_field && + m_bounded_sequence_struct_field == x.m_bounded_sequence_struct_field && + m_unbounded_sequence_char_field == x.m_unbounded_sequence_char_field && + m_unbounded_sequence_uint8_field == x.m_unbounded_sequence_uint8_field && + m_unbounded_sequence_int16_field == x.m_unbounded_sequence_int16_field && + m_unbounded_sequence_uint16_field == x.m_unbounded_sequence_uint16_field && + m_unbounded_sequence_int32_field == x.m_unbounded_sequence_int32_field && + m_unbounded_sequence_uint32_field == x.m_unbounded_sequence_uint32_field && + m_unbounded_sequence_int64_field == x.m_unbounded_sequence_int64_field && + m_unbounded_sequence_uint64_field == x.m_unbounded_sequence_uint64_field && + m_unbounded_sequence_float_field == x.m_unbounded_sequence_float_field && + m_unbounded_sequence_double_field == x.m_unbounded_sequence_double_field && + m_unbounded_sequence_long_double_field == x.m_unbounded_sequence_long_double_field && + m_unbounded_sequence_bool_field == x.m_unbounded_sequence_bool_field && + m_unbounded_sequence_string_field == x.m_unbounded_sequence_string_field && + m_unbounded_sequence_enum_field == x.m_unbounded_sequence_enum_field && + m_unbounded_sequence_enum2_field == x.m_unbounded_sequence_enum2_field && + m_unbounded_sequence_struct_field == x.m_unbounded_sequence_struct_field); +} + +bool ContentFilterTestType::operator !=( + const ContentFilterTestType& x) const +{ + return !(*this == x); +} + +size_t ContentFilterTestType::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ContentFilterTestType_max_cdr_typesize; +} + +size_t ContentFilterTestType::getCdrSerializedSize( + const ContentFilterTestType& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.string_field().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += StructType::getCdrSerializedSize(data.struct_field(), current_alignment); + + + current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += (((max_array_size)) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + + current_alignment += (((max_array_size)) * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + + current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + current_alignment += (((max_array_size)) * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + current_alignment += (((max_array_size)) * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 16); + + + + current_alignment += (((max_array_size)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + + for(size_t a = 0; a < data.array_string_field().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.array_string_field().at(a).size() + 1; + + } + + + + current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + current_alignment += (((max_array_size)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + + for(size_t a = 0; a < data.array_struct_field().size(); ++a) + { + current_alignment += StructType::getCdrSerializedSize(data.array_struct_field().at(a), current_alignment); + + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_char_field().size() > 0) + { + current_alignment += (data.bounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_uint8_field().size() > 0) + { + current_alignment += (data.bounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_int16_field().size() > 0) + { + current_alignment += (data.bounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_uint16_field().size() > 0) + { + current_alignment += (data.bounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_int32_field().size() > 0) + { + current_alignment += (data.bounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_uint32_field().size() > 0) + { + current_alignment += (data.bounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_int64_field().size() > 0) + { + current_alignment += (data.bounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_uint64_field().size() > 0) + { + current_alignment += (data.bounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_float_field().size() > 0) + { + current_alignment += (data.bounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_double_field().size() > 0) + { + current_alignment += (data.bounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_long_double_field().size() > 0) + { + current_alignment += (data.bounded_sequence_long_double_field().size() * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_bool_field().size() > 0) + { + current_alignment += (data.bounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.bounded_sequence_string_field().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + + data.bounded_sequence_string_field().at(a).size() + 1; + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_enum_field().size() > 0) + { + current_alignment += (data.bounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.bounded_sequence_enum2_field().size() > 0) + { + current_alignment += (data.bounded_sequence_enum2_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.bounded_sequence_struct_field().size(); ++a) + { + current_alignment += StructType::getCdrSerializedSize(data.bounded_sequence_struct_field().at(a), current_alignment); + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_char_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_char_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_uint8_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_uint8_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_int16_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_int16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_uint16_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_uint16_field().size() * 2) + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_int32_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_int32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_uint32_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_uint32_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_int64_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_int64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_uint64_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_uint64_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_float_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_float_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_double_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_double_field().size() * 8) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_long_double_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_long_double_field().size() * 16) + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_bool_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_bool_field().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.unbounded_sequence_string_field().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + + data.unbounded_sequence_string_field().at(a).size() + 1; + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_enum_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_enum_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.unbounded_sequence_enum2_field().size() > 0) + { + current_alignment += (data.unbounded_sequence_enum2_field().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.unbounded_sequence_struct_field().size(); ++a) + { + current_alignment += StructType::getCdrSerializedSize(data.unbounded_sequence_struct_field().at(a), current_alignment); + } + + + + return current_alignment - initial_alignment; +} + + +void ContentFilterTestType::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_char_field; + + scdr << m_uint8_field; + + scdr << m_int16_field; + + scdr << m_uint16_field; + + scdr << m_int32_field; + + scdr << m_uint32_field; + + scdr << m_int64_field; + + scdr << m_uint64_field; + + scdr << m_float_field; + + scdr << m_double_field; + + scdr << m_long_double_field; + + scdr << m_bool_field; + + scdr << m_string_field.c_str(); + + scdr << (uint32_t)m_enum_field; + + scdr << (uint32_t)m_enum2_field; + + scdr << m_struct_field; + + scdr << m_array_char_field; + + + scdr << m_array_uint8_field; + + + scdr << m_array_int16_field; + + + scdr << m_array_uint16_field; + + + scdr << m_array_int32_field; + + + scdr << m_array_uint32_field; + + + scdr << m_array_int64_field; + + + scdr << m_array_uint64_field; + + + scdr << m_array_float_field; + + + scdr << m_array_double_field; + + + scdr << m_array_long_double_field; + + + scdr << m_array_bool_field; + + + for (const auto& str : m_array_string_field) + { + scdr << str.c_str(); + } + + + + + + scdr.serializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); + + + scdr.serializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); + + + scdr << m_array_struct_field; + + + scdr << m_bounded_sequence_char_field; + + + scdr << m_bounded_sequence_uint8_field; + + + scdr << m_bounded_sequence_int16_field; + + + scdr << m_bounded_sequence_uint16_field; + + + scdr << m_bounded_sequence_int32_field; + + + scdr << m_bounded_sequence_uint32_field; + + + scdr << m_bounded_sequence_int64_field; + + + scdr << m_bounded_sequence_uint64_field; + + + scdr << m_bounded_sequence_float_field; + + + scdr << m_bounded_sequence_double_field; + + + scdr << m_bounded_sequence_long_double_field; + + + scdr << m_bounded_sequence_bool_field; + + + scdr << m_bounded_sequence_string_field; + + + + + scdr << static_cast(m_bounded_sequence_enum_field.size()); + scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), m_bounded_sequence_enum_field.size()); + + + scdr << static_cast(m_bounded_sequence_enum2_field.size()); + scdr.serializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), m_bounded_sequence_enum2_field.size()); + + + scdr << m_bounded_sequence_struct_field; + + + scdr << m_unbounded_sequence_char_field; + + + scdr << m_unbounded_sequence_uint8_field; + + + scdr << m_unbounded_sequence_int16_field; + + + scdr << m_unbounded_sequence_uint16_field; + + + scdr << m_unbounded_sequence_int32_field; + + + scdr << m_unbounded_sequence_uint32_field; + + + scdr << m_unbounded_sequence_int64_field; + + + scdr << m_unbounded_sequence_uint64_field; + + + scdr << m_unbounded_sequence_float_field; + + + scdr << m_unbounded_sequence_double_field; + + + scdr << m_unbounded_sequence_long_double_field; + + + scdr << m_unbounded_sequence_bool_field; + + + scdr << m_unbounded_sequence_string_field; + + + + + scdr << static_cast(m_unbounded_sequence_enum_field.size()); + scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), m_unbounded_sequence_enum_field.size()); + + + scdr << static_cast(m_unbounded_sequence_enum2_field.size()); + scdr.serializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), m_unbounded_sequence_enum2_field.size()); + + + scdr << m_unbounded_sequence_struct_field; + + +} + +void ContentFilterTestType::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_char_field; + + + + dcdr >> m_uint8_field; + + + + dcdr >> m_int16_field; + + + + dcdr >> m_uint16_field; + + + + dcdr >> m_int32_field; + + + + dcdr >> m_uint32_field; + + + + dcdr >> m_int64_field; + + + + dcdr >> m_uint64_field; + + + + dcdr >> m_float_field; + + + + dcdr >> m_double_field; + + + + dcdr >> m_long_double_field; + + + + dcdr >> m_bool_field; + + + + dcdr >> m_string_field; + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_enum_field = (Color)enum_value; + } + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_enum2_field = (Material)enum_value; + } + + + + dcdr >> m_struct_field; + + + + dcdr >> m_array_char_field; + + + + dcdr >> m_array_uint8_field; + + + + dcdr >> m_array_int16_field; + + + + dcdr >> m_array_uint16_field; + + + + dcdr >> m_array_int32_field; + + + + dcdr >> m_array_uint32_field; + + + + dcdr >> m_array_int64_field; + + + + dcdr >> m_array_uint64_field; + + + + dcdr >> m_array_float_field; + + + + dcdr >> m_array_double_field; + + + + dcdr >> m_array_long_double_field; + + + + dcdr >> m_array_bool_field; + + + + for (auto& str : m_array_string_field) + { + dcdr >> str; + } + + + + + + + dcdr.deserializeArray(reinterpret_cast(m_array_enum_field.data()), m_array_enum_field.size()); + + + + dcdr.deserializeArray(reinterpret_cast(m_array_enum2_field.data()), m_array_enum2_field.size()); + + + + dcdr >> m_array_struct_field; + + + + dcdr >> m_bounded_sequence_char_field; + + + + dcdr >> m_bounded_sequence_uint8_field; + + + + dcdr >> m_bounded_sequence_int16_field; + + + + dcdr >> m_bounded_sequence_uint16_field; + + + + dcdr >> m_bounded_sequence_int32_field; + + + + dcdr >> m_bounded_sequence_uint32_field; + + + + dcdr >> m_bounded_sequence_int64_field; + + + + dcdr >> m_bounded_sequence_uint64_field; + + + + dcdr >> m_bounded_sequence_float_field; + + + + dcdr >> m_bounded_sequence_double_field; + + + + dcdr >> m_bounded_sequence_long_double_field; + + + + dcdr >> m_bounded_sequence_bool_field; + + + + dcdr >> m_bounded_sequence_string_field; + + + + + { + uint32_t seq_length = 0; + dcdr >> seq_length; + m_bounded_sequence_enum_field.resize(seq_length); + dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum_field.data()), seq_length); + } + + + + { + uint32_t seq_length = 0; + dcdr >> seq_length; + m_bounded_sequence_enum2_field.resize(seq_length); + dcdr.deserializeArray(reinterpret_cast(m_bounded_sequence_enum2_field.data()), seq_length); + } + + + + dcdr >> m_bounded_sequence_struct_field; + + + + dcdr >> m_unbounded_sequence_char_field; + + + + dcdr >> m_unbounded_sequence_uint8_field; + + + + dcdr >> m_unbounded_sequence_int16_field; + + + + dcdr >> m_unbounded_sequence_uint16_field; + + + + dcdr >> m_unbounded_sequence_int32_field; + + + + dcdr >> m_unbounded_sequence_uint32_field; + + + + dcdr >> m_unbounded_sequence_int64_field; + + + + dcdr >> m_unbounded_sequence_uint64_field; + + + + dcdr >> m_unbounded_sequence_float_field; + + + + dcdr >> m_unbounded_sequence_double_field; + + + + dcdr >> m_unbounded_sequence_long_double_field; + + + + dcdr >> m_unbounded_sequence_bool_field; + + + + dcdr >> m_unbounded_sequence_string_field; + + + + + { + uint32_t seq_length = 0; + dcdr >> seq_length; + m_unbounded_sequence_enum_field.resize(seq_length); + dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum_field.data()), seq_length); + } + + + + { + uint32_t seq_length = 0; + dcdr >> seq_length; + m_unbounded_sequence_enum2_field.resize(seq_length); + dcdr.deserializeArray(reinterpret_cast(m_unbounded_sequence_enum2_field.data()), seq_length); + } + + + + dcdr >> m_unbounded_sequence_struct_field; + + +} + + +bool ContentFilterTestType::isKeyDefined() +{ + return false; +} + +void ContentFilterTestType::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ +void ContentFilterTestType::char_field( + char _char_field) +{ + m_char_field = _char_field; +} + +/*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ +char ContentFilterTestType::char_field() const +{ + return m_char_field; +} + +/*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ +char& ContentFilterTestType::char_field() +{ + return m_char_field; +} + + +/*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ +void ContentFilterTestType::uint8_field( + uint8_t _uint8_field) +{ + m_uint8_field = _uint8_field; +} + +/*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ +uint8_t ContentFilterTestType::uint8_field() const +{ + return m_uint8_field; +} + +/*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ +uint8_t& ContentFilterTestType::uint8_field() +{ + return m_uint8_field; +} + + +/*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ +void ContentFilterTestType::int16_field( + int16_t _int16_field) +{ + m_int16_field = _int16_field; +} + +/*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ +int16_t ContentFilterTestType::int16_field() const +{ + return m_int16_field; +} + +/*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ +int16_t& ContentFilterTestType::int16_field() +{ + return m_int16_field; +} + + +/*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ +void ContentFilterTestType::uint16_field( + uint16_t _uint16_field) +{ + m_uint16_field = _uint16_field; +} + +/*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ +uint16_t ContentFilterTestType::uint16_field() const +{ + return m_uint16_field; +} + +/*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ +uint16_t& ContentFilterTestType::uint16_field() +{ + return m_uint16_field; +} + + +/*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ +void ContentFilterTestType::int32_field( + int32_t _int32_field) +{ + m_int32_field = _int32_field; +} + +/*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ +int32_t ContentFilterTestType::int32_field() const +{ + return m_int32_field; +} + +/*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ +int32_t& ContentFilterTestType::int32_field() +{ + return m_int32_field; +} + + +/*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ +void ContentFilterTestType::uint32_field( + uint32_t _uint32_field) +{ + m_uint32_field = _uint32_field; +} + +/*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ +uint32_t ContentFilterTestType::uint32_field() const +{ + return m_uint32_field; +} + +/*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ +uint32_t& ContentFilterTestType::uint32_field() +{ + return m_uint32_field; +} + + +/*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ +void ContentFilterTestType::int64_field( + int64_t _int64_field) +{ + m_int64_field = _int64_field; +} + +/*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ +int64_t ContentFilterTestType::int64_field() const +{ + return m_int64_field; +} + +/*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ +int64_t& ContentFilterTestType::int64_field() +{ + return m_int64_field; +} + + +/*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ +void ContentFilterTestType::uint64_field( + uint64_t _uint64_field) +{ + m_uint64_field = _uint64_field; +} + +/*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ +uint64_t ContentFilterTestType::uint64_field() const +{ + return m_uint64_field; +} + +/*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ +uint64_t& ContentFilterTestType::uint64_field() +{ + return m_uint64_field; +} + + +/*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ +void ContentFilterTestType::float_field( + float _float_field) +{ + m_float_field = _float_field; +} + +/*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ +float ContentFilterTestType::float_field() const +{ + return m_float_field; +} + +/*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ +float& ContentFilterTestType::float_field() +{ + return m_float_field; +} + + +/*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ +void ContentFilterTestType::double_field( + double _double_field) +{ + m_double_field = _double_field; +} + +/*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ +double ContentFilterTestType::double_field() const +{ + return m_double_field; +} + +/*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ +double& ContentFilterTestType::double_field() +{ + return m_double_field; +} + + +/*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ +void ContentFilterTestType::long_double_field( + long double _long_double_field) +{ + m_long_double_field = _long_double_field; +} + +/*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ +long double ContentFilterTestType::long_double_field() const +{ + return m_long_double_field; +} + +/*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ +long double& ContentFilterTestType::long_double_field() +{ + return m_long_double_field; +} + + +/*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ +void ContentFilterTestType::bool_field( + bool _bool_field) +{ + m_bool_field = _bool_field; +} + +/*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ +bool ContentFilterTestType::bool_field() const +{ + return m_bool_field; +} + +/*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ +bool& ContentFilterTestType::bool_field() +{ + return m_bool_field; +} + + +/*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ +void ContentFilterTestType::string_field( + const std::string& _string_field) +{ + m_string_field = _string_field; +} + +/*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ +void ContentFilterTestType::string_field( + std::string&& _string_field) +{ + m_string_field = std::move(_string_field); +} + +/*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ +const std::string& ContentFilterTestType::string_field() const +{ + return m_string_field; +} + +/*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ +std::string& ContentFilterTestType::string_field() +{ + return m_string_field; +} + + +/*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ +void ContentFilterTestType::enum_field( + Color _enum_field) +{ + m_enum_field = _enum_field; +} + +/*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ +Color ContentFilterTestType::enum_field() const +{ + return m_enum_field; +} + +/*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ +Color& ContentFilterTestType::enum_field() +{ + return m_enum_field; +} + + +/*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ +void ContentFilterTestType::enum2_field( + Material _enum2_field) +{ + m_enum2_field = _enum2_field; +} + +/*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ +Material ContentFilterTestType::enum2_field() const +{ + return m_enum2_field; +} + +/*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ +Material& ContentFilterTestType::enum2_field() +{ + return m_enum2_field; +} + + +/*! + * @brief This function copies the value in member struct_field + * @param _struct_field New value to be copied in member struct_field + */ +void ContentFilterTestType::struct_field( + const StructType& _struct_field) +{ + m_struct_field = _struct_field; +} + +/*! + * @brief This function moves the value in member struct_field + * @param _struct_field New value to be moved in member struct_field + */ +void ContentFilterTestType::struct_field( + StructType&& _struct_field) +{ + m_struct_field = std::move(_struct_field); +} + +/*! + * @brief This function returns a constant reference to member struct_field + * @return Constant reference to member struct_field + */ +const StructType& ContentFilterTestType::struct_field() const +{ + return m_struct_field; +} + +/*! + * @brief This function returns a reference to member struct_field + * @return Reference to member struct_field + */ +StructType& ContentFilterTestType::struct_field() +{ + return m_struct_field; +} + + +/*! + * @brief This function copies the value in member array_char_field + * @param _array_char_field New value to be copied in member array_char_field + */ +void ContentFilterTestType::array_char_field( + const std::array& _array_char_field) +{ + m_array_char_field = _array_char_field; +} + +/*! + * @brief This function moves the value in member array_char_field + * @param _array_char_field New value to be moved in member array_char_field + */ +void ContentFilterTestType::array_char_field( + std::array&& _array_char_field) +{ + m_array_char_field = std::move(_array_char_field); +} + +/*! + * @brief This function returns a constant reference to member array_char_field + * @return Constant reference to member array_char_field + */ +const std::array& ContentFilterTestType::array_char_field() const +{ + return m_array_char_field; +} + +/*! + * @brief This function returns a reference to member array_char_field + * @return Reference to member array_char_field + */ +std::array& ContentFilterTestType::array_char_field() +{ + return m_array_char_field; +} + + +/*! + * @brief This function copies the value in member array_uint8_field + * @param _array_uint8_field New value to be copied in member array_uint8_field + */ +void ContentFilterTestType::array_uint8_field( + const std::array& _array_uint8_field) +{ + m_array_uint8_field = _array_uint8_field; +} + +/*! + * @brief This function moves the value in member array_uint8_field + * @param _array_uint8_field New value to be moved in member array_uint8_field + */ +void ContentFilterTestType::array_uint8_field( + std::array&& _array_uint8_field) +{ + m_array_uint8_field = std::move(_array_uint8_field); +} + +/*! + * @brief This function returns a constant reference to member array_uint8_field + * @return Constant reference to member array_uint8_field + */ +const std::array& ContentFilterTestType::array_uint8_field() const +{ + return m_array_uint8_field; +} + +/*! + * @brief This function returns a reference to member array_uint8_field + * @return Reference to member array_uint8_field + */ +std::array& ContentFilterTestType::array_uint8_field() +{ + return m_array_uint8_field; +} + + +/*! + * @brief This function copies the value in member array_int16_field + * @param _array_int16_field New value to be copied in member array_int16_field + */ +void ContentFilterTestType::array_int16_field( + const std::array& _array_int16_field) +{ + m_array_int16_field = _array_int16_field; +} + +/*! + * @brief This function moves the value in member array_int16_field + * @param _array_int16_field New value to be moved in member array_int16_field + */ +void ContentFilterTestType::array_int16_field( + std::array&& _array_int16_field) +{ + m_array_int16_field = std::move(_array_int16_field); +} + +/*! + * @brief This function returns a constant reference to member array_int16_field + * @return Constant reference to member array_int16_field + */ +const std::array& ContentFilterTestType::array_int16_field() const +{ + return m_array_int16_field; +} + +/*! + * @brief This function returns a reference to member array_int16_field + * @return Reference to member array_int16_field + */ +std::array& ContentFilterTestType::array_int16_field() +{ + return m_array_int16_field; +} + + +/*! + * @brief This function copies the value in member array_uint16_field + * @param _array_uint16_field New value to be copied in member array_uint16_field + */ +void ContentFilterTestType::array_uint16_field( + const std::array& _array_uint16_field) +{ + m_array_uint16_field = _array_uint16_field; +} + +/*! + * @brief This function moves the value in member array_uint16_field + * @param _array_uint16_field New value to be moved in member array_uint16_field + */ +void ContentFilterTestType::array_uint16_field( + std::array&& _array_uint16_field) +{ + m_array_uint16_field = std::move(_array_uint16_field); +} + +/*! + * @brief This function returns a constant reference to member array_uint16_field + * @return Constant reference to member array_uint16_field + */ +const std::array& ContentFilterTestType::array_uint16_field() const +{ + return m_array_uint16_field; +} + +/*! + * @brief This function returns a reference to member array_uint16_field + * @return Reference to member array_uint16_field + */ +std::array& ContentFilterTestType::array_uint16_field() +{ + return m_array_uint16_field; +} + + +/*! + * @brief This function copies the value in member array_int32_field + * @param _array_int32_field New value to be copied in member array_int32_field + */ +void ContentFilterTestType::array_int32_field( + const std::array& _array_int32_field) +{ + m_array_int32_field = _array_int32_field; +} + +/*! + * @brief This function moves the value in member array_int32_field + * @param _array_int32_field New value to be moved in member array_int32_field + */ +void ContentFilterTestType::array_int32_field( + std::array&& _array_int32_field) +{ + m_array_int32_field = std::move(_array_int32_field); +} + +/*! + * @brief This function returns a constant reference to member array_int32_field + * @return Constant reference to member array_int32_field + */ +const std::array& ContentFilterTestType::array_int32_field() const +{ + return m_array_int32_field; +} + +/*! + * @brief This function returns a reference to member array_int32_field + * @return Reference to member array_int32_field + */ +std::array& ContentFilterTestType::array_int32_field() +{ + return m_array_int32_field; +} + + +/*! + * @brief This function copies the value in member array_uint32_field + * @param _array_uint32_field New value to be copied in member array_uint32_field + */ +void ContentFilterTestType::array_uint32_field( + const std::array& _array_uint32_field) +{ + m_array_uint32_field = _array_uint32_field; +} + +/*! + * @brief This function moves the value in member array_uint32_field + * @param _array_uint32_field New value to be moved in member array_uint32_field + */ +void ContentFilterTestType::array_uint32_field( + std::array&& _array_uint32_field) +{ + m_array_uint32_field = std::move(_array_uint32_field); +} + +/*! + * @brief This function returns a constant reference to member array_uint32_field + * @return Constant reference to member array_uint32_field + */ +const std::array& ContentFilterTestType::array_uint32_field() const +{ + return m_array_uint32_field; +} + +/*! + * @brief This function returns a reference to member array_uint32_field + * @return Reference to member array_uint32_field + */ +std::array& ContentFilterTestType::array_uint32_field() +{ + return m_array_uint32_field; +} + + +/*! + * @brief This function copies the value in member array_int64_field + * @param _array_int64_field New value to be copied in member array_int64_field + */ +void ContentFilterTestType::array_int64_field( + const std::array& _array_int64_field) +{ + m_array_int64_field = _array_int64_field; +} + +/*! + * @brief This function moves the value in member array_int64_field + * @param _array_int64_field New value to be moved in member array_int64_field + */ +void ContentFilterTestType::array_int64_field( + std::array&& _array_int64_field) +{ + m_array_int64_field = std::move(_array_int64_field); +} + +/*! + * @brief This function returns a constant reference to member array_int64_field + * @return Constant reference to member array_int64_field + */ +const std::array& ContentFilterTestType::array_int64_field() const +{ + return m_array_int64_field; +} + +/*! + * @brief This function returns a reference to member array_int64_field + * @return Reference to member array_int64_field + */ +std::array& ContentFilterTestType::array_int64_field() +{ + return m_array_int64_field; +} + + +/*! + * @brief This function copies the value in member array_uint64_field + * @param _array_uint64_field New value to be copied in member array_uint64_field + */ +void ContentFilterTestType::array_uint64_field( + const std::array& _array_uint64_field) +{ + m_array_uint64_field = _array_uint64_field; +} + +/*! + * @brief This function moves the value in member array_uint64_field + * @param _array_uint64_field New value to be moved in member array_uint64_field + */ +void ContentFilterTestType::array_uint64_field( + std::array&& _array_uint64_field) +{ + m_array_uint64_field = std::move(_array_uint64_field); +} + +/*! + * @brief This function returns a constant reference to member array_uint64_field + * @return Constant reference to member array_uint64_field + */ +const std::array& ContentFilterTestType::array_uint64_field() const +{ + return m_array_uint64_field; +} + +/*! + * @brief This function returns a reference to member array_uint64_field + * @return Reference to member array_uint64_field + */ +std::array& ContentFilterTestType::array_uint64_field() +{ + return m_array_uint64_field; +} + + +/*! + * @brief This function copies the value in member array_float_field + * @param _array_float_field New value to be copied in member array_float_field + */ +void ContentFilterTestType::array_float_field( + const std::array& _array_float_field) +{ + m_array_float_field = _array_float_field; +} + +/*! + * @brief This function moves the value in member array_float_field + * @param _array_float_field New value to be moved in member array_float_field + */ +void ContentFilterTestType::array_float_field( + std::array&& _array_float_field) +{ + m_array_float_field = std::move(_array_float_field); +} + +/*! + * @brief This function returns a constant reference to member array_float_field + * @return Constant reference to member array_float_field + */ +const std::array& ContentFilterTestType::array_float_field() const +{ + return m_array_float_field; +} + +/*! + * @brief This function returns a reference to member array_float_field + * @return Reference to member array_float_field + */ +std::array& ContentFilterTestType::array_float_field() +{ + return m_array_float_field; +} + + +/*! + * @brief This function copies the value in member array_double_field + * @param _array_double_field New value to be copied in member array_double_field + */ +void ContentFilterTestType::array_double_field( + const std::array& _array_double_field) +{ + m_array_double_field = _array_double_field; +} + +/*! + * @brief This function moves the value in member array_double_field + * @param _array_double_field New value to be moved in member array_double_field + */ +void ContentFilterTestType::array_double_field( + std::array&& _array_double_field) +{ + m_array_double_field = std::move(_array_double_field); +} + +/*! + * @brief This function returns a constant reference to member array_double_field + * @return Constant reference to member array_double_field + */ +const std::array& ContentFilterTestType::array_double_field() const +{ + return m_array_double_field; +} + +/*! + * @brief This function returns a reference to member array_double_field + * @return Reference to member array_double_field + */ +std::array& ContentFilterTestType::array_double_field() +{ + return m_array_double_field; +} + + +/*! + * @brief This function copies the value in member array_long_double_field + * @param _array_long_double_field New value to be copied in member array_long_double_field + */ +void ContentFilterTestType::array_long_double_field( + const std::array& _array_long_double_field) +{ + m_array_long_double_field = _array_long_double_field; +} + +/*! + * @brief This function moves the value in member array_long_double_field + * @param _array_long_double_field New value to be moved in member array_long_double_field + */ +void ContentFilterTestType::array_long_double_field( + std::array&& _array_long_double_field) +{ + m_array_long_double_field = std::move(_array_long_double_field); +} + +/*! + * @brief This function returns a constant reference to member array_long_double_field + * @return Constant reference to member array_long_double_field + */ +const std::array& ContentFilterTestType::array_long_double_field() const +{ + return m_array_long_double_field; +} + +/*! + * @brief This function returns a reference to member array_long_double_field + * @return Reference to member array_long_double_field + */ +std::array& ContentFilterTestType::array_long_double_field() +{ + return m_array_long_double_field; +} + + +/*! + * @brief This function copies the value in member array_bool_field + * @param _array_bool_field New value to be copied in member array_bool_field + */ +void ContentFilterTestType::array_bool_field( + const std::array& _array_bool_field) +{ + m_array_bool_field = _array_bool_field; +} + +/*! + * @brief This function moves the value in member array_bool_field + * @param _array_bool_field New value to be moved in member array_bool_field + */ +void ContentFilterTestType::array_bool_field( + std::array&& _array_bool_field) +{ + m_array_bool_field = std::move(_array_bool_field); +} + +/*! + * @brief This function returns a constant reference to member array_bool_field + * @return Constant reference to member array_bool_field + */ +const std::array& ContentFilterTestType::array_bool_field() const +{ + return m_array_bool_field; +} + +/*! + * @brief This function returns a reference to member array_bool_field + * @return Reference to member array_bool_field + */ +std::array& ContentFilterTestType::array_bool_field() +{ + return m_array_bool_field; +} + + +/*! + * @brief This function copies the value in member array_string_field + * @param _array_string_field New value to be copied in member array_string_field + */ +void ContentFilterTestType::array_string_field( + const std::array& _array_string_field) +{ + m_array_string_field = _array_string_field; +} + +/*! + * @brief This function moves the value in member array_string_field + * @param _array_string_field New value to be moved in member array_string_field + */ +void ContentFilterTestType::array_string_field( + std::array&& _array_string_field) +{ + m_array_string_field = std::move(_array_string_field); +} + +/*! + * @brief This function returns a constant reference to member array_string_field + * @return Constant reference to member array_string_field + */ +const std::array& ContentFilterTestType::array_string_field() const +{ + return m_array_string_field; +} + +/*! + * @brief This function returns a reference to member array_string_field + * @return Reference to member array_string_field + */ +std::array& ContentFilterTestType::array_string_field() +{ + return m_array_string_field; +} + + +/*! + * @brief This function copies the value in member array_enum_field + * @param _array_enum_field New value to be copied in member array_enum_field + */ +void ContentFilterTestType::array_enum_field( + const std::array& _array_enum_field) +{ + m_array_enum_field = _array_enum_field; +} + +/*! + * @brief This function moves the value in member array_enum_field + * @param _array_enum_field New value to be moved in member array_enum_field + */ +void ContentFilterTestType::array_enum_field( + std::array&& _array_enum_field) +{ + m_array_enum_field = std::move(_array_enum_field); +} + +/*! + * @brief This function returns a constant reference to member array_enum_field + * @return Constant reference to member array_enum_field + */ +const std::array& ContentFilterTestType::array_enum_field() const +{ + return m_array_enum_field; +} + +/*! + * @brief This function returns a reference to member array_enum_field + * @return Reference to member array_enum_field + */ +std::array& ContentFilterTestType::array_enum_field() +{ + return m_array_enum_field; +} + + +/*! + * @brief This function copies the value in member array_enum2_field + * @param _array_enum2_field New value to be copied in member array_enum2_field + */ +void ContentFilterTestType::array_enum2_field( + const std::array& _array_enum2_field) +{ + m_array_enum2_field = _array_enum2_field; +} + +/*! + * @brief This function moves the value in member array_enum2_field + * @param _array_enum2_field New value to be moved in member array_enum2_field + */ +void ContentFilterTestType::array_enum2_field( + std::array&& _array_enum2_field) +{ + m_array_enum2_field = std::move(_array_enum2_field); +} + +/*! + * @brief This function returns a constant reference to member array_enum2_field + * @return Constant reference to member array_enum2_field + */ +const std::array& ContentFilterTestType::array_enum2_field() const +{ + return m_array_enum2_field; +} + +/*! + * @brief This function returns a reference to member array_enum2_field + * @return Reference to member array_enum2_field + */ +std::array& ContentFilterTestType::array_enum2_field() +{ + return m_array_enum2_field; +} + + +/*! + * @brief This function copies the value in member array_struct_field + * @param _array_struct_field New value to be copied in member array_struct_field + */ +void ContentFilterTestType::array_struct_field( + const std::array& _array_struct_field) +{ + m_array_struct_field = _array_struct_field; +} + +/*! + * @brief This function moves the value in member array_struct_field + * @param _array_struct_field New value to be moved in member array_struct_field + */ +void ContentFilterTestType::array_struct_field( + std::array&& _array_struct_field) +{ + m_array_struct_field = std::move(_array_struct_field); +} + +/*! + * @brief This function returns a constant reference to member array_struct_field + * @return Constant reference to member array_struct_field + */ +const std::array& ContentFilterTestType::array_struct_field() const +{ + return m_array_struct_field; +} + +/*! + * @brief This function returns a reference to member array_struct_field + * @return Reference to member array_struct_field + */ +std::array& ContentFilterTestType::array_struct_field() +{ + return m_array_struct_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field + */ +void ContentFilterTestType::bounded_sequence_char_field( + const std::vector& _bounded_sequence_char_field) +{ + m_bounded_sequence_char_field = _bounded_sequence_char_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field + */ +void ContentFilterTestType::bounded_sequence_char_field( + std::vector&& _bounded_sequence_char_field) +{ + m_bounded_sequence_char_field = std::move(_bounded_sequence_char_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_char_field + * @return Constant reference to member bounded_sequence_char_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_char_field() const +{ + return m_bounded_sequence_char_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_char_field + * @return Reference to member bounded_sequence_char_field + */ +std::vector& ContentFilterTestType::bounded_sequence_char_field() +{ + return m_bounded_sequence_char_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field + */ +void ContentFilterTestType::bounded_sequence_uint8_field( + const std::vector& _bounded_sequence_uint8_field) +{ + m_bounded_sequence_uint8_field = _bounded_sequence_uint8_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field + */ +void ContentFilterTestType::bounded_sequence_uint8_field( + std::vector&& _bounded_sequence_uint8_field) +{ + m_bounded_sequence_uint8_field = std::move(_bounded_sequence_uint8_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_uint8_field + * @return Constant reference to member bounded_sequence_uint8_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_uint8_field() const +{ + return m_bounded_sequence_uint8_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_uint8_field + * @return Reference to member bounded_sequence_uint8_field + */ +std::vector& ContentFilterTestType::bounded_sequence_uint8_field() +{ + return m_bounded_sequence_uint8_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field + */ +void ContentFilterTestType::bounded_sequence_int16_field( + const std::vector& _bounded_sequence_int16_field) +{ + m_bounded_sequence_int16_field = _bounded_sequence_int16_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field + */ +void ContentFilterTestType::bounded_sequence_int16_field( + std::vector&& _bounded_sequence_int16_field) +{ + m_bounded_sequence_int16_field = std::move(_bounded_sequence_int16_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_int16_field + * @return Constant reference to member bounded_sequence_int16_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_int16_field() const +{ + return m_bounded_sequence_int16_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_int16_field + * @return Reference to member bounded_sequence_int16_field + */ +std::vector& ContentFilterTestType::bounded_sequence_int16_field() +{ + return m_bounded_sequence_int16_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field + */ +void ContentFilterTestType::bounded_sequence_uint16_field( + const std::vector& _bounded_sequence_uint16_field) +{ + m_bounded_sequence_uint16_field = _bounded_sequence_uint16_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field + */ +void ContentFilterTestType::bounded_sequence_uint16_field( + std::vector&& _bounded_sequence_uint16_field) +{ + m_bounded_sequence_uint16_field = std::move(_bounded_sequence_uint16_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_uint16_field + * @return Constant reference to member bounded_sequence_uint16_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_uint16_field() const +{ + return m_bounded_sequence_uint16_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_uint16_field + * @return Reference to member bounded_sequence_uint16_field + */ +std::vector& ContentFilterTestType::bounded_sequence_uint16_field() +{ + return m_bounded_sequence_uint16_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field + */ +void ContentFilterTestType::bounded_sequence_int32_field( + const std::vector& _bounded_sequence_int32_field) +{ + m_bounded_sequence_int32_field = _bounded_sequence_int32_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field + */ +void ContentFilterTestType::bounded_sequence_int32_field( + std::vector&& _bounded_sequence_int32_field) +{ + m_bounded_sequence_int32_field = std::move(_bounded_sequence_int32_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_int32_field + * @return Constant reference to member bounded_sequence_int32_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_int32_field() const +{ + return m_bounded_sequence_int32_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_int32_field + * @return Reference to member bounded_sequence_int32_field + */ +std::vector& ContentFilterTestType::bounded_sequence_int32_field() +{ + return m_bounded_sequence_int32_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field + */ +void ContentFilterTestType::bounded_sequence_uint32_field( + const std::vector& _bounded_sequence_uint32_field) +{ + m_bounded_sequence_uint32_field = _bounded_sequence_uint32_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field + */ +void ContentFilterTestType::bounded_sequence_uint32_field( + std::vector&& _bounded_sequence_uint32_field) +{ + m_bounded_sequence_uint32_field = std::move(_bounded_sequence_uint32_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_uint32_field + * @return Constant reference to member bounded_sequence_uint32_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_uint32_field() const +{ + return m_bounded_sequence_uint32_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_uint32_field + * @return Reference to member bounded_sequence_uint32_field + */ +std::vector& ContentFilterTestType::bounded_sequence_uint32_field() +{ + return m_bounded_sequence_uint32_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field + */ +void ContentFilterTestType::bounded_sequence_int64_field( + const std::vector& _bounded_sequence_int64_field) +{ + m_bounded_sequence_int64_field = _bounded_sequence_int64_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field + */ +void ContentFilterTestType::bounded_sequence_int64_field( + std::vector&& _bounded_sequence_int64_field) +{ + m_bounded_sequence_int64_field = std::move(_bounded_sequence_int64_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_int64_field + * @return Constant reference to member bounded_sequence_int64_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_int64_field() const +{ + return m_bounded_sequence_int64_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_int64_field + * @return Reference to member bounded_sequence_int64_field + */ +std::vector& ContentFilterTestType::bounded_sequence_int64_field() +{ + return m_bounded_sequence_int64_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field + */ +void ContentFilterTestType::bounded_sequence_uint64_field( + const std::vector& _bounded_sequence_uint64_field) +{ + m_bounded_sequence_uint64_field = _bounded_sequence_uint64_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field + */ +void ContentFilterTestType::bounded_sequence_uint64_field( + std::vector&& _bounded_sequence_uint64_field) +{ + m_bounded_sequence_uint64_field = std::move(_bounded_sequence_uint64_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_uint64_field + * @return Constant reference to member bounded_sequence_uint64_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_uint64_field() const +{ + return m_bounded_sequence_uint64_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_uint64_field + * @return Reference to member bounded_sequence_uint64_field + */ +std::vector& ContentFilterTestType::bounded_sequence_uint64_field() +{ + return m_bounded_sequence_uint64_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field + */ +void ContentFilterTestType::bounded_sequence_float_field( + const std::vector& _bounded_sequence_float_field) +{ + m_bounded_sequence_float_field = _bounded_sequence_float_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field + */ +void ContentFilterTestType::bounded_sequence_float_field( + std::vector&& _bounded_sequence_float_field) +{ + m_bounded_sequence_float_field = std::move(_bounded_sequence_float_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_float_field + * @return Constant reference to member bounded_sequence_float_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_float_field() const +{ + return m_bounded_sequence_float_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_float_field + * @return Reference to member bounded_sequence_float_field + */ +std::vector& ContentFilterTestType::bounded_sequence_float_field() +{ + return m_bounded_sequence_float_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field + */ +void ContentFilterTestType::bounded_sequence_double_field( + const std::vector& _bounded_sequence_double_field) +{ + m_bounded_sequence_double_field = _bounded_sequence_double_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field + */ +void ContentFilterTestType::bounded_sequence_double_field( + std::vector&& _bounded_sequence_double_field) +{ + m_bounded_sequence_double_field = std::move(_bounded_sequence_double_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_double_field + * @return Constant reference to member bounded_sequence_double_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_double_field() const +{ + return m_bounded_sequence_double_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_double_field + * @return Reference to member bounded_sequence_double_field + */ +std::vector& ContentFilterTestType::bounded_sequence_double_field() +{ + return m_bounded_sequence_double_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field + */ +void ContentFilterTestType::bounded_sequence_long_double_field( + const std::vector& _bounded_sequence_long_double_field) +{ + m_bounded_sequence_long_double_field = _bounded_sequence_long_double_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field + */ +void ContentFilterTestType::bounded_sequence_long_double_field( + std::vector&& _bounded_sequence_long_double_field) +{ + m_bounded_sequence_long_double_field = std::move(_bounded_sequence_long_double_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_long_double_field + * @return Constant reference to member bounded_sequence_long_double_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_long_double_field() const +{ + return m_bounded_sequence_long_double_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_long_double_field + * @return Reference to member bounded_sequence_long_double_field + */ +std::vector& ContentFilterTestType::bounded_sequence_long_double_field() +{ + return m_bounded_sequence_long_double_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field + */ +void ContentFilterTestType::bounded_sequence_bool_field( + const std::vector& _bounded_sequence_bool_field) +{ + m_bounded_sequence_bool_field = _bounded_sequence_bool_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field + */ +void ContentFilterTestType::bounded_sequence_bool_field( + std::vector&& _bounded_sequence_bool_field) +{ + m_bounded_sequence_bool_field = std::move(_bounded_sequence_bool_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_bool_field + * @return Constant reference to member bounded_sequence_bool_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_bool_field() const +{ + return m_bounded_sequence_bool_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_bool_field + * @return Reference to member bounded_sequence_bool_field + */ +std::vector& ContentFilterTestType::bounded_sequence_bool_field() +{ + return m_bounded_sequence_bool_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field + */ +void ContentFilterTestType::bounded_sequence_string_field( + const std::vector& _bounded_sequence_string_field) +{ + m_bounded_sequence_string_field = _bounded_sequence_string_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field + */ +void ContentFilterTestType::bounded_sequence_string_field( + std::vector&& _bounded_sequence_string_field) +{ + m_bounded_sequence_string_field = std::move(_bounded_sequence_string_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_string_field + * @return Constant reference to member bounded_sequence_string_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_string_field() const +{ + return m_bounded_sequence_string_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_string_field + * @return Reference to member bounded_sequence_string_field + */ +std::vector& ContentFilterTestType::bounded_sequence_string_field() +{ + return m_bounded_sequence_string_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field + */ +void ContentFilterTestType::bounded_sequence_enum_field( + const std::vector& _bounded_sequence_enum_field) +{ + m_bounded_sequence_enum_field = _bounded_sequence_enum_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field + */ +void ContentFilterTestType::bounded_sequence_enum_field( + std::vector&& _bounded_sequence_enum_field) +{ + m_bounded_sequence_enum_field = std::move(_bounded_sequence_enum_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_enum_field + * @return Constant reference to member bounded_sequence_enum_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_enum_field() const +{ + return m_bounded_sequence_enum_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_enum_field + * @return Reference to member bounded_sequence_enum_field + */ +std::vector& ContentFilterTestType::bounded_sequence_enum_field() +{ + return m_bounded_sequence_enum_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field + */ +void ContentFilterTestType::bounded_sequence_enum2_field( + const std::vector& _bounded_sequence_enum2_field) +{ + m_bounded_sequence_enum2_field = _bounded_sequence_enum2_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field + */ +void ContentFilterTestType::bounded_sequence_enum2_field( + std::vector&& _bounded_sequence_enum2_field) +{ + m_bounded_sequence_enum2_field = std::move(_bounded_sequence_enum2_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_enum2_field + * @return Constant reference to member bounded_sequence_enum2_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_enum2_field() const +{ + return m_bounded_sequence_enum2_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_enum2_field + * @return Reference to member bounded_sequence_enum2_field + */ +std::vector& ContentFilterTestType::bounded_sequence_enum2_field() +{ + return m_bounded_sequence_enum2_field; +} + + +/*! + * @brief This function copies the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field + */ +void ContentFilterTestType::bounded_sequence_struct_field( + const std::vector& _bounded_sequence_struct_field) +{ + m_bounded_sequence_struct_field = _bounded_sequence_struct_field; +} + +/*! + * @brief This function moves the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field + */ +void ContentFilterTestType::bounded_sequence_struct_field( + std::vector&& _bounded_sequence_struct_field) +{ + m_bounded_sequence_struct_field = std::move(_bounded_sequence_struct_field); +} + +/*! + * @brief This function returns a constant reference to member bounded_sequence_struct_field + * @return Constant reference to member bounded_sequence_struct_field + */ +const std::vector& ContentFilterTestType::bounded_sequence_struct_field() const +{ + return m_bounded_sequence_struct_field; +} + +/*! + * @brief This function returns a reference to member bounded_sequence_struct_field + * @return Reference to member bounded_sequence_struct_field + */ +std::vector& ContentFilterTestType::bounded_sequence_struct_field() +{ + return m_bounded_sequence_struct_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field + */ +void ContentFilterTestType::unbounded_sequence_char_field( + const std::vector& _unbounded_sequence_char_field) +{ + m_unbounded_sequence_char_field = _unbounded_sequence_char_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field + */ +void ContentFilterTestType::unbounded_sequence_char_field( + std::vector&& _unbounded_sequence_char_field) +{ + m_unbounded_sequence_char_field = std::move(_unbounded_sequence_char_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_char_field + * @return Constant reference to member unbounded_sequence_char_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_char_field() const +{ + return m_unbounded_sequence_char_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_char_field + * @return Reference to member unbounded_sequence_char_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_char_field() +{ + return m_unbounded_sequence_char_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field + */ +void ContentFilterTestType::unbounded_sequence_uint8_field( + const std::vector& _unbounded_sequence_uint8_field) +{ + m_unbounded_sequence_uint8_field = _unbounded_sequence_uint8_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field + */ +void ContentFilterTestType::unbounded_sequence_uint8_field( + std::vector&& _unbounded_sequence_uint8_field) +{ + m_unbounded_sequence_uint8_field = std::move(_unbounded_sequence_uint8_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_uint8_field + * @return Constant reference to member unbounded_sequence_uint8_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() const +{ + return m_unbounded_sequence_uint8_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_uint8_field + * @return Reference to member unbounded_sequence_uint8_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_uint8_field() +{ + return m_unbounded_sequence_uint8_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field + */ +void ContentFilterTestType::unbounded_sequence_int16_field( + const std::vector& _unbounded_sequence_int16_field) +{ + m_unbounded_sequence_int16_field = _unbounded_sequence_int16_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field + */ +void ContentFilterTestType::unbounded_sequence_int16_field( + std::vector&& _unbounded_sequence_int16_field) +{ + m_unbounded_sequence_int16_field = std::move(_unbounded_sequence_int16_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_int16_field + * @return Constant reference to member unbounded_sequence_int16_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_int16_field() const +{ + return m_unbounded_sequence_int16_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_int16_field + * @return Reference to member unbounded_sequence_int16_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_int16_field() +{ + return m_unbounded_sequence_int16_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field + */ +void ContentFilterTestType::unbounded_sequence_uint16_field( + const std::vector& _unbounded_sequence_uint16_field) +{ + m_unbounded_sequence_uint16_field = _unbounded_sequence_uint16_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field + */ +void ContentFilterTestType::unbounded_sequence_uint16_field( + std::vector&& _unbounded_sequence_uint16_field) +{ + m_unbounded_sequence_uint16_field = std::move(_unbounded_sequence_uint16_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_uint16_field + * @return Constant reference to member unbounded_sequence_uint16_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() const +{ + return m_unbounded_sequence_uint16_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_uint16_field + * @return Reference to member unbounded_sequence_uint16_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_uint16_field() +{ + return m_unbounded_sequence_uint16_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field + */ +void ContentFilterTestType::unbounded_sequence_int32_field( + const std::vector& _unbounded_sequence_int32_field) +{ + m_unbounded_sequence_int32_field = _unbounded_sequence_int32_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field + */ +void ContentFilterTestType::unbounded_sequence_int32_field( + std::vector&& _unbounded_sequence_int32_field) +{ + m_unbounded_sequence_int32_field = std::move(_unbounded_sequence_int32_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_int32_field + * @return Constant reference to member unbounded_sequence_int32_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_int32_field() const +{ + return m_unbounded_sequence_int32_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_int32_field + * @return Reference to member unbounded_sequence_int32_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_int32_field() +{ + return m_unbounded_sequence_int32_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field + */ +void ContentFilterTestType::unbounded_sequence_uint32_field( + const std::vector& _unbounded_sequence_uint32_field) +{ + m_unbounded_sequence_uint32_field = _unbounded_sequence_uint32_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field + */ +void ContentFilterTestType::unbounded_sequence_uint32_field( + std::vector&& _unbounded_sequence_uint32_field) +{ + m_unbounded_sequence_uint32_field = std::move(_unbounded_sequence_uint32_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_uint32_field + * @return Constant reference to member unbounded_sequence_uint32_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() const +{ + return m_unbounded_sequence_uint32_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_uint32_field + * @return Reference to member unbounded_sequence_uint32_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_uint32_field() +{ + return m_unbounded_sequence_uint32_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field + */ +void ContentFilterTestType::unbounded_sequence_int64_field( + const std::vector& _unbounded_sequence_int64_field) +{ + m_unbounded_sequence_int64_field = _unbounded_sequence_int64_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field + */ +void ContentFilterTestType::unbounded_sequence_int64_field( + std::vector&& _unbounded_sequence_int64_field) +{ + m_unbounded_sequence_int64_field = std::move(_unbounded_sequence_int64_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_int64_field + * @return Constant reference to member unbounded_sequence_int64_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_int64_field() const +{ + return m_unbounded_sequence_int64_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_int64_field + * @return Reference to member unbounded_sequence_int64_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_int64_field() +{ + return m_unbounded_sequence_int64_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field + */ +void ContentFilterTestType::unbounded_sequence_uint64_field( + const std::vector& _unbounded_sequence_uint64_field) +{ + m_unbounded_sequence_uint64_field = _unbounded_sequence_uint64_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field + */ +void ContentFilterTestType::unbounded_sequence_uint64_field( + std::vector&& _unbounded_sequence_uint64_field) +{ + m_unbounded_sequence_uint64_field = std::move(_unbounded_sequence_uint64_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_uint64_field + * @return Constant reference to member unbounded_sequence_uint64_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() const +{ + return m_unbounded_sequence_uint64_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_uint64_field + * @return Reference to member unbounded_sequence_uint64_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_uint64_field() +{ + return m_unbounded_sequence_uint64_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field + */ +void ContentFilterTestType::unbounded_sequence_float_field( + const std::vector& _unbounded_sequence_float_field) +{ + m_unbounded_sequence_float_field = _unbounded_sequence_float_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field + */ +void ContentFilterTestType::unbounded_sequence_float_field( + std::vector&& _unbounded_sequence_float_field) +{ + m_unbounded_sequence_float_field = std::move(_unbounded_sequence_float_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_float_field + * @return Constant reference to member unbounded_sequence_float_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_float_field() const +{ + return m_unbounded_sequence_float_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_float_field + * @return Reference to member unbounded_sequence_float_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_float_field() +{ + return m_unbounded_sequence_float_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field + */ +void ContentFilterTestType::unbounded_sequence_double_field( + const std::vector& _unbounded_sequence_double_field) +{ + m_unbounded_sequence_double_field = _unbounded_sequence_double_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field + */ +void ContentFilterTestType::unbounded_sequence_double_field( + std::vector&& _unbounded_sequence_double_field) +{ + m_unbounded_sequence_double_field = std::move(_unbounded_sequence_double_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_double_field + * @return Constant reference to member unbounded_sequence_double_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_double_field() const +{ + return m_unbounded_sequence_double_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_double_field + * @return Reference to member unbounded_sequence_double_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_double_field() +{ + return m_unbounded_sequence_double_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field + */ +void ContentFilterTestType::unbounded_sequence_long_double_field( + const std::vector& _unbounded_sequence_long_double_field) +{ + m_unbounded_sequence_long_double_field = _unbounded_sequence_long_double_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field + */ +void ContentFilterTestType::unbounded_sequence_long_double_field( + std::vector&& _unbounded_sequence_long_double_field) +{ + m_unbounded_sequence_long_double_field = std::move(_unbounded_sequence_long_double_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_long_double_field + * @return Constant reference to member unbounded_sequence_long_double_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() const +{ + return m_unbounded_sequence_long_double_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_long_double_field + * @return Reference to member unbounded_sequence_long_double_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_long_double_field() +{ + return m_unbounded_sequence_long_double_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field + */ +void ContentFilterTestType::unbounded_sequence_bool_field( + const std::vector& _unbounded_sequence_bool_field) +{ + m_unbounded_sequence_bool_field = _unbounded_sequence_bool_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field + */ +void ContentFilterTestType::unbounded_sequence_bool_field( + std::vector&& _unbounded_sequence_bool_field) +{ + m_unbounded_sequence_bool_field = std::move(_unbounded_sequence_bool_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_bool_field + * @return Constant reference to member unbounded_sequence_bool_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_bool_field() const +{ + return m_unbounded_sequence_bool_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_bool_field + * @return Reference to member unbounded_sequence_bool_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_bool_field() +{ + return m_unbounded_sequence_bool_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field + */ +void ContentFilterTestType::unbounded_sequence_string_field( + const std::vector& _unbounded_sequence_string_field) +{ + m_unbounded_sequence_string_field = _unbounded_sequence_string_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field + */ +void ContentFilterTestType::unbounded_sequence_string_field( + std::vector&& _unbounded_sequence_string_field) +{ + m_unbounded_sequence_string_field = std::move(_unbounded_sequence_string_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_string_field + * @return Constant reference to member unbounded_sequence_string_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_string_field() const +{ + return m_unbounded_sequence_string_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_string_field + * @return Reference to member unbounded_sequence_string_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_string_field() +{ + return m_unbounded_sequence_string_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field + */ +void ContentFilterTestType::unbounded_sequence_enum_field( + const std::vector& _unbounded_sequence_enum_field) +{ + m_unbounded_sequence_enum_field = _unbounded_sequence_enum_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field + */ +void ContentFilterTestType::unbounded_sequence_enum_field( + std::vector&& _unbounded_sequence_enum_field) +{ + m_unbounded_sequence_enum_field = std::move(_unbounded_sequence_enum_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_enum_field + * @return Constant reference to member unbounded_sequence_enum_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_enum_field() const +{ + return m_unbounded_sequence_enum_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_enum_field + * @return Reference to member unbounded_sequence_enum_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_enum_field() +{ + return m_unbounded_sequence_enum_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field + */ +void ContentFilterTestType::unbounded_sequence_enum2_field( + const std::vector& _unbounded_sequence_enum2_field) +{ + m_unbounded_sequence_enum2_field = _unbounded_sequence_enum2_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field + */ +void ContentFilterTestType::unbounded_sequence_enum2_field( + std::vector&& _unbounded_sequence_enum2_field) +{ + m_unbounded_sequence_enum2_field = std::move(_unbounded_sequence_enum2_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_enum2_field + * @return Constant reference to member unbounded_sequence_enum2_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() const +{ + return m_unbounded_sequence_enum2_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_enum2_field + * @return Reference to member unbounded_sequence_enum2_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_enum2_field() +{ + return m_unbounded_sequence_enum2_field; +} + + +/*! + * @brief This function copies the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field + */ +void ContentFilterTestType::unbounded_sequence_struct_field( + const std::vector& _unbounded_sequence_struct_field) +{ + m_unbounded_sequence_struct_field = _unbounded_sequence_struct_field; +} + +/*! + * @brief This function moves the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field + */ +void ContentFilterTestType::unbounded_sequence_struct_field( + std::vector&& _unbounded_sequence_struct_field) +{ + m_unbounded_sequence_struct_field = std::move(_unbounded_sequence_struct_field); +} + +/*! + * @brief This function returns a constant reference to member unbounded_sequence_struct_field + * @return Constant reference to member unbounded_sequence_struct_field + */ +const std::vector& ContentFilterTestType::unbounded_sequence_struct_field() const +{ + return m_unbounded_sequence_struct_field; +} + +/*! + * @brief This function returns a reference to member unbounded_sequence_struct_field + * @return Reference to member unbounded_sequence_struct_field + */ +std::vector& ContentFilterTestType::unbounded_sequence_struct_field() +{ + return m_unbounded_sequence_struct_field; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h new file mode 100644 index 00000000000..d4aafaa5ca3 --- /dev/null +++ b/test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestTypev1.h @@ -0,0 +1,2358 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file ContentFilterTestType.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ +#define _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(CONTENTFILTERTESTTYPE_SOURCE) +#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllexport ) +#else +#define CONTENTFILTERTESTTYPE_DllAPI __declspec( dllimport ) +#endif // CONTENTFILTERTESTTYPE_SOURCE +#else +#define CONTENTFILTERTESTTYPE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define CONTENTFILTERTESTTYPE_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration Color defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +enum Color : uint32_t +{ + RED, + GREEN, + BLUE, + YELLOW, + MAGENTA +}; +/*! + * @brief This class represents the enumeration Material defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +enum Material : uint32_t +{ + WOOD, + PLASTIC, + METAL, + CONCRETE, + STONE +}; + + +/*! + * @brief This class represents the structure StructType defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +class StructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StructType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StructType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType( + const StructType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType( + StructType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType& operator =( + const StructType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StructType that will be copied. + */ + eProsima_user_DllExport StructType& operator =( + StructType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StructType& x) const; + + /*! + * @brief Comparison operator. + * @param x StructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StructType& x) const; + + /*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ + eProsima_user_DllExport void char_field( + char _char_field); + + /*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ + eProsima_user_DllExport char char_field() const; + + /*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ + eProsima_user_DllExport char& char_field(); + + + /*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ + eProsima_user_DllExport void uint8_field( + uint8_t _uint8_field); + + /*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ + eProsima_user_DllExport uint8_t uint8_field() const; + + /*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ + eProsima_user_DllExport uint8_t& uint8_field(); + + + /*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ + eProsima_user_DllExport void int16_field( + int16_t _int16_field); + + /*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ + eProsima_user_DllExport int16_t int16_field() const; + + /*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ + eProsima_user_DllExport int16_t& int16_field(); + + + /*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ + eProsima_user_DllExport void uint16_field( + uint16_t _uint16_field); + + /*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ + eProsima_user_DllExport uint16_t uint16_field() const; + + /*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ + eProsima_user_DllExport uint16_t& uint16_field(); + + + /*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ + eProsima_user_DllExport void int32_field( + int32_t _int32_field); + + /*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ + eProsima_user_DllExport int32_t int32_field() const; + + /*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ + eProsima_user_DllExport int32_t& int32_field(); + + + /*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ + eProsima_user_DllExport void uint32_field( + uint32_t _uint32_field); + + /*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ + eProsima_user_DllExport uint32_t uint32_field() const; + + /*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ + eProsima_user_DllExport uint32_t& uint32_field(); + + + /*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ + eProsima_user_DllExport void int64_field( + int64_t _int64_field); + + /*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ + eProsima_user_DllExport int64_t int64_field() const; + + /*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ + eProsima_user_DllExport int64_t& int64_field(); + + + /*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ + eProsima_user_DllExport void uint64_field( + uint64_t _uint64_field); + + /*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ + eProsima_user_DllExport uint64_t uint64_field() const; + + /*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ + eProsima_user_DllExport uint64_t& uint64_field(); + + + /*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ + eProsima_user_DllExport void float_field( + float _float_field); + + /*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ + eProsima_user_DllExport float float_field() const; + + /*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ + eProsima_user_DllExport float& float_field(); + + + /*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ + eProsima_user_DllExport void double_field( + double _double_field); + + /*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ + eProsima_user_DllExport double double_field() const; + + /*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ + eProsima_user_DllExport double& double_field(); + + + /*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ + eProsima_user_DllExport void long_double_field( + long double _long_double_field); + + /*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ + eProsima_user_DllExport long double long_double_field() const; + + /*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ + eProsima_user_DllExport long double& long_double_field(); + + + /*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ + eProsima_user_DllExport void bool_field( + bool _bool_field); + + /*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ + eProsima_user_DllExport bool bool_field() const; + + /*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ + eProsima_user_DllExport bool& bool_field(); + + + /*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ + eProsima_user_DllExport void string_field( + const std::string& _string_field); + + /*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ + eProsima_user_DllExport void string_field( + std::string&& _string_field); + + /*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ + eProsima_user_DllExport const std::string& string_field() const; + + /*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ + eProsima_user_DllExport std::string& string_field(); + + + /*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ + eProsima_user_DllExport void enum_field( + Color _enum_field); + + /*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ + eProsima_user_DllExport Color enum_field() const; + + /*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ + eProsima_user_DllExport Color& enum_field(); + + + /*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ + eProsima_user_DllExport void enum2_field( + Material _enum2_field); + + /*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ + eProsima_user_DllExport Material enum2_field() const; + + /*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ + eProsima_user_DllExport Material& enum2_field(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StructType& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + char m_char_field; + uint8_t m_uint8_field; + int16_t m_int16_field; + uint16_t m_uint16_field; + int32_t m_int32_field; + uint32_t m_uint32_field; + int64_t m_int64_field; + uint64_t m_uint64_field; + float m_float_field; + double m_double_field; + long double m_long_double_field; + bool m_bool_field; + std::string m_string_field; + Color m_enum_field; + Material m_enum2_field; + +}; + +const uint32_t max_array_size = 3; + +const uint32_t max_seq_size = 5; + + + + + +/*! + * @brief This class represents the structure ContentFilterTestType defined by the user in the IDL file. + * @ingroup ContentFilterTestType + */ +class ContentFilterTestType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ContentFilterTestType(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ContentFilterTestType(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType( + const ContentFilterTestType& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType( + ContentFilterTestType&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType& operator =( + const ContentFilterTestType& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ContentFilterTestType that will be copied. + */ + eProsima_user_DllExport ContentFilterTestType& operator =( + ContentFilterTestType&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ContentFilterTestType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ContentFilterTestType& x) const; + + /*! + * @brief Comparison operator. + * @param x ContentFilterTestType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ContentFilterTestType& x) const; + + /*! + * @brief This function sets a value in member char_field + * @param _char_field New value for member char_field + */ + eProsima_user_DllExport void char_field( + char _char_field); + + /*! + * @brief This function returns the value of member char_field + * @return Value of member char_field + */ + eProsima_user_DllExport char char_field() const; + + /*! + * @brief This function returns a reference to member char_field + * @return Reference to member char_field + */ + eProsima_user_DllExport char& char_field(); + + + /*! + * @brief This function sets a value in member uint8_field + * @param _uint8_field New value for member uint8_field + */ + eProsima_user_DllExport void uint8_field( + uint8_t _uint8_field); + + /*! + * @brief This function returns the value of member uint8_field + * @return Value of member uint8_field + */ + eProsima_user_DllExport uint8_t uint8_field() const; + + /*! + * @brief This function returns a reference to member uint8_field + * @return Reference to member uint8_field + */ + eProsima_user_DllExport uint8_t& uint8_field(); + + + /*! + * @brief This function sets a value in member int16_field + * @param _int16_field New value for member int16_field + */ + eProsima_user_DllExport void int16_field( + int16_t _int16_field); + + /*! + * @brief This function returns the value of member int16_field + * @return Value of member int16_field + */ + eProsima_user_DllExport int16_t int16_field() const; + + /*! + * @brief This function returns a reference to member int16_field + * @return Reference to member int16_field + */ + eProsima_user_DllExport int16_t& int16_field(); + + + /*! + * @brief This function sets a value in member uint16_field + * @param _uint16_field New value for member uint16_field + */ + eProsima_user_DllExport void uint16_field( + uint16_t _uint16_field); + + /*! + * @brief This function returns the value of member uint16_field + * @return Value of member uint16_field + */ + eProsima_user_DllExport uint16_t uint16_field() const; + + /*! + * @brief This function returns a reference to member uint16_field + * @return Reference to member uint16_field + */ + eProsima_user_DllExport uint16_t& uint16_field(); + + + /*! + * @brief This function sets a value in member int32_field + * @param _int32_field New value for member int32_field + */ + eProsima_user_DllExport void int32_field( + int32_t _int32_field); + + /*! + * @brief This function returns the value of member int32_field + * @return Value of member int32_field + */ + eProsima_user_DllExport int32_t int32_field() const; + + /*! + * @brief This function returns a reference to member int32_field + * @return Reference to member int32_field + */ + eProsima_user_DllExport int32_t& int32_field(); + + + /*! + * @brief This function sets a value in member uint32_field + * @param _uint32_field New value for member uint32_field + */ + eProsima_user_DllExport void uint32_field( + uint32_t _uint32_field); + + /*! + * @brief This function returns the value of member uint32_field + * @return Value of member uint32_field + */ + eProsima_user_DllExport uint32_t uint32_field() const; + + /*! + * @brief This function returns a reference to member uint32_field + * @return Reference to member uint32_field + */ + eProsima_user_DllExport uint32_t& uint32_field(); + + + /*! + * @brief This function sets a value in member int64_field + * @param _int64_field New value for member int64_field + */ + eProsima_user_DllExport void int64_field( + int64_t _int64_field); + + /*! + * @brief This function returns the value of member int64_field + * @return Value of member int64_field + */ + eProsima_user_DllExport int64_t int64_field() const; + + /*! + * @brief This function returns a reference to member int64_field + * @return Reference to member int64_field + */ + eProsima_user_DllExport int64_t& int64_field(); + + + /*! + * @brief This function sets a value in member uint64_field + * @param _uint64_field New value for member uint64_field + */ + eProsima_user_DllExport void uint64_field( + uint64_t _uint64_field); + + /*! + * @brief This function returns the value of member uint64_field + * @return Value of member uint64_field + */ + eProsima_user_DllExport uint64_t uint64_field() const; + + /*! + * @brief This function returns a reference to member uint64_field + * @return Reference to member uint64_field + */ + eProsima_user_DllExport uint64_t& uint64_field(); + + + /*! + * @brief This function sets a value in member float_field + * @param _float_field New value for member float_field + */ + eProsima_user_DllExport void float_field( + float _float_field); + + /*! + * @brief This function returns the value of member float_field + * @return Value of member float_field + */ + eProsima_user_DllExport float float_field() const; + + /*! + * @brief This function returns a reference to member float_field + * @return Reference to member float_field + */ + eProsima_user_DllExport float& float_field(); + + + /*! + * @brief This function sets a value in member double_field + * @param _double_field New value for member double_field + */ + eProsima_user_DllExport void double_field( + double _double_field); + + /*! + * @brief This function returns the value of member double_field + * @return Value of member double_field + */ + eProsima_user_DllExport double double_field() const; + + /*! + * @brief This function returns a reference to member double_field + * @return Reference to member double_field + */ + eProsima_user_DllExport double& double_field(); + + + /*! + * @brief This function sets a value in member long_double_field + * @param _long_double_field New value for member long_double_field + */ + eProsima_user_DllExport void long_double_field( + long double _long_double_field); + + /*! + * @brief This function returns the value of member long_double_field + * @return Value of member long_double_field + */ + eProsima_user_DllExport long double long_double_field() const; + + /*! + * @brief This function returns a reference to member long_double_field + * @return Reference to member long_double_field + */ + eProsima_user_DllExport long double& long_double_field(); + + + /*! + * @brief This function sets a value in member bool_field + * @param _bool_field New value for member bool_field + */ + eProsima_user_DllExport void bool_field( + bool _bool_field); + + /*! + * @brief This function returns the value of member bool_field + * @return Value of member bool_field + */ + eProsima_user_DllExport bool bool_field() const; + + /*! + * @brief This function returns a reference to member bool_field + * @return Reference to member bool_field + */ + eProsima_user_DllExport bool& bool_field(); + + + /*! + * @brief This function copies the value in member string_field + * @param _string_field New value to be copied in member string_field + */ + eProsima_user_DllExport void string_field( + const std::string& _string_field); + + /*! + * @brief This function moves the value in member string_field + * @param _string_field New value to be moved in member string_field + */ + eProsima_user_DllExport void string_field( + std::string&& _string_field); + + /*! + * @brief This function returns a constant reference to member string_field + * @return Constant reference to member string_field + */ + eProsima_user_DllExport const std::string& string_field() const; + + /*! + * @brief This function returns a reference to member string_field + * @return Reference to member string_field + */ + eProsima_user_DllExport std::string& string_field(); + + + /*! + * @brief This function sets a value in member enum_field + * @param _enum_field New value for member enum_field + */ + eProsima_user_DllExport void enum_field( + Color _enum_field); + + /*! + * @brief This function returns the value of member enum_field + * @return Value of member enum_field + */ + eProsima_user_DllExport Color enum_field() const; + + /*! + * @brief This function returns a reference to member enum_field + * @return Reference to member enum_field + */ + eProsima_user_DllExport Color& enum_field(); + + + /*! + * @brief This function sets a value in member enum2_field + * @param _enum2_field New value for member enum2_field + */ + eProsima_user_DllExport void enum2_field( + Material _enum2_field); + + /*! + * @brief This function returns the value of member enum2_field + * @return Value of member enum2_field + */ + eProsima_user_DllExport Material enum2_field() const; + + /*! + * @brief This function returns a reference to member enum2_field + * @return Reference to member enum2_field + */ + eProsima_user_DllExport Material& enum2_field(); + + + /*! + * @brief This function copies the value in member struct_field + * @param _struct_field New value to be copied in member struct_field + */ + eProsima_user_DllExport void struct_field( + const StructType& _struct_field); + + /*! + * @brief This function moves the value in member struct_field + * @param _struct_field New value to be moved in member struct_field + */ + eProsima_user_DllExport void struct_field( + StructType&& _struct_field); + + /*! + * @brief This function returns a constant reference to member struct_field + * @return Constant reference to member struct_field + */ + eProsima_user_DllExport const StructType& struct_field() const; + + /*! + * @brief This function returns a reference to member struct_field + * @return Reference to member struct_field + */ + eProsima_user_DllExport StructType& struct_field(); + + + /*! + * @brief This function copies the value in member array_char_field + * @param _array_char_field New value to be copied in member array_char_field + */ + eProsima_user_DllExport void array_char_field( + const std::array& _array_char_field); + + /*! + * @brief This function moves the value in member array_char_field + * @param _array_char_field New value to be moved in member array_char_field + */ + eProsima_user_DllExport void array_char_field( + std::array&& _array_char_field); + + /*! + * @brief This function returns a constant reference to member array_char_field + * @return Constant reference to member array_char_field + */ + eProsima_user_DllExport const std::array& array_char_field() const; + + /*! + * @brief This function returns a reference to member array_char_field + * @return Reference to member array_char_field + */ + eProsima_user_DllExport std::array& array_char_field(); + + + /*! + * @brief This function copies the value in member array_uint8_field + * @param _array_uint8_field New value to be copied in member array_uint8_field + */ + eProsima_user_DllExport void array_uint8_field( + const std::array& _array_uint8_field); + + /*! + * @brief This function moves the value in member array_uint8_field + * @param _array_uint8_field New value to be moved in member array_uint8_field + */ + eProsima_user_DllExport void array_uint8_field( + std::array&& _array_uint8_field); + + /*! + * @brief This function returns a constant reference to member array_uint8_field + * @return Constant reference to member array_uint8_field + */ + eProsima_user_DllExport const std::array& array_uint8_field() const; + + /*! + * @brief This function returns a reference to member array_uint8_field + * @return Reference to member array_uint8_field + */ + eProsima_user_DllExport std::array& array_uint8_field(); + + + /*! + * @brief This function copies the value in member array_int16_field + * @param _array_int16_field New value to be copied in member array_int16_field + */ + eProsima_user_DllExport void array_int16_field( + const std::array& _array_int16_field); + + /*! + * @brief This function moves the value in member array_int16_field + * @param _array_int16_field New value to be moved in member array_int16_field + */ + eProsima_user_DllExport void array_int16_field( + std::array&& _array_int16_field); + + /*! + * @brief This function returns a constant reference to member array_int16_field + * @return Constant reference to member array_int16_field + */ + eProsima_user_DllExport const std::array& array_int16_field() const; + + /*! + * @brief This function returns a reference to member array_int16_field + * @return Reference to member array_int16_field + */ + eProsima_user_DllExport std::array& array_int16_field(); + + + /*! + * @brief This function copies the value in member array_uint16_field + * @param _array_uint16_field New value to be copied in member array_uint16_field + */ + eProsima_user_DllExport void array_uint16_field( + const std::array& _array_uint16_field); + + /*! + * @brief This function moves the value in member array_uint16_field + * @param _array_uint16_field New value to be moved in member array_uint16_field + */ + eProsima_user_DllExport void array_uint16_field( + std::array&& _array_uint16_field); + + /*! + * @brief This function returns a constant reference to member array_uint16_field + * @return Constant reference to member array_uint16_field + */ + eProsima_user_DllExport const std::array& array_uint16_field() const; + + /*! + * @brief This function returns a reference to member array_uint16_field + * @return Reference to member array_uint16_field + */ + eProsima_user_DllExport std::array& array_uint16_field(); + + + /*! + * @brief This function copies the value in member array_int32_field + * @param _array_int32_field New value to be copied in member array_int32_field + */ + eProsima_user_DllExport void array_int32_field( + const std::array& _array_int32_field); + + /*! + * @brief This function moves the value in member array_int32_field + * @param _array_int32_field New value to be moved in member array_int32_field + */ + eProsima_user_DllExport void array_int32_field( + std::array&& _array_int32_field); + + /*! + * @brief This function returns a constant reference to member array_int32_field + * @return Constant reference to member array_int32_field + */ + eProsima_user_DllExport const std::array& array_int32_field() const; + + /*! + * @brief This function returns a reference to member array_int32_field + * @return Reference to member array_int32_field + */ + eProsima_user_DllExport std::array& array_int32_field(); + + + /*! + * @brief This function copies the value in member array_uint32_field + * @param _array_uint32_field New value to be copied in member array_uint32_field + */ + eProsima_user_DllExport void array_uint32_field( + const std::array& _array_uint32_field); + + /*! + * @brief This function moves the value in member array_uint32_field + * @param _array_uint32_field New value to be moved in member array_uint32_field + */ + eProsima_user_DllExport void array_uint32_field( + std::array&& _array_uint32_field); + + /*! + * @brief This function returns a constant reference to member array_uint32_field + * @return Constant reference to member array_uint32_field + */ + eProsima_user_DllExport const std::array& array_uint32_field() const; + + /*! + * @brief This function returns a reference to member array_uint32_field + * @return Reference to member array_uint32_field + */ + eProsima_user_DllExport std::array& array_uint32_field(); + + + /*! + * @brief This function copies the value in member array_int64_field + * @param _array_int64_field New value to be copied in member array_int64_field + */ + eProsima_user_DllExport void array_int64_field( + const std::array& _array_int64_field); + + /*! + * @brief This function moves the value in member array_int64_field + * @param _array_int64_field New value to be moved in member array_int64_field + */ + eProsima_user_DllExport void array_int64_field( + std::array&& _array_int64_field); + + /*! + * @brief This function returns a constant reference to member array_int64_field + * @return Constant reference to member array_int64_field + */ + eProsima_user_DllExport const std::array& array_int64_field() const; + + /*! + * @brief This function returns a reference to member array_int64_field + * @return Reference to member array_int64_field + */ + eProsima_user_DllExport std::array& array_int64_field(); + + + /*! + * @brief This function copies the value in member array_uint64_field + * @param _array_uint64_field New value to be copied in member array_uint64_field + */ + eProsima_user_DllExport void array_uint64_field( + const std::array& _array_uint64_field); + + /*! + * @brief This function moves the value in member array_uint64_field + * @param _array_uint64_field New value to be moved in member array_uint64_field + */ + eProsima_user_DllExport void array_uint64_field( + std::array&& _array_uint64_field); + + /*! + * @brief This function returns a constant reference to member array_uint64_field + * @return Constant reference to member array_uint64_field + */ + eProsima_user_DllExport const std::array& array_uint64_field() const; + + /*! + * @brief This function returns a reference to member array_uint64_field + * @return Reference to member array_uint64_field + */ + eProsima_user_DllExport std::array& array_uint64_field(); + + + /*! + * @brief This function copies the value in member array_float_field + * @param _array_float_field New value to be copied in member array_float_field + */ + eProsima_user_DllExport void array_float_field( + const std::array& _array_float_field); + + /*! + * @brief This function moves the value in member array_float_field + * @param _array_float_field New value to be moved in member array_float_field + */ + eProsima_user_DllExport void array_float_field( + std::array&& _array_float_field); + + /*! + * @brief This function returns a constant reference to member array_float_field + * @return Constant reference to member array_float_field + */ + eProsima_user_DllExport const std::array& array_float_field() const; + + /*! + * @brief This function returns a reference to member array_float_field + * @return Reference to member array_float_field + */ + eProsima_user_DllExport std::array& array_float_field(); + + + /*! + * @brief This function copies the value in member array_double_field + * @param _array_double_field New value to be copied in member array_double_field + */ + eProsima_user_DllExport void array_double_field( + const std::array& _array_double_field); + + /*! + * @brief This function moves the value in member array_double_field + * @param _array_double_field New value to be moved in member array_double_field + */ + eProsima_user_DllExport void array_double_field( + std::array&& _array_double_field); + + /*! + * @brief This function returns a constant reference to member array_double_field + * @return Constant reference to member array_double_field + */ + eProsima_user_DllExport const std::array& array_double_field() const; + + /*! + * @brief This function returns a reference to member array_double_field + * @return Reference to member array_double_field + */ + eProsima_user_DllExport std::array& array_double_field(); + + + /*! + * @brief This function copies the value in member array_long_double_field + * @param _array_long_double_field New value to be copied in member array_long_double_field + */ + eProsima_user_DllExport void array_long_double_field( + const std::array& _array_long_double_field); + + /*! + * @brief This function moves the value in member array_long_double_field + * @param _array_long_double_field New value to be moved in member array_long_double_field + */ + eProsima_user_DllExport void array_long_double_field( + std::array&& _array_long_double_field); + + /*! + * @brief This function returns a constant reference to member array_long_double_field + * @return Constant reference to member array_long_double_field + */ + eProsima_user_DllExport const std::array& array_long_double_field() const; + + /*! + * @brief This function returns a reference to member array_long_double_field + * @return Reference to member array_long_double_field + */ + eProsima_user_DllExport std::array& array_long_double_field(); + + + /*! + * @brief This function copies the value in member array_bool_field + * @param _array_bool_field New value to be copied in member array_bool_field + */ + eProsima_user_DllExport void array_bool_field( + const std::array& _array_bool_field); + + /*! + * @brief This function moves the value in member array_bool_field + * @param _array_bool_field New value to be moved in member array_bool_field + */ + eProsima_user_DllExport void array_bool_field( + std::array&& _array_bool_field); + + /*! + * @brief This function returns a constant reference to member array_bool_field + * @return Constant reference to member array_bool_field + */ + eProsima_user_DllExport const std::array& array_bool_field() const; + + /*! + * @brief This function returns a reference to member array_bool_field + * @return Reference to member array_bool_field + */ + eProsima_user_DllExport std::array& array_bool_field(); + + + /*! + * @brief This function copies the value in member array_string_field + * @param _array_string_field New value to be copied in member array_string_field + */ + eProsima_user_DllExport void array_string_field( + const std::array& _array_string_field); + + /*! + * @brief This function moves the value in member array_string_field + * @param _array_string_field New value to be moved in member array_string_field + */ + eProsima_user_DllExport void array_string_field( + std::array&& _array_string_field); + + /*! + * @brief This function returns a constant reference to member array_string_field + * @return Constant reference to member array_string_field + */ + eProsima_user_DllExport const std::array& array_string_field() const; + + /*! + * @brief This function returns a reference to member array_string_field + * @return Reference to member array_string_field + */ + eProsima_user_DllExport std::array& array_string_field(); + + + /*! + * @brief This function copies the value in member array_enum_field + * @param _array_enum_field New value to be copied in member array_enum_field + */ + eProsima_user_DllExport void array_enum_field( + const std::array& _array_enum_field); + + /*! + * @brief This function moves the value in member array_enum_field + * @param _array_enum_field New value to be moved in member array_enum_field + */ + eProsima_user_DllExport void array_enum_field( + std::array&& _array_enum_field); + + /*! + * @brief This function returns a constant reference to member array_enum_field + * @return Constant reference to member array_enum_field + */ + eProsima_user_DllExport const std::array& array_enum_field() const; + + /*! + * @brief This function returns a reference to member array_enum_field + * @return Reference to member array_enum_field + */ + eProsima_user_DllExport std::array& array_enum_field(); + + + /*! + * @brief This function copies the value in member array_enum2_field + * @param _array_enum2_field New value to be copied in member array_enum2_field + */ + eProsima_user_DllExport void array_enum2_field( + const std::array& _array_enum2_field); + + /*! + * @brief This function moves the value in member array_enum2_field + * @param _array_enum2_field New value to be moved in member array_enum2_field + */ + eProsima_user_DllExport void array_enum2_field( + std::array&& _array_enum2_field); + + /*! + * @brief This function returns a constant reference to member array_enum2_field + * @return Constant reference to member array_enum2_field + */ + eProsima_user_DllExport const std::array& array_enum2_field() const; + + /*! + * @brief This function returns a reference to member array_enum2_field + * @return Reference to member array_enum2_field + */ + eProsima_user_DllExport std::array& array_enum2_field(); + + + /*! + * @brief This function copies the value in member array_struct_field + * @param _array_struct_field New value to be copied in member array_struct_field + */ + eProsima_user_DllExport void array_struct_field( + const std::array& _array_struct_field); + + /*! + * @brief This function moves the value in member array_struct_field + * @param _array_struct_field New value to be moved in member array_struct_field + */ + eProsima_user_DllExport void array_struct_field( + std::array&& _array_struct_field); + + /*! + * @brief This function returns a constant reference to member array_struct_field + * @return Constant reference to member array_struct_field + */ + eProsima_user_DllExport const std::array& array_struct_field() const; + + /*! + * @brief This function returns a reference to member array_struct_field + * @return Reference to member array_struct_field + */ + eProsima_user_DllExport std::array& array_struct_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be copied in member bounded_sequence_char_field + */ + eProsima_user_DllExport void bounded_sequence_char_field( + const std::vector& _bounded_sequence_char_field); + + /*! + * @brief This function moves the value in member bounded_sequence_char_field + * @param _bounded_sequence_char_field New value to be moved in member bounded_sequence_char_field + */ + eProsima_user_DllExport void bounded_sequence_char_field( + std::vector&& _bounded_sequence_char_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_char_field + * @return Constant reference to member bounded_sequence_char_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_char_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_char_field + * @return Reference to member bounded_sequence_char_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_char_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be copied in member bounded_sequence_uint8_field + */ + eProsima_user_DllExport void bounded_sequence_uint8_field( + const std::vector& _bounded_sequence_uint8_field); + + /*! + * @brief This function moves the value in member bounded_sequence_uint8_field + * @param _bounded_sequence_uint8_field New value to be moved in member bounded_sequence_uint8_field + */ + eProsima_user_DllExport void bounded_sequence_uint8_field( + std::vector&& _bounded_sequence_uint8_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint8_field + * @return Constant reference to member bounded_sequence_uint8_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint8_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_uint8_field + * @return Reference to member bounded_sequence_uint8_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint8_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be copied in member bounded_sequence_int16_field + */ + eProsima_user_DllExport void bounded_sequence_int16_field( + const std::vector& _bounded_sequence_int16_field); + + /*! + * @brief This function moves the value in member bounded_sequence_int16_field + * @param _bounded_sequence_int16_field New value to be moved in member bounded_sequence_int16_field + */ + eProsima_user_DllExport void bounded_sequence_int16_field( + std::vector&& _bounded_sequence_int16_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int16_field + * @return Constant reference to member bounded_sequence_int16_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int16_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_int16_field + * @return Reference to member bounded_sequence_int16_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int16_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be copied in member bounded_sequence_uint16_field + */ + eProsima_user_DllExport void bounded_sequence_uint16_field( + const std::vector& _bounded_sequence_uint16_field); + + /*! + * @brief This function moves the value in member bounded_sequence_uint16_field + * @param _bounded_sequence_uint16_field New value to be moved in member bounded_sequence_uint16_field + */ + eProsima_user_DllExport void bounded_sequence_uint16_field( + std::vector&& _bounded_sequence_uint16_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint16_field + * @return Constant reference to member bounded_sequence_uint16_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint16_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_uint16_field + * @return Reference to member bounded_sequence_uint16_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint16_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be copied in member bounded_sequence_int32_field + */ + eProsima_user_DllExport void bounded_sequence_int32_field( + const std::vector& _bounded_sequence_int32_field); + + /*! + * @brief This function moves the value in member bounded_sequence_int32_field + * @param _bounded_sequence_int32_field New value to be moved in member bounded_sequence_int32_field + */ + eProsima_user_DllExport void bounded_sequence_int32_field( + std::vector&& _bounded_sequence_int32_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int32_field + * @return Constant reference to member bounded_sequence_int32_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int32_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_int32_field + * @return Reference to member bounded_sequence_int32_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int32_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be copied in member bounded_sequence_uint32_field + */ + eProsima_user_DllExport void bounded_sequence_uint32_field( + const std::vector& _bounded_sequence_uint32_field); + + /*! + * @brief This function moves the value in member bounded_sequence_uint32_field + * @param _bounded_sequence_uint32_field New value to be moved in member bounded_sequence_uint32_field + */ + eProsima_user_DllExport void bounded_sequence_uint32_field( + std::vector&& _bounded_sequence_uint32_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint32_field + * @return Constant reference to member bounded_sequence_uint32_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint32_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_uint32_field + * @return Reference to member bounded_sequence_uint32_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint32_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be copied in member bounded_sequence_int64_field + */ + eProsima_user_DllExport void bounded_sequence_int64_field( + const std::vector& _bounded_sequence_int64_field); + + /*! + * @brief This function moves the value in member bounded_sequence_int64_field + * @param _bounded_sequence_int64_field New value to be moved in member bounded_sequence_int64_field + */ + eProsima_user_DllExport void bounded_sequence_int64_field( + std::vector&& _bounded_sequence_int64_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_int64_field + * @return Constant reference to member bounded_sequence_int64_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_int64_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_int64_field + * @return Reference to member bounded_sequence_int64_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_int64_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be copied in member bounded_sequence_uint64_field + */ + eProsima_user_DllExport void bounded_sequence_uint64_field( + const std::vector& _bounded_sequence_uint64_field); + + /*! + * @brief This function moves the value in member bounded_sequence_uint64_field + * @param _bounded_sequence_uint64_field New value to be moved in member bounded_sequence_uint64_field + */ + eProsima_user_DllExport void bounded_sequence_uint64_field( + std::vector&& _bounded_sequence_uint64_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_uint64_field + * @return Constant reference to member bounded_sequence_uint64_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_uint64_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_uint64_field + * @return Reference to member bounded_sequence_uint64_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_uint64_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be copied in member bounded_sequence_float_field + */ + eProsima_user_DllExport void bounded_sequence_float_field( + const std::vector& _bounded_sequence_float_field); + + /*! + * @brief This function moves the value in member bounded_sequence_float_field + * @param _bounded_sequence_float_field New value to be moved in member bounded_sequence_float_field + */ + eProsima_user_DllExport void bounded_sequence_float_field( + std::vector&& _bounded_sequence_float_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_float_field + * @return Constant reference to member bounded_sequence_float_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_float_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_float_field + * @return Reference to member bounded_sequence_float_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_float_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be copied in member bounded_sequence_double_field + */ + eProsima_user_DllExport void bounded_sequence_double_field( + const std::vector& _bounded_sequence_double_field); + + /*! + * @brief This function moves the value in member bounded_sequence_double_field + * @param _bounded_sequence_double_field New value to be moved in member bounded_sequence_double_field + */ + eProsima_user_DllExport void bounded_sequence_double_field( + std::vector&& _bounded_sequence_double_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_double_field + * @return Constant reference to member bounded_sequence_double_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_double_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_double_field + * @return Reference to member bounded_sequence_double_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_double_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be copied in member bounded_sequence_long_double_field + */ + eProsima_user_DllExport void bounded_sequence_long_double_field( + const std::vector& _bounded_sequence_long_double_field); + + /*! + * @brief This function moves the value in member bounded_sequence_long_double_field + * @param _bounded_sequence_long_double_field New value to be moved in member bounded_sequence_long_double_field + */ + eProsima_user_DllExport void bounded_sequence_long_double_field( + std::vector&& _bounded_sequence_long_double_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_long_double_field + * @return Constant reference to member bounded_sequence_long_double_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_long_double_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_long_double_field + * @return Reference to member bounded_sequence_long_double_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_long_double_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be copied in member bounded_sequence_bool_field + */ + eProsima_user_DllExport void bounded_sequence_bool_field( + const std::vector& _bounded_sequence_bool_field); + + /*! + * @brief This function moves the value in member bounded_sequence_bool_field + * @param _bounded_sequence_bool_field New value to be moved in member bounded_sequence_bool_field + */ + eProsima_user_DllExport void bounded_sequence_bool_field( + std::vector&& _bounded_sequence_bool_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_bool_field + * @return Constant reference to member bounded_sequence_bool_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_bool_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_bool_field + * @return Reference to member bounded_sequence_bool_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_bool_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be copied in member bounded_sequence_string_field + */ + eProsima_user_DllExport void bounded_sequence_string_field( + const std::vector& _bounded_sequence_string_field); + + /*! + * @brief This function moves the value in member bounded_sequence_string_field + * @param _bounded_sequence_string_field New value to be moved in member bounded_sequence_string_field + */ + eProsima_user_DllExport void bounded_sequence_string_field( + std::vector&& _bounded_sequence_string_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_string_field + * @return Constant reference to member bounded_sequence_string_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_string_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_string_field + * @return Reference to member bounded_sequence_string_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_string_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be copied in member bounded_sequence_enum_field + */ + eProsima_user_DllExport void bounded_sequence_enum_field( + const std::vector& _bounded_sequence_enum_field); + + /*! + * @brief This function moves the value in member bounded_sequence_enum_field + * @param _bounded_sequence_enum_field New value to be moved in member bounded_sequence_enum_field + */ + eProsima_user_DllExport void bounded_sequence_enum_field( + std::vector&& _bounded_sequence_enum_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_enum_field + * @return Constant reference to member bounded_sequence_enum_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_enum_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_enum_field + * @return Reference to member bounded_sequence_enum_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_enum_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be copied in member bounded_sequence_enum2_field + */ + eProsima_user_DllExport void bounded_sequence_enum2_field( + const std::vector& _bounded_sequence_enum2_field); + + /*! + * @brief This function moves the value in member bounded_sequence_enum2_field + * @param _bounded_sequence_enum2_field New value to be moved in member bounded_sequence_enum2_field + */ + eProsima_user_DllExport void bounded_sequence_enum2_field( + std::vector&& _bounded_sequence_enum2_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_enum2_field + * @return Constant reference to member bounded_sequence_enum2_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_enum2_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_enum2_field + * @return Reference to member bounded_sequence_enum2_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_enum2_field(); + + + /*! + * @brief This function copies the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be copied in member bounded_sequence_struct_field + */ + eProsima_user_DllExport void bounded_sequence_struct_field( + const std::vector& _bounded_sequence_struct_field); + + /*! + * @brief This function moves the value in member bounded_sequence_struct_field + * @param _bounded_sequence_struct_field New value to be moved in member bounded_sequence_struct_field + */ + eProsima_user_DllExport void bounded_sequence_struct_field( + std::vector&& _bounded_sequence_struct_field); + + /*! + * @brief This function returns a constant reference to member bounded_sequence_struct_field + * @return Constant reference to member bounded_sequence_struct_field + */ + eProsima_user_DllExport const std::vector& bounded_sequence_struct_field() const; + + /*! + * @brief This function returns a reference to member bounded_sequence_struct_field + * @return Reference to member bounded_sequence_struct_field + */ + eProsima_user_DllExport std::vector& bounded_sequence_struct_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be copied in member unbounded_sequence_char_field + */ + eProsima_user_DllExport void unbounded_sequence_char_field( + const std::vector& _unbounded_sequence_char_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_char_field + * @param _unbounded_sequence_char_field New value to be moved in member unbounded_sequence_char_field + */ + eProsima_user_DllExport void unbounded_sequence_char_field( + std::vector&& _unbounded_sequence_char_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_char_field + * @return Constant reference to member unbounded_sequence_char_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_char_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_char_field + * @return Reference to member unbounded_sequence_char_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_char_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be copied in member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport void unbounded_sequence_uint8_field( + const std::vector& _unbounded_sequence_uint8_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_uint8_field + * @param _unbounded_sequence_uint8_field New value to be moved in member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport void unbounded_sequence_uint8_field( + std::vector&& _unbounded_sequence_uint8_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint8_field + * @return Constant reference to member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint8_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint8_field + * @return Reference to member unbounded_sequence_uint8_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint8_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be copied in member unbounded_sequence_int16_field + */ + eProsima_user_DllExport void unbounded_sequence_int16_field( + const std::vector& _unbounded_sequence_int16_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_int16_field + * @param _unbounded_sequence_int16_field New value to be moved in member unbounded_sequence_int16_field + */ + eProsima_user_DllExport void unbounded_sequence_int16_field( + std::vector&& _unbounded_sequence_int16_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int16_field + * @return Constant reference to member unbounded_sequence_int16_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int16_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_int16_field + * @return Reference to member unbounded_sequence_int16_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int16_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be copied in member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport void unbounded_sequence_uint16_field( + const std::vector& _unbounded_sequence_uint16_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_uint16_field + * @param _unbounded_sequence_uint16_field New value to be moved in member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport void unbounded_sequence_uint16_field( + std::vector&& _unbounded_sequence_uint16_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint16_field + * @return Constant reference to member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint16_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint16_field + * @return Reference to member unbounded_sequence_uint16_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint16_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be copied in member unbounded_sequence_int32_field + */ + eProsima_user_DllExport void unbounded_sequence_int32_field( + const std::vector& _unbounded_sequence_int32_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_int32_field + * @param _unbounded_sequence_int32_field New value to be moved in member unbounded_sequence_int32_field + */ + eProsima_user_DllExport void unbounded_sequence_int32_field( + std::vector&& _unbounded_sequence_int32_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int32_field + * @return Constant reference to member unbounded_sequence_int32_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int32_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_int32_field + * @return Reference to member unbounded_sequence_int32_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int32_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be copied in member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport void unbounded_sequence_uint32_field( + const std::vector& _unbounded_sequence_uint32_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_uint32_field + * @param _unbounded_sequence_uint32_field New value to be moved in member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport void unbounded_sequence_uint32_field( + std::vector&& _unbounded_sequence_uint32_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint32_field + * @return Constant reference to member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint32_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint32_field + * @return Reference to member unbounded_sequence_uint32_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint32_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be copied in member unbounded_sequence_int64_field + */ + eProsima_user_DllExport void unbounded_sequence_int64_field( + const std::vector& _unbounded_sequence_int64_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_int64_field + * @param _unbounded_sequence_int64_field New value to be moved in member unbounded_sequence_int64_field + */ + eProsima_user_DllExport void unbounded_sequence_int64_field( + std::vector&& _unbounded_sequence_int64_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_int64_field + * @return Constant reference to member unbounded_sequence_int64_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_int64_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_int64_field + * @return Reference to member unbounded_sequence_int64_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_int64_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be copied in member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport void unbounded_sequence_uint64_field( + const std::vector& _unbounded_sequence_uint64_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_uint64_field + * @param _unbounded_sequence_uint64_field New value to be moved in member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport void unbounded_sequence_uint64_field( + std::vector&& _unbounded_sequence_uint64_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_uint64_field + * @return Constant reference to member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_uint64_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_uint64_field + * @return Reference to member unbounded_sequence_uint64_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_uint64_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be copied in member unbounded_sequence_float_field + */ + eProsima_user_DllExport void unbounded_sequence_float_field( + const std::vector& _unbounded_sequence_float_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_float_field + * @param _unbounded_sequence_float_field New value to be moved in member unbounded_sequence_float_field + */ + eProsima_user_DllExport void unbounded_sequence_float_field( + std::vector&& _unbounded_sequence_float_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_float_field + * @return Constant reference to member unbounded_sequence_float_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_float_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_float_field + * @return Reference to member unbounded_sequence_float_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_float_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be copied in member unbounded_sequence_double_field + */ + eProsima_user_DllExport void unbounded_sequence_double_field( + const std::vector& _unbounded_sequence_double_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_double_field + * @param _unbounded_sequence_double_field New value to be moved in member unbounded_sequence_double_field + */ + eProsima_user_DllExport void unbounded_sequence_double_field( + std::vector&& _unbounded_sequence_double_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_double_field + * @return Constant reference to member unbounded_sequence_double_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_double_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_double_field + * @return Reference to member unbounded_sequence_double_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_double_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be copied in member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport void unbounded_sequence_long_double_field( + const std::vector& _unbounded_sequence_long_double_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_long_double_field + * @param _unbounded_sequence_long_double_field New value to be moved in member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport void unbounded_sequence_long_double_field( + std::vector&& _unbounded_sequence_long_double_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_long_double_field + * @return Constant reference to member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_long_double_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_long_double_field + * @return Reference to member unbounded_sequence_long_double_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_long_double_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be copied in member unbounded_sequence_bool_field + */ + eProsima_user_DllExport void unbounded_sequence_bool_field( + const std::vector& _unbounded_sequence_bool_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_bool_field + * @param _unbounded_sequence_bool_field New value to be moved in member unbounded_sequence_bool_field + */ + eProsima_user_DllExport void unbounded_sequence_bool_field( + std::vector&& _unbounded_sequence_bool_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_bool_field + * @return Constant reference to member unbounded_sequence_bool_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_bool_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_bool_field + * @return Reference to member unbounded_sequence_bool_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_bool_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be copied in member unbounded_sequence_string_field + */ + eProsima_user_DllExport void unbounded_sequence_string_field( + const std::vector& _unbounded_sequence_string_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_string_field + * @param _unbounded_sequence_string_field New value to be moved in member unbounded_sequence_string_field + */ + eProsima_user_DllExport void unbounded_sequence_string_field( + std::vector&& _unbounded_sequence_string_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_string_field + * @return Constant reference to member unbounded_sequence_string_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_string_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_string_field + * @return Reference to member unbounded_sequence_string_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_string_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be copied in member unbounded_sequence_enum_field + */ + eProsima_user_DllExport void unbounded_sequence_enum_field( + const std::vector& _unbounded_sequence_enum_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_enum_field + * @param _unbounded_sequence_enum_field New value to be moved in member unbounded_sequence_enum_field + */ + eProsima_user_DllExport void unbounded_sequence_enum_field( + std::vector&& _unbounded_sequence_enum_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_enum_field + * @return Constant reference to member unbounded_sequence_enum_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_enum_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_enum_field + * @return Reference to member unbounded_sequence_enum_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_enum_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be copied in member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport void unbounded_sequence_enum2_field( + const std::vector& _unbounded_sequence_enum2_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_enum2_field + * @param _unbounded_sequence_enum2_field New value to be moved in member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport void unbounded_sequence_enum2_field( + std::vector&& _unbounded_sequence_enum2_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_enum2_field + * @return Constant reference to member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_enum2_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_enum2_field + * @return Reference to member unbounded_sequence_enum2_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_enum2_field(); + + + /*! + * @brief This function copies the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be copied in member unbounded_sequence_struct_field + */ + eProsima_user_DllExport void unbounded_sequence_struct_field( + const std::vector& _unbounded_sequence_struct_field); + + /*! + * @brief This function moves the value in member unbounded_sequence_struct_field + * @param _unbounded_sequence_struct_field New value to be moved in member unbounded_sequence_struct_field + */ + eProsima_user_DllExport void unbounded_sequence_struct_field( + std::vector&& _unbounded_sequence_struct_field); + + /*! + * @brief This function returns a constant reference to member unbounded_sequence_struct_field + * @return Constant reference to member unbounded_sequence_struct_field + */ + eProsima_user_DllExport const std::vector& unbounded_sequence_struct_field() const; + + /*! + * @brief This function returns a reference to member unbounded_sequence_struct_field + * @return Reference to member unbounded_sequence_struct_field + */ + eProsima_user_DllExport std::vector& unbounded_sequence_struct_field(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ContentFilterTestType& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + char m_char_field; + uint8_t m_uint8_field; + int16_t m_int16_field; + uint16_t m_uint16_field; + int32_t m_int32_field; + uint32_t m_uint32_field; + int64_t m_int64_field; + uint64_t m_uint64_field; + float m_float_field; + double m_double_field; + long double m_long_double_field; + bool m_bool_field; + std::string m_string_field; + Color m_enum_field; + Material m_enum2_field; + StructType m_struct_field; + std::array m_array_char_field; + std::array m_array_uint8_field; + std::array m_array_int16_field; + std::array m_array_uint16_field; + std::array m_array_int32_field; + std::array m_array_uint32_field; + std::array m_array_int64_field; + std::array m_array_uint64_field; + std::array m_array_float_field; + std::array m_array_double_field; + std::array m_array_long_double_field; + std::array m_array_bool_field; + std::array m_array_string_field; + std::array m_array_enum_field; + std::array m_array_enum2_field; + std::array m_array_struct_field; + std::vector m_bounded_sequence_char_field; + std::vector m_bounded_sequence_uint8_field; + std::vector m_bounded_sequence_int16_field; + std::vector m_bounded_sequence_uint16_field; + std::vector m_bounded_sequence_int32_field; + std::vector m_bounded_sequence_uint32_field; + std::vector m_bounded_sequence_int64_field; + std::vector m_bounded_sequence_uint64_field; + std::vector m_bounded_sequence_float_field; + std::vector m_bounded_sequence_double_field; + std::vector m_bounded_sequence_long_double_field; + std::vector m_bounded_sequence_bool_field; + std::vector m_bounded_sequence_string_field; + std::vector m_bounded_sequence_enum_field; + std::vector m_bounded_sequence_enum2_field; + std::vector m_bounded_sequence_struct_field; + std::vector m_unbounded_sequence_char_field; + std::vector m_unbounded_sequence_uint8_field; + std::vector m_unbounded_sequence_int16_field; + std::vector m_unbounded_sequence_uint16_field; + std::vector m_unbounded_sequence_int32_field; + std::vector m_unbounded_sequence_uint32_field; + std::vector m_unbounded_sequence_int64_field; + std::vector m_unbounded_sequence_uint64_field; + std::vector m_unbounded_sequence_float_field; + std::vector m_unbounded_sequence_double_field; + std::vector m_unbounded_sequence_long_double_field; + std::vector m_unbounded_sequence_bool_field; + std::vector m_unbounded_sequence_string_field; + std::vector m_unbounded_sequence_enum_field; + std::vector m_unbounded_sequence_enum2_field; + std::vector m_unbounded_sequence_struct_field; + +}; + + +#endif // _FAST_DDS_GENERATED_CONTENTFILTERTESTTYPE_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/CMakeLists.txt b/test/unittest/dynamic_types/CMakeLists.txt index a709601897a..4bcb40fd526 100644 --- a/test/unittest/dynamic_types/CMakeLists.txt +++ b/test/unittest/dynamic_types/CMakeLists.txt @@ -73,6 +73,7 @@ endif() set(DYNAMIC_TYPES_TEST_SOURCE DynamicTypesTests.cpp idl/Basic.cxx + idl/Basicv1.cxx idl/BasicPubSubTypes.cxx idl/BasicTypeObject.cxx ${DYNAMIC_TYPES_SOURCE} @@ -91,6 +92,7 @@ set(DYNAMIC_TYPES_TEST_SOURCE set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE DynamicComplexTypesTests.cpp idl/Test.cxx + idl/Testv1.cxx idl/TestPubSubTypes.cxx idl/TestTypeObject.cxx ${DYNAMIC_TYPES_SOURCE} @@ -99,6 +101,7 @@ set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE set(DYNAMIC_TYPES_4_2_TEST_SOURCE DynamicTypes_4_2_Tests.cpp idl/new_features_4_2.cxx + idl/new_features_4_2v1.cxx idl/new_features_4_2PubSubTypes.cxx idl/new_features_4_2TypeObject.cxx ${DYNAMIC_TYPES_SOURCE} diff --git a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp b/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp index b64f0d71ba8..75930dcc02f 100644 --- a/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp +++ b/test/unittest/dynamic_types/DynamicComplexTypesTests.cpp @@ -12,8 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include + +#include +#include +#include #include #include #include @@ -27,9 +30,6 @@ #include #include #include -#include - -#include #include "idl/Test.h" #include "idl/TestPubSubTypes.h" diff --git a/test/unittest/dynamic_types/DynamicTypesTests.cpp b/test/unittest/dynamic_types/DynamicTypesTests.cpp index 269af76f639..41729254ecd 100644 --- a/test/unittest/dynamic_types/DynamicTypesTests.cpp +++ b/test/unittest/dynamic_types/DynamicTypesTests.cpp @@ -1394,9 +1394,9 @@ TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); } -/* TODO Commented because deprecated xtypes 1.1 will not be fix. Uncomment in future xtypes 1.3 api. - TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) - { +#if FASTCDR_VERSION_MAJOR == 1 +TEST_F(DynamicTypesTests, DynamicType_char16_unit_tests) +{ { DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); ASSERT_TRUE(created_builder != nullptr); @@ -1495,8 +1495,8 @@ TEST_F(DynamicTypesTests, DynamicType_char8_unit_tests) } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); - } - */ +} +#endif // if FASTCDR_VERSION_MAJOR == 1 TEST_F(DynamicTypesTests, DynamicType_byte_unit_tests) { @@ -1941,9 +1941,9 @@ TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); } -/* TODO Commented because deprecated xtypes 1.1 will not be fix. Uncomment in future xtypes 1.3 api. - TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) - { +#if FASTCDR_VERSION_MAJOR == 1 +TEST_F(DynamicTypesTests, DynamicType_wstring_unit_tests) +{ uint32_t length = 15; { DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder( @@ -2051,8 +2051,8 @@ TEST_F(DynamicTypesTests, DynamicType_string_unit_tests) } ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); - } - */ +} +#endif // if FASTCDR_VERSION_MAJOR == 1 TEST_F(DynamicTypesTests, DynamicType_alias_unit_tests) { diff --git a/test/unittest/dynamic_types/idl/Basic.cxx b/test/unittest/dynamic_types/idl/Basic.cxx index 38f2b74d52c..90e2adc8191 100644 --- a/test/unittest/dynamic_types/idl/Basic.cxx +++ b/test/unittest/dynamic_types/idl/Basic.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Basic.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "BasicTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + EnumStruct::EnumStruct() { - // Just to register all known types registerBasicTypes(); } @@ -66,7 +70,6 @@ EnumStruct& EnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -75,7 +78,6 @@ EnumStruct& EnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -120,9 +122,10 @@ MyEnum& EnumStruct::my_enum() } + + AliasStruct::AliasStruct() { - // Just to register all known types registerBasicTypes(); } @@ -148,7 +151,6 @@ AliasStruct& AliasStruct::operator =( { m_my_alias = x.m_my_alias; - return *this; } @@ -157,7 +159,6 @@ AliasStruct& AliasStruct::operator =( { m_my_alias = x.m_my_alias; - return *this; } @@ -202,9 +203,10 @@ MyAliasEnum& AliasStruct::my_alias() } + + AliasAliasStruct::AliasAliasStruct() { - // Just to register all known types registerBasicTypes(); } @@ -230,7 +232,6 @@ AliasAliasStruct& AliasAliasStruct::operator =( { m_my_alias_alias = x.m_my_alias_alias; - return *this; } @@ -239,7 +240,6 @@ AliasAliasStruct& AliasAliasStruct::operator =( { m_my_alias_alias = x.m_my_alias_alias; - return *this; } @@ -284,9 +284,10 @@ MyAliasAliasEnum& AliasAliasStruct::my_alias_alias() } + + BoolStruct::BoolStruct() { - // Just to register all known types registerBasicTypes(); } @@ -312,7 +313,6 @@ BoolStruct& BoolStruct::operator =( { m_my_bool = x.m_my_bool; - return *this; } @@ -321,7 +321,6 @@ BoolStruct& BoolStruct::operator =( { m_my_bool = x.m_my_bool; - return *this; } @@ -366,9 +365,10 @@ bool& BoolStruct::my_bool() } + + OctetStruct::OctetStruct() { - // Just to register all known types registerBasicTypes(); } @@ -394,7 +394,6 @@ OctetStruct& OctetStruct::operator =( { m_my_octet = x.m_my_octet; - return *this; } @@ -403,7 +402,6 @@ OctetStruct& OctetStruct::operator =( { m_my_octet = x.m_my_octet; - return *this; } @@ -448,9 +446,10 @@ uint8_t& OctetStruct::my_octet() } + + ShortStruct::ShortStruct() { - // Just to register all known types registerBasicTypes(); } @@ -476,7 +475,6 @@ ShortStruct& ShortStruct::operator =( { m_my_int16 = x.m_my_int16; - return *this; } @@ -485,7 +483,6 @@ ShortStruct& ShortStruct::operator =( { m_my_int16 = x.m_my_int16; - return *this; } @@ -530,9 +527,10 @@ int16_t& ShortStruct::my_int16() } + + LongStruct::LongStruct() { - // Just to register all known types registerBasicTypes(); } @@ -558,7 +556,6 @@ LongStruct& LongStruct::operator =( { m_my_int32 = x.m_my_int32; - return *this; } @@ -567,7 +564,6 @@ LongStruct& LongStruct::operator =( { m_my_int32 = x.m_my_int32; - return *this; } @@ -612,9 +608,10 @@ int32_t& LongStruct::my_int32() } + + LongLongStruct::LongLongStruct() { - // Just to register all known types registerBasicTypes(); } @@ -640,7 +637,6 @@ LongLongStruct& LongLongStruct::operator =( { m_my_int64 = x.m_my_int64; - return *this; } @@ -649,7 +645,6 @@ LongLongStruct& LongLongStruct::operator =( { m_my_int64 = x.m_my_int64; - return *this; } @@ -694,9 +689,10 @@ int64_t& LongLongStruct::my_int64() } + + UShortStruct::UShortStruct() { - // Just to register all known types registerBasicTypes(); } @@ -722,7 +718,6 @@ UShortStruct& UShortStruct::operator =( { m_my_uint16 = x.m_my_uint16; - return *this; } @@ -731,7 +726,6 @@ UShortStruct& UShortStruct::operator =( { m_my_uint16 = x.m_my_uint16; - return *this; } @@ -776,9 +770,10 @@ uint16_t& UShortStruct::my_uint16() } + + ULongStruct::ULongStruct() { - // Just to register all known types registerBasicTypes(); } @@ -804,7 +799,6 @@ ULongStruct& ULongStruct::operator =( { m_my_uint32 = x.m_my_uint32; - return *this; } @@ -813,7 +807,6 @@ ULongStruct& ULongStruct::operator =( { m_my_uint32 = x.m_my_uint32; - return *this; } @@ -858,9 +851,10 @@ uint32_t& ULongStruct::my_uint32() } + + ULongLongStruct::ULongLongStruct() { - // Just to register all known types registerBasicTypes(); } @@ -886,7 +880,6 @@ ULongLongStruct& ULongLongStruct::operator =( { m_my_uint64 = x.m_my_uint64; - return *this; } @@ -895,7 +888,6 @@ ULongLongStruct& ULongLongStruct::operator =( { m_my_uint64 = x.m_my_uint64; - return *this; } @@ -940,9 +932,10 @@ uint64_t& ULongLongStruct::my_uint64() } + + FloatStruct::FloatStruct() { - // Just to register all known types registerBasicTypes(); } @@ -968,7 +961,6 @@ FloatStruct& FloatStruct::operator =( { m_my_float32 = x.m_my_float32; - return *this; } @@ -977,7 +969,6 @@ FloatStruct& FloatStruct::operator =( { m_my_float32 = x.m_my_float32; - return *this; } @@ -1022,9 +1013,10 @@ float& FloatStruct::my_float32() } + + DoubleStruct::DoubleStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1050,7 +1042,6 @@ DoubleStruct& DoubleStruct::operator =( { m_my_float64 = x.m_my_float64; - return *this; } @@ -1059,7 +1050,6 @@ DoubleStruct& DoubleStruct::operator =( { m_my_float64 = x.m_my_float64; - return *this; } @@ -1104,9 +1094,10 @@ double& DoubleStruct::my_float64() } + + LongDoubleStruct::LongDoubleStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1132,7 +1123,6 @@ LongDoubleStruct& LongDoubleStruct::operator =( { m_my_float128 = x.m_my_float128; - return *this; } @@ -1141,7 +1131,6 @@ LongDoubleStruct& LongDoubleStruct::operator =( { m_my_float128 = x.m_my_float128; - return *this; } @@ -1186,9 +1175,10 @@ long double& LongDoubleStruct::my_float128() } + + CharStruct::CharStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1214,7 +1204,6 @@ CharStruct& CharStruct::operator =( { m_my_char = x.m_my_char; - return *this; } @@ -1223,7 +1212,6 @@ CharStruct& CharStruct::operator =( { m_my_char = x.m_my_char; - return *this; } @@ -1268,9 +1256,10 @@ char& CharStruct::my_char() } + + WCharStruct::WCharStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1296,7 +1285,6 @@ WCharStruct& WCharStruct::operator =( { m_my_wchar = x.m_my_wchar; - return *this; } @@ -1305,7 +1293,6 @@ WCharStruct& WCharStruct::operator =( { m_my_wchar = x.m_my_wchar; - return *this; } @@ -1350,9 +1337,10 @@ wchar_t& WCharStruct::my_wchar() } + + StringStruct::StringStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1378,7 +1366,6 @@ StringStruct& StringStruct::operator =( { m_my_string = x.m_my_string; - return *this; } @@ -1387,7 +1374,6 @@ StringStruct& StringStruct::operator =( { m_my_string = std::move(x.m_my_string); - return *this; } @@ -1442,9 +1428,10 @@ std::string& StringStruct::my_string() } + + WStringStruct::WStringStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1470,7 +1457,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = x.m_my_wstring; - return *this; } @@ -1479,7 +1465,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = std::move(x.m_my_wstring); - return *this; } @@ -1534,9 +1519,10 @@ std::wstring& WStringStruct::my_wstring() } + + LargeStringStruct::LargeStringStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1562,7 +1548,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = x.m_my_large_string; - return *this; } @@ -1571,7 +1556,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = std::move(x.m_my_large_string); - return *this; } @@ -1626,9 +1610,10 @@ eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() } + + LargeWStringStruct::LargeWStringStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1654,7 +1639,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = x.m_my_large_wstring; - return *this; } @@ -1663,7 +1647,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; } @@ -1718,9 +1701,10 @@ std::wstring& LargeWStringStruct::my_large_wstring() } + + ArraytStruct::ArraytStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1746,7 +1730,6 @@ ArraytStruct& ArraytStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1755,7 +1738,6 @@ ArraytStruct& ArraytStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1811,9 +1793,10 @@ std::array, 2>, 2>& ArraytStruct::my_array() + + ArrayArrayStruct::ArrayArrayStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1839,7 +1822,6 @@ ArrayArrayStruct& ArrayArrayStruct::operator =( { m_my_array_array = x.m_my_array_array; - return *this; } @@ -1848,7 +1830,6 @@ ArrayArrayStruct& ArrayArrayStruct::operator =( { m_my_array_array = std::move(x.m_my_array_array); - return *this; } @@ -1903,9 +1884,12 @@ std::array, 2>& ArrayArrayStruct::my_array_array() } + + + + SequenceStruct::SequenceStruct() { - // Just to register all known types registerBasicTypes(); } @@ -1931,7 +1915,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -1940,7 +1923,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -1995,9 +1977,14 @@ std::vector& SequenceStruct::my_sequence() } + + + + + + SequenceSequenceStruct::SequenceSequenceStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2023,7 +2010,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; } @@ -2032,7 +2018,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; } @@ -2087,9 +2072,12 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( } + + + + MapStruct::MapStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2115,7 +2103,6 @@ MapStruct& MapStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2124,7 +2111,6 @@ MapStruct& MapStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2179,9 +2165,14 @@ std::map& MapStruct::my_map() } + + + + + + MapMapStruct::MapMapStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2207,7 +2198,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = x.m_my_map_map; - return *this; } @@ -2216,7 +2206,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = std::move(x.m_my_map_map); - return *this; } @@ -2381,26 +2370,26 @@ std::bitset<30> MyBitset::bitset() const { std::string str_value; - str_value = m_bitset.to_string() + str_value; return std::bitset<30>(str_value); } -void MyBitset::bitset(const std::bitset<30>& bitset) +void MyBitset::bitset( + const std::bitset<30>& bitset) { std::string str_value {bitset.to_string()}; size_t base_diff {0}; size_t last_post {std::string::npos}; - base_diff += 30; m_bitset = std::bitset<30>(str_value.substr(str_value.length() - base_diff, last_post)); } + + BitsetStruct::BitsetStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2426,7 +2415,6 @@ BitsetStruct& BitsetStruct::operator =( { m_a = x.m_a; - return *this; } @@ -2435,7 +2423,6 @@ BitsetStruct& BitsetStruct::operator =( { m_a = std::move(x.m_a); - return *this; } @@ -2490,9 +2477,10 @@ MyBitset& BitsetStruct::a() } + + StructStruct::StructStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2521,7 +2509,6 @@ StructStruct& StructStruct::operator =( m_a = x.m_a; m_b = x.m_b; - return *this; } @@ -2531,7 +2518,6 @@ StructStruct& StructStruct::operator =( m_a = x.m_a; m_b = x.m_b; - return *this; } @@ -2606,9 +2592,10 @@ int64_t& StructStruct::b() } + + StructStructStruct::StructStructStruct() { - // Just to register all known types registerBasicTypes(); } @@ -2637,7 +2624,6 @@ StructStructStruct& StructStructStruct::operator =( m_child_struct = x.m_child_struct; m_child_int64 = x.m_child_int64; - return *this; } @@ -2647,7 +2633,6 @@ StructStructStruct& StructStructStruct::operator =( m_child_struct = std::move(x.m_child_struct); m_child_int64 = x.m_child_int64; - return *this; } @@ -2732,6 +2717,8 @@ int64_t& StructStructStruct::child_int64() } + + SimpleUnion::SimpleUnion() { m__d = A; @@ -2890,6 +2877,8 @@ void SimpleUnion::_d( } break; + default: + break; } if (!b) @@ -3012,6 +3001,8 @@ int64_t& SimpleUnion::second() } + + UnionUnion::UnionUnion() { m__d = A; @@ -3172,6 +3163,8 @@ void UnionUnion::_d( } break; + default: + break; } if (!b) @@ -3302,6 +3295,8 @@ SimpleUnion& UnionUnion::second() } + + WCharUnion::WCharUnion() { m__d = A; @@ -3460,6 +3455,8 @@ void WCharUnion::_d( } break; + default: + break; } if (!b) @@ -3582,9 +3579,10 @@ int64_t& WCharUnion::second() } + + SimpleUnionStruct::SimpleUnionStruct() { - // Just to register all known types registerBasicTypes(); } @@ -3610,7 +3608,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -3619,7 +3616,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -3674,9 +3670,10 @@ SimpleUnion& SimpleUnionStruct::my_union() } + + UnionUnionUnionStruct::UnionUnionUnionStruct() { - // Just to register all known types registerBasicTypes(); } @@ -3702,7 +3699,6 @@ UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -3711,7 +3707,6 @@ UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -3766,9 +3761,10 @@ UnionUnion& UnionUnionUnionStruct::my_union() } + + WCharUnionStruct::WCharUnionStruct() { - // Just to register all known types registerBasicTypes(); } @@ -3794,7 +3790,6 @@ WCharUnionStruct& WCharUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -3803,7 +3798,6 @@ WCharUnionStruct& WCharUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -3860,3 +3854,5 @@ WCharUnion& WCharUnionStruct::my_union() // Include auxiliary functions like for serializing/deserializing. #include "BasicCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Basic.h b/test/unittest/dynamic_types/idl/Basic.h index 6200dc7dbec..3f82c93abc2 100644 --- a/test/unittest/dynamic_types/idl/Basic.h +++ b/test/unittest/dynamic_types/idl/Basic.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Basicv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_BASIC_H_ #define _FAST_DDS_GENERATED_BASIC_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -81,6 +87,8 @@ typedef MyEnum MyAliasEnum; typedef MyAliasEnum MyAliasAliasEnum; + + /*! * @brief This class represents the structure EnumStruct defined by the user in the IDL file. * @ingroup Basic @@ -165,6 +173,8 @@ class EnumStruct MyEnum m_my_enum{::A}; }; + + /*! * @brief This class represents the structure AliasStruct defined by the user in the IDL file. * @ingroup Basic @@ -249,6 +259,8 @@ class AliasStruct MyAliasEnum m_my_alias{::A}; }; + + /*! * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. * @ingroup Basic @@ -333,6 +345,8 @@ class AliasAliasStruct MyAliasAliasEnum m_my_alias_alias{::A}; }; + + /*! * @brief This class represents the structure BoolStruct defined by the user in the IDL file. * @ingroup Basic @@ -417,6 +431,8 @@ class BoolStruct bool m_my_bool{false}; }; + + /*! * @brief This class represents the structure OctetStruct defined by the user in the IDL file. * @ingroup Basic @@ -501,6 +517,8 @@ class OctetStruct uint8_t m_my_octet{0}; }; + + /*! * @brief This class represents the structure ShortStruct defined by the user in the IDL file. * @ingroup Basic @@ -585,6 +603,8 @@ class ShortStruct int16_t m_my_int16{0}; }; + + /*! * @brief This class represents the structure LongStruct defined by the user in the IDL file. * @ingroup Basic @@ -669,6 +689,8 @@ class LongStruct int32_t m_my_int32{0}; }; + + /*! * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. * @ingroup Basic @@ -753,6 +775,8 @@ class LongLongStruct int64_t m_my_int64{0}; }; + + /*! * @brief This class represents the structure UShortStruct defined by the user in the IDL file. * @ingroup Basic @@ -837,6 +861,8 @@ class UShortStruct uint16_t m_my_uint16{0}; }; + + /*! * @brief This class represents the structure ULongStruct defined by the user in the IDL file. * @ingroup Basic @@ -921,6 +947,8 @@ class ULongStruct uint32_t m_my_uint32{0}; }; + + /*! * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. * @ingroup Basic @@ -1005,6 +1033,8 @@ class ULongLongStruct uint64_t m_my_uint64{0}; }; + + /*! * @brief This class represents the structure FloatStruct defined by the user in the IDL file. * @ingroup Basic @@ -1089,6 +1119,8 @@ class FloatStruct float m_my_float32{0.0}; }; + + /*! * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. * @ingroup Basic @@ -1173,6 +1205,8 @@ class DoubleStruct double m_my_float64{0.0}; }; + + /*! * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. * @ingroup Basic @@ -1257,6 +1291,8 @@ class LongDoubleStruct long double m_my_float128{0.0}; }; + + /*! * @brief This class represents the structure CharStruct defined by the user in the IDL file. * @ingroup Basic @@ -1341,6 +1377,8 @@ class CharStruct char m_my_char{0}; }; + + /*! * @brief This class represents the structure WCharStruct defined by the user in the IDL file. * @ingroup Basic @@ -1425,6 +1463,8 @@ class WCharStruct wchar_t m_my_wchar{0}; }; + + /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1516,6 +1556,8 @@ class StringStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1607,6 +1649,8 @@ class WStringStruct std::wstring m_my_wstring; }; + + /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1698,6 +1742,8 @@ class LargeStringStruct eprosima::fastcdr::fixed_string<41925> m_my_large_string; }; + + /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1789,6 +1835,8 @@ class LargeWStringStruct std::wstring m_my_large_wstring; }; + + /*! * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. * @ingroup Basic @@ -1882,6 +1930,8 @@ class ArraytStruct }; typedef std::array, 2> MyArray; + + /*! * @brief This class represents the structure ArrayArrayStruct defined by the user in the IDL file. * @ingroup Basic @@ -1973,6 +2023,10 @@ class ArrayArrayStruct std::array, 2> m_my_array_array{ {{ {{ {{0}} }} }} }; }; + + + + /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. * @ingroup Basic @@ -2064,6 +2118,12 @@ class SequenceStruct std::vector m_my_sequence; }; + + + + + + /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Basic @@ -2155,6 +2215,10 @@ class SequenceSequenceStruct std::vector> m_my_sequence_sequence; }; + + + + /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. * @ingroup Basic @@ -2246,6 +2310,12 @@ class MapStruct std::map m_my_map; }; + + + + + + /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. * @ingroup Basic @@ -2431,10 +2501,14 @@ class MyBitset eProsima_user_DllExport void bitset( const std::bitset<30>&); + + private: std::bitset<30> m_bitset; }; + + /*! * @brief This class represents the structure BitsetStruct defined by the user in the IDL file. * @ingroup Basic @@ -2526,6 +2600,8 @@ class BitsetStruct MyBitset m_a; }; + + /*! * @brief This class represents the structure StructStruct defined by the user in the IDL file. * @ingroup Basic @@ -2631,6 +2707,8 @@ class StructStruct int64_t m_b{0}; }; + + /*! * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. * @ingroup Basic @@ -2743,6 +2821,8 @@ class StructStructStruct int64_t m_child_int64{0}; }; + + /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. * @ingroup Basic @@ -2873,6 +2953,8 @@ class SimpleUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union UnionUnion defined by the user in the IDL file. * @ingroup Basic @@ -3010,6 +3092,8 @@ class UnionUnion int32_t m_first{0}; SimpleUnion m_second; }; + + /*! * @brief This class represents the union WCharUnion defined by the user in the IDL file. * @ingroup Basic @@ -3140,6 +3224,8 @@ class WCharUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. * @ingroup Basic @@ -3231,6 +3317,8 @@ class SimpleUnionStruct SimpleUnion m_my_union; }; + + /*! * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. * @ingroup Basic @@ -3322,6 +3410,8 @@ class UnionUnionUnionStruct UnionUnion m_my_union; }; + + /*! * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. * @ingroup Basic @@ -3416,3 +3506,6 @@ class WCharUnionStruct #endif // _FAST_DDS_GENERATED_BASIC_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp b/test/unittest/dynamic_types/idl/BasicCdrAux.hpp index 48fd42b1f2d..ddb7d2cc3b4 100644 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.hpp +++ b/test/unittest/dynamic_types/idl/BasicCdrAux.hpp @@ -135,120 +135,195 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const EnumStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AliasStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AliasAliasStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BoolStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const OctetStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ShortStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LongStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LongLongStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const UShortStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ULongStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ULongLongStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FloatStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const DoubleStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LongDoubleStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const CharStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const WCharStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const WStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeWStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArraytStruct& data); + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayArrayStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceSequenceStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapMapStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BitsetStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StructStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StructStructStruct& data); @@ -256,14 +331,29 @@ eProsima_user_DllExport void serialize_key( + + + + + + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const UnionUnionUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const WCharUnionStruct& data); @@ -272,4 +362,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BASICCDRAUX_HPP_ + diff --git a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp b/test/unittest/dynamic_types/idl/BasicCdrAux.ipp index 99c5a7053eb..99cd2571ef3 100644 --- a/test/unittest/dynamic_types/idl/BasicCdrAux.ipp +++ b/test/unittest/dynamic_types/idl/BasicCdrAux.ipp @@ -34,6 +34,12 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +79,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -111,6 +116,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -150,7 +157,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_alias() ; - scdr.end_serialize_type(current_state); } @@ -188,6 +194,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -227,7 +235,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_alias_alias() ; - scdr.end_serialize_type(current_state); } @@ -265,6 +272,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -304,7 +313,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_bool() ; - scdr.end_serialize_type(current_state); } @@ -342,6 +350,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -381,7 +391,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_octet() ; - scdr.end_serialize_type(current_state); } @@ -419,6 +428,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -458,7 +469,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_int16() ; - scdr.end_serialize_type(current_state); } @@ -496,6 +506,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -535,7 +547,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_int32() ; - scdr.end_serialize_type(current_state); } @@ -573,6 +584,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -612,7 +625,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_int64() ; - scdr.end_serialize_type(current_state); } @@ -650,6 +662,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -689,7 +703,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_uint16() ; - scdr.end_serialize_type(current_state); } @@ -727,6 +740,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -766,7 +781,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_uint32() ; - scdr.end_serialize_type(current_state); } @@ -804,6 +818,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -843,7 +859,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_uint64() ; - scdr.end_serialize_type(current_state); } @@ -881,6 +896,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -920,7 +937,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_float32() ; - scdr.end_serialize_type(current_state); } @@ -958,6 +974,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -997,7 +1015,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_float64() ; - scdr.end_serialize_type(current_state); } @@ -1035,6 +1052,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1074,7 +1093,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_float128() ; - scdr.end_serialize_type(current_state); } @@ -1112,6 +1130,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1151,7 +1171,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_char() ; - scdr.end_serialize_type(current_state); } @@ -1189,6 +1208,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1228,7 +1249,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_wchar() ; - scdr.end_serialize_type(current_state); } @@ -1266,6 +1286,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1305,7 +1327,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -1343,6 +1364,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1382,7 +1405,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_wstring() ; - scdr.end_serialize_type(current_state); } @@ -1420,6 +1442,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1459,7 +1483,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_string() ; - scdr.end_serialize_type(current_state); } @@ -1497,6 +1520,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1536,7 +1561,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() ; - scdr.end_serialize_type(current_state); } @@ -1574,6 +1598,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1613,7 +1639,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1652,6 +1677,9 @@ void serialize_key( + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1691,7 +1719,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array_array() ; - scdr.end_serialize_type(current_state); } @@ -1729,6 +1756,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1768,7 +1799,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1806,6 +1836,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1845,7 +1881,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1883,6 +1918,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1922,7 +1961,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -1960,6 +1998,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1999,7 +2043,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_map() ; - scdr.end_serialize_type(current_state); } @@ -2064,6 +2107,8 @@ eProsima_user_DllExport void deserialize( data.bitset(bitset); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2103,7 +2148,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.a() ; - scdr.end_serialize_type(current_state); } @@ -2141,6 +2185,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2184,7 +2230,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.a() << eprosima::fastcdr::MemberId(1) << data.b() ; - scdr.end_serialize_type(current_state); } @@ -2226,6 +2271,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2269,7 +2316,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.child_struct() << eprosima::fastcdr::MemberId(1) << data.child_int64() ; - scdr.end_serialize_type(current_state); } @@ -2311,6 +2357,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2341,6 +2389,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2372,6 +2422,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2404,6 +2456,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2412,6 +2466,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2442,6 +2498,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2473,6 +2531,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2505,6 +2565,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2513,6 +2575,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2543,6 +2607,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2574,6 +2640,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2606,6 +2674,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2614,6 +2684,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2653,7 +2725,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -2691,6 +2762,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2730,7 +2803,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -2768,6 +2840,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2807,7 +2881,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -2849,4 +2922,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BASICCDRAUX_IPP_ + diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx b/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx index ebfa75bc6af..efe25ce72f8 100644 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx +++ b/test/unittest/dynamic_types/idl/BasicPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "BasicPubSubTypes.h" #include "BasicCdrAux.hpp" @@ -31,10 +29,21 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + + + + EnumStructPubSubType::EnumStructPubSubType() { setName("EnumStruct"); - uint32_t type_size = EnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(EnumStruct::getMaxCdrSerializedSize()); +#else + EnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +74,12 @@ bool EnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +94,11 @@ bool EnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +115,11 @@ bool EnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +142,26 @@ std::function EnumStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +193,20 @@ bool EnumStructPubSubType::getKey( EnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || EnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -183,10 +223,17 @@ bool EnumStructPubSubType::getKey( return true; } + + AliasStructPubSubType::AliasStructPubSubType() { setName("AliasStruct"); - uint32_t type_size = AliasStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AliasStruct::getMaxCdrSerializedSize()); +#else + AliasStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -217,10 +264,12 @@ bool AliasStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -235,7 +284,11 @@ bool AliasStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -252,7 +305,11 @@ bool AliasStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -275,13 +332,26 @@ std::function AliasStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -313,12 +383,20 @@ bool AliasStructPubSubType::getKey( AliasStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || AliasStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -335,10 +413,17 @@ bool AliasStructPubSubType::getKey( return true; } + + AliasAliasStructPubSubType::AliasAliasStructPubSubType() { setName("AliasAliasStruct"); - uint32_t type_size = AliasAliasStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(AliasAliasStruct::getMaxCdrSerializedSize()); +#else + AliasAliasStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -369,10 +454,12 @@ bool AliasAliasStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -387,7 +474,11 @@ bool AliasAliasStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -404,7 +495,11 @@ bool AliasAliasStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -427,13 +522,26 @@ std::function AliasAliasStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -465,12 +573,20 @@ bool AliasAliasStructPubSubType::getKey( AliasAliasStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || AliasAliasStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -487,10 +603,17 @@ bool AliasAliasStructPubSubType::getKey( return true; } + + BoolStructPubSubType::BoolStructPubSubType() { setName("BoolStruct"); - uint32_t type_size = BoolStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BoolStruct::getMaxCdrSerializedSize()); +#else + BoolStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -521,10 +644,12 @@ bool BoolStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -539,7 +664,11 @@ bool BoolStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -556,7 +685,11 @@ bool BoolStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -579,13 +712,26 @@ std::function BoolStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -617,12 +763,20 @@ bool BoolStructPubSubType::getKey( BoolStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BoolStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -639,10 +793,17 @@ bool BoolStructPubSubType::getKey( return true; } + + OctetStructPubSubType::OctetStructPubSubType() { setName("OctetStruct"); - uint32_t type_size = OctetStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(OctetStruct::getMaxCdrSerializedSize()); +#else + OctetStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -673,10 +834,12 @@ bool OctetStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -691,7 +854,11 @@ bool OctetStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -708,7 +875,11 @@ bool OctetStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -731,13 +902,26 @@ std::function OctetStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -769,12 +953,20 @@ bool OctetStructPubSubType::getKey( OctetStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || OctetStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -791,10 +983,17 @@ bool OctetStructPubSubType::getKey( return true; } + + ShortStructPubSubType::ShortStructPubSubType() { setName("ShortStruct"); - uint32_t type_size = ShortStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ShortStruct::getMaxCdrSerializedSize()); +#else + ShortStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -825,10 +1024,12 @@ bool ShortStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -843,7 +1044,11 @@ bool ShortStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -860,7 +1065,11 @@ bool ShortStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -883,13 +1092,26 @@ std::function ShortStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -921,12 +1143,20 @@ bool ShortStructPubSubType::getKey( ShortStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ShortStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -943,10 +1173,17 @@ bool ShortStructPubSubType::getKey( return true; } + + LongStructPubSubType::LongStructPubSubType() { setName("LongStruct"); - uint32_t type_size = LongStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LongStruct::getMaxCdrSerializedSize()); +#else + LongStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -977,10 +1214,12 @@ bool LongStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -995,7 +1234,11 @@ bool LongStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1012,7 +1255,11 @@ bool LongStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1035,13 +1282,26 @@ std::function LongStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1073,12 +1333,20 @@ bool LongStructPubSubType::getKey( LongStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LongStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1095,10 +1363,17 @@ bool LongStructPubSubType::getKey( return true; } + + LongLongStructPubSubType::LongLongStructPubSubType() { setName("LongLongStruct"); - uint32_t type_size = LongLongStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LongLongStruct::getMaxCdrSerializedSize()); +#else + LongLongStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1129,10 +1404,12 @@ bool LongLongStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1147,7 +1424,11 @@ bool LongLongStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1164,7 +1445,11 @@ bool LongLongStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1187,13 +1472,26 @@ std::function LongLongStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1225,12 +1523,20 @@ bool LongLongStructPubSubType::getKey( LongLongStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LongLongStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1247,10 +1553,17 @@ bool LongLongStructPubSubType::getKey( return true; } + + UShortStructPubSubType::UShortStructPubSubType() { setName("UShortStruct"); - uint32_t type_size = UShortStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(UShortStruct::getMaxCdrSerializedSize()); +#else + UShortStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1281,10 +1594,12 @@ bool UShortStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1299,7 +1614,11 @@ bool UShortStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1316,7 +1635,11 @@ bool UShortStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1339,13 +1662,26 @@ std::function UShortStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1377,12 +1713,20 @@ bool UShortStructPubSubType::getKey( UShortStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || UShortStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1399,10 +1743,17 @@ bool UShortStructPubSubType::getKey( return true; } + + ULongStructPubSubType::ULongStructPubSubType() { setName("ULongStruct"); - uint32_t type_size = ULongStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ULongStruct::getMaxCdrSerializedSize()); +#else + ULongStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1433,10 +1784,12 @@ bool ULongStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1451,7 +1804,11 @@ bool ULongStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1468,7 +1825,11 @@ bool ULongStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1491,13 +1852,26 @@ std::function ULongStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1529,12 +1903,20 @@ bool ULongStructPubSubType::getKey( ULongStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ULongStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1551,10 +1933,17 @@ bool ULongStructPubSubType::getKey( return true; } + + ULongLongStructPubSubType::ULongLongStructPubSubType() { setName("ULongLongStruct"); - uint32_t type_size = ULongLongStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ULongLongStruct::getMaxCdrSerializedSize()); +#else + ULongLongStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1585,10 +1974,12 @@ bool ULongLongStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1603,7 +1994,11 @@ bool ULongLongStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1620,7 +2015,11 @@ bool ULongLongStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1643,13 +2042,26 @@ std::function ULongLongStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1681,12 +2093,20 @@ bool ULongLongStructPubSubType::getKey( ULongLongStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ULongLongStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1703,10 +2123,17 @@ bool ULongLongStructPubSubType::getKey( return true; } + + FloatStructPubSubType::FloatStructPubSubType() { setName("FloatStruct"); - uint32_t type_size = FloatStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(FloatStruct::getMaxCdrSerializedSize()); +#else + FloatStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1737,10 +2164,12 @@ bool FloatStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1755,7 +2184,11 @@ bool FloatStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1772,7 +2205,11 @@ bool FloatStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1795,13 +2232,26 @@ std::function FloatStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1833,12 +2283,20 @@ bool FloatStructPubSubType::getKey( FloatStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || FloatStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1855,10 +2313,17 @@ bool FloatStructPubSubType::getKey( return true; } + + DoubleStructPubSubType::DoubleStructPubSubType() { setName("DoubleStruct"); - uint32_t type_size = DoubleStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(DoubleStruct::getMaxCdrSerializedSize()); +#else + DoubleStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1889,10 +2354,12 @@ bool DoubleStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1907,7 +2374,11 @@ bool DoubleStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1924,7 +2395,11 @@ bool DoubleStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1947,13 +2422,26 @@ std::function DoubleStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1985,12 +2473,20 @@ bool DoubleStructPubSubType::getKey( DoubleStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || DoubleStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2007,10 +2503,17 @@ bool DoubleStructPubSubType::getKey( return true; } + + LongDoubleStructPubSubType::LongDoubleStructPubSubType() { setName("LongDoubleStruct"); - uint32_t type_size = LongDoubleStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LongDoubleStruct::getMaxCdrSerializedSize()); +#else + LongDoubleStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2041,10 +2544,12 @@ bool LongDoubleStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2059,7 +2564,11 @@ bool LongDoubleStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2076,7 +2585,11 @@ bool LongDoubleStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2099,13 +2612,26 @@ std::function LongDoubleStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2137,12 +2663,20 @@ bool LongDoubleStructPubSubType::getKey( LongDoubleStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LongDoubleStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2159,10 +2693,17 @@ bool LongDoubleStructPubSubType::getKey( return true; } + + CharStructPubSubType::CharStructPubSubType() { setName("CharStruct"); - uint32_t type_size = CharStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CharStruct::getMaxCdrSerializedSize()); +#else + CharStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2193,10 +2734,12 @@ bool CharStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2211,7 +2754,11 @@ bool CharStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2228,7 +2775,11 @@ bool CharStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2251,13 +2802,26 @@ std::function CharStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2289,12 +2853,20 @@ bool CharStructPubSubType::getKey( CharStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || CharStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2311,10 +2883,17 @@ bool CharStructPubSubType::getKey( return true; } + + WCharStructPubSubType::WCharStructPubSubType() { setName("WCharStruct"); - uint32_t type_size = WCharStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(WCharStruct::getMaxCdrSerializedSize()); +#else + WCharStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2345,10 +2924,12 @@ bool WCharStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2363,7 +2944,11 @@ bool WCharStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2380,7 +2965,11 @@ bool WCharStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2403,13 +2992,26 @@ std::function WCharStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2441,12 +3043,20 @@ bool WCharStructPubSubType::getKey( WCharStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || WCharStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2463,10 +3073,17 @@ bool WCharStructPubSubType::getKey( return true; } + + StringStructPubSubType::StringStructPubSubType() { setName("StringStruct"); - uint32_t type_size = StringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringStruct::getMaxCdrSerializedSize()); +#else + StringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2497,10 +3114,12 @@ bool StringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2515,7 +3134,11 @@ bool StringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2532,7 +3155,11 @@ bool StringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2555,13 +3182,26 @@ std::function StringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2593,12 +3233,20 @@ bool StringStructPubSubType::getKey( StringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2615,10 +3263,17 @@ bool StringStructPubSubType::getKey( return true; } + + WStringStructPubSubType::WStringStructPubSubType() { setName("WStringStruct"); - uint32_t type_size = WStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(WStringStruct::getMaxCdrSerializedSize()); +#else + WStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2649,10 +3304,12 @@ bool WStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2667,7 +3324,11 @@ bool WStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2684,7 +3345,11 @@ bool WStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2707,13 +3372,26 @@ std::function WStringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2745,12 +3423,20 @@ bool WStringStructPubSubType::getKey( WStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || WStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2767,10 +3453,17 @@ bool WStringStructPubSubType::getKey( return true; } + + LargeStringStructPubSubType::LargeStringStructPubSubType() { setName("LargeStringStruct"); - uint32_t type_size = LargeStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeStringStruct::getMaxCdrSerializedSize()); +#else + LargeStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2801,10 +3494,12 @@ bool LargeStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2819,7 +3514,11 @@ bool LargeStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2836,7 +3535,11 @@ bool LargeStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2859,13 +3562,26 @@ std::function LargeStringStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2897,12 +3613,20 @@ bool LargeStringStructPubSubType::getKey( LargeStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2919,10 +3643,17 @@ bool LargeStringStructPubSubType::getKey( return true; } + + LargeWStringStructPubSubType::LargeWStringStructPubSubType() { setName("LargeWStringStruct"); - uint32_t type_size = LargeWStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); +#else + LargeWStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2953,10 +3684,12 @@ bool LargeWStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2971,7 +3704,11 @@ bool LargeWStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2988,7 +3725,11 @@ bool LargeWStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3011,13 +3752,26 @@ std::function LargeWStringStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3049,12 +3803,20 @@ bool LargeWStringStructPubSubType::getKey( LargeWStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeWStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3071,10 +3833,17 @@ bool LargeWStringStructPubSubType::getKey( return true; } + + ArraytStructPubSubType::ArraytStructPubSubType() { setName("ArraytStruct"); - uint32_t type_size = ArraytStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArraytStruct::getMaxCdrSerializedSize()); +#else + ArraytStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3105,10 +3874,12 @@ bool ArraytStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3123,7 +3894,11 @@ bool ArraytStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3140,7 +3915,11 @@ bool ArraytStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3163,13 +3942,26 @@ std::function ArraytStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3201,12 +3993,20 @@ bool ArraytStructPubSubType::getKey( ArraytStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArraytStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3224,10 +4024,18 @@ bool ArraytStructPubSubType::getKey( } + + + ArrayArrayStructPubSubType::ArrayArrayStructPubSubType() { setName("ArrayArrayStruct"); - uint32_t type_size = ArrayArrayStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayArrayStruct::getMaxCdrSerializedSize()); +#else + ArrayArrayStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3258,10 +4066,12 @@ bool ArrayArrayStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3276,7 +4086,11 @@ bool ArrayArrayStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3293,7 +4107,11 @@ bool ArrayArrayStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3316,13 +4134,26 @@ std::function ArrayArrayStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3354,12 +4185,20 @@ bool ArrayArrayStructPubSubType::getKey( ArrayArrayStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayArrayStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3376,10 +4215,19 @@ bool ArrayArrayStructPubSubType::getKey( return true; } + + + + SequenceStructPubSubType::SequenceStructPubSubType() { setName("SequenceStruct"); - uint32_t type_size = SequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3410,10 +4258,12 @@ bool SequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3428,7 +4278,11 @@ bool SequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3445,7 +4299,11 @@ bool SequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3468,13 +4326,26 @@ std::function SequenceStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3506,12 +4377,20 @@ bool SequenceStructPubSubType::getKey( SequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3528,10 +4407,21 @@ bool SequenceStructPubSubType::getKey( return true; } + + + + + + SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() { setName("SequenceSequenceStruct"); - uint32_t type_size = SequenceSequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceSequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3562,10 +4452,12 @@ bool SequenceSequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3580,7 +4472,11 @@ bool SequenceSequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3597,7 +4493,11 @@ bool SequenceSequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3620,13 +4520,26 @@ std::function SequenceSequenceStructPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3658,12 +4571,20 @@ bool SequenceSequenceStructPubSubType::getKey( SequenceSequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceSequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3680,10 +4601,19 @@ bool SequenceSequenceStructPubSubType::getKey( return true; } + + + + MapStructPubSubType::MapStructPubSubType() { setName("MapStruct"); - uint32_t type_size = MapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapStruct::getMaxCdrSerializedSize()); +#else + MapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3714,10 +4644,12 @@ bool MapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3732,7 +4664,11 @@ bool MapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3749,7 +4685,11 @@ bool MapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3772,13 +4712,26 @@ std::function MapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3810,12 +4763,20 @@ bool MapStructPubSubType::getKey( MapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3832,10 +4793,21 @@ bool MapStructPubSubType::getKey( return true; } + + + + + + MapMapStructPubSubType::MapMapStructPubSubType() { setName("MapMapStruct"); - uint32_t type_size = MapMapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapMapStruct::getMaxCdrSerializedSize()); +#else + MapMapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3866,10 +4838,12 @@ bool MapMapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3884,7 +4858,11 @@ bool MapMapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3901,7 +4879,11 @@ bool MapMapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3924,13 +4906,26 @@ std::function MapMapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3962,12 +4957,20 @@ bool MapMapStructPubSubType::getKey( MapMapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapMapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3985,10 +4988,17 @@ bool MapMapStructPubSubType::getKey( } + + BitsetStructPubSubType::BitsetStructPubSubType() { setName("BitsetStruct"); - uint32_t type_size = BitsetStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BitsetStruct::getMaxCdrSerializedSize()); +#else + BitsetStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4019,10 +5029,12 @@ bool BitsetStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4037,7 +5049,11 @@ bool BitsetStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4054,7 +5070,11 @@ bool BitsetStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4077,13 +5097,26 @@ std::function BitsetStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4115,12 +5148,20 @@ bool BitsetStructPubSubType::getKey( BitsetStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BitsetStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4137,10 +5178,17 @@ bool BitsetStructPubSubType::getKey( return true; } + + StructStructPubSubType::StructStructPubSubType() { setName("StructStruct"); - uint32_t type_size = StructStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructStruct::getMaxCdrSerializedSize()); +#else + StructStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4171,10 +5219,12 @@ bool StructStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4189,7 +5239,11 @@ bool StructStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4206,7 +5260,11 @@ bool StructStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4229,13 +5287,26 @@ std::function StructStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4267,12 +5338,20 @@ bool StructStructPubSubType::getKey( StructStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StructStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4289,10 +5368,17 @@ bool StructStructPubSubType::getKey( return true; } + + StructStructStructPubSubType::StructStructStructPubSubType() { setName("StructStructStruct"); - uint32_t type_size = StructStructStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructStructStruct::getMaxCdrSerializedSize()); +#else + StructStructStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4323,10 +5409,12 @@ bool StructStructStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4341,7 +5429,11 @@ bool StructStructStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4358,7 +5450,11 @@ bool StructStructStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4381,13 +5477,26 @@ std::function StructStructStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4419,12 +5528,20 @@ bool StructStructStructPubSubType::getKey( StructStructStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StructStructStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4444,10 +5561,26 @@ bool StructStructStructPubSubType::getKey( + + + + + + + + + + + SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() { setName("SimpleUnionStruct"); - uint32_t type_size = SimpleUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4478,10 +5611,12 @@ bool SimpleUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4496,7 +5631,11 @@ bool SimpleUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4513,7 +5652,11 @@ bool SimpleUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4536,13 +5679,26 @@ std::function SimpleUnionStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4574,12 +5730,20 @@ bool SimpleUnionStructPubSubType::getKey( SimpleUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4596,10 +5760,17 @@ bool SimpleUnionStructPubSubType::getKey( return true; } + + UnionUnionUnionStructPubSubType::UnionUnionUnionStructPubSubType() { setName("UnionUnionUnionStruct"); - uint32_t type_size = UnionUnionUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(UnionUnionUnionStruct::getMaxCdrSerializedSize()); +#else + UnionUnionUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4630,10 +5801,12 @@ bool UnionUnionUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4648,7 +5821,11 @@ bool UnionUnionUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4665,7 +5842,11 @@ bool UnionUnionUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4688,13 +5869,26 @@ std::function UnionUnionUnionStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4726,12 +5920,20 @@ bool UnionUnionUnionStructPubSubType::getKey( UnionUnionUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || UnionUnionUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4748,10 +5950,17 @@ bool UnionUnionUnionStructPubSubType::getKey( return true; } + + WCharUnionStructPubSubType::WCharUnionStructPubSubType() { setName("WCharUnionStruct"); - uint32_t type_size = WCharUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(WCharUnionStruct::getMaxCdrSerializedSize()); +#else + WCharUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4782,10 +5991,12 @@ bool WCharUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4800,7 +6011,11 @@ bool WCharUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4817,7 +6032,11 @@ bool WCharUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4840,13 +6059,26 @@ std::function WCharUnionStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4878,12 +6110,20 @@ bool WCharUnionStructPubSubType::getKey( WCharUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || WCharUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h index 1bc5fc64ea1..467e624b19b 100644 --- a/test/unittest/dynamic_types/idl/BasicPubSubTypes.h +++ b/test/unittest/dynamic_types/idl/BasicPubSubTypes.h @@ -40,6 +40,8 @@ typedef MyEnum MyAliasEnum; typedef MyAliasEnum MyAliasAliasEnum; + + /*! * @brief This class represents the TopicDataType of the type EnumStruct defined by the user in the IDL file. * @ingroup Basic @@ -128,6 +130,8 @@ class EnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type AliasStruct defined by the user in the IDL file. * @ingroup Basic @@ -216,6 +220,8 @@ class AliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type AliasAliasStruct defined by the user in the IDL file. * @ingroup Basic @@ -304,6 +310,8 @@ class AliasAliasStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BoolStruct defined by the user in the IDL file. * @ingroup Basic @@ -392,6 +400,8 @@ class BoolStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type OctetStruct defined by the user in the IDL file. * @ingroup Basic @@ -480,6 +490,8 @@ class OctetStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ShortStruct defined by the user in the IDL file. * @ingroup Basic @@ -568,6 +580,8 @@ class ShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LongStruct defined by the user in the IDL file. * @ingroup Basic @@ -656,6 +670,8 @@ class LongStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LongLongStruct defined by the user in the IDL file. * @ingroup Basic @@ -744,6 +760,8 @@ class LongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type UShortStruct defined by the user in the IDL file. * @ingroup Basic @@ -832,6 +850,8 @@ class UShortStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ULongStruct defined by the user in the IDL file. * @ingroup Basic @@ -920,6 +940,8 @@ class ULongStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ULongLongStruct defined by the user in the IDL file. * @ingroup Basic @@ -1008,6 +1030,8 @@ class ULongLongStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type FloatStruct defined by the user in the IDL file. * @ingroup Basic @@ -1096,6 +1120,8 @@ class FloatStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type DoubleStruct defined by the user in the IDL file. * @ingroup Basic @@ -1184,6 +1210,8 @@ class DoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LongDoubleStruct defined by the user in the IDL file. * @ingroup Basic @@ -1272,6 +1300,8 @@ class LongDoubleStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type CharStruct defined by the user in the IDL file. * @ingroup Basic @@ -1360,6 +1390,8 @@ class CharStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type WCharStruct defined by the user in the IDL file. * @ingroup Basic @@ -1448,6 +1480,8 @@ class WCharStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1536,6 +1570,8 @@ class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1624,6 +1660,8 @@ class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1712,6 +1750,8 @@ class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. * @ingroup Basic @@ -1800,6 +1840,8 @@ class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp }; + + /*! * @brief This class represents the TopicDataType of the type ArraytStruct defined by the user in the IDL file. * @ingroup Basic @@ -1889,6 +1931,8 @@ class ArraytStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; typedef std::array, 2> MyArray; + + /*! * @brief This class represents the TopicDataType of the type ArrayArrayStruct defined by the user in the IDL file. * @ingroup Basic @@ -1977,6 +2021,10 @@ class ArrayArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. * @ingroup Basic @@ -2065,6 +2113,12 @@ class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Basic @@ -2153,6 +2207,10 @@ class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDat }; + + + + /*! * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. * @ingroup Basic @@ -2241,6 +2299,12 @@ class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. * @ingroup Basic @@ -2330,6 +2394,8 @@ class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BitsetStruct defined by the user in the IDL file. * @ingroup Basic @@ -2418,6 +2484,8 @@ class BitsetStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type StructStruct defined by the user in the IDL file. * @ingroup Basic @@ -2506,6 +2574,8 @@ class StructStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type StructStructStruct defined by the user in the IDL file. * @ingroup Basic @@ -2597,6 +2667,17 @@ class StructStructStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp + + + + + + + + + + + /*! * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. * @ingroup Basic @@ -2685,6 +2766,8 @@ class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type UnionUnionUnionStruct defined by the user in the IDL file. * @ingroup Basic @@ -2773,6 +2856,8 @@ class UnionUnionUnionStructPubSubType : public eprosima::fastdds::dds::TopicData }; + + /*! * @brief This class represents the TopicDataType of the type WCharUnionStruct defined by the user in the IDL file. * @ingroup Basic diff --git a/test/unittest/dynamic_types/idl/BasicTypeObject.cxx b/test/unittest/dynamic_types/idl/BasicTypeObject.cxx index 8549d293964..282c8898fe4 100644 --- a/test/unittest/dynamic_types/idl/BasicTypeObject.cxx +++ b/test/unittest/dynamic_types/idl/BasicTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -401,7 +399,11 @@ const TypeObject* GetMinimalMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -493,7 +495,11 @@ const TypeObject* GetCompleteMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -596,7 +602,11 @@ const TypeObject* GetMinimalMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -680,7 +690,11 @@ const TypeObject* GetCompleteMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -786,7 +800,11 @@ const TypeObject* GetMinimalMyAliasAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -870,7 +888,11 @@ const TypeObject* GetCompleteMyAliasAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -887,6 +909,8 @@ const TypeObject* GetCompleteMyAliasAliasEnumObject() return TypeObjectFactory::get_instance()->get_type_object("MyAliasAliasEnum", true); } + + const TypeIdentifier* GetEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("EnumStruct", complete); @@ -956,7 +980,6 @@ const TypeObject* GetMinimalEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -972,7 +995,11 @@ const TypeObject* GetMinimalEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1024,7 +1051,6 @@ const TypeObject* GetCompleteEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("EnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1040,7 +1066,11 @@ const TypeObject* GetCompleteEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1054,6 +1084,8 @@ const TypeObject* GetCompleteEnumStructObject() return TypeObjectFactory::get_instance()->get_type_object("EnumStruct", true); } + + const TypeIdentifier* GetAliasStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("AliasStruct", complete); @@ -1123,7 +1155,6 @@ const TypeObject* GetMinimalAliasStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1139,7 +1170,11 @@ const TypeObject* GetMinimalAliasStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1191,7 +1226,6 @@ const TypeObject* GetCompleteAliasStructObject() // Header type_object->complete().struct_type().header().detail().type_name("AliasStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1207,7 +1241,11 @@ const TypeObject* GetCompleteAliasStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1221,6 +1259,8 @@ const TypeObject* GetCompleteAliasStructObject() return TypeObjectFactory::get_instance()->get_type_object("AliasStruct", true); } + + const TypeIdentifier* GetAliasAliasStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("AliasAliasStruct", complete); @@ -1290,7 +1330,6 @@ const TypeObject* GetMinimalAliasAliasStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1306,7 +1345,11 @@ const TypeObject* GetMinimalAliasAliasStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1358,7 +1401,6 @@ const TypeObject* GetCompleteAliasAliasStructObject() // Header type_object->complete().struct_type().header().detail().type_name("AliasAliasStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1374,7 +1416,11 @@ const TypeObject* GetCompleteAliasAliasStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1388,6 +1434,8 @@ const TypeObject* GetCompleteAliasAliasStructObject() return TypeObjectFactory::get_instance()->get_type_object("AliasAliasStruct", true); } + + const TypeIdentifier* GetBoolStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BoolStruct", complete); @@ -1458,7 +1506,6 @@ const TypeObject* GetMinimalBoolStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1474,7 +1521,11 @@ const TypeObject* GetMinimalBoolStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1527,7 +1578,6 @@ const TypeObject* GetCompleteBoolStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BoolStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1543,7 +1593,11 @@ const TypeObject* GetCompleteBoolStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1557,6 +1611,8 @@ const TypeObject* GetCompleteBoolStructObject() return TypeObjectFactory::get_instance()->get_type_object("BoolStruct", true); } + + const TypeIdentifier* GetOctetStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("OctetStruct", complete); @@ -1627,7 +1683,6 @@ const TypeObject* GetMinimalOctetStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1643,7 +1698,11 @@ const TypeObject* GetMinimalOctetStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1696,7 +1755,6 @@ const TypeObject* GetCompleteOctetStructObject() // Header type_object->complete().struct_type().header().detail().type_name("OctetStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1712,7 +1770,11 @@ const TypeObject* GetCompleteOctetStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1726,6 +1788,8 @@ const TypeObject* GetCompleteOctetStructObject() return TypeObjectFactory::get_instance()->get_type_object("OctetStruct", true); } + + const TypeIdentifier* GetShortStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ShortStruct", complete); @@ -1796,7 +1860,6 @@ const TypeObject* GetMinimalShortStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1812,7 +1875,11 @@ const TypeObject* GetMinimalShortStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1865,7 +1932,6 @@ const TypeObject* GetCompleteShortStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ShortStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1881,7 +1947,11 @@ const TypeObject* GetCompleteShortStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1895,6 +1965,8 @@ const TypeObject* GetCompleteShortStructObject() return TypeObjectFactory::get_instance()->get_type_object("ShortStruct", true); } + + const TypeIdentifier* GetLongStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongStruct", complete); @@ -1965,7 +2037,6 @@ const TypeObject* GetMinimalLongStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1981,7 +2052,11 @@ const TypeObject* GetMinimalLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2034,7 +2109,6 @@ const TypeObject* GetCompleteLongStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LongStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2050,7 +2124,11 @@ const TypeObject* GetCompleteLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2064,6 +2142,8 @@ const TypeObject* GetCompleteLongStructObject() return TypeObjectFactory::get_instance()->get_type_object("LongStruct", true); } + + const TypeIdentifier* GetLongLongStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongLongStruct", complete); @@ -2134,7 +2214,6 @@ const TypeObject* GetMinimalLongLongStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2150,7 +2229,11 @@ const TypeObject* GetMinimalLongLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2203,7 +2286,6 @@ const TypeObject* GetCompleteLongLongStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LongLongStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2219,7 +2301,11 @@ const TypeObject* GetCompleteLongLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2233,6 +2319,8 @@ const TypeObject* GetCompleteLongLongStructObject() return TypeObjectFactory::get_instance()->get_type_object("LongLongStruct", true); } + + const TypeIdentifier* GetUShortStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UShortStruct", complete); @@ -2303,7 +2391,6 @@ const TypeObject* GetMinimalUShortStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2319,7 +2406,11 @@ const TypeObject* GetMinimalUShortStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2372,7 +2463,6 @@ const TypeObject* GetCompleteUShortStructObject() // Header type_object->complete().struct_type().header().detail().type_name("UShortStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2388,7 +2478,11 @@ const TypeObject* GetCompleteUShortStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2402,6 +2496,8 @@ const TypeObject* GetCompleteUShortStructObject() return TypeObjectFactory::get_instance()->get_type_object("UShortStruct", true); } + + const TypeIdentifier* GetULongStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ULongStruct", complete); @@ -2472,7 +2568,6 @@ const TypeObject* GetMinimalULongStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2488,7 +2583,11 @@ const TypeObject* GetMinimalULongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2541,7 +2640,6 @@ const TypeObject* GetCompleteULongStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ULongStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2557,7 +2655,11 @@ const TypeObject* GetCompleteULongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2571,6 +2673,8 @@ const TypeObject* GetCompleteULongStructObject() return TypeObjectFactory::get_instance()->get_type_object("ULongStruct", true); } + + const TypeIdentifier* GetULongLongStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ULongLongStruct", complete); @@ -2641,7 +2745,6 @@ const TypeObject* GetMinimalULongLongStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2657,7 +2760,11 @@ const TypeObject* GetMinimalULongLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2710,7 +2817,6 @@ const TypeObject* GetCompleteULongLongStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ULongLongStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2726,7 +2832,11 @@ const TypeObject* GetCompleteULongLongStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2740,6 +2850,8 @@ const TypeObject* GetCompleteULongLongStructObject() return TypeObjectFactory::get_instance()->get_type_object("ULongLongStruct", true); } + + const TypeIdentifier* GetFloatStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("FloatStruct", complete); @@ -2810,7 +2922,6 @@ const TypeObject* GetMinimalFloatStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2826,7 +2937,11 @@ const TypeObject* GetMinimalFloatStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2879,7 +2994,6 @@ const TypeObject* GetCompleteFloatStructObject() // Header type_object->complete().struct_type().header().detail().type_name("FloatStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2895,7 +3009,11 @@ const TypeObject* GetCompleteFloatStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2909,6 +3027,8 @@ const TypeObject* GetCompleteFloatStructObject() return TypeObjectFactory::get_instance()->get_type_object("FloatStruct", true); } + + const TypeIdentifier* GetDoubleStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("DoubleStruct", complete); @@ -2979,7 +3099,6 @@ const TypeObject* GetMinimalDoubleStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2995,7 +3114,11 @@ const TypeObject* GetMinimalDoubleStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3048,7 +3171,6 @@ const TypeObject* GetCompleteDoubleStructObject() // Header type_object->complete().struct_type().header().detail().type_name("DoubleStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3064,7 +3186,11 @@ const TypeObject* GetCompleteDoubleStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3078,6 +3204,8 @@ const TypeObject* GetCompleteDoubleStructObject() return TypeObjectFactory::get_instance()->get_type_object("DoubleStruct", true); } + + const TypeIdentifier* GetLongDoubleStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LongDoubleStruct", complete); @@ -3148,7 +3276,6 @@ const TypeObject* GetMinimalLongDoubleStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3164,7 +3291,11 @@ const TypeObject* GetMinimalLongDoubleStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3217,7 +3348,6 @@ const TypeObject* GetCompleteLongDoubleStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LongDoubleStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3233,7 +3363,11 @@ const TypeObject* GetCompleteLongDoubleStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3247,6 +3381,8 @@ const TypeObject* GetCompleteLongDoubleStructObject() return TypeObjectFactory::get_instance()->get_type_object("LongDoubleStruct", true); } + + const TypeIdentifier* GetCharStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("CharStruct", complete); @@ -3317,7 +3453,6 @@ const TypeObject* GetMinimalCharStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3333,7 +3468,11 @@ const TypeObject* GetMinimalCharStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3386,7 +3525,6 @@ const TypeObject* GetCompleteCharStructObject() // Header type_object->complete().struct_type().header().detail().type_name("CharStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3402,7 +3540,11 @@ const TypeObject* GetCompleteCharStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3416,6 +3558,8 @@ const TypeObject* GetCompleteCharStructObject() return TypeObjectFactory::get_instance()->get_type_object("CharStruct", true); } + + const TypeIdentifier* GetWCharStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharStruct", complete); @@ -3486,7 +3630,6 @@ const TypeObject* GetMinimalWCharStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3502,7 +3645,11 @@ const TypeObject* GetMinimalWCharStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3555,7 +3702,6 @@ const TypeObject* GetCompleteWCharStructObject() // Header type_object->complete().struct_type().header().detail().type_name("WCharStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3571,7 +3717,11 @@ const TypeObject* GetCompleteWCharStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3585,6 +3735,8 @@ const TypeObject* GetCompleteWCharStructObject() return TypeObjectFactory::get_instance()->get_type_object("WCharStruct", true); } + + const TypeIdentifier* GetStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); @@ -3654,7 +3806,6 @@ const TypeObject* GetMinimalStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3670,7 +3821,11 @@ const TypeObject* GetMinimalStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3722,7 +3877,6 @@ const TypeObject* GetCompleteStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("StringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3738,7 +3892,11 @@ const TypeObject* GetCompleteStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3752,6 +3910,8 @@ const TypeObject* GetCompleteStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); } + + const TypeIdentifier* GetWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); @@ -3821,7 +3981,6 @@ const TypeObject* GetMinimalWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3837,7 +3996,11 @@ const TypeObject* GetMinimalWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3889,7 +4052,6 @@ const TypeObject* GetCompleteWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("WStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3905,7 +4067,11 @@ const TypeObject* GetCompleteWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3919,6 +4085,8 @@ const TypeObject* GetCompleteWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); } + + const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); @@ -3988,7 +4156,6 @@ const TypeObject* GetMinimalLargeStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4004,7 +4171,11 @@ const TypeObject* GetMinimalLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4056,7 +4227,6 @@ const TypeObject* GetCompleteLargeStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4072,7 +4242,11 @@ const TypeObject* GetCompleteLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4086,6 +4260,8 @@ const TypeObject* GetCompleteLargeStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); } + + const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); @@ -4155,7 +4331,6 @@ const TypeObject* GetMinimalLargeWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4171,7 +4346,11 @@ const TypeObject* GetMinimalLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4223,7 +4402,6 @@ const TypeObject* GetCompleteLargeWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4239,7 +4417,11 @@ const TypeObject* GetCompleteLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4253,6 +4435,8 @@ const TypeObject* GetCompleteLargeWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); } + + const TypeIdentifier* GetArraytStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraytStruct", complete); @@ -4322,7 +4506,6 @@ const TypeObject* GetMinimalArraytStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4338,7 +4521,11 @@ const TypeObject* GetMinimalArraytStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4390,7 +4577,6 @@ const TypeObject* GetCompleteArraytStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArraytStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4406,7 +4592,11 @@ const TypeObject* GetCompleteArraytStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4509,7 +4699,11 @@ const TypeObject* GetMinimalMyArrayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4593,7 +4787,11 @@ const TypeObject* GetCompleteMyArrayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4610,6 +4808,8 @@ const TypeObject* GetCompleteMyArrayObject() return TypeObjectFactory::get_instance()->get_type_object("MyArray", true); } + + const TypeIdentifier* GetArrayArrayStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayArrayStruct", complete); @@ -4679,7 +4879,6 @@ const TypeObject* GetMinimalArrayArrayStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4695,7 +4894,11 @@ const TypeObject* GetMinimalArrayArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4747,7 +4950,6 @@ const TypeObject* GetCompleteArrayArrayStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayArrayStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4763,7 +4965,11 @@ const TypeObject* GetCompleteArrayArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4777,6 +4983,10 @@ const TypeObject* GetCompleteArrayArrayStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayArrayStruct", true); } + + + + const TypeIdentifier* GetSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); @@ -4846,7 +5056,6 @@ const TypeObject* GetMinimalSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4862,7 +5071,11 @@ const TypeObject* GetMinimalSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4914,7 +5127,6 @@ const TypeObject* GetCompleteSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4930,7 +5142,11 @@ const TypeObject* GetCompleteSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4944,6 +5160,12 @@ const TypeObject* GetCompleteSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); } + + + + + + const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); @@ -5013,7 +5235,6 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5029,7 +5250,11 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5081,7 +5306,6 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5097,7 +5321,11 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5111,6 +5339,10 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); } + + + + const TypeIdentifier* GetMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); @@ -5180,7 +5412,6 @@ const TypeObject* GetMinimalMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5196,7 +5427,11 @@ const TypeObject* GetMinimalMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5248,7 +5483,6 @@ const TypeObject* GetCompleteMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5264,7 +5498,11 @@ const TypeObject* GetCompleteMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5278,6 +5516,12 @@ const TypeObject* GetCompleteMapStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); } + + + + + + const TypeIdentifier* GetMapMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); @@ -5347,7 +5591,6 @@ const TypeObject* GetMinimalMapMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5363,7 +5606,11 @@ const TypeObject* GetMinimalMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5415,7 +5662,6 @@ const TypeObject* GetCompleteMapMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5431,7 +5677,11 @@ const TypeObject* GetCompleteMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5523,7 +5773,6 @@ const TypeObject* GetMinimalMyBitsetObject() type_object->minimal().bitset_type().field_seq().emplace_back(mbf_b); - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5539,7 +5788,11 @@ const TypeObject* GetMinimalMyBitsetObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5687,7 +5940,6 @@ const TypeObject* GetCompleteMyBitsetObject() type_object->complete().bitset_type().field_seq().emplace_back(cbf_b); - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5703,7 +5955,11 @@ const TypeObject* GetCompleteMyBitsetObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5717,6 +5973,8 @@ const TypeObject* GetCompleteMyBitsetObject() return TypeObjectFactory::get_instance()->get_type_object("MyBitset", true); } + + const TypeIdentifier* GetBitsetStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BitsetStruct", complete); @@ -5786,7 +6044,6 @@ const TypeObject* GetMinimalBitsetStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5802,7 +6059,11 @@ const TypeObject* GetMinimalBitsetStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5854,7 +6115,6 @@ const TypeObject* GetCompleteBitsetStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BitsetStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5870,7 +6130,11 @@ const TypeObject* GetCompleteBitsetStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5884,6 +6148,8 @@ const TypeObject* GetCompleteBitsetStructObject() return TypeObjectFactory::get_instance()->get_type_object("BitsetStruct", true); } + + const TypeIdentifier* GetStructStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructStruct", complete); @@ -5973,7 +6239,6 @@ const TypeObject* GetMinimalStructStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5989,7 +6254,11 @@ const TypeObject* GetMinimalStructStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6058,7 +6327,6 @@ const TypeObject* GetCompleteStructStructObject() // Header type_object->complete().struct_type().header().detail().type_name("StructStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6074,7 +6342,11 @@ const TypeObject* GetCompleteStructStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6088,6 +6360,8 @@ const TypeObject* GetCompleteStructStructObject() return TypeObjectFactory::get_instance()->get_type_object("StructStruct", true); } + + const TypeIdentifier* GetStructStructStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructStructStruct", complete); @@ -6176,7 +6450,6 @@ const TypeObject* GetMinimalStructStructStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6192,7 +6465,11 @@ const TypeObject* GetMinimalStructStructStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6260,7 +6537,6 @@ const TypeObject* GetCompleteStructStructStructObject() // Header type_object->complete().struct_type().header().detail().type_name("StructStructStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6276,7 +6552,11 @@ const TypeObject* GetCompleteStructStructStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6290,6 +6570,8 @@ const TypeObject* GetCompleteStructStructStructObject() return TypeObjectFactory::get_instance()->get_type_object("StructStructStruct", true); } + + const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); @@ -6407,7 +6689,11 @@ const TypeObject* GetMinimalSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6506,7 +6792,11 @@ const TypeObject* GetCompleteSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6521,6 +6811,8 @@ const TypeObject* GetCompleteSimpleUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); } + + const TypeIdentifier* GetUnionUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UnionUnion", complete); @@ -6637,7 +6929,11 @@ const TypeObject* GetMinimalUnionUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6735,7 +7031,11 @@ const TypeObject* GetCompleteUnionUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6750,6 +7050,8 @@ const TypeObject* GetCompleteUnionUnionObject() return TypeObjectFactory::get_instance()->get_type_object("UnionUnion", true); } + + const TypeIdentifier* GetWCharUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); @@ -6867,7 +7169,11 @@ const TypeObject* GetMinimalWCharUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6966,7 +7272,11 @@ const TypeObject* GetCompleteWCharUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6981,6 +7291,8 @@ const TypeObject* GetCompleteWCharUnionObject() return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); } + + const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); @@ -7050,7 +7362,6 @@ const TypeObject* GetMinimalSimpleUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7066,7 +7377,11 @@ const TypeObject* GetMinimalSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7118,7 +7433,6 @@ const TypeObject* GetCompleteSimpleUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7134,7 +7448,11 @@ const TypeObject* GetCompleteSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7148,6 +7466,8 @@ const TypeObject* GetCompleteSimpleUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); } + + const TypeIdentifier* GetUnionUnionUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("UnionUnionUnionStruct", complete); @@ -7217,7 +7537,6 @@ const TypeObject* GetMinimalUnionUnionUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7233,7 +7552,11 @@ const TypeObject* GetMinimalUnionUnionUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7285,7 +7608,6 @@ const TypeObject* GetCompleteUnionUnionUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("UnionUnionUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7301,7 +7623,11 @@ const TypeObject* GetCompleteUnionUnionUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7315,6 +7641,8 @@ const TypeObject* GetCompleteUnionUnionUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("UnionUnionUnionStruct", true); } + + const TypeIdentifier* GetWCharUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnionStruct", complete); @@ -7384,7 +7712,6 @@ const TypeObject* GetMinimalWCharUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7400,7 +7727,11 @@ const TypeObject* GetMinimalWCharUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7452,7 +7783,6 @@ const TypeObject* GetCompleteWCharUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("WCharUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7468,7 +7798,11 @@ const TypeObject* GetCompleteWCharUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/dynamic_types/idl/BasicTypeObject.h b/test/unittest/dynamic_types/idl/BasicTypeObject.h index 79114e644fc..e114b7d10d0 100644 --- a/test/unittest/dynamic_types/idl/BasicTypeObject.h +++ b/test/unittest/dynamic_types/idl/BasicTypeObject.h @@ -69,106 +69,148 @@ eProsima_user_DllExport const TypeObject* GetMyAliasAliasEnumObject(bool complet eProsima_user_DllExport const TypeObject* GetMinimalMyAliasAliasEnumObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasAliasEnumObject(); + + eProsima_user_DllExport const TypeIdentifier* GetEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalEnumStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteEnumStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetAliasStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetAliasStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalAliasStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteAliasStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetAliasAliasStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetAliasAliasStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalAliasAliasStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteAliasAliasStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBoolStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBoolStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBoolStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBoolStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetOctetStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetOctetStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalOctetStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteOctetStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetShortStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetShortStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalShortStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteShortStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLongStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLongStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLongStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLongStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLongLongStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLongLongStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLongLongStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLongLongStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetUShortStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetUShortStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalUShortStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteUShortStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetULongStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetULongStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalULongStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteULongStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetULongLongStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetULongLongStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalULongLongStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteULongLongStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetFloatStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetFloatStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalFloatStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteFloatStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetDoubleStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetDoubleStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalDoubleStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteDoubleStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLongDoubleStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLongDoubleStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLongDoubleStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLongDoubleStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetCharStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetCharStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalCharStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteCharStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWCharStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWCharStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWCharStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteWCharStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArraytStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArraytStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArraytStructObject(); @@ -179,26 +221,48 @@ eProsima_user_DllExport const TypeObject* GetMyArrayObject(bool complete = false eProsima_user_DllExport const TypeObject* GetMinimalMyArrayObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyArrayObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayArrayStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayArrayStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayArrayStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayArrayStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); @@ -209,46 +273,64 @@ eProsima_user_DllExport const TypeObject* GetMyBitsetObject(bool complete = fals eProsima_user_DllExport const TypeObject* GetMinimalMyBitsetObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyBitsetObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBitsetStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBitsetStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBitsetStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBitsetStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStructStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStructStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStructStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteStructStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStructStructStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStructStructStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStructStructStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteStructStructStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetUnionUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetUnionUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalUnionUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteUnionUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWCharUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWCharUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteWCharUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetUnionUnionUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetUnionUnionUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalUnionUnionUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteUnionUnionUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWCharUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWCharUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionStructObject(); diff --git a/test/unittest/dynamic_types/idl/Basicv1.cxx b/test/unittest/dynamic_types/idl/Basicv1.cxx new file mode 100644 index 00000000000..b8fca04e00d --- /dev/null +++ b/test/unittest/dynamic_types/idl/Basicv1.cxx @@ -0,0 +1,6119 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Basic.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Basic.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "BasicTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define ArraytStruct_max_cdr_typesize 36ULL; +#define SimpleUnionStruct_max_cdr_typesize 24ULL; + +#define WCharUnionStruct_max_cdr_typesize 24ULL; +#define OctetStruct_max_cdr_typesize 5ULL; +#define LongStruct_max_cdr_typesize 8ULL; +#define EnumStruct_max_cdr_typesize 8ULL; +#define BitsetStruct_max_cdr_typesize 8ULL; + + +#define DoubleStruct_max_cdr_typesize 16ULL; +#define LargeWStringStruct_max_cdr_typesize 167708ULL; +#define WCharStruct_max_cdr_typesize 8ULL; + +#define WStringStruct_max_cdr_typesize 1028ULL; +#define SequenceStruct_max_cdr_typesize 16ULL; + +#define ULongStruct_max_cdr_typesize 8ULL; +#define SequenceSequenceStruct_max_cdr_typesize 48ULL; +#define FloatStruct_max_cdr_typesize 8ULL; +#define LongDoubleStruct_max_cdr_typesize 24ULL; +#define StructStructStruct_max_cdr_typesize 32ULL; +#define UnionUnionUnionStruct_max_cdr_typesize 32ULL; +#define BoolStruct_max_cdr_typesize 5ULL; +#define MapMapStruct_max_cdr_typesize 60ULL; +#define AliasAliasStruct_max_cdr_typesize 8ULL; +#define ArrayArrayStruct_max_cdr_typesize 72ULL; +#define ShortStruct_max_cdr_typesize 6ULL; +#define MapStruct_max_cdr_typesize 24ULL; +#define UShortStruct_max_cdr_typesize 6ULL; + + +#define ULongLongStruct_max_cdr_typesize 16ULL; +#define AliasStruct_max_cdr_typesize 8ULL; +#define LargeStringStruct_max_cdr_typesize 41934ULL; +#define CharStruct_max_cdr_typesize 5ULL; +#define LongLongStruct_max_cdr_typesize 16ULL; +#define StringStruct_max_cdr_typesize 264ULL; +#define StructStruct_max_cdr_typesize 16ULL; + + + + + +EnumStruct::EnumStruct() +{ + // MyEnum m_my_enum + m_my_enum = ::A; + + // Just to register all known types + registerBasicTypes(); +} + +EnumStruct::~EnumStruct() +{ +} + +EnumStruct::EnumStruct( + const EnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +EnumStruct::EnumStruct( + EnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +EnumStruct& EnumStruct::operator =( + const EnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +EnumStruct& EnumStruct::operator =( + EnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool EnumStruct::operator ==( + const EnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool EnumStruct::operator !=( + const EnumStruct& x) const +{ + return !(*this == x); +} + +size_t EnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return EnumStruct_max_cdr_typesize; +} + +size_t EnumStruct::getCdrSerializedSize( + const EnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void EnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void EnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyEnum)enum_value; + } + + +} + + +bool EnumStruct::isKeyDefined() +{ + return false; +} + +void EnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void EnumStruct::my_enum( + MyEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyEnum EnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyEnum& EnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + +AliasStruct::AliasStruct() +{ + // MyAliasEnum m_my_alias + m_my_alias = ::A; + + // Just to register all known types + registerBasicTypes(); +} + +AliasStruct::~AliasStruct() +{ +} + +AliasStruct::AliasStruct( + const AliasStruct& x) +{ + m_my_alias = x.m_my_alias; + +} + +AliasStruct::AliasStruct( + AliasStruct&& x) noexcept +{ + m_my_alias = x.m_my_alias; + +} + +AliasStruct& AliasStruct::operator =( + const AliasStruct& x) +{ + m_my_alias = x.m_my_alias; + + return *this; +} + +AliasStruct& AliasStruct::operator =( + AliasStruct&& x) noexcept +{ + m_my_alias = x.m_my_alias; + + return *this; +} + +bool AliasStruct::operator ==( + const AliasStruct& x) const +{ + return (m_my_alias == x.m_my_alias); +} + +bool AliasStruct::operator !=( + const AliasStruct& x) const +{ + return !(*this == x); +} + +size_t AliasStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return AliasStruct_max_cdr_typesize; +} + +size_t AliasStruct::getCdrSerializedSize( + const AliasStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void AliasStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_alias; + +} + +void AliasStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_alias = (MyAliasEnum)enum_value; + } + + +} + + +bool AliasStruct::isKeyDefined() +{ + return false; +} + +void AliasStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_alias + * @param _my_alias New value for member my_alias + */ +void AliasStruct::my_alias( + MyAliasEnum _my_alias) +{ + m_my_alias = _my_alias; +} + +/*! + * @brief This function returns the value of member my_alias + * @return Value of member my_alias + */ +MyAliasEnum AliasStruct::my_alias() const +{ + return m_my_alias; +} + +/*! + * @brief This function returns a reference to member my_alias + * @return Reference to member my_alias + */ +MyAliasEnum& AliasStruct::my_alias() +{ + return m_my_alias; +} + + + + + +AliasAliasStruct::AliasAliasStruct() +{ + // MyAliasAliasEnum m_my_alias_alias + m_my_alias_alias = ::A; + + // Just to register all known types + registerBasicTypes(); +} + +AliasAliasStruct::~AliasAliasStruct() +{ +} + +AliasAliasStruct::AliasAliasStruct( + const AliasAliasStruct& x) +{ + m_my_alias_alias = x.m_my_alias_alias; + +} + +AliasAliasStruct::AliasAliasStruct( + AliasAliasStruct&& x) noexcept +{ + m_my_alias_alias = x.m_my_alias_alias; + +} + +AliasAliasStruct& AliasAliasStruct::operator =( + const AliasAliasStruct& x) +{ + m_my_alias_alias = x.m_my_alias_alias; + + return *this; +} + +AliasAliasStruct& AliasAliasStruct::operator =( + AliasAliasStruct&& x) noexcept +{ + m_my_alias_alias = x.m_my_alias_alias; + + return *this; +} + +bool AliasAliasStruct::operator ==( + const AliasAliasStruct& x) const +{ + return (m_my_alias_alias == x.m_my_alias_alias); +} + +bool AliasAliasStruct::operator !=( + const AliasAliasStruct& x) const +{ + return !(*this == x); +} + +size_t AliasAliasStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return AliasAliasStruct_max_cdr_typesize; +} + +size_t AliasAliasStruct::getCdrSerializedSize( + const AliasAliasStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void AliasAliasStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_alias_alias; + +} + +void AliasAliasStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_alias_alias = (MyAliasAliasEnum)enum_value; + } + + +} + + +bool AliasAliasStruct::isKeyDefined() +{ + return false; +} + +void AliasAliasStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_alias_alias + * @param _my_alias_alias New value for member my_alias_alias + */ +void AliasAliasStruct::my_alias_alias( + MyAliasAliasEnum _my_alias_alias) +{ + m_my_alias_alias = _my_alias_alias; +} + +/*! + * @brief This function returns the value of member my_alias_alias + * @return Value of member my_alias_alias + */ +MyAliasAliasEnum AliasAliasStruct::my_alias_alias() const +{ + return m_my_alias_alias; +} + +/*! + * @brief This function returns a reference to member my_alias_alias + * @return Reference to member my_alias_alias + */ +MyAliasAliasEnum& AliasAliasStruct::my_alias_alias() +{ + return m_my_alias_alias; +} + + + + + +BoolStruct::BoolStruct() +{ + // boolean m_my_bool + m_my_bool = false; + + // Just to register all known types + registerBasicTypes(); +} + +BoolStruct::~BoolStruct() +{ +} + +BoolStruct::BoolStruct( + const BoolStruct& x) +{ + m_my_bool = x.m_my_bool; + +} + +BoolStruct::BoolStruct( + BoolStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + +} + +BoolStruct& BoolStruct::operator =( + const BoolStruct& x) +{ + m_my_bool = x.m_my_bool; + + return *this; +} + +BoolStruct& BoolStruct::operator =( + BoolStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + return *this; +} + +bool BoolStruct::operator ==( + const BoolStruct& x) const +{ + return (m_my_bool == x.m_my_bool); +} + +bool BoolStruct::operator !=( + const BoolStruct& x) const +{ + return !(*this == x); +} + +size_t BoolStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BoolStruct_max_cdr_typesize; +} + +size_t BoolStruct::getCdrSerializedSize( + const BoolStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void BoolStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + +} + +void BoolStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + +} + + +bool BoolStruct::isKeyDefined() +{ + return false; +} + +void BoolStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BoolStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BoolStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BoolStruct::my_bool() +{ + return m_my_bool; +} + + + + + +OctetStruct::OctetStruct() +{ + // octet m_my_octet + m_my_octet = 0; + + // Just to register all known types + registerBasicTypes(); +} + +OctetStruct::~OctetStruct() +{ +} + +OctetStruct::OctetStruct( + const OctetStruct& x) +{ + m_my_octet = x.m_my_octet; + +} + +OctetStruct::OctetStruct( + OctetStruct&& x) noexcept +{ + m_my_octet = x.m_my_octet; + +} + +OctetStruct& OctetStruct::operator =( + const OctetStruct& x) +{ + m_my_octet = x.m_my_octet; + + return *this; +} + +OctetStruct& OctetStruct::operator =( + OctetStruct&& x) noexcept +{ + m_my_octet = x.m_my_octet; + + return *this; +} + +bool OctetStruct::operator ==( + const OctetStruct& x) const +{ + return (m_my_octet == x.m_my_octet); +} + +bool OctetStruct::operator !=( + const OctetStruct& x) const +{ + return !(*this == x); +} + +size_t OctetStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return OctetStruct_max_cdr_typesize; +} + +size_t OctetStruct::getCdrSerializedSize( + const OctetStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void OctetStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_octet; + +} + +void OctetStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_octet; + + +} + + +bool OctetStruct::isKeyDefined() +{ + return false; +} + +void OctetStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ +void OctetStruct::my_octet( + uint8_t _my_octet) +{ + m_my_octet = _my_octet; +} + +/*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ +uint8_t OctetStruct::my_octet() const +{ + return m_my_octet; +} + +/*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ +uint8_t& OctetStruct::my_octet() +{ + return m_my_octet; +} + + + + + +ShortStruct::ShortStruct() +{ + // short m_my_int16 + m_my_int16 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +ShortStruct::~ShortStruct() +{ +} + +ShortStruct::ShortStruct( + const ShortStruct& x) +{ + m_my_int16 = x.m_my_int16; + +} + +ShortStruct::ShortStruct( + ShortStruct&& x) noexcept +{ + m_my_int16 = x.m_my_int16; + +} + +ShortStruct& ShortStruct::operator =( + const ShortStruct& x) +{ + m_my_int16 = x.m_my_int16; + + return *this; +} + +ShortStruct& ShortStruct::operator =( + ShortStruct&& x) noexcept +{ + m_my_int16 = x.m_my_int16; + + return *this; +} + +bool ShortStruct::operator ==( + const ShortStruct& x) const +{ + return (m_my_int16 == x.m_my_int16); +} + +bool ShortStruct::operator !=( + const ShortStruct& x) const +{ + return !(*this == x); +} + +size_t ShortStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ShortStruct_max_cdr_typesize; +} + +size_t ShortStruct::getCdrSerializedSize( + const ShortStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + + +void ShortStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_int16; + +} + +void ShortStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_int16; + + +} + + +bool ShortStruct::isKeyDefined() +{ + return false; +} + +void ShortStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_int16 + * @param _my_int16 New value for member my_int16 + */ +void ShortStruct::my_int16( + int16_t _my_int16) +{ + m_my_int16 = _my_int16; +} + +/*! + * @brief This function returns the value of member my_int16 + * @return Value of member my_int16 + */ +int16_t ShortStruct::my_int16() const +{ + return m_my_int16; +} + +/*! + * @brief This function returns a reference to member my_int16 + * @return Reference to member my_int16 + */ +int16_t& ShortStruct::my_int16() +{ + return m_my_int16; +} + + + + + +LongStruct::LongStruct() +{ + // long m_my_int32 + m_my_int32 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +LongStruct::~LongStruct() +{ +} + +LongStruct::LongStruct( + const LongStruct& x) +{ + m_my_int32 = x.m_my_int32; + +} + +LongStruct::LongStruct( + LongStruct&& x) noexcept +{ + m_my_int32 = x.m_my_int32; + +} + +LongStruct& LongStruct::operator =( + const LongStruct& x) +{ + m_my_int32 = x.m_my_int32; + + return *this; +} + +LongStruct& LongStruct::operator =( + LongStruct&& x) noexcept +{ + m_my_int32 = x.m_my_int32; + + return *this; +} + +bool LongStruct::operator ==( + const LongStruct& x) const +{ + return (m_my_int32 == x.m_my_int32); +} + +bool LongStruct::operator !=( + const LongStruct& x) const +{ + return !(*this == x); +} + +size_t LongStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LongStruct_max_cdr_typesize; +} + +size_t LongStruct::getCdrSerializedSize( + const LongStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void LongStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_int32; + +} + +void LongStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_int32; + + +} + + +bool LongStruct::isKeyDefined() +{ + return false; +} + +void LongStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void LongStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t LongStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& LongStruct::my_int32() +{ + return m_my_int32; +} + + + + + +LongLongStruct::LongLongStruct() +{ + // long long m_my_int64 + m_my_int64 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +LongLongStruct::~LongLongStruct() +{ +} + +LongLongStruct::LongLongStruct( + const LongLongStruct& x) +{ + m_my_int64 = x.m_my_int64; + +} + +LongLongStruct::LongLongStruct( + LongLongStruct&& x) noexcept +{ + m_my_int64 = x.m_my_int64; + +} + +LongLongStruct& LongLongStruct::operator =( + const LongLongStruct& x) +{ + m_my_int64 = x.m_my_int64; + + return *this; +} + +LongLongStruct& LongLongStruct::operator =( + LongLongStruct&& x) noexcept +{ + m_my_int64 = x.m_my_int64; + + return *this; +} + +bool LongLongStruct::operator ==( + const LongLongStruct& x) const +{ + return (m_my_int64 == x.m_my_int64); +} + +bool LongLongStruct::operator !=( + const LongLongStruct& x) const +{ + return !(*this == x); +} + +size_t LongLongStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LongLongStruct_max_cdr_typesize; +} + +size_t LongLongStruct::getCdrSerializedSize( + const LongLongStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void LongLongStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_int64; + +} + +void LongLongStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_int64; + + +} + + +bool LongLongStruct::isKeyDefined() +{ + return false; +} + +void LongLongStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_int64 + * @param _my_int64 New value for member my_int64 + */ +void LongLongStruct::my_int64( + int64_t _my_int64) +{ + m_my_int64 = _my_int64; +} + +/*! + * @brief This function returns the value of member my_int64 + * @return Value of member my_int64 + */ +int64_t LongLongStruct::my_int64() const +{ + return m_my_int64; +} + +/*! + * @brief This function returns a reference to member my_int64 + * @return Reference to member my_int64 + */ +int64_t& LongLongStruct::my_int64() +{ + return m_my_int64; +} + + + + + +UShortStruct::UShortStruct() +{ + // unsigned short m_my_uint16 + m_my_uint16 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +UShortStruct::~UShortStruct() +{ +} + +UShortStruct::UShortStruct( + const UShortStruct& x) +{ + m_my_uint16 = x.m_my_uint16; + +} + +UShortStruct::UShortStruct( + UShortStruct&& x) noexcept +{ + m_my_uint16 = x.m_my_uint16; + +} + +UShortStruct& UShortStruct::operator =( + const UShortStruct& x) +{ + m_my_uint16 = x.m_my_uint16; + + return *this; +} + +UShortStruct& UShortStruct::operator =( + UShortStruct&& x) noexcept +{ + m_my_uint16 = x.m_my_uint16; + + return *this; +} + +bool UShortStruct::operator ==( + const UShortStruct& x) const +{ + return (m_my_uint16 == x.m_my_uint16); +} + +bool UShortStruct::operator !=( + const UShortStruct& x) const +{ + return !(*this == x); +} + +size_t UShortStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return UShortStruct_max_cdr_typesize; +} + +size_t UShortStruct::getCdrSerializedSize( + const UShortStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + return current_alignment - initial_alignment; +} + + +void UShortStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_uint16; + +} + +void UShortStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_uint16; + + +} + + +bool UShortStruct::isKeyDefined() +{ + return false; +} + +void UShortStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_uint16 + * @param _my_uint16 New value for member my_uint16 + */ +void UShortStruct::my_uint16( + uint16_t _my_uint16) +{ + m_my_uint16 = _my_uint16; +} + +/*! + * @brief This function returns the value of member my_uint16 + * @return Value of member my_uint16 + */ +uint16_t UShortStruct::my_uint16() const +{ + return m_my_uint16; +} + +/*! + * @brief This function returns a reference to member my_uint16 + * @return Reference to member my_uint16 + */ +uint16_t& UShortStruct::my_uint16() +{ + return m_my_uint16; +} + + + + + +ULongStruct::ULongStruct() +{ + // unsigned long m_my_uint32 + m_my_uint32 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +ULongStruct::~ULongStruct() +{ +} + +ULongStruct::ULongStruct( + const ULongStruct& x) +{ + m_my_uint32 = x.m_my_uint32; + +} + +ULongStruct::ULongStruct( + ULongStruct&& x) noexcept +{ + m_my_uint32 = x.m_my_uint32; + +} + +ULongStruct& ULongStruct::operator =( + const ULongStruct& x) +{ + m_my_uint32 = x.m_my_uint32; + + return *this; +} + +ULongStruct& ULongStruct::operator =( + ULongStruct&& x) noexcept +{ + m_my_uint32 = x.m_my_uint32; + + return *this; +} + +bool ULongStruct::operator ==( + const ULongStruct& x) const +{ + return (m_my_uint32 == x.m_my_uint32); +} + +bool ULongStruct::operator !=( + const ULongStruct& x) const +{ + return !(*this == x); +} + +size_t ULongStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ULongStruct_max_cdr_typesize; +} + +size_t ULongStruct::getCdrSerializedSize( + const ULongStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void ULongStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_uint32; + +} + +void ULongStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_uint32; + + +} + + +bool ULongStruct::isKeyDefined() +{ + return false; +} + +void ULongStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_uint32 + * @param _my_uint32 New value for member my_uint32 + */ +void ULongStruct::my_uint32( + uint32_t _my_uint32) +{ + m_my_uint32 = _my_uint32; +} + +/*! + * @brief This function returns the value of member my_uint32 + * @return Value of member my_uint32 + */ +uint32_t ULongStruct::my_uint32() const +{ + return m_my_uint32; +} + +/*! + * @brief This function returns a reference to member my_uint32 + * @return Reference to member my_uint32 + */ +uint32_t& ULongStruct::my_uint32() +{ + return m_my_uint32; +} + + + + + +ULongLongStruct::ULongLongStruct() +{ + // unsigned long long m_my_uint64 + m_my_uint64 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +ULongLongStruct::~ULongLongStruct() +{ +} + +ULongLongStruct::ULongLongStruct( + const ULongLongStruct& x) +{ + m_my_uint64 = x.m_my_uint64; + +} + +ULongLongStruct::ULongLongStruct( + ULongLongStruct&& x) noexcept +{ + m_my_uint64 = x.m_my_uint64; + +} + +ULongLongStruct& ULongLongStruct::operator =( + const ULongLongStruct& x) +{ + m_my_uint64 = x.m_my_uint64; + + return *this; +} + +ULongLongStruct& ULongLongStruct::operator =( + ULongLongStruct&& x) noexcept +{ + m_my_uint64 = x.m_my_uint64; + + return *this; +} + +bool ULongLongStruct::operator ==( + const ULongLongStruct& x) const +{ + return (m_my_uint64 == x.m_my_uint64); +} + +bool ULongLongStruct::operator !=( + const ULongLongStruct& x) const +{ + return !(*this == x); +} + +size_t ULongLongStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ULongLongStruct_max_cdr_typesize; +} + +size_t ULongLongStruct::getCdrSerializedSize( + const ULongLongStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void ULongLongStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_uint64; + +} + +void ULongLongStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_uint64; + + +} + + +bool ULongLongStruct::isKeyDefined() +{ + return false; +} + +void ULongLongStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_uint64 + * @param _my_uint64 New value for member my_uint64 + */ +void ULongLongStruct::my_uint64( + uint64_t _my_uint64) +{ + m_my_uint64 = _my_uint64; +} + +/*! + * @brief This function returns the value of member my_uint64 + * @return Value of member my_uint64 + */ +uint64_t ULongLongStruct::my_uint64() const +{ + return m_my_uint64; +} + +/*! + * @brief This function returns a reference to member my_uint64 + * @return Reference to member my_uint64 + */ +uint64_t& ULongLongStruct::my_uint64() +{ + return m_my_uint64; +} + + + + + +FloatStruct::FloatStruct() +{ + // float m_my_float32 + m_my_float32 = 0.0; + + // Just to register all known types + registerBasicTypes(); +} + +FloatStruct::~FloatStruct() +{ +} + +FloatStruct::FloatStruct( + const FloatStruct& x) +{ + m_my_float32 = x.m_my_float32; + +} + +FloatStruct::FloatStruct( + FloatStruct&& x) noexcept +{ + m_my_float32 = x.m_my_float32; + +} + +FloatStruct& FloatStruct::operator =( + const FloatStruct& x) +{ + m_my_float32 = x.m_my_float32; + + return *this; +} + +FloatStruct& FloatStruct::operator =( + FloatStruct&& x) noexcept +{ + m_my_float32 = x.m_my_float32; + + return *this; +} + +bool FloatStruct::operator ==( + const FloatStruct& x) const +{ + return (m_my_float32 == x.m_my_float32); +} + +bool FloatStruct::operator !=( + const FloatStruct& x) const +{ + return !(*this == x); +} + +size_t FloatStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return FloatStruct_max_cdr_typesize; +} + +size_t FloatStruct::getCdrSerializedSize( + const FloatStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void FloatStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_float32; + +} + +void FloatStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_float32; + + +} + + +bool FloatStruct::isKeyDefined() +{ + return false; +} + +void FloatStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_float32 + * @param _my_float32 New value for member my_float32 + */ +void FloatStruct::my_float32( + float _my_float32) +{ + m_my_float32 = _my_float32; +} + +/*! + * @brief This function returns the value of member my_float32 + * @return Value of member my_float32 + */ +float FloatStruct::my_float32() const +{ + return m_my_float32; +} + +/*! + * @brief This function returns a reference to member my_float32 + * @return Reference to member my_float32 + */ +float& FloatStruct::my_float32() +{ + return m_my_float32; +} + + + + + +DoubleStruct::DoubleStruct() +{ + // double m_my_float64 + m_my_float64 = 0.0; + + // Just to register all known types + registerBasicTypes(); +} + +DoubleStruct::~DoubleStruct() +{ +} + +DoubleStruct::DoubleStruct( + const DoubleStruct& x) +{ + m_my_float64 = x.m_my_float64; + +} + +DoubleStruct::DoubleStruct( + DoubleStruct&& x) noexcept +{ + m_my_float64 = x.m_my_float64; + +} + +DoubleStruct& DoubleStruct::operator =( + const DoubleStruct& x) +{ + m_my_float64 = x.m_my_float64; + + return *this; +} + +DoubleStruct& DoubleStruct::operator =( + DoubleStruct&& x) noexcept +{ + m_my_float64 = x.m_my_float64; + + return *this; +} + +bool DoubleStruct::operator ==( + const DoubleStruct& x) const +{ + return (m_my_float64 == x.m_my_float64); +} + +bool DoubleStruct::operator !=( + const DoubleStruct& x) const +{ + return !(*this == x); +} + +size_t DoubleStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return DoubleStruct_max_cdr_typesize; +} + +size_t DoubleStruct::getCdrSerializedSize( + const DoubleStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void DoubleStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_float64; + +} + +void DoubleStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_float64; + + +} + + +bool DoubleStruct::isKeyDefined() +{ + return false; +} + +void DoubleStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_float64 + * @param _my_float64 New value for member my_float64 + */ +void DoubleStruct::my_float64( + double _my_float64) +{ + m_my_float64 = _my_float64; +} + +/*! + * @brief This function returns the value of member my_float64 + * @return Value of member my_float64 + */ +double DoubleStruct::my_float64() const +{ + return m_my_float64; +} + +/*! + * @brief This function returns a reference to member my_float64 + * @return Reference to member my_float64 + */ +double& DoubleStruct::my_float64() +{ + return m_my_float64; +} + + + + + +LongDoubleStruct::LongDoubleStruct() +{ + // long double m_my_float128 + m_my_float128 = 0.0; + + // Just to register all known types + registerBasicTypes(); +} + +LongDoubleStruct::~LongDoubleStruct() +{ +} + +LongDoubleStruct::LongDoubleStruct( + const LongDoubleStruct& x) +{ + m_my_float128 = x.m_my_float128; + +} + +LongDoubleStruct::LongDoubleStruct( + LongDoubleStruct&& x) noexcept +{ + m_my_float128 = x.m_my_float128; + +} + +LongDoubleStruct& LongDoubleStruct::operator =( + const LongDoubleStruct& x) +{ + m_my_float128 = x.m_my_float128; + + return *this; +} + +LongDoubleStruct& LongDoubleStruct::operator =( + LongDoubleStruct&& x) noexcept +{ + m_my_float128 = x.m_my_float128; + + return *this; +} + +bool LongDoubleStruct::operator ==( + const LongDoubleStruct& x) const +{ + return (m_my_float128 == x.m_my_float128); +} + +bool LongDoubleStruct::operator !=( + const LongDoubleStruct& x) const +{ + return !(*this == x); +} + +size_t LongDoubleStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LongDoubleStruct_max_cdr_typesize; +} + +size_t LongDoubleStruct::getCdrSerializedSize( + const LongDoubleStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + + + return current_alignment - initial_alignment; +} + + +void LongDoubleStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_float128; + +} + +void LongDoubleStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_float128; + + +} + + +bool LongDoubleStruct::isKeyDefined() +{ + return false; +} + +void LongDoubleStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_float128 + * @param _my_float128 New value for member my_float128 + */ +void LongDoubleStruct::my_float128( + long double _my_float128) +{ + m_my_float128 = _my_float128; +} + +/*! + * @brief This function returns the value of member my_float128 + * @return Value of member my_float128 + */ +long double LongDoubleStruct::my_float128() const +{ + return m_my_float128; +} + +/*! + * @brief This function returns a reference to member my_float128 + * @return Reference to member my_float128 + */ +long double& LongDoubleStruct::my_float128() +{ + return m_my_float128; +} + + + + + +CharStruct::CharStruct() +{ + // char m_my_char + m_my_char = 0; + + // Just to register all known types + registerBasicTypes(); +} + +CharStruct::~CharStruct() +{ +} + +CharStruct::CharStruct( + const CharStruct& x) +{ + m_my_char = x.m_my_char; + +} + +CharStruct::CharStruct( + CharStruct&& x) noexcept +{ + m_my_char = x.m_my_char; + +} + +CharStruct& CharStruct::operator =( + const CharStruct& x) +{ + m_my_char = x.m_my_char; + + return *this; +} + +CharStruct& CharStruct::operator =( + CharStruct&& x) noexcept +{ + m_my_char = x.m_my_char; + + return *this; +} + +bool CharStruct::operator ==( + const CharStruct& x) const +{ + return (m_my_char == x.m_my_char); +} + +bool CharStruct::operator !=( + const CharStruct& x) const +{ + return !(*this == x); +} + +size_t CharStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return CharStruct_max_cdr_typesize; +} + +size_t CharStruct::getCdrSerializedSize( + const CharStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void CharStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_char; + +} + +void CharStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_char; + + +} + + +bool CharStruct::isKeyDefined() +{ + return false; +} + +void CharStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_char + * @param _my_char New value for member my_char + */ +void CharStruct::my_char( + char _my_char) +{ + m_my_char = _my_char; +} + +/*! + * @brief This function returns the value of member my_char + * @return Value of member my_char + */ +char CharStruct::my_char() const +{ + return m_my_char; +} + +/*! + * @brief This function returns a reference to member my_char + * @return Reference to member my_char + */ +char& CharStruct::my_char() +{ + return m_my_char; +} + + + + + +WCharStruct::WCharStruct() +{ + // wchar m_my_wchar + m_my_wchar = 0; + + // Just to register all known types + registerBasicTypes(); +} + +WCharStruct::~WCharStruct() +{ +} + +WCharStruct::WCharStruct( + const WCharStruct& x) +{ + m_my_wchar = x.m_my_wchar; + +} + +WCharStruct::WCharStruct( + WCharStruct&& x) noexcept +{ + m_my_wchar = x.m_my_wchar; + +} + +WCharStruct& WCharStruct::operator =( + const WCharStruct& x) +{ + m_my_wchar = x.m_my_wchar; + + return *this; +} + +WCharStruct& WCharStruct::operator =( + WCharStruct&& x) noexcept +{ + m_my_wchar = x.m_my_wchar; + + return *this; +} + +bool WCharStruct::operator ==( + const WCharStruct& x) const +{ + return (m_my_wchar == x.m_my_wchar); +} + +bool WCharStruct::operator !=( + const WCharStruct& x) const +{ + return !(*this == x); +} + +size_t WCharStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return WCharStruct_max_cdr_typesize; +} + +size_t WCharStruct::getCdrSerializedSize( + const WCharStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void WCharStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_wchar; + +} + +void WCharStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_wchar; + + +} + + +bool WCharStruct::isKeyDefined() +{ + return false; +} + +void WCharStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_wchar + * @param _my_wchar New value for member my_wchar + */ +void WCharStruct::my_wchar( + wchar_t _my_wchar) +{ + m_my_wchar = _my_wchar; +} + +/*! + * @brief This function returns the value of member my_wchar + * @return Value of member my_wchar + */ +wchar_t WCharStruct::my_wchar() const +{ + return m_my_wchar; +} + +/*! + * @brief This function returns a reference to member my_wchar + * @return Reference to member my_wchar + */ +wchar_t& WCharStruct::my_wchar() +{ + return m_my_wchar; +} + + + + + +StringStruct::StringStruct() +{ + // /type_d() m_my_string + + + // Just to register all known types + registerBasicTypes(); +} + +StringStruct::~StringStruct() +{ +} + +StringStruct::StringStruct( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + +} + +StringStruct::StringStruct( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + +} + +StringStruct& StringStruct::operator =( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + + return *this; +} + +StringStruct& StringStruct::operator =( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool StringStruct::operator ==( + const StringStruct& x) const +{ + return (m_my_string == x.m_my_string); +} + +bool StringStruct::operator !=( + const StringStruct& x) const +{ + return !(*this == x); +} + +size_t StringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; +} + +size_t StringStruct::getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void StringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_string.c_str(); + +} + +void StringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_string; + + +} + + +bool StringStruct::isKeyDefined() +{ + return false; +} + +void StringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void StringStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void StringStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& StringStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& StringStruct::my_string() +{ + return m_my_string; +} + + + + + +WStringStruct::WStringStruct() +{ + // /type_15() m_my_wstring + + + // Just to register all known types + registerBasicTypes(); +} + +WStringStruct::~WStringStruct() +{ +} + +WStringStruct::WStringStruct( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + +} + +WStringStruct::WStringStruct( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + +} + +WStringStruct& WStringStruct::operator =( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + + return *this; +} + +WStringStruct& WStringStruct::operator =( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + + return *this; +} + +bool WStringStruct::operator ==( + const WStringStruct& x) const +{ + return (m_my_wstring == x.m_my_wstring); +} + +bool WStringStruct::operator !=( + const WStringStruct& x) const +{ + return !(*this == x); +} + +size_t WStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; +} + +size_t WStringStruct::getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void WStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_wstring; + +} + +void WStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_wstring; + + +} + + +bool WStringStruct::isKeyDefined() +{ + return false; +} + +void WStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ +void WStringStruct::my_wstring( + const std::wstring& _my_wstring) +{ + m_my_wstring = _my_wstring; +} + +/*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ +void WStringStruct::my_wstring( + std::wstring&& _my_wstring) +{ + m_my_wstring = std::move(_my_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ +const std::wstring& WStringStruct::my_wstring() const +{ + return m_my_wstring; +} + +/*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ +std::wstring& WStringStruct::my_wstring() +{ + return m_my_wstring; +} + + + + + +LargeStringStruct::LargeStringStruct() +{ + // /type_d() m_my_large_string + + + // Just to register all known types + registerBasicTypes(); +} + +LargeStringStruct::~LargeStringStruct() +{ +} + +LargeStringStruct::LargeStringStruct( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + +} + +LargeStringStruct::LargeStringStruct( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + +} + +LargeStringStruct& LargeStringStruct::operator =( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + + return *this; +} + +LargeStringStruct& LargeStringStruct::operator =( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + + return *this; +} + +bool LargeStringStruct::operator ==( + const LargeStringStruct& x) const +{ + return (m_my_large_string == x.m_my_large_string); +} + +bool LargeStringStruct::operator !=( + const LargeStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; +} + +size_t LargeStringStruct::getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void LargeStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_string.c_str(); + +} + +void LargeStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + std::string aux; + dcdr >> aux; + m_my_large_string = aux.c_str(); + } + + +} + + +bool LargeStringStruct::isKeyDefined() +{ + return false; +} + +void LargeStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ +void LargeStringStruct::my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string) +{ + m_my_large_string = _my_large_string; +} + +/*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ +void LargeStringStruct::my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string) +{ + m_my_large_string = std::move(_my_large_string); +} + +/*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ +const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const +{ + return m_my_large_string; +} + +/*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ +eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() +{ + return m_my_large_string; +} + + + + + +LargeWStringStruct::LargeWStringStruct() +{ + // /type_15() m_my_large_wstring + + + // Just to register all known types + registerBasicTypes(); +} + +LargeWStringStruct::~LargeWStringStruct() +{ +} + +LargeWStringStruct::LargeWStringStruct( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + +} + +LargeWStringStruct::LargeWStringStruct( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + +} + +LargeWStringStruct& LargeWStringStruct::operator =( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + + return *this; +} + +LargeWStringStruct& LargeWStringStruct::operator =( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + + return *this; +} + +bool LargeWStringStruct::operator ==( + const LargeWStringStruct& x) const +{ + return (m_my_large_wstring == x.m_my_large_wstring); +} + +bool LargeWStringStruct::operator !=( + const LargeWStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeWStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; +} + +size_t LargeWStringStruct::getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void LargeWStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_wstring; + +} + +void LargeWStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_large_wstring; + + +} + + +bool LargeWStringStruct::isKeyDefined() +{ + return false; +} + +void LargeWStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + const std::wstring& _my_large_wstring) +{ + m_my_large_wstring = _my_large_wstring; +} + +/*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + std::wstring&& _my_large_wstring) +{ + m_my_large_wstring = std::move(_my_large_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ +const std::wstring& LargeWStringStruct::my_large_wstring() const +{ + return m_my_large_wstring; +} + +/*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ +std::wstring& LargeWStringStruct::my_large_wstring() +{ + return m_my_large_wstring; +} + + + + + +ArraytStruct::ArraytStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((2) * (2) * (2)) * 4); + + // Just to register all known types + registerBasicTypes(); +} + +ArraytStruct::~ArraytStruct() +{ +} + +ArraytStruct::ArraytStruct( + const ArraytStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArraytStruct::ArraytStruct( + ArraytStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArraytStruct& ArraytStruct::operator =( + const ArraytStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArraytStruct& ArraytStruct::operator =( + ArraytStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArraytStruct::operator ==( + const ArraytStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArraytStruct::operator !=( + const ArraytStruct& x) const +{ + return !(*this == x); +} + +size_t ArraytStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArraytStruct_max_cdr_typesize; +} + +size_t ArraytStruct::getCdrSerializedSize( + const ArraytStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2) * (2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArraytStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + for (uint32_t b = 0; b < m_my_array.size(); ++b) + { + for (uint32_t c = 0; c < m_my_array[b].size(); ++c) + { + scdr << m_my_array[b][c]; + + } + + } + + + +} + +void ArraytStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + for (uint32_t e = 0; e < m_my_array.size(); ++e) + { + for (uint32_t f = 0; f < m_my_array[e].size(); ++f) + { + dcdr >> m_my_array[e][f]; + + } + + } + + + +} + + +bool ArraytStruct::isKeyDefined() +{ + return false; +} + +void ArraytStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArraytStruct::my_array( + const std::array, 2>, 2>& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArraytStruct::my_array( + std::array, 2>, 2>&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array, 2>, 2>& ArraytStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array, 2>, 2>& ArraytStruct::my_array() +{ + return m_my_array; +} + + + + + + +ArrayArrayStruct::ArrayArrayStruct() +{ + // MyArray m_my_array_array + + + // Just to register all known types + registerBasicTypes(); +} + +ArrayArrayStruct::~ArrayArrayStruct() +{ +} + +ArrayArrayStruct::ArrayArrayStruct( + const ArrayArrayStruct& x) +{ + m_my_array_array = x.m_my_array_array; + +} + +ArrayArrayStruct::ArrayArrayStruct( + ArrayArrayStruct&& x) noexcept +{ + m_my_array_array = std::move(x.m_my_array_array); + +} + +ArrayArrayStruct& ArrayArrayStruct::operator =( + const ArrayArrayStruct& x) +{ + m_my_array_array = x.m_my_array_array; + + return *this; +} + +ArrayArrayStruct& ArrayArrayStruct::operator =( + ArrayArrayStruct&& x) noexcept +{ + m_my_array_array = std::move(x.m_my_array_array); + + return *this; +} + +bool ArrayArrayStruct::operator ==( + const ArrayArrayStruct& x) const +{ + return (m_my_array_array == x.m_my_array_array); +} + +bool ArrayArrayStruct::operator !=( + const ArrayArrayStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayArrayStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayArrayStruct_max_cdr_typesize; +} + +size_t ArrayArrayStruct::getCdrSerializedSize( + const ArrayArrayStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + + for(size_t a = 0; a < data.my_array_array().size(); ++a) + { + + for(size_t b = 0; b < data.my_array_array().at(a).size(); ++b) + { + current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + } + + } + + + + return current_alignment - initial_alignment; +} + + +void ArrayArrayStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + for (uint32_t d = 0; d < m_my_array_array.size(); ++d) + { + scdr << m_my_array_array[d]; + + } + + + +} + +void ArrayArrayStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + for (uint32_t f = 0; f < m_my_array_array.size(); ++f) + { + dcdr >> m_my_array_array[f]; + + } + + + +} + + +bool ArrayArrayStruct::isKeyDefined() +{ + return false; +} + +void ArrayArrayStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array_array + * @param _my_array_array New value to be copied in member my_array_array + */ +void ArrayArrayStruct::my_array_array( + const std::array, 2>& _my_array_array) +{ + m_my_array_array = _my_array_array; +} + +/*! + * @brief This function moves the value in member my_array_array + * @param _my_array_array New value to be moved in member my_array_array + */ +void ArrayArrayStruct::my_array_array( + std::array, 2>&& _my_array_array) +{ + m_my_array_array = std::move(_my_array_array); +} + +/*! + * @brief This function returns a constant reference to member my_array_array + * @return Constant reference to member my_array_array + */ +const std::array, 2>& ArrayArrayStruct::my_array_array() const +{ + return m_my_array_array; +} + +/*! + * @brief This function returns a reference to member my_array_array + * @return Reference to member my_array_array + */ +std::array, 2>& ArrayArrayStruct::my_array_array() +{ + return m_my_array_array; +} + + + + + + + +SequenceStruct::SequenceStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerBasicTypes(); +} + +SequenceStruct::~SequenceStruct() +{ +} + +SequenceStruct::SequenceStruct( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceStruct::SequenceStruct( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceStruct& SequenceStruct::operator =( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceStruct& SequenceStruct::operator =( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceStruct::operator ==( + const SequenceStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceStruct::operator !=( + const SequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; +} + +size_t SequenceStruct::getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + + + +SequenceSequenceStruct::SequenceSequenceStruct() +{ + // sequence, 3> m_my_sequence_sequence + + + // Just to register all known types + registerBasicTypes(); +} + +SequenceSequenceStruct::~SequenceSequenceStruct() +{ +} + +SequenceSequenceStruct::SequenceSequenceStruct( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + +} + +SequenceSequenceStruct::SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + + return *this; +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + + return *this; +} + +bool SequenceSequenceStruct::operator ==( + const SequenceSequenceStruct& x) const +{ + return (m_my_sequence_sequence == x.m_my_sequence_sequence); +} + +bool SequenceSequenceStruct::operator !=( + const SequenceSequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceSequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; +} + +size_t SequenceSequenceStruct::getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_sequence().at(a).size() > 0) + { + current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + } + + + + return current_alignment - initial_alignment; +} + + +void SequenceSequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_sequence; + + +} + +void SequenceSequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_sequence; + + +} + + +bool SequenceSequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceSequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + const std::vector>& _my_sequence_sequence) +{ + m_my_sequence_sequence = _my_sequence_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + std::vector>&& _my_sequence_sequence) +{ + m_my_sequence_sequence = std::move(_my_sequence_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ +const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const +{ + return m_my_sequence_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ +std::vector>& SequenceSequenceStruct::my_sequence_sequence() +{ + return m_my_sequence_sequence; +} + + + + + + + +MapStruct::MapStruct() +{ + // map m_my_map + + + // Just to register all known types + registerBasicTypes(); +} + +MapStruct::~MapStruct() +{ +} + +MapStruct::MapStruct( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapStruct::MapStruct( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapStruct& MapStruct::operator =( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapStruct& MapStruct::operator =( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapStruct::operator ==( + const MapStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapStruct::operator !=( + const MapStruct& x) const +{ + return !(*this == x); +} + +size_t MapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; +} + +size_t MapStruct::getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapStruct::isKeyDefined() +{ + return false; +} + +void MapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapStruct::my_map() +{ + return m_my_map; +} + + + + + + + + + +MapMapStruct::MapMapStruct() +{ + // map> m_my_map_map + + + // Just to register all known types + registerBasicTypes(); +} + +MapMapStruct::~MapMapStruct() +{ +} + +MapMapStruct::MapMapStruct( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + +} + +MapMapStruct::MapMapStruct( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + +} + +MapMapStruct& MapMapStruct::operator =( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + + return *this; +} + +MapMapStruct& MapMapStruct::operator =( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + + return *this; +} + +bool MapMapStruct::operator ==( + const MapMapStruct& x) const +{ + return (m_my_map_map == x.m_my_map_map); +} + +bool MapMapStruct::operator !=( + const MapMapStruct& x) const +{ + return !(*this == x); +} + +size_t MapMapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; +} + +size_t MapMapStruct::getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + } + + + return current_alignment - initial_alignment; +} + + +void MapMapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_map.size()); + for (const auto& pair : m_my_map_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapMapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_map; + + +} + + +bool MapMapStruct::isKeyDefined() +{ + return false; +} + +void MapMapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ +void MapMapStruct::my_map_map( + const std::map>& _my_map_map) +{ + m_my_map_map = _my_map_map; +} + +/*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ +void MapMapStruct::my_map_map( + std::map>&& _my_map_map) +{ + m_my_map_map = std::move(_my_map_map); +} + +/*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ +const std::map>& MapMapStruct::my_map_map() const +{ + return m_my_map_map; +} + +/*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ +std::map>& MapMapStruct::my_map_map() +{ + return m_my_map_map; +} + + + +MyBitset::MyBitset() +{ + // Just to register all known types + registerBasicTypes(); +} + +MyBitset::~MyBitset() +{ +} + +MyBitset::MyBitset( + const MyBitset& x) +{ + m_bitset = x.m_bitset; +} + +MyBitset::MyBitset( + MyBitset&& x) noexcept +{ + m_bitset = x.m_bitset; +} + +MyBitset& MyBitset::operator =( + const MyBitset& x) +{ + m_bitset = x.m_bitset; + + return *this; +} + +MyBitset& MyBitset::operator =( + MyBitset&& x) noexcept +{ + m_bitset = x.m_bitset; + + return *this; +} + +bool MyBitset::operator ==( + const MyBitset& x) const +{ + return m_bitset == x.m_bitset; +} + +bool MyBitset::operator !=( + const MyBitset& x) const +{ + return !(*this == x); +} + +size_t MyBitset::getCdrSerializedSize( + const MyBitset&, + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + current_alignment += sizeof(helper::FindType<30>::type) + + eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<30>::type)); + + return current_alignment - initial_alignment; +} + + +void MyBitset::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + helper::FindType<30>::type bits = static_cast::type>(bitset().to_ullong()); + scdr << bits; +} + +void MyBitset::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + helper::FindType<30>::type bits; + dcdr >> bits; + bitset(std::bitset<30>(bits)); +} + + + +void MyBitset::a( + char _a) +{ + int base = 0; + int size = 2; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_a & 0x01)); + _a = _a >> 1; + } + +} + +char MyBitset::a() const +{ + int base = 0; + int size = 2; + std::bitset<2> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + + +void MyBitset::b( + uint32_t _b) +{ + int base = 10; + int size = 20; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_b & 0x01)); + _b = _b >> 1; + } + +} + +uint32_t MyBitset::b() const +{ + int base = 10; + int size = 20; + std::bitset<20> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +std::bitset<30> MyBitset::bitset() const +{ + std::string str_value; + + str_value = m_bitset.to_string() + str_value; + + return std::bitset<30>(str_value); +} + +void MyBitset::bitset( + const std::bitset<30>& bitset) +{ + std::string str_value {bitset.to_string()}; + size_t base_diff {0}; + size_t last_post {std::string::npos}; + + base_diff += 30; + m_bitset = std::bitset<30>(str_value.substr(str_value.length() - base_diff, last_post)); +} + + + +BitsetStruct::BitsetStruct() +{ + // MyBitset m_a + + + // Just to register all known types + registerBasicTypes(); +} + +BitsetStruct::~BitsetStruct() +{ +} + +BitsetStruct::BitsetStruct( + const BitsetStruct& x) +{ + m_a = x.m_a; + +} + +BitsetStruct::BitsetStruct( + BitsetStruct&& x) noexcept +{ + m_a = std::move(x.m_a); + +} + +BitsetStruct& BitsetStruct::operator =( + const BitsetStruct& x) +{ + m_a = x.m_a; + + return *this; +} + +BitsetStruct& BitsetStruct::operator =( + BitsetStruct&& x) noexcept +{ + m_a = std::move(x.m_a); + + return *this; +} + +bool BitsetStruct::operator ==( + const BitsetStruct& x) const +{ + return (m_a == x.m_a); +} + +bool BitsetStruct::operator !=( + const BitsetStruct& x) const +{ + return !(*this == x); +} + +size_t BitsetStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BitsetStruct_max_cdr_typesize; +} + +size_t BitsetStruct::getCdrSerializedSize( + const BitsetStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += MyBitset::getCdrSerializedSize(data.a(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void BitsetStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_a; + +} + +void BitsetStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_a; + + +} + + +bool BitsetStruct::isKeyDefined() +{ + return false; +} + +void BitsetStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member a + * @param _a New value to be copied in member a + */ +void BitsetStruct::a( + const MyBitset& _a) +{ + m_a = _a; +} + +/*! + * @brief This function moves the value in member a + * @param _a New value to be moved in member a + */ +void BitsetStruct::a( + MyBitset&& _a) +{ + m_a = std::move(_a); +} + +/*! + * @brief This function returns a constant reference to member a + * @return Constant reference to member a + */ +const MyBitset& BitsetStruct::a() const +{ + return m_a; +} + +/*! + * @brief This function returns a reference to member a + * @return Reference to member a + */ +MyBitset& BitsetStruct::a() +{ + return m_a; +} + + + + + +StructStruct::StructStruct() +{ + // long m_a + m_a = 0; + // long long m_b + m_b = 0; + + // Just to register all known types + registerBasicTypes(); +} + +StructStruct::~StructStruct() +{ +} + +StructStruct::StructStruct( + const StructStruct& x) +{ + m_a = x.m_a; + + + m_b = x.m_b; + +} + +StructStruct::StructStruct( + StructStruct&& x) noexcept +{ + m_a = x.m_a; + + + m_b = x.m_b; + +} + +StructStruct& StructStruct::operator =( + const StructStruct& x) +{ + m_a = x.m_a; + + + m_b = x.m_b; + + return *this; +} + +StructStruct& StructStruct::operator =( + StructStruct&& x) noexcept +{ + m_a = x.m_a; + + + m_b = x.m_b; + + return *this; +} + +bool StructStruct::operator ==( + const StructStruct& x) const +{ + return (m_a == x.m_a && + m_b == x.m_b); +} + +bool StructStruct::operator !=( + const StructStruct& x) const +{ + return !(*this == x); +} + +size_t StructStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StructStruct_max_cdr_typesize; +} + +size_t StructStruct::getCdrSerializedSize( + const StructStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void StructStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_a; + + scdr << m_b; + +} + +void StructStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_a; + + + + dcdr >> m_b; + + +} + + +bool StructStruct::isKeyDefined() +{ + return false; +} + +void StructStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member a + * @param _a New value for member a + */ +void StructStruct::a( + int32_t _a) +{ + m_a = _a; +} + +/*! + * @brief This function returns the value of member a + * @return Value of member a + */ +int32_t StructStruct::a() const +{ + return m_a; +} + +/*! + * @brief This function returns a reference to member a + * @return Reference to member a + */ +int32_t& StructStruct::a() +{ + return m_a; +} + + +/*! + * @brief This function sets a value in member b + * @param _b New value for member b + */ +void StructStruct::b( + int64_t _b) +{ + m_b = _b; +} + +/*! + * @brief This function returns the value of member b + * @return Value of member b + */ +int64_t StructStruct::b() const +{ + return m_b; +} + +/*! + * @brief This function returns a reference to member b + * @return Reference to member b + */ +int64_t& StructStruct::b() +{ + return m_b; +} + + + + + +StructStructStruct::StructStructStruct() +{ + // StructStruct m_child_struct + + // long long m_child_int64 + m_child_int64 = 0; + + // Just to register all known types + registerBasicTypes(); +} + +StructStructStruct::~StructStructStruct() +{ +} + +StructStructStruct::StructStructStruct( + const StructStructStruct& x) +{ + m_child_struct = x.m_child_struct; + + + m_child_int64 = x.m_child_int64; + +} + +StructStructStruct::StructStructStruct( + StructStructStruct&& x) noexcept +{ + m_child_struct = std::move(x.m_child_struct); + + + m_child_int64 = x.m_child_int64; + +} + +StructStructStruct& StructStructStruct::operator =( + const StructStructStruct& x) +{ + m_child_struct = x.m_child_struct; + + + m_child_int64 = x.m_child_int64; + + return *this; +} + +StructStructStruct& StructStructStruct::operator =( + StructStructStruct&& x) noexcept +{ + m_child_struct = std::move(x.m_child_struct); + + + m_child_int64 = x.m_child_int64; + + return *this; +} + +bool StructStructStruct::operator ==( + const StructStructStruct& x) const +{ + return (m_child_struct == x.m_child_struct && + m_child_int64 == x.m_child_int64); +} + +bool StructStructStruct::operator !=( + const StructStructStruct& x) const +{ + return !(*this == x); +} + +size_t StructStructStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StructStructStruct_max_cdr_typesize; +} + +size_t StructStructStruct::getCdrSerializedSize( + const StructStructStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += StructStruct::getCdrSerializedSize(data.child_struct(), current_alignment); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + return current_alignment - initial_alignment; +} + + +void StructStructStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_child_struct; + + scdr << m_child_int64; + +} + +void StructStructStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_child_struct; + + + + dcdr >> m_child_int64; + + +} + + +bool StructStructStruct::isKeyDefined() +{ + return false; +} + +void StructStructStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member child_struct + * @param _child_struct New value to be copied in member child_struct + */ +void StructStructStruct::child_struct( + const StructStruct& _child_struct) +{ + m_child_struct = _child_struct; +} + +/*! + * @brief This function moves the value in member child_struct + * @param _child_struct New value to be moved in member child_struct + */ +void StructStructStruct::child_struct( + StructStruct&& _child_struct) +{ + m_child_struct = std::move(_child_struct); +} + +/*! + * @brief This function returns a constant reference to member child_struct + * @return Constant reference to member child_struct + */ +const StructStruct& StructStructStruct::child_struct() const +{ + return m_child_struct; +} + +/*! + * @brief This function returns a reference to member child_struct + * @return Reference to member child_struct + */ +StructStruct& StructStructStruct::child_struct() +{ + return m_child_struct; +} + + +/*! + * @brief This function sets a value in member child_int64 + * @param _child_int64 New value for member child_int64 + */ +void StructStructStruct::child_int64( + int64_t _child_int64) +{ + m_child_int64 = _child_int64; +} + +/*! + * @brief This function returns the value of member child_int64 + * @return Value of member child_int64 + */ +int64_t StructStructStruct::child_int64() const +{ + return m_child_int64; +} + +/*! + * @brief This function returns a reference to member child_int64 + * @return Reference to member child_int64 + */ +int64_t& StructStructStruct::child_int64() +{ + return m_child_int64; +} + + + + + +SimpleUnion::SimpleUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleUnion::~SimpleUnion() +{ +} + +SimpleUnion::SimpleUnion( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion::SimpleUnion( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion& SimpleUnion::operator =( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleUnion& SimpleUnion::operator =( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleUnion::operator ==( + const SimpleUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleUnion::operator !=( + const SimpleUnion& x) const +{ + return !(*this == x); +} + +void SimpleUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleUnion::_d() +{ + return m__d; +} + +void SimpleUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleUnion::getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +UnionUnion::UnionUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // SimpleUnion m_second + +} + +UnionUnion::~UnionUnion() +{ +} + +UnionUnion::UnionUnion( + const UnionUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +UnionUnion::UnionUnion( + UnionUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = std::move(x.m_second); + + break; + + default: + break; + } +} + +UnionUnion& UnionUnion::operator =( + const UnionUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +UnionUnion& UnionUnion::operator =( + UnionUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = std::move(x.m_second); + + break; + + default: + break; + } + + return *this; +} + +bool UnionUnion::operator ==( + const UnionUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool UnionUnion::operator !=( + const UnionUnion& x) const +{ + return !(*this == x); +} + +void UnionUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t UnionUnion::_d() const +{ + return m__d; +} + +int32_t& UnionUnion::_d() +{ + return m__d; +} + +void UnionUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t UnionUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& UnionUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void UnionUnion::second( + const SimpleUnion& _second) +{ + m_second = _second; + m__d = B; + +} + +void UnionUnion::second( + SimpleUnion&& _second) +{ + m_second = std::move(_second); + m__d = B; + +} + +const SimpleUnion& UnionUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +SimpleUnion& UnionUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t UnionUnion::getCdrSerializedSize( + const UnionUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += SimpleUnion::getCdrSerializedSize(data.second(), current_alignment); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void UnionUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void UnionUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +WCharUnion::WCharUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +WCharUnion::~WCharUnion() +{ +} + +WCharUnion::WCharUnion( + const WCharUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +WCharUnion::WCharUnion( + WCharUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +WCharUnion& WCharUnion::operator =( + const WCharUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +WCharUnion& WCharUnion::operator =( + WCharUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool WCharUnion::operator ==( + const WCharUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool WCharUnion::operator !=( + const WCharUnion& x) const +{ + return !(*this == x); +} + +void WCharUnion::_d( + wchar_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +wchar_t WCharUnion::_d() const +{ + return m__d; +} + +wchar_t& WCharUnion::_d() +{ + return m__d; +} + +void WCharUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t WCharUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& WCharUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void WCharUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t WCharUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& WCharUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t WCharUnion::getCdrSerializedSize( + const WCharUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void WCharUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void WCharUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleUnionStruct::SimpleUnionStruct() +{ + // SimpleUnion m_my_union + + + // Just to register all known types + registerBasicTypes(); +} + +SimpleUnionStruct::~SimpleUnionStruct() +{ +} + +SimpleUnionStruct::SimpleUnionStruct( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleUnionStruct::SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleUnionStruct::operator ==( + const SimpleUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleUnionStruct::operator !=( + const SimpleUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; +} + +size_t SimpleUnionStruct::getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleUnionStruct::my_union( + const SimpleUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleUnionStruct::my_union( + SimpleUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleUnion& SimpleUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleUnion& SimpleUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +UnionUnionUnionStruct::UnionUnionUnionStruct() +{ + // UnionUnion m_my_union + + + // Just to register all known types + registerBasicTypes(); +} + +UnionUnionUnionStruct::~UnionUnionUnionStruct() +{ +} + +UnionUnionUnionStruct::UnionUnionUnionStruct( + const UnionUnionUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +UnionUnionUnionStruct::UnionUnionUnionStruct( + UnionUnionUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( + const UnionUnionUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +UnionUnionUnionStruct& UnionUnionUnionStruct::operator =( + UnionUnionUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool UnionUnionUnionStruct::operator ==( + const UnionUnionUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool UnionUnionUnionStruct::operator !=( + const UnionUnionUnionStruct& x) const +{ + return !(*this == x); +} + +size_t UnionUnionUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return UnionUnionUnionStruct_max_cdr_typesize; +} + +size_t UnionUnionUnionStruct::getCdrSerializedSize( + const UnionUnionUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += UnionUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void UnionUnionUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void UnionUnionUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool UnionUnionUnionStruct::isKeyDefined() +{ + return false; +} + +void UnionUnionUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void UnionUnionUnionStruct::my_union( + const UnionUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void UnionUnionUnionStruct::my_union( + UnionUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const UnionUnion& UnionUnionUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +UnionUnion& UnionUnionUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +WCharUnionStruct::WCharUnionStruct() +{ + // WCharUnion m_my_union + + + // Just to register all known types + registerBasicTypes(); +} + +WCharUnionStruct::~WCharUnionStruct() +{ +} + +WCharUnionStruct::WCharUnionStruct( + const WCharUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +WCharUnionStruct::WCharUnionStruct( + WCharUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +WCharUnionStruct& WCharUnionStruct::operator =( + const WCharUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +WCharUnionStruct& WCharUnionStruct::operator =( + WCharUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool WCharUnionStruct::operator ==( + const WCharUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool WCharUnionStruct::operator !=( + const WCharUnionStruct& x) const +{ + return !(*this == x); +} + +size_t WCharUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return WCharUnionStruct_max_cdr_typesize; +} + +size_t WCharUnionStruct::getCdrSerializedSize( + const WCharUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += WCharUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void WCharUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void WCharUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool WCharUnionStruct::isKeyDefined() +{ + return false; +} + +void WCharUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void WCharUnionStruct::my_union( + const WCharUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void WCharUnionStruct::my_union( + WCharUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const WCharUnion& WCharUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +WCharUnion& WCharUnionStruct::my_union() +{ + return m_my_union; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Basicv1.h b/test/unittest/dynamic_types/idl/Basicv1.h new file mode 100644 index 00000000000..b8b27164562 --- /dev/null +++ b/test/unittest/dynamic_types/idl/Basicv1.h @@ -0,0 +1,5326 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Basic.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_BASIC_H_ +#define _FAST_DDS_GENERATED_BASIC_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(BASIC_SOURCE) +#define BASIC_DllAPI __declspec( dllexport ) +#else +#define BASIC_DllAPI __declspec( dllimport ) +#endif // BASIC_SOURCE +#else +#define BASIC_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define BASIC_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. + * @ingroup Basic + */ +enum MyEnum : uint32_t +{ + A, + B, + C +}; +typedef MyEnum MyAliasEnum; + +typedef MyAliasEnum MyAliasAliasEnum; + + + +/*! + * @brief This class represents the structure EnumStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class EnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport EnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~EnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object EnumStruct that will be copied. + */ + eProsima_user_DllExport EnumStruct( + const EnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object EnumStruct that will be copied. + */ + eProsima_user_DllExport EnumStruct( + EnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object EnumStruct that will be copied. + */ + eProsima_user_DllExport EnumStruct& operator =( + const EnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object EnumStruct that will be copied. + */ + eProsima_user_DllExport EnumStruct& operator =( + EnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x EnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const EnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x EnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const EnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const EnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyEnum m_my_enum; + +}; + + + +/*! + * @brief This class represents the structure AliasStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class AliasStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AliasStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AliasStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object AliasStruct that will be copied. + */ + eProsima_user_DllExport AliasStruct( + const AliasStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object AliasStruct that will be copied. + */ + eProsima_user_DllExport AliasStruct( + AliasStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object AliasStruct that will be copied. + */ + eProsima_user_DllExport AliasStruct& operator =( + const AliasStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object AliasStruct that will be copied. + */ + eProsima_user_DllExport AliasStruct& operator =( + AliasStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x AliasStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AliasStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x AliasStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AliasStruct& x) const; + + /*! + * @brief This function sets a value in member my_alias + * @param _my_alias New value for member my_alias + */ + eProsima_user_DllExport void my_alias( + MyAliasEnum _my_alias); + + /*! + * @brief This function returns the value of member my_alias + * @return Value of member my_alias + */ + eProsima_user_DllExport MyAliasEnum my_alias() const; + + /*! + * @brief This function returns a reference to member my_alias + * @return Reference to member my_alias + */ + eProsima_user_DllExport MyAliasEnum& my_alias(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const AliasStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyAliasEnum m_my_alias; + +}; + + + +/*! + * @brief This class represents the structure AliasAliasStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class AliasAliasStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AliasAliasStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AliasAliasStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object AliasAliasStruct that will be copied. + */ + eProsima_user_DllExport AliasAliasStruct( + const AliasAliasStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object AliasAliasStruct that will be copied. + */ + eProsima_user_DllExport AliasAliasStruct( + AliasAliasStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object AliasAliasStruct that will be copied. + */ + eProsima_user_DllExport AliasAliasStruct& operator =( + const AliasAliasStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object AliasAliasStruct that will be copied. + */ + eProsima_user_DllExport AliasAliasStruct& operator =( + AliasAliasStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x AliasAliasStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AliasAliasStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x AliasAliasStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AliasAliasStruct& x) const; + + /*! + * @brief This function sets a value in member my_alias_alias + * @param _my_alias_alias New value for member my_alias_alias + */ + eProsima_user_DllExport void my_alias_alias( + MyAliasAliasEnum _my_alias_alias); + + /*! + * @brief This function returns the value of member my_alias_alias + * @return Value of member my_alias_alias + */ + eProsima_user_DllExport MyAliasAliasEnum my_alias_alias() const; + + /*! + * @brief This function returns a reference to member my_alias_alias + * @return Reference to member my_alias_alias + */ + eProsima_user_DllExport MyAliasAliasEnum& my_alias_alias(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const AliasAliasStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyAliasAliasEnum m_my_alias_alias; + +}; + + + +/*! + * @brief This class represents the structure BoolStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class BoolStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BoolStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BoolStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BoolStruct that will be copied. + */ + eProsima_user_DllExport BoolStruct( + const BoolStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BoolStruct that will be copied. + */ + eProsima_user_DllExport BoolStruct( + BoolStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BoolStruct that will be copied. + */ + eProsima_user_DllExport BoolStruct& operator =( + const BoolStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BoolStruct that will be copied. + */ + eProsima_user_DllExport BoolStruct& operator =( + BoolStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BoolStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BoolStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BoolStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BoolStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BoolStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + +}; + + + +/*! + * @brief This class represents the structure OctetStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class OctetStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport OctetStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~OctetStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object OctetStruct that will be copied. + */ + eProsima_user_DllExport OctetStruct( + const OctetStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object OctetStruct that will be copied. + */ + eProsima_user_DllExport OctetStruct( + OctetStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object OctetStruct that will be copied. + */ + eProsima_user_DllExport OctetStruct& operator =( + const OctetStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object OctetStruct that will be copied. + */ + eProsima_user_DllExport OctetStruct& operator =( + OctetStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x OctetStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const OctetStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x OctetStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const OctetStruct& x) const; + + /*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ + eProsima_user_DllExport void my_octet( + uint8_t _my_octet); + + /*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ + eProsima_user_DllExport uint8_t my_octet() const; + + /*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ + eProsima_user_DllExport uint8_t& my_octet(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const OctetStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_my_octet; + +}; + + + +/*! + * @brief This class represents the structure ShortStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class ShortStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ShortStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ShortStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ShortStruct that will be copied. + */ + eProsima_user_DllExport ShortStruct( + const ShortStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ShortStruct that will be copied. + */ + eProsima_user_DllExport ShortStruct( + ShortStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ShortStruct that will be copied. + */ + eProsima_user_DllExport ShortStruct& operator =( + const ShortStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ShortStruct that will be copied. + */ + eProsima_user_DllExport ShortStruct& operator =( + ShortStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ShortStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ShortStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ShortStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ShortStruct& x) const; + + /*! + * @brief This function sets a value in member my_int16 + * @param _my_int16 New value for member my_int16 + */ + eProsima_user_DllExport void my_int16( + int16_t _my_int16); + + /*! + * @brief This function returns the value of member my_int16 + * @return Value of member my_int16 + */ + eProsima_user_DllExport int16_t my_int16() const; + + /*! + * @brief This function returns a reference to member my_int16 + * @return Reference to member my_int16 + */ + eProsima_user_DllExport int16_t& my_int16(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ShortStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int16_t m_my_int16; + +}; + + + +/*! + * @brief This class represents the structure LongStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class LongStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LongStruct that will be copied. + */ + eProsima_user_DllExport LongStruct( + const LongStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LongStruct that will be copied. + */ + eProsima_user_DllExport LongStruct( + LongStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LongStruct that will be copied. + */ + eProsima_user_DllExport LongStruct& operator =( + const LongStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LongStruct that will be copied. + */ + eProsima_user_DllExport LongStruct& operator =( + LongStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LongStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LongStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongStruct& x) const; + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LongStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int32_t m_my_int32; + +}; + + + +/*! + * @brief This class represents the structure LongLongStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class LongLongStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongLongStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongLongStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LongLongStruct that will be copied. + */ + eProsima_user_DllExport LongLongStruct( + const LongLongStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LongLongStruct that will be copied. + */ + eProsima_user_DllExport LongLongStruct( + LongLongStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LongLongStruct that will be copied. + */ + eProsima_user_DllExport LongLongStruct& operator =( + const LongLongStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LongLongStruct that will be copied. + */ + eProsima_user_DllExport LongLongStruct& operator =( + LongLongStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LongLongStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongLongStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LongLongStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongLongStruct& x) const; + + /*! + * @brief This function sets a value in member my_int64 + * @param _my_int64 New value for member my_int64 + */ + eProsima_user_DllExport void my_int64( + int64_t _my_int64); + + /*! + * @brief This function returns the value of member my_int64 + * @return Value of member my_int64 + */ + eProsima_user_DllExport int64_t my_int64() const; + + /*! + * @brief This function returns a reference to member my_int64 + * @return Reference to member my_int64 + */ + eProsima_user_DllExport int64_t& my_int64(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LongLongStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int64_t m_my_int64; + +}; + + + +/*! + * @brief This class represents the structure UShortStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class UShortStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport UShortStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~UShortStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object UShortStruct that will be copied. + */ + eProsima_user_DllExport UShortStruct( + const UShortStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object UShortStruct that will be copied. + */ + eProsima_user_DllExport UShortStruct( + UShortStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object UShortStruct that will be copied. + */ + eProsima_user_DllExport UShortStruct& operator =( + const UShortStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object UShortStruct that will be copied. + */ + eProsima_user_DllExport UShortStruct& operator =( + UShortStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x UShortStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const UShortStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x UShortStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const UShortStruct& x) const; + + /*! + * @brief This function sets a value in member my_uint16 + * @param _my_uint16 New value for member my_uint16 + */ + eProsima_user_DllExport void my_uint16( + uint16_t _my_uint16); + + /*! + * @brief This function returns the value of member my_uint16 + * @return Value of member my_uint16 + */ + eProsima_user_DllExport uint16_t my_uint16() const; + + /*! + * @brief This function returns a reference to member my_uint16 + * @return Reference to member my_uint16 + */ + eProsima_user_DllExport uint16_t& my_uint16(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const UShortStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint16_t m_my_uint16; + +}; + + + +/*! + * @brief This class represents the structure ULongStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class ULongStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ULongStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ULongStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ULongStruct that will be copied. + */ + eProsima_user_DllExport ULongStruct( + const ULongStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ULongStruct that will be copied. + */ + eProsima_user_DllExport ULongStruct( + ULongStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ULongStruct that will be copied. + */ + eProsima_user_DllExport ULongStruct& operator =( + const ULongStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ULongStruct that will be copied. + */ + eProsima_user_DllExport ULongStruct& operator =( + ULongStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ULongStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ULongStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ULongStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ULongStruct& x) const; + + /*! + * @brief This function sets a value in member my_uint32 + * @param _my_uint32 New value for member my_uint32 + */ + eProsima_user_DllExport void my_uint32( + uint32_t _my_uint32); + + /*! + * @brief This function returns the value of member my_uint32 + * @return Value of member my_uint32 + */ + eProsima_user_DllExport uint32_t my_uint32() const; + + /*! + * @brief This function returns a reference to member my_uint32 + * @return Reference to member my_uint32 + */ + eProsima_user_DllExport uint32_t& my_uint32(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ULongStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint32_t m_my_uint32; + +}; + + + +/*! + * @brief This class represents the structure ULongLongStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class ULongLongStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ULongLongStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ULongLongStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ULongLongStruct that will be copied. + */ + eProsima_user_DllExport ULongLongStruct( + const ULongLongStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ULongLongStruct that will be copied. + */ + eProsima_user_DllExport ULongLongStruct( + ULongLongStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ULongLongStruct that will be copied. + */ + eProsima_user_DllExport ULongLongStruct& operator =( + const ULongLongStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ULongLongStruct that will be copied. + */ + eProsima_user_DllExport ULongLongStruct& operator =( + ULongLongStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ULongLongStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ULongLongStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ULongLongStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ULongLongStruct& x) const; + + /*! + * @brief This function sets a value in member my_uint64 + * @param _my_uint64 New value for member my_uint64 + */ + eProsima_user_DllExport void my_uint64( + uint64_t _my_uint64); + + /*! + * @brief This function returns the value of member my_uint64 + * @return Value of member my_uint64 + */ + eProsima_user_DllExport uint64_t my_uint64() const; + + /*! + * @brief This function returns a reference to member my_uint64 + * @return Reference to member my_uint64 + */ + eProsima_user_DllExport uint64_t& my_uint64(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ULongLongStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint64_t m_my_uint64; + +}; + + + +/*! + * @brief This class represents the structure FloatStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class FloatStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport FloatStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~FloatStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object FloatStruct that will be copied. + */ + eProsima_user_DllExport FloatStruct( + const FloatStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object FloatStruct that will be copied. + */ + eProsima_user_DllExport FloatStruct( + FloatStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object FloatStruct that will be copied. + */ + eProsima_user_DllExport FloatStruct& operator =( + const FloatStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object FloatStruct that will be copied. + */ + eProsima_user_DllExport FloatStruct& operator =( + FloatStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x FloatStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const FloatStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x FloatStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const FloatStruct& x) const; + + /*! + * @brief This function sets a value in member my_float32 + * @param _my_float32 New value for member my_float32 + */ + eProsima_user_DllExport void my_float32( + float _my_float32); + + /*! + * @brief This function returns the value of member my_float32 + * @return Value of member my_float32 + */ + eProsima_user_DllExport float my_float32() const; + + /*! + * @brief This function returns a reference to member my_float32 + * @return Reference to member my_float32 + */ + eProsima_user_DllExport float& my_float32(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const FloatStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + float m_my_float32; + +}; + + + +/*! + * @brief This class represents the structure DoubleStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class DoubleStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport DoubleStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~DoubleStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object DoubleStruct that will be copied. + */ + eProsima_user_DllExport DoubleStruct( + const DoubleStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object DoubleStruct that will be copied. + */ + eProsima_user_DllExport DoubleStruct( + DoubleStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object DoubleStruct that will be copied. + */ + eProsima_user_DllExport DoubleStruct& operator =( + const DoubleStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object DoubleStruct that will be copied. + */ + eProsima_user_DllExport DoubleStruct& operator =( + DoubleStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x DoubleStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const DoubleStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x DoubleStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const DoubleStruct& x) const; + + /*! + * @brief This function sets a value in member my_float64 + * @param _my_float64 New value for member my_float64 + */ + eProsima_user_DllExport void my_float64( + double _my_float64); + + /*! + * @brief This function returns the value of member my_float64 + * @return Value of member my_float64 + */ + eProsima_user_DllExport double my_float64() const; + + /*! + * @brief This function returns a reference to member my_float64 + * @return Reference to member my_float64 + */ + eProsima_user_DllExport double& my_float64(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const DoubleStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + double m_my_float64; + +}; + + + +/*! + * @brief This class represents the structure LongDoubleStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class LongDoubleStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LongDoubleStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LongDoubleStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LongDoubleStruct that will be copied. + */ + eProsima_user_DllExport LongDoubleStruct( + const LongDoubleStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LongDoubleStruct that will be copied. + */ + eProsima_user_DllExport LongDoubleStruct( + LongDoubleStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LongDoubleStruct that will be copied. + */ + eProsima_user_DllExport LongDoubleStruct& operator =( + const LongDoubleStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LongDoubleStruct that will be copied. + */ + eProsima_user_DllExport LongDoubleStruct& operator =( + LongDoubleStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LongDoubleStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LongDoubleStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LongDoubleStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LongDoubleStruct& x) const; + + /*! + * @brief This function sets a value in member my_float128 + * @param _my_float128 New value for member my_float128 + */ + eProsima_user_DllExport void my_float128( + long double _my_float128); + + /*! + * @brief This function returns the value of member my_float128 + * @return Value of member my_float128 + */ + eProsima_user_DllExport long double my_float128() const; + + /*! + * @brief This function returns a reference to member my_float128 + * @return Reference to member my_float128 + */ + eProsima_user_DllExport long double& my_float128(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LongDoubleStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + long double m_my_float128; + +}; + + + +/*! + * @brief This class represents the structure CharStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class CharStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CharStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CharStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object CharStruct that will be copied. + */ + eProsima_user_DllExport CharStruct( + const CharStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object CharStruct that will be copied. + */ + eProsima_user_DllExport CharStruct( + CharStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object CharStruct that will be copied. + */ + eProsima_user_DllExport CharStruct& operator =( + const CharStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object CharStruct that will be copied. + */ + eProsima_user_DllExport CharStruct& operator =( + CharStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x CharStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CharStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x CharStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CharStruct& x) const; + + /*! + * @brief This function sets a value in member my_char + * @param _my_char New value for member my_char + */ + eProsima_user_DllExport void my_char( + char _my_char); + + /*! + * @brief This function returns the value of member my_char + * @return Value of member my_char + */ + eProsima_user_DllExport char my_char() const; + + /*! + * @brief This function returns a reference to member my_char + * @return Reference to member my_char + */ + eProsima_user_DllExport char& my_char(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const CharStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + char m_my_char; + +}; + + + +/*! + * @brief This class represents the structure WCharStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class WCharStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WCharStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WCharStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WCharStruct that will be copied. + */ + eProsima_user_DllExport WCharStruct( + const WCharStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WCharStruct that will be copied. + */ + eProsima_user_DllExport WCharStruct( + WCharStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WCharStruct that will be copied. + */ + eProsima_user_DllExport WCharStruct& operator =( + const WCharStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WCharStruct that will be copied. + */ + eProsima_user_DllExport WCharStruct& operator =( + WCharStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WCharStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WCharStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x WCharStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WCharStruct& x) const; + + /*! + * @brief This function sets a value in member my_wchar + * @param _my_wchar New value for member my_wchar + */ + eProsima_user_DllExport void my_wchar( + wchar_t _my_wchar); + + /*! + * @brief This function returns the value of member my_wchar + * @return Value of member my_wchar + */ + eProsima_user_DllExport wchar_t my_wchar() const; + + /*! + * @brief This function returns a reference to member my_wchar + * @return Reference to member my_wchar + */ + eProsima_user_DllExport wchar_t& my_wchar(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WCharStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + wchar_t m_my_wchar; + +}; + + + +/*! + * @brief This class represents the structure StringStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class StringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + const StringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + StringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + const StringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + StringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringStruct& x) const; + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure WStringStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class WStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + const WStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + WStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + const WStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + WStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + const std::wstring& _my_wstring); + + /*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + std::wstring&& _my_wstring); + + /*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ + eProsima_user_DllExport const std::wstring& my_wstring() const; + + /*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ + eProsima_user_DllExport std::wstring& my_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_wstring; + +}; + + + +/*! + * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class LargeStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + const LargeStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + const LargeStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string); + + /*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string); + + /*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; + + /*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + eprosima::fastrtps::fixed_string<41925> m_my_large_string; + +}; + + + +/*! + * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class LargeWStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeWStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeWStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + const LargeWStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + const LargeWStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeWStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeWStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + const std::wstring& _my_large_wstring); + + /*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + std::wstring&& _my_large_wstring); + + /*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ + eProsima_user_DllExport const std::wstring& my_large_wstring() const; + + /*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ + eProsima_user_DllExport std::wstring& my_large_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_large_wstring; + +}; + + + +/*! + * @brief This class represents the structure ArraytStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class ArraytStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArraytStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArraytStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArraytStruct that will be copied. + */ + eProsima_user_DllExport ArraytStruct( + const ArraytStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArraytStruct that will be copied. + */ + eProsima_user_DllExport ArraytStruct( + ArraytStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArraytStruct that will be copied. + */ + eProsima_user_DllExport ArraytStruct& operator =( + const ArraytStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArraytStruct that will be copied. + */ + eProsima_user_DllExport ArraytStruct& operator =( + ArraytStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArraytStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArraytStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArraytStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArraytStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array, 2>, 2>& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array, 2>, 2>&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array, 2>, 2>& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array, 2>, 2>& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArraytStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array, 2>, 2> m_my_array; + +}; + +typedef std::array, 2> MyArray; + + + +/*! + * @brief This class represents the structure ArrayArrayStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class ArrayArrayStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayArrayStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayArrayStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayArrayStruct( + const ArrayArrayStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayArrayStruct( + ArrayArrayStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayArrayStruct& operator =( + const ArrayArrayStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayArrayStruct& operator =( + ArrayArrayStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayArrayStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayArrayStruct& x) const; + + /*! + * @brief This function copies the value in member my_array_array + * @param _my_array_array New value to be copied in member my_array_array + */ + eProsima_user_DllExport void my_array_array( + const std::array, 2>& _my_array_array); + + /*! + * @brief This function moves the value in member my_array_array + * @param _my_array_array New value to be moved in member my_array_array + */ + eProsima_user_DllExport void my_array_array( + std::array, 2>&& _my_array_array); + + /*! + * @brief This function returns a constant reference to member my_array_array + * @return Constant reference to member my_array_array + */ + eProsima_user_DllExport const std::array, 2>& my_array_array() const; + + /*! + * @brief This function returns a reference to member my_array_array + * @return Reference to member my_array_array + */ + eProsima_user_DllExport std::array, 2>& my_array_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayArrayStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array, 2> m_my_array_array; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class SequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + const SequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + SequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + const SequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + SequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + + + +/*! + * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class SequenceSequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceSequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceSequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + const SequenceSequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + const SequenceSequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceSequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceSequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + const std::vector>& _my_sequence_sequence); + + /*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + std::vector>&& _my_sequence_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ + eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ + eProsima_user_DllExport std::vector>& my_sequence_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector> m_my_sequence_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure MapStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class MapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + const MapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + MapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + const MapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + MapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + + + +/*! + * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class MapMapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapMapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapMapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + const MapMapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + MapMapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + const MapMapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + MapMapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapMapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapMapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + const std::map>& _my_map_map); + + /*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + std::map>&& _my_map_map); + + /*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ + eProsima_user_DllExport const std::map>& my_map_map() const; + + /*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ + eProsima_user_DllExport std::map>& my_map_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map> m_my_map_map; + +}; + +/*! + * @brief This class represents the structure MyBitset defined by the user in the IDL file. + * @ingroup Basic + */ +class MyBitset +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyBitset(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyBitset(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + const MyBitset& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + MyBitset&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + const MyBitset& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + MyBitset&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyBitset object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyBitset& x) const; + + /*! + * @brief Comparison operator. + * @param x MyBitset object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyBitset& x) const; + + /*! + * @brief This function sets a value in member a + * @param _a New value for member a + */ + eProsima_user_DllExport void a( + char _a); + + /*! + * @brief This function returns the value of member a + * @return Value of member a + */ + eProsima_user_DllExport char a() const; + + + + /*! + * @brief This function sets a value in member b + * @param _b New value for member b + */ + eProsima_user_DllExport void b( + uint32_t _b); + + /*! + * @brief This function returns the value of member b + * @return Value of member b + */ + eProsima_user_DllExport uint32_t b() const; + + + eProsima_user_DllExport std::bitset<30> bitset() const; + + eProsima_user_DllExport void bitset( + const std::bitset<30>&); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyBitset& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + std::bitset<30> m_bitset; +}; + + +/*! + * @brief This class represents the structure BitsetStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class BitsetStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BitsetStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BitsetStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BitsetStruct that will be copied. + */ + eProsima_user_DllExport BitsetStruct( + const BitsetStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BitsetStruct that will be copied. + */ + eProsima_user_DllExport BitsetStruct( + BitsetStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BitsetStruct that will be copied. + */ + eProsima_user_DllExport BitsetStruct& operator =( + const BitsetStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BitsetStruct that will be copied. + */ + eProsima_user_DllExport BitsetStruct& operator =( + BitsetStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BitsetStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BitsetStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BitsetStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BitsetStruct& x) const; + + /*! + * @brief This function copies the value in member a + * @param _a New value to be copied in member a + */ + eProsima_user_DllExport void a( + const MyBitset& _a); + + /*! + * @brief This function moves the value in member a + * @param _a New value to be moved in member a + */ + eProsima_user_DllExport void a( + MyBitset&& _a); + + /*! + * @brief This function returns a constant reference to member a + * @return Constant reference to member a + */ + eProsima_user_DllExport const MyBitset& a() const; + + /*! + * @brief This function returns a reference to member a + * @return Reference to member a + */ + eProsima_user_DllExport MyBitset& a(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BitsetStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyBitset m_a; + +}; + + + +/*! + * @brief This class represents the structure StructStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class StructStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StructStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StructStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StructStruct that will be copied. + */ + eProsima_user_DllExport StructStruct( + const StructStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StructStruct that will be copied. + */ + eProsima_user_DllExport StructStruct( + StructStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StructStruct that will be copied. + */ + eProsima_user_DllExport StructStruct& operator =( + const StructStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StructStruct that will be copied. + */ + eProsima_user_DllExport StructStruct& operator =( + StructStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StructStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StructStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x StructStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StructStruct& x) const; + + /*! + * @brief This function sets a value in member a + * @param _a New value for member a + */ + eProsima_user_DllExport void a( + int32_t _a); + + /*! + * @brief This function returns the value of member a + * @return Value of member a + */ + eProsima_user_DllExport int32_t a() const; + + /*! + * @brief This function returns a reference to member a + * @return Reference to member a + */ + eProsima_user_DllExport int32_t& a(); + + + /*! + * @brief This function sets a value in member b + * @param _b New value for member b + */ + eProsima_user_DllExport void b( + int64_t _b); + + /*! + * @brief This function returns the value of member b + * @return Value of member b + */ + eProsima_user_DllExport int64_t b() const; + + /*! + * @brief This function returns a reference to member b + * @return Reference to member b + */ + eProsima_user_DllExport int64_t& b(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StructStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int32_t m_a; + int64_t m_b; + +}; + + + +/*! + * @brief This class represents the structure StructStructStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class StructStructStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StructStructStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StructStructStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StructStructStruct that will be copied. + */ + eProsima_user_DllExport StructStructStruct( + const StructStructStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StructStructStruct that will be copied. + */ + eProsima_user_DllExport StructStructStruct( + StructStructStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StructStructStruct that will be copied. + */ + eProsima_user_DllExport StructStructStruct& operator =( + const StructStructStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StructStructStruct that will be copied. + */ + eProsima_user_DllExport StructStructStruct& operator =( + StructStructStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StructStructStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StructStructStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x StructStructStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StructStructStruct& x) const; + + /*! + * @brief This function copies the value in member child_struct + * @param _child_struct New value to be copied in member child_struct + */ + eProsima_user_DllExport void child_struct( + const StructStruct& _child_struct); + + /*! + * @brief This function moves the value in member child_struct + * @param _child_struct New value to be moved in member child_struct + */ + eProsima_user_DllExport void child_struct( + StructStruct&& _child_struct); + + /*! + * @brief This function returns a constant reference to member child_struct + * @return Constant reference to member child_struct + */ + eProsima_user_DllExport const StructStruct& child_struct() const; + + /*! + * @brief This function returns a reference to member child_struct + * @return Reference to member child_struct + */ + eProsima_user_DllExport StructStruct& child_struct(); + + + /*! + * @brief This function sets a value in member child_int64 + * @param _child_int64 New value for member child_int64 + */ + eProsima_user_DllExport void child_int64( + int64_t _child_int64); + + /*! + * @brief This function returns the value of member child_int64 + * @return Value of member child_int64 + */ + eProsima_user_DllExport int64_t child_int64() const; + + /*! + * @brief This function returns a reference to member child_int64 + * @return Reference to member child_int64 + */ + eProsima_user_DllExport int64_t& child_int64(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StructStructStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + StructStruct m_child_struct; + int64_t m_child_int64; + +}; + + + +/*! + * @brief This class represents the union SimpleUnion defined by the user in the IDL file. + * @ingroup Basic + */ +class SimpleUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + const SimpleUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + SimpleUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + const SimpleUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + SimpleUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union UnionUnion defined by the user in the IDL file. + * @ingroup Basic + */ +class UnionUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport UnionUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~UnionUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object UnionUnion that will be copied. + */ + eProsima_user_DllExport UnionUnion( + const UnionUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object UnionUnion that will be copied. + */ + eProsima_user_DllExport UnionUnion( + UnionUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object UnionUnion that will be copied. + */ + eProsima_user_DllExport UnionUnion& operator =( + const UnionUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object UnionUnion that will be copied. + */ + eProsima_user_DllExport UnionUnion& operator =( + UnionUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x UnionUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const UnionUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x UnionUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const UnionUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function copies the value in member second + * @param _second New value to be copied in member second + */ + eProsima_user_DllExport void second( + const SimpleUnion& _second); + + /*! + * @brief This function moves the value in member second + * @param _second New value to be moved in member second + */ + eProsima_user_DllExport void second( + SimpleUnion&& _second); + + /*! + * @brief This function returns a constant reference to member second + * @return Constant reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const SimpleUnion& second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport SimpleUnion& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const UnionUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + SimpleUnion m_second; +}; + + + +/*! + * @brief This class represents the union WCharUnion defined by the user in the IDL file. + * @ingroup Basic + */ +class WCharUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WCharUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WCharUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion( + const WCharUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion( + WCharUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion& operator =( + const WCharUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion& operator =( + WCharUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WCharUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WCharUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x WCharUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WCharUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + wchar_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport wchar_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport wchar_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WCharUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + wchar_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class SimpleUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + const SimpleUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + const SimpleUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure UnionUnionUnionStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class UnionUnionUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport UnionUnionUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~UnionUnionUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object UnionUnionUnionStruct that will be copied. + */ + eProsima_user_DllExport UnionUnionUnionStruct( + const UnionUnionUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object UnionUnionUnionStruct that will be copied. + */ + eProsima_user_DllExport UnionUnionUnionStruct( + UnionUnionUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object UnionUnionUnionStruct that will be copied. + */ + eProsima_user_DllExport UnionUnionUnionStruct& operator =( + const UnionUnionUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object UnionUnionUnionStruct that will be copied. + */ + eProsima_user_DllExport UnionUnionUnionStruct& operator =( + UnionUnionUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x UnionUnionUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const UnionUnionUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x UnionUnionUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const UnionUnionUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const UnionUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + UnionUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const UnionUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport UnionUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const UnionUnionUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + UnionUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure WCharUnionStruct defined by the user in the IDL file. + * @ingroup Basic + */ +class WCharUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WCharUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WCharUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WCharUnionStruct that will be copied. + */ + eProsima_user_DllExport WCharUnionStruct( + const WCharUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WCharUnionStruct that will be copied. + */ + eProsima_user_DllExport WCharUnionStruct( + WCharUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WCharUnionStruct that will be copied. + */ + eProsima_user_DllExport WCharUnionStruct& operator =( + const WCharUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WCharUnionStruct that will be copied. + */ + eProsima_user_DllExport WCharUnionStruct& operator =( + WCharUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WCharUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WCharUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x WCharUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WCharUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const WCharUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + WCharUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const WCharUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport WCharUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WCharUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + WCharUnion m_my_union; + +}; + + +#endif // _FAST_DDS_GENERATED_BASIC_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Test.cxx b/test/unittest/dynamic_types/idl/Test.cxx index 8e0aaafab30..423925e0980 100644 --- a/test/unittest/dynamic_types/idl/Test.cxx +++ b/test/unittest/dynamic_types/idl/Test.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Test.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "TestTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + BasicStruct::BasicStruct() { - // Just to register all known types registerTestTypes(); } @@ -102,7 +106,6 @@ BasicStruct& BasicStruct::operator =( m_my_float128 = x.m_my_float128; m_my_char = x.m_my_char; m_my_string = x.m_my_string; - return *this; } @@ -123,7 +126,6 @@ BasicStruct& BasicStruct::operator =( m_my_float128 = x.m_my_float128; m_my_char = x.m_my_char; m_my_string = std::move(x.m_my_string); - return *this; } @@ -543,9 +545,12 @@ std::string& BasicStruct::my_string() + + + + ComplexStruct::ComplexStruct() { - // Just to register all known types registerTestTypes(); } @@ -628,7 +633,6 @@ ComplexStruct& ComplexStruct::operator =( m_multi_alias_array_42 = x.m_multi_alias_array_42; m_my_array_arrays = x.m_my_array_arrays; m_my_sequences_array = x.m_my_sequences_array; - return *this; } @@ -656,7 +660,6 @@ ComplexStruct& ComplexStruct::operator =( m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); m_my_array_arrays = std::move(x.m_my_array_arrays); m_my_sequences_array = std::move(x.m_my_sequences_array); - return *this; } @@ -1441,6 +1444,8 @@ std::array& ComplexStruct::my_sequences_array() } + + MyUnion::MyUnion() { m__d = ::A; @@ -1610,6 +1615,8 @@ void MyUnion::_d( } break; + default: + break; } if (!b) @@ -1750,6 +1757,8 @@ ComplexStruct& MyUnion::complex() } + + MyUnion2::MyUnion2() { m__d = A; @@ -1947,6 +1956,8 @@ void MyUnion2::_d( } break; + default: + break; } if (!b) @@ -2128,9 +2139,10 @@ int32_t& MyUnion2::tres() } + + CompleteStruct::CompleteStruct() { - // Just to register all known types registerTestTypes(); } @@ -2159,7 +2171,6 @@ CompleteStruct& CompleteStruct::operator =( m_my_union = x.m_my_union; m_my_union_2 = x.m_my_union_2; - return *this; } @@ -2169,7 +2180,6 @@ CompleteStruct& CompleteStruct::operator =( m_my_union = std::move(x.m_my_union); m_my_union_2 = std::move(x.m_my_union_2); - return *this; } @@ -2264,9 +2274,10 @@ MyUnion2& CompleteStruct::my_union_2() } + + KeyedStruct::KeyedStruct() { - // Just to register all known types registerTestTypes(); } @@ -2295,7 +2306,6 @@ KeyedStruct& KeyedStruct::operator =( m_key = x.m_key; m_basic = x.m_basic; - return *this; } @@ -2305,7 +2315,6 @@ KeyedStruct& KeyedStruct::operator =( m_key = x.m_key; m_basic = std::move(x.m_basic); - return *this; } @@ -2392,3 +2401,5 @@ BasicStruct& KeyedStruct::basic() // Include auxiliary functions like for serializing/deserializing. #include "TestCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/Test.h b/test/unittest/dynamic_types/idl/Test.h index 45249c30467..a67ced7e1c2 100644 --- a/test/unittest/dynamic_types/idl/Test.h +++ b/test/unittest/dynamic_types/idl/Test.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Testv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TEST_H_ #define _FAST_DDS_GENERATED_TEST_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -83,6 +89,8 @@ typedef MyAliasEnum MyAliasEnum2; typedef MyAliasEnum2 MyAliasEnum3; + + /*! * @brief This class represents the structure BasicStruct defined by the user in the IDL file. * @ingroup Test @@ -434,8 +442,12 @@ typedef std::array MA3; typedef std::array MyMiniArray; + + typedef std::vector MySequenceLong; + + /*! * @brief This class represents the structure ComplexStruct defined by the user in the IDL file. * @ingroup Test @@ -925,8 +937,7 @@ class ComplexStruct * @brief This function returns a constant reference to member my_array_string * @return Constant reference to member my_array_string */ - eProsima_user_DllExport const std::array, 5>, - 5>& my_array_string() const; + eProsima_user_DllExport const std::array, 5>, 5>& my_array_string() const; /*! * @brief This function returns a reference to member my_array_string @@ -1035,10 +1046,12 @@ class ComplexStruct eprosima::fastcdr::fixed_string<500> m_my_large_string_8; std::array, 5>, 5> m_my_array_string; MA3 m_multi_alias_array_42{::A}; - std::array m_my_array_arrays { {{0}} }; + std::array m_my_array_arrays{ {{0}} }; std::array m_my_sequences_array; }; + + /*! * @brief This class represents the union MyUnion defined by the user in the IDL file. * @ingroup Test @@ -1183,6 +1196,8 @@ class MyUnion BasicStruct m_basic; ComplexStruct m_complex; }; + + /*! * @brief This class represents the union MyUnion2 defined by the user in the IDL file. * @ingroup Test @@ -1343,6 +1358,8 @@ class MyUnion2 std::string m_imString; int32_t m_tres{0}; }; + + /*! * @brief This class represents the structure CompleteStruct defined by the user in the IDL file. * @ingroup Test @@ -1462,6 +1479,8 @@ class CompleteStruct MyUnion2 m_my_union_2; }; + + /*! * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. * @ingroup Test @@ -1577,3 +1596,6 @@ class KeyedStruct #endif // _FAST_DDS_GENERATED_TEST_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.hpp b/test/unittest/dynamic_types/idl/TestCdrAux.hpp index fa4e905bf91..785beb525b0 100644 --- a/test/unittest/dynamic_types/idl/TestCdrAux.hpp +++ b/test/unittest/dynamic_types/idl/TestCdrAux.hpp @@ -54,6 +54,14 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicStruct& data); @@ -63,16 +71,35 @@ eProsima_user_DllExport void serialize_key( + + + + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ComplexStruct& data); + + + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const CompleteStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const KeyedStruct& data); @@ -81,4 +108,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TESTCDRAUX_HPP_ + diff --git a/test/unittest/dynamic_types/idl/TestCdrAux.ipp b/test/unittest/dynamic_types/idl/TestCdrAux.ipp index 7ae4838e78f..8832623f78e 100644 --- a/test/unittest/dynamic_types/idl/TestCdrAux.ipp +++ b/test/unittest/dynamic_types/idl/TestCdrAux.ipp @@ -34,6 +34,14 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -121,7 +129,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(11) << data.my_char() << eprosima::fastcdr::MemberId(12) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -212,6 +219,15 @@ void serialize_key( + + + + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -327,7 +343,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(18) << data.my_array_arrays() << eprosima::fastcdr::MemberId(19) << data.my_sequences_array() ; - scdr.end_serialize_type(current_state); } @@ -441,6 +456,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -472,6 +489,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.complex(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -504,6 +523,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.complex(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -537,6 +558,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.complex(); break; + default: + break; } ret_value = false; break; @@ -545,6 +568,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -580,6 +605,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.tres(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -615,6 +642,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(2) << data.tres(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -651,6 +680,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.tres(); break; + default: + break; } ret_value = false; break; @@ -659,6 +690,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -702,7 +735,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.my_union() << eprosima::fastcdr::MemberId(1) << data.my_union_2() ; - scdr.end_serialize_type(current_state); } @@ -744,6 +776,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -787,7 +821,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.key() << eprosima::fastcdr::MemberId(1) << data.basic() ; - scdr.end_serialize_type(current_state); } @@ -836,4 +869,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TESTCDRAUX_IPP_ + diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx b/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx index db462402e74..d450d6de064 100644 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx +++ b/test/unittest/dynamic_types/idl/TestPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TestPubSubTypes.h" #include "TestCdrAux.hpp" @@ -31,10 +29,23 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + + + + + + + BasicStructPubSubType::BasicStructPubSubType() { setName("BasicStruct"); - uint32_t type_size = BasicStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicStruct::getMaxCdrSerializedSize()); +#else + BasicStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +76,12 @@ bool BasicStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +96,11 @@ bool BasicStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +117,11 @@ bool BasicStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +144,26 @@ std::function BasicStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +195,20 @@ bool BasicStructPubSubType::getKey( BasicStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -188,10 +230,24 @@ bool BasicStructPubSubType::getKey( + + + + + + + + + ComplexStructPubSubType::ComplexStructPubSubType() { setName("ComplexStruct"); - uint32_t type_size = ComplexStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ComplexStruct::getMaxCdrSerializedSize()); +#else + ComplexStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -222,10 +278,12 @@ bool ComplexStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -240,7 +298,11 @@ bool ComplexStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -257,7 +319,11 @@ bool ComplexStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -280,13 +346,26 @@ std::function ComplexStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -318,12 +397,20 @@ bool ComplexStructPubSubType::getKey( ComplexStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ComplexStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -342,10 +429,23 @@ bool ComplexStructPubSubType::getKey( + + + + + + + + CompleteStructPubSubType::CompleteStructPubSubType() { setName("CompleteStruct"); - uint32_t type_size = CompleteStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(CompleteStruct::getMaxCdrSerializedSize()); +#else + CompleteStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -376,10 +476,12 @@ bool CompleteStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -394,7 +496,11 @@ bool CompleteStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -411,7 +517,11 @@ bool CompleteStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -434,13 +544,26 @@ std::function CompleteStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -472,12 +595,20 @@ bool CompleteStructPubSubType::getKey( CompleteStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || CompleteStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -494,10 +625,17 @@ bool CompleteStructPubSubType::getKey( return true; } + + KeyedStructPubSubType::KeyedStructPubSubType() { setName("KeyedStruct"); - uint32_t type_size = KeyedStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(KeyedStruct::getMaxCdrSerializedSize()); +#else + KeyedStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = true; @@ -528,10 +666,12 @@ bool KeyedStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -546,7 +686,11 @@ bool KeyedStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -563,7 +707,11 @@ bool KeyedStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -586,13 +734,26 @@ std::function KeyedStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -624,12 +785,20 @@ bool KeyedStructPubSubType::getKey( KeyedStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || KeyedStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/dynamic_types/idl/TestPubSubTypes.h b/test/unittest/dynamic_types/idl/TestPubSubTypes.h index ef5904a710d..d74f7ae2664 100644 --- a/test/unittest/dynamic_types/idl/TestPubSubTypes.h +++ b/test/unittest/dynamic_types/idl/TestPubSubTypes.h @@ -41,6 +41,8 @@ typedef MyEnum MyAliasEnum; typedef MyAliasEnum MyAliasEnum2; typedef MyAliasEnum2 MyAliasEnum3; + + /*! * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. * @ingroup Test @@ -132,8 +134,12 @@ typedef std::array MyOctetArray500; typedef std::array BSAlias5; typedef std::array MA3; typedef std::array MyMiniArray; + + typedef std::vector MySequenceLong; + + /*! * @brief This class represents the TopicDataType of the type ComplexStruct defined by the user in the IDL file. * @ingroup Test @@ -224,6 +230,14 @@ class ComplexStructPubSubType : public eprosima::fastdds::dds::TopicDataType + + + + + + + + /*! * @brief This class represents the TopicDataType of the type CompleteStruct defined by the user in the IDL file. * @ingroup Test @@ -312,6 +326,8 @@ class CompleteStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type KeyedStruct defined by the user in the IDL file. * @ingroup Test diff --git a/test/unittest/dynamic_types/idl/TestTypeObject.cxx b/test/unittest/dynamic_types/idl/TestTypeObject.cxx index fe78e42306c..60d8dba0b18 100644 --- a/test/unittest/dynamic_types/idl/TestTypeObject.cxx +++ b/test/unittest/dynamic_types/idl/TestTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -251,7 +249,11 @@ const TypeObject* GetMinimalMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -343,7 +345,11 @@ const TypeObject* GetCompleteMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -446,7 +452,11 @@ const TypeObject* GetMinimalMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -530,7 +540,11 @@ const TypeObject* GetCompleteMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -636,7 +650,11 @@ const TypeObject* GetMinimalMyAliasEnum2Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -720,7 +738,11 @@ const TypeObject* GetCompleteMyAliasEnum2Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -826,7 +848,11 @@ const TypeObject* GetMinimalMyAliasEnum3Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -910,7 +936,11 @@ const TypeObject* GetCompleteMyAliasEnum3Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -927,6 +957,8 @@ const TypeObject* GetCompleteMyAliasEnum3Object() return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum3", true); } + + const TypeIdentifier* GetBasicStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); @@ -1224,7 +1256,6 @@ const TypeObject* GetMinimalBasicStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1240,7 +1271,11 @@ const TypeObject* GetMinimalBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1484,7 +1519,6 @@ const TypeObject* GetCompleteBasicStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1500,7 +1534,11 @@ const TypeObject* GetCompleteBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1603,7 +1641,11 @@ const TypeObject* GetMinimalMyOctetArray500Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1687,7 +1729,11 @@ const TypeObject* GetCompleteMyOctetArray500Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1793,7 +1839,11 @@ const TypeObject* GetMinimalBSAlias5Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1877,7 +1927,11 @@ const TypeObject* GetCompleteBSAlias5Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1983,7 +2037,11 @@ const TypeObject* GetMinimalMA3Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2067,7 +2125,11 @@ const TypeObject* GetCompleteMA3Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2173,7 +2235,11 @@ const TypeObject* GetMinimalMyMiniArrayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2257,7 +2323,11 @@ const TypeObject* GetCompleteMyMiniArrayObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2274,6 +2344,8 @@ const TypeObject* GetCompleteMyMiniArrayObject() return TypeObjectFactory::get_instance()->get_type_object("MyMiniArray", true); } + + const TypeIdentifier* GetMySequenceLongIdentifier(bool complete) { const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MySequenceLong", complete); @@ -2363,7 +2435,11 @@ const TypeObject* GetMinimalMySequenceLongObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2447,7 +2523,11 @@ const TypeObject* GetCompleteMySequenceLongObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2464,6 +2544,8 @@ const TypeObject* GetCompleteMySequenceLongObject() return TypeObjectFactory::get_instance()->get_type_object("MySequenceLong", true); } + + const TypeIdentifier* GetComplexStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ComplexStruct", complete); @@ -2876,7 +2958,6 @@ const TypeObject* GetMinimalComplexStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2892,7 +2973,11 @@ const TypeObject* GetMinimalComplexStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3230,7 +3315,6 @@ const TypeObject* GetCompleteComplexStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ComplexStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3246,7 +3330,11 @@ const TypeObject* GetCompleteComplexStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3260,6 +3348,8 @@ const TypeObject* GetCompleteComplexStructObject() return TypeObjectFactory::get_instance()->get_type_object("ComplexStruct", true); } + + const TypeIdentifier* GetMyUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyUnion", complete); @@ -3376,7 +3466,11 @@ const TypeObject* GetMinimalMyUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3474,7 +3568,11 @@ const TypeObject* GetCompleteMyUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3489,6 +3587,8 @@ const TypeObject* GetCompleteMyUnionObject() return TypeObjectFactory::get_instance()->get_type_object("MyUnion", true); } + + const TypeIdentifier* GetMyUnion2Identifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyUnion2", complete); @@ -3626,7 +3726,11 @@ const TypeObject* GetMinimalMyUnion2Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3742,7 +3846,11 @@ const TypeObject* GetCompleteMyUnion2Object() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3757,6 +3865,8 @@ const TypeObject* GetCompleteMyUnion2Object() return TypeObjectFactory::get_instance()->get_type_object("MyUnion2", true); } + + const TypeIdentifier* GetCompleteStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("CompleteStruct", complete); @@ -3844,7 +3954,6 @@ const TypeObject* GetMinimalCompleteStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3860,7 +3969,11 @@ const TypeObject* GetMinimalCompleteStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3927,7 +4040,6 @@ const TypeObject* GetCompleteCompleteStructObject() // Header type_object->complete().struct_type().header().detail().type_name("CompleteStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3943,7 +4055,11 @@ const TypeObject* GetCompleteCompleteStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3957,6 +4073,8 @@ const TypeObject* GetCompleteCompleteStructObject() return TypeObjectFactory::get_instance()->get_type_object("CompleteStruct", true); } + + const TypeIdentifier* GetKeyedStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("KeyedStruct", complete); @@ -4045,7 +4163,6 @@ const TypeObject* GetMinimalKeyedStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4061,7 +4178,11 @@ const TypeObject* GetMinimalKeyedStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4151,7 +4272,6 @@ const TypeObject* GetCompleteKeyedStructObject() // Header type_object->complete().struct_type().header().detail().type_name("KeyedStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4167,7 +4287,11 @@ const TypeObject* GetCompleteKeyedStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/dynamic_types/idl/TestTypeObject.h b/test/unittest/dynamic_types/idl/TestTypeObject.h index 8ac5056145c..9d4dc990651 100644 --- a/test/unittest/dynamic_types/idl/TestTypeObject.h +++ b/test/unittest/dynamic_types/idl/TestTypeObject.h @@ -74,6 +74,8 @@ eProsima_user_DllExport const TypeObject* GetMyAliasEnum3Object(bool complete = eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnum3Object(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnum3Object(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); @@ -99,31 +101,43 @@ eProsima_user_DllExport const TypeObject* GetMyMiniArrayObject(bool complete = f eProsima_user_DllExport const TypeObject* GetMinimalMyMiniArrayObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyMiniArrayObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMySequenceLongIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMySequenceLongObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMySequenceLongObject(); eProsima_user_DllExport const TypeObject* GetCompleteMySequenceLongObject(); + + eProsima_user_DllExport const TypeIdentifier* GetComplexStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetComplexStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalComplexStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteComplexStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyUnion2Identifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyUnion2Object(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyUnion2Object(); eProsima_user_DllExport const TypeObject* GetCompleteMyUnion2Object(); + + eProsima_user_DllExport const TypeIdentifier* GetCompleteStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetCompleteStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalCompleteStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteCompleteStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetKeyedStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetKeyedStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalKeyedStructObject(); diff --git a/test/unittest/dynamic_types/idl/Testv1.cxx b/test/unittest/dynamic_types/idl/Testv1.cxx new file mode 100644 index 00000000000..d5f720de3dd --- /dev/null +++ b/test/unittest/dynamic_types/idl/Testv1.cxx @@ -0,0 +1,3744 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Test.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Test.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "TestTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define KeyedStruct_max_cdr_typesize 344ULL; + + + +#define BasicStruct_max_cdr_typesize 336ULL; + +#define ComplexStruct_max_cdr_typesize 18064796ULL; + + +#define CompleteStruct_max_cdr_typesize 18065072ULL; + + + + + + + + + +BasicStruct::BasicStruct() +{ + // boolean m_my_bool + m_my_bool = false; + // octet m_my_octet + m_my_octet = 0; + // short m_my_int16 + m_my_int16 = 0; + // long m_my_int32 + m_my_int32 = 0; + // long long m_my_int64 + m_my_int64 = 0; + // unsigned short m_my_uint16 + m_my_uint16 = 0; + // unsigned long m_my_uint32 + m_my_uint32 = 0; + // unsigned long long m_my_uint64 + m_my_uint64 = 0; + // float m_my_float32 + m_my_float32 = 0.0; + // double m_my_float64 + m_my_float64 = 0.0; + // long double m_my_float128 + m_my_float128 = 0.0; + // char m_my_char + m_my_char = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTestTypes(); +} + +BasicStruct::~BasicStruct() +{ +} + +BasicStruct::BasicStruct( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_octet = x.m_my_octet; + + + m_my_int16 = x.m_my_int16; + + + m_my_int32 = x.m_my_int32; + + + m_my_int64 = x.m_my_int64; + + + m_my_uint16 = x.m_my_uint16; + + + m_my_uint32 = x.m_my_uint32; + + + m_my_uint64 = x.m_my_uint64; + + + m_my_float32 = x.m_my_float32; + + + m_my_float64 = x.m_my_float64; + + + m_my_float128 = x.m_my_float128; + + + m_my_char = x.m_my_char; + + + m_my_string = x.m_my_string; + +} + +BasicStruct::BasicStruct( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_octet = x.m_my_octet; + + + m_my_int16 = x.m_my_int16; + + + m_my_int32 = x.m_my_int32; + + + m_my_int64 = x.m_my_int64; + + + m_my_uint16 = x.m_my_uint16; + + + m_my_uint32 = x.m_my_uint32; + + + m_my_uint64 = x.m_my_uint64; + + + m_my_float32 = x.m_my_float32; + + + m_my_float64 = x.m_my_float64; + + + m_my_float128 = x.m_my_float128; + + + m_my_char = x.m_my_char; + + + m_my_string = std::move(x.m_my_string); + +} + +BasicStruct& BasicStruct::operator =( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_octet = x.m_my_octet; + + + m_my_int16 = x.m_my_int16; + + + m_my_int32 = x.m_my_int32; + + + m_my_int64 = x.m_my_int64; + + + m_my_uint16 = x.m_my_uint16; + + + m_my_uint32 = x.m_my_uint32; + + + m_my_uint64 = x.m_my_uint64; + + + m_my_float32 = x.m_my_float32; + + + m_my_float64 = x.m_my_float64; + + + m_my_float128 = x.m_my_float128; + + + m_my_char = x.m_my_char; + + + m_my_string = x.m_my_string; + + return *this; +} + +BasicStruct& BasicStruct::operator =( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_octet = x.m_my_octet; + + + m_my_int16 = x.m_my_int16; + + + m_my_int32 = x.m_my_int32; + + + m_my_int64 = x.m_my_int64; + + + m_my_uint16 = x.m_my_uint16; + + + m_my_uint32 = x.m_my_uint32; + + + m_my_uint64 = x.m_my_uint64; + + + m_my_float32 = x.m_my_float32; + + + m_my_float64 = x.m_my_float64; + + + m_my_float128 = x.m_my_float128; + + + m_my_char = x.m_my_char; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BasicStruct::operator ==( + const BasicStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_octet == x.m_my_octet && + m_my_int16 == x.m_my_int16 && + m_my_int32 == x.m_my_int32 && + m_my_int64 == x.m_my_int64 && + m_my_uint16 == x.m_my_uint16 && + m_my_uint32 == x.m_my_uint32 && + m_my_uint64 == x.m_my_uint64 && + m_my_float32 == x.m_my_float32 && + m_my_float64 == x.m_my_float64 && + m_my_float128 == x.m_my_float128 && + m_my_char == x.m_my_char && + m_my_string == x.m_my_string); +} + +bool BasicStruct::operator !=( + const BasicStruct& x) const +{ + return !(*this == x); +} + +size_t BasicStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; +} + +size_t BasicStruct::getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 16 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); // 128 bits, but aligned as 64 + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_octet; + + scdr << m_my_int16; + + scdr << m_my_int32; + + scdr << m_my_int64; + + scdr << m_my_uint16; + + scdr << m_my_uint32; + + scdr << m_my_uint64; + + scdr << m_my_float32; + + scdr << m_my_float64; + + scdr << m_my_float128; + + scdr << m_my_char; + + scdr << m_my_string.c_str(); + +} + +void BasicStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_octet; + + + + dcdr >> m_my_int16; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_int64; + + + + dcdr >> m_my_uint16; + + + + dcdr >> m_my_uint32; + + + + dcdr >> m_my_uint64; + + + + dcdr >> m_my_float32; + + + + dcdr >> m_my_float64; + + + + dcdr >> m_my_float128; + + + + dcdr >> m_my_char; + + + + dcdr >> m_my_string; + + +} + + +bool BasicStruct::isKeyDefined() +{ + return false; +} + +void BasicStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BasicStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BasicStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ +void BasicStruct::my_octet( + uint8_t _my_octet) +{ + m_my_octet = _my_octet; +} + +/*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ +uint8_t BasicStruct::my_octet() const +{ + return m_my_octet; +} + +/*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ +uint8_t& BasicStruct::my_octet() +{ + return m_my_octet; +} + + +/*! + * @brief This function sets a value in member my_int16 + * @param _my_int16 New value for member my_int16 + */ +void BasicStruct::my_int16( + int16_t _my_int16) +{ + m_my_int16 = _my_int16; +} + +/*! + * @brief This function returns the value of member my_int16 + * @return Value of member my_int16 + */ +int16_t BasicStruct::my_int16() const +{ + return m_my_int16; +} + +/*! + * @brief This function returns a reference to member my_int16 + * @return Reference to member my_int16 + */ +int16_t& BasicStruct::my_int16() +{ + return m_my_int16; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function sets a value in member my_int64 + * @param _my_int64 New value for member my_int64 + */ +void BasicStruct::my_int64( + int64_t _my_int64) +{ + m_my_int64 = _my_int64; +} + +/*! + * @brief This function returns the value of member my_int64 + * @return Value of member my_int64 + */ +int64_t BasicStruct::my_int64() const +{ + return m_my_int64; +} + +/*! + * @brief This function returns a reference to member my_int64 + * @return Reference to member my_int64 + */ +int64_t& BasicStruct::my_int64() +{ + return m_my_int64; +} + + +/*! + * @brief This function sets a value in member my_uint16 + * @param _my_uint16 New value for member my_uint16 + */ +void BasicStruct::my_uint16( + uint16_t _my_uint16) +{ + m_my_uint16 = _my_uint16; +} + +/*! + * @brief This function returns the value of member my_uint16 + * @return Value of member my_uint16 + */ +uint16_t BasicStruct::my_uint16() const +{ + return m_my_uint16; +} + +/*! + * @brief This function returns a reference to member my_uint16 + * @return Reference to member my_uint16 + */ +uint16_t& BasicStruct::my_uint16() +{ + return m_my_uint16; +} + + +/*! + * @brief This function sets a value in member my_uint32 + * @param _my_uint32 New value for member my_uint32 + */ +void BasicStruct::my_uint32( + uint32_t _my_uint32) +{ + m_my_uint32 = _my_uint32; +} + +/*! + * @brief This function returns the value of member my_uint32 + * @return Value of member my_uint32 + */ +uint32_t BasicStruct::my_uint32() const +{ + return m_my_uint32; +} + +/*! + * @brief This function returns a reference to member my_uint32 + * @return Reference to member my_uint32 + */ +uint32_t& BasicStruct::my_uint32() +{ + return m_my_uint32; +} + + +/*! + * @brief This function sets a value in member my_uint64 + * @param _my_uint64 New value for member my_uint64 + */ +void BasicStruct::my_uint64( + uint64_t _my_uint64) +{ + m_my_uint64 = _my_uint64; +} + +/*! + * @brief This function returns the value of member my_uint64 + * @return Value of member my_uint64 + */ +uint64_t BasicStruct::my_uint64() const +{ + return m_my_uint64; +} + +/*! + * @brief This function returns a reference to member my_uint64 + * @return Reference to member my_uint64 + */ +uint64_t& BasicStruct::my_uint64() +{ + return m_my_uint64; +} + + +/*! + * @brief This function sets a value in member my_float32 + * @param _my_float32 New value for member my_float32 + */ +void BasicStruct::my_float32( + float _my_float32) +{ + m_my_float32 = _my_float32; +} + +/*! + * @brief This function returns the value of member my_float32 + * @return Value of member my_float32 + */ +float BasicStruct::my_float32() const +{ + return m_my_float32; +} + +/*! + * @brief This function returns a reference to member my_float32 + * @return Reference to member my_float32 + */ +float& BasicStruct::my_float32() +{ + return m_my_float32; +} + + +/*! + * @brief This function sets a value in member my_float64 + * @param _my_float64 New value for member my_float64 + */ +void BasicStruct::my_float64( + double _my_float64) +{ + m_my_float64 = _my_float64; +} + +/*! + * @brief This function returns the value of member my_float64 + * @return Value of member my_float64 + */ +double BasicStruct::my_float64() const +{ + return m_my_float64; +} + +/*! + * @brief This function returns a reference to member my_float64 + * @return Reference to member my_float64 + */ +double& BasicStruct::my_float64() +{ + return m_my_float64; +} + + +/*! + * @brief This function sets a value in member my_float128 + * @param _my_float128 New value for member my_float128 + */ +void BasicStruct::my_float128( + long double _my_float128) +{ + m_my_float128 = _my_float128; +} + +/*! + * @brief This function returns the value of member my_float128 + * @return Value of member my_float128 + */ +long double BasicStruct::my_float128() const +{ + return m_my_float128; +} + +/*! + * @brief This function returns a reference to member my_float128 + * @return Reference to member my_float128 + */ +long double& BasicStruct::my_float128() +{ + return m_my_float128; +} + + +/*! + * @brief This function sets a value in member my_char + * @param _my_char New value for member my_char + */ +void BasicStruct::my_char( + char _my_char) +{ + m_my_char = _my_char; +} + +/*! + * @brief This function returns the value of member my_char + * @return Value of member my_char + */ +char BasicStruct::my_char() const +{ + return m_my_char; +} + +/*! + * @brief This function returns a reference to member my_char + * @return Reference to member my_char + */ +char& BasicStruct::my_char() +{ + return m_my_char; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicStruct::my_string() +{ + return m_my_string; +} + + + + + + + + + + + + +ComplexStruct::ComplexStruct() +{ + // octet m_my_octet + m_my_octet = 0; + // BasicStruct m_my_basic_struct + + // MyAliasEnum m_my_alias_enum + m_my_alias_enum = ::A; + // MyEnum m_my_enum + m_my_enum = ::A; + // sequence m_my_sequence_octet + + // sequence m_my_sequence_struct + + // char m_my_array_octet + memset(&m_my_array_octet, 0, ((500) * (5) * (4)) * 1); + // MyOctetArray500 m_my_octet_array_500 + memset(&m_my_octet_array_500, 0, ((500)) * 1); + // BasicStruct m_my_array_struct + + // map m_my_map_octet_short + + // map m_my_map_long_struct + + // map>> m_my_map_long_seq_octet + + // map m_my_map_long_octet_array_500 + + // map> m_my_map_long_lol_type + + // /type_d() m_my_small_string_8 + + // /type_d() m_my_large_string_8 + + // /type_d() m_my_array_string + + // MA3 m_multi_alias_array_42 + memset(&m_multi_alias_array_42, 0, ((42)) * 4); + // MyMiniArray m_my_array_arrays + + // MySequenceLong m_my_sequences_array + + + // Just to register all known types + registerTestTypes(); +} + +ComplexStruct::~ComplexStruct() +{ +} + +ComplexStruct::ComplexStruct( + const ComplexStruct& x) +{ + m_my_octet = x.m_my_octet; + + + m_my_basic_struct = x.m_my_basic_struct; + + + m_my_alias_enum = x.m_my_alias_enum; + + + m_my_enum = x.m_my_enum; + + + m_my_sequence_octet = x.m_my_sequence_octet; + + + m_my_sequence_struct = x.m_my_sequence_struct; + + + m_my_array_octet = x.m_my_array_octet; + + + m_my_octet_array_500 = x.m_my_octet_array_500; + + + m_my_array_struct = x.m_my_array_struct; + + + m_my_map_octet_short = x.m_my_map_octet_short; + + + m_my_map_long_struct = x.m_my_map_long_struct; + + + m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; + + + m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; + + + m_my_map_long_lol_type = x.m_my_map_long_lol_type; + + + m_my_small_string_8 = x.m_my_small_string_8; + + + m_my_large_string_8 = x.m_my_large_string_8; + + + m_my_array_string = x.m_my_array_string; + + + m_multi_alias_array_42 = x.m_multi_alias_array_42; + + + m_my_array_arrays = x.m_my_array_arrays; + + + m_my_sequences_array = x.m_my_sequences_array; + +} + +ComplexStruct::ComplexStruct( + ComplexStruct&& x) noexcept +{ + m_my_octet = x.m_my_octet; + + + m_my_basic_struct = std::move(x.m_my_basic_struct); + + + m_my_alias_enum = x.m_my_alias_enum; + + + m_my_enum = x.m_my_enum; + + + m_my_sequence_octet = std::move(x.m_my_sequence_octet); + + + m_my_sequence_struct = std::move(x.m_my_sequence_struct); + + + m_my_array_octet = std::move(x.m_my_array_octet); + + + m_my_octet_array_500 = std::move(x.m_my_octet_array_500); + + + m_my_array_struct = std::move(x.m_my_array_struct); + + + m_my_map_octet_short = std::move(x.m_my_map_octet_short); + + + m_my_map_long_struct = std::move(x.m_my_map_long_struct); + + + m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); + + + m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); + + + m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); + + + m_my_small_string_8 = std::move(x.m_my_small_string_8); + + + m_my_large_string_8 = std::move(x.m_my_large_string_8); + + + m_my_array_string = std::move(x.m_my_array_string); + + + m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); + + + m_my_array_arrays = std::move(x.m_my_array_arrays); + + + m_my_sequences_array = std::move(x.m_my_sequences_array); + +} + +ComplexStruct& ComplexStruct::operator =( + const ComplexStruct& x) +{ + m_my_octet = x.m_my_octet; + + + m_my_basic_struct = x.m_my_basic_struct; + + + m_my_alias_enum = x.m_my_alias_enum; + + + m_my_enum = x.m_my_enum; + + + m_my_sequence_octet = x.m_my_sequence_octet; + + + m_my_sequence_struct = x.m_my_sequence_struct; + + + m_my_array_octet = x.m_my_array_octet; + + + m_my_octet_array_500 = x.m_my_octet_array_500; + + + m_my_array_struct = x.m_my_array_struct; + + + m_my_map_octet_short = x.m_my_map_octet_short; + + + m_my_map_long_struct = x.m_my_map_long_struct; + + + m_my_map_long_seq_octet = x.m_my_map_long_seq_octet; + + + m_my_map_long_octet_array_500 = x.m_my_map_long_octet_array_500; + + + m_my_map_long_lol_type = x.m_my_map_long_lol_type; + + + m_my_small_string_8 = x.m_my_small_string_8; + + + m_my_large_string_8 = x.m_my_large_string_8; + + + m_my_array_string = x.m_my_array_string; + + + m_multi_alias_array_42 = x.m_multi_alias_array_42; + + + m_my_array_arrays = x.m_my_array_arrays; + + + m_my_sequences_array = x.m_my_sequences_array; + + return *this; +} + +ComplexStruct& ComplexStruct::operator =( + ComplexStruct&& x) noexcept +{ + m_my_octet = x.m_my_octet; + + + m_my_basic_struct = std::move(x.m_my_basic_struct); + + + m_my_alias_enum = x.m_my_alias_enum; + + + m_my_enum = x.m_my_enum; + + + m_my_sequence_octet = std::move(x.m_my_sequence_octet); + + + m_my_sequence_struct = std::move(x.m_my_sequence_struct); + + + m_my_array_octet = std::move(x.m_my_array_octet); + + + m_my_octet_array_500 = std::move(x.m_my_octet_array_500); + + + m_my_array_struct = std::move(x.m_my_array_struct); + + + m_my_map_octet_short = std::move(x.m_my_map_octet_short); + + + m_my_map_long_struct = std::move(x.m_my_map_long_struct); + + + m_my_map_long_seq_octet = std::move(x.m_my_map_long_seq_octet); + + + m_my_map_long_octet_array_500 = std::move(x.m_my_map_long_octet_array_500); + + + m_my_map_long_lol_type = std::move(x.m_my_map_long_lol_type); + + + m_my_small_string_8 = std::move(x.m_my_small_string_8); + + + m_my_large_string_8 = std::move(x.m_my_large_string_8); + + + m_my_array_string = std::move(x.m_my_array_string); + + + m_multi_alias_array_42 = std::move(x.m_multi_alias_array_42); + + + m_my_array_arrays = std::move(x.m_my_array_arrays); + + + m_my_sequences_array = std::move(x.m_my_sequences_array); + + return *this; +} + +bool ComplexStruct::operator ==( + const ComplexStruct& x) const +{ + return (m_my_octet == x.m_my_octet && + m_my_basic_struct == x.m_my_basic_struct && + m_my_alias_enum == x.m_my_alias_enum && + m_my_enum == x.m_my_enum && + m_my_sequence_octet == x.m_my_sequence_octet && + m_my_sequence_struct == x.m_my_sequence_struct && + m_my_array_octet == x.m_my_array_octet && + m_my_octet_array_500 == x.m_my_octet_array_500 && + m_my_array_struct == x.m_my_array_struct && + m_my_map_octet_short == x.m_my_map_octet_short && + m_my_map_long_struct == x.m_my_map_long_struct && + m_my_map_long_seq_octet == x.m_my_map_long_seq_octet && + m_my_map_long_octet_array_500 == x.m_my_map_long_octet_array_500 && + m_my_map_long_lol_type == x.m_my_map_long_lol_type && + m_my_small_string_8 == x.m_my_small_string_8 && + m_my_large_string_8 == x.m_my_large_string_8 && + m_my_array_string == x.m_my_array_string && + m_multi_alias_array_42 == x.m_multi_alias_array_42 && + m_my_array_arrays == x.m_my_array_arrays && + m_my_sequences_array == x.m_my_sequences_array); +} + +bool ComplexStruct::operator !=( + const ComplexStruct& x) const +{ + return !(*this == x); +} + +size_t ComplexStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ComplexStruct_max_cdr_typesize; +} + +size_t ComplexStruct::getCdrSerializedSize( + const ComplexStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += BasicStruct::getCdrSerializedSize(data.my_basic_struct(), current_alignment); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_octet().size() > 0) + { + current_alignment += (data.my_sequence_octet().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_struct().size(); ++a) + { + current_alignment += BasicStruct::getCdrSerializedSize(data.my_sequence_struct().at(a), current_alignment); + } + + + + current_alignment += (((500) * (5) * (4)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + current_alignment += (((500)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + + for(size_t a = 0; a < data.my_array_struct().size(); ++a) + { + current_alignment += BasicStruct::getCdrSerializedSize(data.my_array_struct().at(a), current_alignment); + + } + + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_octet_short()) + { + (void)a; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + } + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_long_struct()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += BasicStruct::getCdrSerializedSize(a.second, current_alignment); + + } + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_long_seq_octet()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t b = 0; b < a.second.size(); ++b) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (a.second.at(b).size() > 0) + { + current_alignment += (a.second.at(b).size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + } + + + } + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_long_octet_array_500()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += (((500)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + } + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_long_lol_type()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + for(size_t c = 0; c < b.second.size(); ++c) + { + current_alignment += BasicStruct::getCdrSerializedSize(b.second.at(c), current_alignment); + + } + + + } + + } + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_small_string_8().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string_8().size() + 1; + + + + for(size_t a = 0; a < data.my_array_string().size(); ++a) + { + + for(size_t b = 0; b < data.my_array_string().at(a).size(); ++b) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_array_string().at(a).at(b).size() + 1; + + } + + } + + + + current_alignment += (((42)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + + for(size_t a = 0; a < data.my_array_arrays().size(); ++a) + { + current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + } + + + + + for(size_t a = 0; a < data.my_sequences_array().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequences_array().at(a).size() > 0) + { + current_alignment += (data.my_sequences_array().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + } + + + + return current_alignment - initial_alignment; +} + + +void ComplexStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_octet; + + scdr << m_my_basic_struct; + + scdr << (uint32_t)m_my_alias_enum; + + scdr << (uint32_t)m_my_enum; + + scdr << m_my_sequence_octet; + + + scdr << m_my_sequence_struct; + + + for (uint32_t d = 0; d < m_my_array_octet.size(); ++d) + { + for (uint32_t e = 0; e < m_my_array_octet[d].size(); ++e) + { + scdr << m_my_array_octet[d][e]; + + } + + } + + + + scdr << m_my_octet_array_500; + + + scdr << m_my_array_struct; + + + scdr << static_cast(m_my_map_octet_short.size()); + for (const auto& pair : m_my_map_octet_short) + { + scdr << pair.first; + scdr << pair.second; + } + + scdr << static_cast(m_my_map_long_struct.size()); + for (const auto& pair : m_my_map_long_struct) + { + scdr << pair.first; + scdr << pair.second; + } + + scdr << static_cast(m_my_map_long_seq_octet.size()); + for (const auto& pair : m_my_map_long_seq_octet) + { + scdr << pair.first; + scdr << pair.second; + } + + scdr << static_cast(m_my_map_long_octet_array_500.size()); + for (const auto& pair : m_my_map_long_octet_array_500) + { + scdr << pair.first; + scdr << pair.second; + } + + scdr << static_cast(m_my_map_long_lol_type.size()); + for (const auto& pair : m_my_map_long_lol_type) + { + scdr << pair.first; + scdr << pair.second; + } + + scdr << m_my_small_string_8.c_str(); + + scdr << m_my_large_string_8.c_str(); + + for (uint32_t g = 0; g < m_my_array_string.size(); ++g) + { + for (const auto& str : m_my_array_string[g]) + { + scdr << str.c_str(); + } + + + } + + + + + scdr.serializeArray(reinterpret_cast(m_multi_alias_array_42.data()), m_multi_alias_array_42.size()); + + + scdr << m_my_array_arrays; + + + scdr << m_my_sequences_array; + + +} + +void ComplexStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_octet; + + + + dcdr >> m_my_basic_struct; + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_alias_enum = (MyAliasEnum)enum_value; + } + + + + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyEnum)enum_value; + } + + + + dcdr >> m_my_sequence_octet; + + + + dcdr >> m_my_sequence_struct; + + + + for (uint32_t i = 0; i < m_my_array_octet.size(); ++i) + { + for (uint32_t j = 0; j < m_my_array_octet[i].size(); ++j) + { + dcdr >> m_my_array_octet[i][j]; + + } + + } + + + + + dcdr >> m_my_octet_array_500; + + + + dcdr >> m_my_array_struct; + + + + + dcdr >> m_my_map_octet_short; + + + + + dcdr >> m_my_map_long_struct; + + + + + dcdr >> m_my_map_long_seq_octet; + + + + + dcdr >> m_my_map_long_octet_array_500; + + + + + dcdr >> m_my_map_long_lol_type; + + + + { + std::string aux; + dcdr >> aux; + m_my_small_string_8 = aux.c_str(); + } + + + + { + std::string aux; + dcdr >> aux; + m_my_large_string_8 = aux.c_str(); + } + + + + for (uint32_t l = 0; l < m_my_array_string.size(); ++l) + { + for (auto& str : m_my_array_string[l]) + { + { + std::string aux_str; + dcdr >> aux_str; + str = aux_str.c_str(); + } + + } + + + } + + + + + + dcdr.deserializeArray(reinterpret_cast(m_multi_alias_array_42.data()), m_multi_alias_array_42.size()); + + + + dcdr >> m_my_array_arrays; + + + + dcdr >> m_my_sequences_array; + + +} + + +bool ComplexStruct::isKeyDefined() +{ + return false; +} + +void ComplexStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ +void ComplexStruct::my_octet( + uint8_t _my_octet) +{ + m_my_octet = _my_octet; +} + +/*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ +uint8_t ComplexStruct::my_octet() const +{ + return m_my_octet; +} + +/*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ +uint8_t& ComplexStruct::my_octet() +{ + return m_my_octet; +} + + +/*! + * @brief This function copies the value in member my_basic_struct + * @param _my_basic_struct New value to be copied in member my_basic_struct + */ +void ComplexStruct::my_basic_struct( + const BasicStruct& _my_basic_struct) +{ + m_my_basic_struct = _my_basic_struct; +} + +/*! + * @brief This function moves the value in member my_basic_struct + * @param _my_basic_struct New value to be moved in member my_basic_struct + */ +void ComplexStruct::my_basic_struct( + BasicStruct&& _my_basic_struct) +{ + m_my_basic_struct = std::move(_my_basic_struct); +} + +/*! + * @brief This function returns a constant reference to member my_basic_struct + * @return Constant reference to member my_basic_struct + */ +const BasicStruct& ComplexStruct::my_basic_struct() const +{ + return m_my_basic_struct; +} + +/*! + * @brief This function returns a reference to member my_basic_struct + * @return Reference to member my_basic_struct + */ +BasicStruct& ComplexStruct::my_basic_struct() +{ + return m_my_basic_struct; +} + + +/*! + * @brief This function sets a value in member my_alias_enum + * @param _my_alias_enum New value for member my_alias_enum + */ +void ComplexStruct::my_alias_enum( + MyAliasEnum _my_alias_enum) +{ + m_my_alias_enum = _my_alias_enum; +} + +/*! + * @brief This function returns the value of member my_alias_enum + * @return Value of member my_alias_enum + */ +MyAliasEnum ComplexStruct::my_alias_enum() const +{ + return m_my_alias_enum; +} + +/*! + * @brief This function returns a reference to member my_alias_enum + * @return Reference to member my_alias_enum + */ +MyAliasEnum& ComplexStruct::my_alias_enum() +{ + return m_my_alias_enum; +} + + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void ComplexStruct::my_enum( + MyEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyEnum ComplexStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyEnum& ComplexStruct::my_enum() +{ + return m_my_enum; +} + + +/*! + * @brief This function copies the value in member my_sequence_octet + * @param _my_sequence_octet New value to be copied in member my_sequence_octet + */ +void ComplexStruct::my_sequence_octet( + const std::vector& _my_sequence_octet) +{ + m_my_sequence_octet = _my_sequence_octet; +} + +/*! + * @brief This function moves the value in member my_sequence_octet + * @param _my_sequence_octet New value to be moved in member my_sequence_octet + */ +void ComplexStruct::my_sequence_octet( + std::vector&& _my_sequence_octet) +{ + m_my_sequence_octet = std::move(_my_sequence_octet); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_octet + * @return Constant reference to member my_sequence_octet + */ +const std::vector& ComplexStruct::my_sequence_octet() const +{ + return m_my_sequence_octet; +} + +/*! + * @brief This function returns a reference to member my_sequence_octet + * @return Reference to member my_sequence_octet + */ +std::vector& ComplexStruct::my_sequence_octet() +{ + return m_my_sequence_octet; +} + + +/*! + * @brief This function copies the value in member my_sequence_struct + * @param _my_sequence_struct New value to be copied in member my_sequence_struct + */ +void ComplexStruct::my_sequence_struct( + const std::vector& _my_sequence_struct) +{ + m_my_sequence_struct = _my_sequence_struct; +} + +/*! + * @brief This function moves the value in member my_sequence_struct + * @param _my_sequence_struct New value to be moved in member my_sequence_struct + */ +void ComplexStruct::my_sequence_struct( + std::vector&& _my_sequence_struct) +{ + m_my_sequence_struct = std::move(_my_sequence_struct); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_struct + * @return Constant reference to member my_sequence_struct + */ +const std::vector& ComplexStruct::my_sequence_struct() const +{ + return m_my_sequence_struct; +} + +/*! + * @brief This function returns a reference to member my_sequence_struct + * @return Reference to member my_sequence_struct + */ +std::vector& ComplexStruct::my_sequence_struct() +{ + return m_my_sequence_struct; +} + + +/*! + * @brief This function copies the value in member my_array_octet + * @param _my_array_octet New value to be copied in member my_array_octet + */ +void ComplexStruct::my_array_octet( + const std::array, 5>, 500>& _my_array_octet) +{ + m_my_array_octet = _my_array_octet; +} + +/*! + * @brief This function moves the value in member my_array_octet + * @param _my_array_octet New value to be moved in member my_array_octet + */ +void ComplexStruct::my_array_octet( + std::array, 5>, 500>&& _my_array_octet) +{ + m_my_array_octet = std::move(_my_array_octet); +} + +/*! + * @brief This function returns a constant reference to member my_array_octet + * @return Constant reference to member my_array_octet + */ +const std::array, 5>, 500>& ComplexStruct::my_array_octet() const +{ + return m_my_array_octet; +} + +/*! + * @brief This function returns a reference to member my_array_octet + * @return Reference to member my_array_octet + */ +std::array, 5>, 500>& ComplexStruct::my_array_octet() +{ + return m_my_array_octet; +} + + +/*! + * @brief This function copies the value in member my_octet_array_500 + * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 + */ +void ComplexStruct::my_octet_array_500( + const MyOctetArray500& _my_octet_array_500) +{ + m_my_octet_array_500 = _my_octet_array_500; +} + +/*! + * @brief This function moves the value in member my_octet_array_500 + * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 + */ +void ComplexStruct::my_octet_array_500( + MyOctetArray500&& _my_octet_array_500) +{ + m_my_octet_array_500 = std::move(_my_octet_array_500); +} + +/*! + * @brief This function returns a constant reference to member my_octet_array_500 + * @return Constant reference to member my_octet_array_500 + */ +const MyOctetArray500& ComplexStruct::my_octet_array_500() const +{ + return m_my_octet_array_500; +} + +/*! + * @brief This function returns a reference to member my_octet_array_500 + * @return Reference to member my_octet_array_500 + */ +MyOctetArray500& ComplexStruct::my_octet_array_500() +{ + return m_my_octet_array_500; +} + + +/*! + * @brief This function copies the value in member my_array_struct + * @param _my_array_struct New value to be copied in member my_array_struct + */ +void ComplexStruct::my_array_struct( + const std::array& _my_array_struct) +{ + m_my_array_struct = _my_array_struct; +} + +/*! + * @brief This function moves the value in member my_array_struct + * @param _my_array_struct New value to be moved in member my_array_struct + */ +void ComplexStruct::my_array_struct( + std::array&& _my_array_struct) +{ + m_my_array_struct = std::move(_my_array_struct); +} + +/*! + * @brief This function returns a constant reference to member my_array_struct + * @return Constant reference to member my_array_struct + */ +const std::array& ComplexStruct::my_array_struct() const +{ + return m_my_array_struct; +} + +/*! + * @brief This function returns a reference to member my_array_struct + * @return Reference to member my_array_struct + */ +std::array& ComplexStruct::my_array_struct() +{ + return m_my_array_struct; +} + + +/*! + * @brief This function copies the value in member my_map_octet_short + * @param _my_map_octet_short New value to be copied in member my_map_octet_short + */ +void ComplexStruct::my_map_octet_short( + const std::map& _my_map_octet_short) +{ + m_my_map_octet_short = _my_map_octet_short; +} + +/*! + * @brief This function moves the value in member my_map_octet_short + * @param _my_map_octet_short New value to be moved in member my_map_octet_short + */ +void ComplexStruct::my_map_octet_short( + std::map&& _my_map_octet_short) +{ + m_my_map_octet_short = std::move(_my_map_octet_short); +} + +/*! + * @brief This function returns a constant reference to member my_map_octet_short + * @return Constant reference to member my_map_octet_short + */ +const std::map& ComplexStruct::my_map_octet_short() const +{ + return m_my_map_octet_short; +} + +/*! + * @brief This function returns a reference to member my_map_octet_short + * @return Reference to member my_map_octet_short + */ +std::map& ComplexStruct::my_map_octet_short() +{ + return m_my_map_octet_short; +} + + +/*! + * @brief This function copies the value in member my_map_long_struct + * @param _my_map_long_struct New value to be copied in member my_map_long_struct + */ +void ComplexStruct::my_map_long_struct( + const std::map& _my_map_long_struct) +{ + m_my_map_long_struct = _my_map_long_struct; +} + +/*! + * @brief This function moves the value in member my_map_long_struct + * @param _my_map_long_struct New value to be moved in member my_map_long_struct + */ +void ComplexStruct::my_map_long_struct( + std::map&& _my_map_long_struct) +{ + m_my_map_long_struct = std::move(_my_map_long_struct); +} + +/*! + * @brief This function returns a constant reference to member my_map_long_struct + * @return Constant reference to member my_map_long_struct + */ +const std::map& ComplexStruct::my_map_long_struct() const +{ + return m_my_map_long_struct; +} + +/*! + * @brief This function returns a reference to member my_map_long_struct + * @return Reference to member my_map_long_struct + */ +std::map& ComplexStruct::my_map_long_struct() +{ + return m_my_map_long_struct; +} + + +/*! + * @brief This function copies the value in member my_map_long_seq_octet + * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet + */ +void ComplexStruct::my_map_long_seq_octet( + const std::map>>& _my_map_long_seq_octet) +{ + m_my_map_long_seq_octet = _my_map_long_seq_octet; +} + +/*! + * @brief This function moves the value in member my_map_long_seq_octet + * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet + */ +void ComplexStruct::my_map_long_seq_octet( + std::map>>&& _my_map_long_seq_octet) +{ + m_my_map_long_seq_octet = std::move(_my_map_long_seq_octet); +} + +/*! + * @brief This function returns a constant reference to member my_map_long_seq_octet + * @return Constant reference to member my_map_long_seq_octet + */ +const std::map>>& ComplexStruct::my_map_long_seq_octet() const +{ + return m_my_map_long_seq_octet; +} + +/*! + * @brief This function returns a reference to member my_map_long_seq_octet + * @return Reference to member my_map_long_seq_octet + */ +std::map>>& ComplexStruct::my_map_long_seq_octet() +{ + return m_my_map_long_seq_octet; +} + + +/*! + * @brief This function copies the value in member my_map_long_octet_array_500 + * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 + */ +void ComplexStruct::my_map_long_octet_array_500( + const std::map& _my_map_long_octet_array_500) +{ + m_my_map_long_octet_array_500 = _my_map_long_octet_array_500; +} + +/*! + * @brief This function moves the value in member my_map_long_octet_array_500 + * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 + */ +void ComplexStruct::my_map_long_octet_array_500( + std::map&& _my_map_long_octet_array_500) +{ + m_my_map_long_octet_array_500 = std::move(_my_map_long_octet_array_500); +} + +/*! + * @brief This function returns a constant reference to member my_map_long_octet_array_500 + * @return Constant reference to member my_map_long_octet_array_500 + */ +const std::map& ComplexStruct::my_map_long_octet_array_500() const +{ + return m_my_map_long_octet_array_500; +} + +/*! + * @brief This function returns a reference to member my_map_long_octet_array_500 + * @return Reference to member my_map_long_octet_array_500 + */ +std::map& ComplexStruct::my_map_long_octet_array_500() +{ + return m_my_map_long_octet_array_500; +} + + +/*! + * @brief This function copies the value in member my_map_long_lol_type + * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type + */ +void ComplexStruct::my_map_long_lol_type( + const std::map>& _my_map_long_lol_type) +{ + m_my_map_long_lol_type = _my_map_long_lol_type; +} + +/*! + * @brief This function moves the value in member my_map_long_lol_type + * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type + */ +void ComplexStruct::my_map_long_lol_type( + std::map>&& _my_map_long_lol_type) +{ + m_my_map_long_lol_type = std::move(_my_map_long_lol_type); +} + +/*! + * @brief This function returns a constant reference to member my_map_long_lol_type + * @return Constant reference to member my_map_long_lol_type + */ +const std::map>& ComplexStruct::my_map_long_lol_type() const +{ + return m_my_map_long_lol_type; +} + +/*! + * @brief This function returns a reference to member my_map_long_lol_type + * @return Reference to member my_map_long_lol_type + */ +std::map>& ComplexStruct::my_map_long_lol_type() +{ + return m_my_map_long_lol_type; +} + + +/*! + * @brief This function copies the value in member my_small_string_8 + * @param _my_small_string_8 New value to be copied in member my_small_string_8 + */ +void ComplexStruct::my_small_string_8( + const eprosima::fastrtps::fixed_string<128>& _my_small_string_8) +{ + m_my_small_string_8 = _my_small_string_8; +} + +/*! + * @brief This function moves the value in member my_small_string_8 + * @param _my_small_string_8 New value to be moved in member my_small_string_8 + */ +void ComplexStruct::my_small_string_8( + eprosima::fastrtps::fixed_string<128>&& _my_small_string_8) +{ + m_my_small_string_8 = std::move(_my_small_string_8); +} + +/*! + * @brief This function returns a constant reference to member my_small_string_8 + * @return Constant reference to member my_small_string_8 + */ +const eprosima::fastrtps::fixed_string<128>& ComplexStruct::my_small_string_8() const +{ + return m_my_small_string_8; +} + +/*! + * @brief This function returns a reference to member my_small_string_8 + * @return Reference to member my_small_string_8 + */ +eprosima::fastrtps::fixed_string<128>& ComplexStruct::my_small_string_8() +{ + return m_my_small_string_8; +} + + +/*! + * @brief This function copies the value in member my_large_string_8 + * @param _my_large_string_8 New value to be copied in member my_large_string_8 + */ +void ComplexStruct::my_large_string_8( + const eprosima::fastrtps::fixed_string<500>& _my_large_string_8) +{ + m_my_large_string_8 = _my_large_string_8; +} + +/*! + * @brief This function moves the value in member my_large_string_8 + * @param _my_large_string_8 New value to be moved in member my_large_string_8 + */ +void ComplexStruct::my_large_string_8( + eprosima::fastrtps::fixed_string<500>&& _my_large_string_8) +{ + m_my_large_string_8 = std::move(_my_large_string_8); +} + +/*! + * @brief This function returns a constant reference to member my_large_string_8 + * @return Constant reference to member my_large_string_8 + */ +const eprosima::fastrtps::fixed_string<500>& ComplexStruct::my_large_string_8() const +{ + return m_my_large_string_8; +} + +/*! + * @brief This function returns a reference to member my_large_string_8 + * @return Reference to member my_large_string_8 + */ +eprosima::fastrtps::fixed_string<500>& ComplexStruct::my_large_string_8() +{ + return m_my_large_string_8; +} + + +/*! + * @brief This function copies the value in member my_array_string + * @param _my_array_string New value to be copied in member my_array_string + */ +void ComplexStruct::my_array_string( + const std::array, 5>, 5>& _my_array_string) +{ + m_my_array_string = _my_array_string; +} + +/*! + * @brief This function moves the value in member my_array_string + * @param _my_array_string New value to be moved in member my_array_string + */ +void ComplexStruct::my_array_string( + std::array, 5>, 5>&& _my_array_string) +{ + m_my_array_string = std::move(_my_array_string); +} + +/*! + * @brief This function returns a constant reference to member my_array_string + * @return Constant reference to member my_array_string + */ +const std::array, 5>, 5>& ComplexStruct::my_array_string() const +{ + return m_my_array_string; +} + +/*! + * @brief This function returns a reference to member my_array_string + * @return Reference to member my_array_string + */ +std::array, 5>, 5>& ComplexStruct::my_array_string() +{ + return m_my_array_string; +} + + +/*! + * @brief This function copies the value in member multi_alias_array_42 + * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 + */ +void ComplexStruct::multi_alias_array_42( + const MA3& _multi_alias_array_42) +{ + m_multi_alias_array_42 = _multi_alias_array_42; +} + +/*! + * @brief This function moves the value in member multi_alias_array_42 + * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 + */ +void ComplexStruct::multi_alias_array_42( + MA3&& _multi_alias_array_42) +{ + m_multi_alias_array_42 = std::move(_multi_alias_array_42); +} + +/*! + * @brief This function returns a constant reference to member multi_alias_array_42 + * @return Constant reference to member multi_alias_array_42 + */ +const MA3& ComplexStruct::multi_alias_array_42() const +{ + return m_multi_alias_array_42; +} + +/*! + * @brief This function returns a reference to member multi_alias_array_42 + * @return Reference to member multi_alias_array_42 + */ +MA3& ComplexStruct::multi_alias_array_42() +{ + return m_multi_alias_array_42; +} + + +/*! + * @brief This function copies the value in member my_array_arrays + * @param _my_array_arrays New value to be copied in member my_array_arrays + */ +void ComplexStruct::my_array_arrays( + const std::array& _my_array_arrays) +{ + m_my_array_arrays = _my_array_arrays; +} + +/*! + * @brief This function moves the value in member my_array_arrays + * @param _my_array_arrays New value to be moved in member my_array_arrays + */ +void ComplexStruct::my_array_arrays( + std::array&& _my_array_arrays) +{ + m_my_array_arrays = std::move(_my_array_arrays); +} + +/*! + * @brief This function returns a constant reference to member my_array_arrays + * @return Constant reference to member my_array_arrays + */ +const std::array& ComplexStruct::my_array_arrays() const +{ + return m_my_array_arrays; +} + +/*! + * @brief This function returns a reference to member my_array_arrays + * @return Reference to member my_array_arrays + */ +std::array& ComplexStruct::my_array_arrays() +{ + return m_my_array_arrays; +} + + +/*! + * @brief This function copies the value in member my_sequences_array + * @param _my_sequences_array New value to be copied in member my_sequences_array + */ +void ComplexStruct::my_sequences_array( + const std::array& _my_sequences_array) +{ + m_my_sequences_array = _my_sequences_array; +} + +/*! + * @brief This function moves the value in member my_sequences_array + * @param _my_sequences_array New value to be moved in member my_sequences_array + */ +void ComplexStruct::my_sequences_array( + std::array&& _my_sequences_array) +{ + m_my_sequences_array = std::move(_my_sequences_array); +} + +/*! + * @brief This function returns a constant reference to member my_sequences_array + * @return Constant reference to member my_sequences_array + */ +const std::array& ComplexStruct::my_sequences_array() const +{ + return m_my_sequences_array; +} + +/*! + * @brief This function returns a reference to member my_sequences_array + * @return Reference to member my_sequences_array + */ +std::array& ComplexStruct::my_sequences_array() +{ + return m_my_sequences_array; +} + + + + + +MyUnion::MyUnion() +{ + m__d = ::A; + // BasicStruct m_basic + + // ComplexStruct m_complex + +} + +MyUnion::~MyUnion() +{ +} + +MyUnion::MyUnion( + const MyUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case ::A: + m_basic = x.m_basic; + break; + + + case ::B: + case ::C: + m_complex = x.m_complex; + break; + + default: + break; + } +} + +MyUnion::MyUnion( + MyUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case ::A: + m_basic = std::move(x.m_basic); + + break; + + + case ::B: + case ::C: + m_complex = std::move(x.m_complex); + + break; + + default: + break; + } +} + +MyUnion& MyUnion::operator =( + const MyUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case ::A: + m_basic = x.m_basic; + break; + + + case ::B: + case ::C: + m_complex = x.m_complex; + break; + + default: + break; + } + + return *this; +} + +MyUnion& MyUnion::operator =( + MyUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case ::A: + m_basic = std::move(x.m_basic); + + break; + + + case ::B: + case ::C: + m_complex = std::move(x.m_complex); + + break; + + default: + break; + } + + return *this; +} + +bool MyUnion::operator ==( + const MyUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case ::A: + return (m_basic == x.m_basic); + break; + + + case ::B: + case ::C: + return (m_complex == x.m_complex); + break; + + default: + break; + } + return false; +} + +bool MyUnion::operator !=( + const MyUnion& x) const +{ + return !(*this == x); +} + +void MyUnion::_d( + MyEnum __d) +{ + bool b = false; + + switch(m__d) + { + case ::A: + switch(__d) + { + case ::A: + b = true; + break; + default: + break; + } + break; + + + case ::B: + case ::C: + switch(__d) + { + case ::B: + case ::C: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +MyEnum MyUnion::_d() const +{ + return m__d; +} + +MyEnum& MyUnion::_d() +{ + return m__d; +} + +void MyUnion::basic( + const BasicStruct& _basic) +{ + m_basic = _basic; + m__d = ::A; + +} + +void MyUnion::basic( + BasicStruct&& _basic) +{ + m_basic = std::move(_basic); + m__d = ::A; + +} + +const BasicStruct& MyUnion::basic() const +{ + bool b = false; + + switch(m__d) + { + case ::A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_basic; +} + +BasicStruct& MyUnion::basic() +{ + bool b = false; + + switch(m__d) + { + case ::A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_basic; +} + + +void MyUnion::complex( + const ComplexStruct& _complex) +{ + m_complex = _complex; + m__d = ::B; + +} + +void MyUnion::complex( + ComplexStruct&& _complex) +{ + m_complex = std::move(_complex); + m__d = ::B; + +} + +const ComplexStruct& MyUnion::complex() const +{ + bool b = false; + + switch(m__d) + { + case ::B: + case ::C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_complex; +} + +ComplexStruct& MyUnion::complex() +{ + bool b = false; + + switch(m__d) + { + case ::B: + case ::C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_complex; +} + + +// TODO(Ricardo) Review +size_t MyUnion::getCdrSerializedSize( + const MyUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case ::A: + current_alignment += BasicStruct::getCdrSerializedSize(data.basic(), current_alignment); + + break; + + + case ::B: + case ::C: + current_alignment += ComplexStruct::getCdrSerializedSize(data.complex(), current_alignment); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void MyUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m__d; + + switch(m__d) + { + case ::A: + scdr << m_basic; + + break; + + + case ::B: + case ::C: + scdr << m_complex; + + break; + + default: + break; + } +} + +void MyUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m__d = (MyEnum)enum_value; + } + + + switch(m__d) + { + case ::A: + dcdr >> m_basic; + + + break; + + + case ::B: + case ::C: + dcdr >> m_complex; + + + break; + + default: + break; + } +} + + + + + +MyUnion2::MyUnion2() +{ + m__d = A; + // long m_uno + m_uno = 0; + // /type_d() m_imString + + // long m_tres + m_tres = 0; +} + +MyUnion2::~MyUnion2() +{ +} + +MyUnion2::MyUnion2( + const MyUnion2& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_uno = x.m_uno; + break; + + + case B: + m_imString = x.m_imString; + break; + + + case C: + m_tres = x.m_tres; + break; + + default: + break; + } +} + +MyUnion2::MyUnion2( + MyUnion2&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_uno = x.m_uno; + break; + + + case B: + m_imString = std::move(x.m_imString); + + break; + + + case C: + m_tres = x.m_tres; + break; + + default: + break; + } +} + +MyUnion2& MyUnion2::operator =( + const MyUnion2& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_uno = x.m_uno; + break; + + + case B: + m_imString = x.m_imString; + break; + + + case C: + m_tres = x.m_tres; + break; + + default: + break; + } + + return *this; +} + +MyUnion2& MyUnion2::operator =( + MyUnion2&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_uno = x.m_uno; + break; + + + case B: + m_imString = std::move(x.m_imString); + + break; + + + case C: + m_tres = x.m_tres; + break; + + default: + break; + } + + return *this; +} + +bool MyUnion2::operator ==( + const MyUnion2& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_uno == x.m_uno); + break; + + + case B: + return (m_imString == x.m_imString); + break; + + + case C: + return (m_tres == x.m_tres); + break; + + default: + break; + } + return false; +} + +bool MyUnion2::operator !=( + const MyUnion2& x) const +{ + return !(*this == x); +} + +void MyUnion2::_d( + uint8_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + + case C: + switch(__d) + { + case C: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +uint8_t MyUnion2::_d() const +{ + return m__d; +} + +uint8_t& MyUnion2::_d() +{ + return m__d; +} + +void MyUnion2::uno( + int32_t _uno) +{ + m_uno = _uno; + m__d = A; + +} + +int32_t MyUnion2::uno() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_uno; +} + +int32_t& MyUnion2::uno() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_uno; +} + + +void MyUnion2::imString( + const std::string& _imString) +{ + m_imString = _imString; + m__d = B; + +} + +void MyUnion2::imString( + std::string&& _imString) +{ + m_imString = std::move(_imString); + m__d = B; + +} + +const std::string& MyUnion2::imString() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_imString; +} + +std::string& MyUnion2::imString() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_imString; +} + + +void MyUnion2::tres( + int32_t _tres) +{ + m_tres = _tres; + m__d = C; + +} + +int32_t MyUnion2::tres() const +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_tres; +} + +int32_t& MyUnion2::tres() +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_tres; +} + + +// TODO(Ricardo) Review +size_t MyUnion2::getCdrSerializedSize( + const MyUnion2& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.imString().size() + 1; + + break; + + + case C: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void MyUnion2::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_uno; + + break; + + + case B: + scdr << m_imString.c_str(); + + break; + + + case C: + scdr << m_tres; + + break; + + default: + break; + } +} + +void MyUnion2::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_uno; + + + break; + + + case B: + dcdr >> m_imString; + + + break; + + + case C: + dcdr >> m_tres; + + + break; + + default: + break; + } +} + + + + + +CompleteStruct::CompleteStruct() +{ + // MyUnion m_my_union + + // MyUnion2 m_my_union_2 + + + // Just to register all known types + registerTestTypes(); +} + +CompleteStruct::~CompleteStruct() +{ +} + +CompleteStruct::CompleteStruct( + const CompleteStruct& x) +{ + m_my_union = x.m_my_union; + + + m_my_union_2 = x.m_my_union_2; + +} + +CompleteStruct::CompleteStruct( + CompleteStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + + m_my_union_2 = std::move(x.m_my_union_2); + +} + +CompleteStruct& CompleteStruct::operator =( + const CompleteStruct& x) +{ + m_my_union = x.m_my_union; + + + m_my_union_2 = x.m_my_union_2; + + return *this; +} + +CompleteStruct& CompleteStruct::operator =( + CompleteStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + + m_my_union_2 = std::move(x.m_my_union_2); + + return *this; +} + +bool CompleteStruct::operator ==( + const CompleteStruct& x) const +{ + return (m_my_union == x.m_my_union && + m_my_union_2 == x.m_my_union_2); +} + +bool CompleteStruct::operator !=( + const CompleteStruct& x) const +{ + return !(*this == x); +} + +size_t CompleteStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return CompleteStruct_max_cdr_typesize; +} + +size_t CompleteStruct::getCdrSerializedSize( + const CompleteStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += MyUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + current_alignment += MyUnion2::getCdrSerializedSize(data.my_union_2(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void CompleteStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + + scdr << m_my_union_2; + +} + +void CompleteStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + + + dcdr >> m_my_union_2; + + +} + + +bool CompleteStruct::isKeyDefined() +{ + return false; +} + +void CompleteStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void CompleteStruct::my_union( + const MyUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void CompleteStruct::my_union( + MyUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const MyUnion& CompleteStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +MyUnion& CompleteStruct::my_union() +{ + return m_my_union; +} + + +/*! + * @brief This function copies the value in member my_union_2 + * @param _my_union_2 New value to be copied in member my_union_2 + */ +void CompleteStruct::my_union_2( + const MyUnion2& _my_union_2) +{ + m_my_union_2 = _my_union_2; +} + +/*! + * @brief This function moves the value in member my_union_2 + * @param _my_union_2 New value to be moved in member my_union_2 + */ +void CompleteStruct::my_union_2( + MyUnion2&& _my_union_2) +{ + m_my_union_2 = std::move(_my_union_2); +} + +/*! + * @brief This function returns a constant reference to member my_union_2 + * @return Constant reference to member my_union_2 + */ +const MyUnion2& CompleteStruct::my_union_2() const +{ + return m_my_union_2; +} + +/*! + * @brief This function returns a reference to member my_union_2 + * @return Reference to member my_union_2 + */ +MyUnion2& CompleteStruct::my_union_2() +{ + return m_my_union_2; +} + + + + + +KeyedStruct::KeyedStruct() +{ + // octet m_key + m_key = 0; + // BasicStruct m_basic + + + // Just to register all known types + registerTestTypes(); +} + +KeyedStruct::~KeyedStruct() +{ +} + +KeyedStruct::KeyedStruct( + const KeyedStruct& x) +{ + m_key = x.m_key; + + + m_basic = x.m_basic; + +} + +KeyedStruct::KeyedStruct( + KeyedStruct&& x) noexcept +{ + m_key = x.m_key; + + + m_basic = std::move(x.m_basic); + +} + +KeyedStruct& KeyedStruct::operator =( + const KeyedStruct& x) +{ + m_key = x.m_key; + + + m_basic = x.m_basic; + + return *this; +} + +KeyedStruct& KeyedStruct::operator =( + KeyedStruct&& x) noexcept +{ + m_key = x.m_key; + + + m_basic = std::move(x.m_basic); + + return *this; +} + +bool KeyedStruct::operator ==( + const KeyedStruct& x) const +{ + return (m_key == x.m_key && + m_basic == x.m_basic); +} + +bool KeyedStruct::operator !=( + const KeyedStruct& x) const +{ + return !(*this == x); +} + +size_t KeyedStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return KeyedStruct_max_cdr_typesize; +} + +size_t KeyedStruct::getCdrSerializedSize( + const KeyedStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += BasicStruct::getCdrSerializedSize(data.basic(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void KeyedStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_key; + + scdr << m_basic; + +} + +void KeyedStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_key; + + + + dcdr >> m_basic; + + +} + + +bool KeyedStruct::isKeyDefined() +{ + return true; +} + +void KeyedStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + + scdr << m_key; + + +} + +/*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ +void KeyedStruct::key( + uint8_t _key) +{ + m_key = _key; +} + +/*! + * @brief This function returns the value of member key + * @return Value of member key + */ +uint8_t KeyedStruct::key() const +{ + return m_key; +} + +/*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ +uint8_t& KeyedStruct::key() +{ + return m_key; +} + + +/*! + * @brief This function copies the value in member basic + * @param _basic New value to be copied in member basic + */ +void KeyedStruct::basic( + const BasicStruct& _basic) +{ + m_basic = _basic; +} + +/*! + * @brief This function moves the value in member basic + * @param _basic New value to be moved in member basic + */ +void KeyedStruct::basic( + BasicStruct&& _basic) +{ + m_basic = std::move(_basic); +} + +/*! + * @brief This function returns a constant reference to member basic + * @return Constant reference to member basic + */ +const BasicStruct& KeyedStruct::basic() const +{ + return m_basic; +} + +/*! + * @brief This function returns a reference to member basic + * @return Reference to member basic + */ +BasicStruct& KeyedStruct::basic() +{ + return m_basic; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/Testv1.h b/test/unittest/dynamic_types/idl/Testv1.h new file mode 100644 index 00000000000..6c0a546aa8f --- /dev/null +++ b/test/unittest/dynamic_types/idl/Testv1.h @@ -0,0 +1,1872 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Test.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TEST_H_ +#define _FAST_DDS_GENERATED_TEST_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TEST_SOURCE) +#define TEST_DllAPI __declspec( dllexport ) +#else +#define TEST_DllAPI __declspec( dllimport ) +#endif // TEST_SOURCE +#else +#define TEST_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TEST_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. + * @ingroup Test + */ +enum MyEnum : uint32_t +{ + A, + B, + C +}; +typedef MyEnum MyAliasEnum; + +typedef MyAliasEnum MyAliasEnum2; + +typedef MyAliasEnum2 MyAliasEnum3; + + + +/*! + * @brief This class represents the structure BasicStruct defined by the user in the IDL file. + * @ingroup Test + */ +class BasicStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + const BasicStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + BasicStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + const BasicStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + BasicStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ + eProsima_user_DllExport void my_octet( + uint8_t _my_octet); + + /*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ + eProsima_user_DllExport uint8_t my_octet() const; + + /*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ + eProsima_user_DllExport uint8_t& my_octet(); + + + /*! + * @brief This function sets a value in member my_int16 + * @param _my_int16 New value for member my_int16 + */ + eProsima_user_DllExport void my_int16( + int16_t _my_int16); + + /*! + * @brief This function returns the value of member my_int16 + * @return Value of member my_int16 + */ + eProsima_user_DllExport int16_t my_int16() const; + + /*! + * @brief This function returns a reference to member my_int16 + * @return Reference to member my_int16 + */ + eProsima_user_DllExport int16_t& my_int16(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function sets a value in member my_int64 + * @param _my_int64 New value for member my_int64 + */ + eProsima_user_DllExport void my_int64( + int64_t _my_int64); + + /*! + * @brief This function returns the value of member my_int64 + * @return Value of member my_int64 + */ + eProsima_user_DllExport int64_t my_int64() const; + + /*! + * @brief This function returns a reference to member my_int64 + * @return Reference to member my_int64 + */ + eProsima_user_DllExport int64_t& my_int64(); + + + /*! + * @brief This function sets a value in member my_uint16 + * @param _my_uint16 New value for member my_uint16 + */ + eProsima_user_DllExport void my_uint16( + uint16_t _my_uint16); + + /*! + * @brief This function returns the value of member my_uint16 + * @return Value of member my_uint16 + */ + eProsima_user_DllExport uint16_t my_uint16() const; + + /*! + * @brief This function returns a reference to member my_uint16 + * @return Reference to member my_uint16 + */ + eProsima_user_DllExport uint16_t& my_uint16(); + + + /*! + * @brief This function sets a value in member my_uint32 + * @param _my_uint32 New value for member my_uint32 + */ + eProsima_user_DllExport void my_uint32( + uint32_t _my_uint32); + + /*! + * @brief This function returns the value of member my_uint32 + * @return Value of member my_uint32 + */ + eProsima_user_DllExport uint32_t my_uint32() const; + + /*! + * @brief This function returns a reference to member my_uint32 + * @return Reference to member my_uint32 + */ + eProsima_user_DllExport uint32_t& my_uint32(); + + + /*! + * @brief This function sets a value in member my_uint64 + * @param _my_uint64 New value for member my_uint64 + */ + eProsima_user_DllExport void my_uint64( + uint64_t _my_uint64); + + /*! + * @brief This function returns the value of member my_uint64 + * @return Value of member my_uint64 + */ + eProsima_user_DllExport uint64_t my_uint64() const; + + /*! + * @brief This function returns a reference to member my_uint64 + * @return Reference to member my_uint64 + */ + eProsima_user_DllExport uint64_t& my_uint64(); + + + /*! + * @brief This function sets a value in member my_float32 + * @param _my_float32 New value for member my_float32 + */ + eProsima_user_DllExport void my_float32( + float _my_float32); + + /*! + * @brief This function returns the value of member my_float32 + * @return Value of member my_float32 + */ + eProsima_user_DllExport float my_float32() const; + + /*! + * @brief This function returns a reference to member my_float32 + * @return Reference to member my_float32 + */ + eProsima_user_DllExport float& my_float32(); + + + /*! + * @brief This function sets a value in member my_float64 + * @param _my_float64 New value for member my_float64 + */ + eProsima_user_DllExport void my_float64( + double _my_float64); + + /*! + * @brief This function returns the value of member my_float64 + * @return Value of member my_float64 + */ + eProsima_user_DllExport double my_float64() const; + + /*! + * @brief This function returns a reference to member my_float64 + * @return Reference to member my_float64 + */ + eProsima_user_DllExport double& my_float64(); + + + /*! + * @brief This function sets a value in member my_float128 + * @param _my_float128 New value for member my_float128 + */ + eProsima_user_DllExport void my_float128( + long double _my_float128); + + /*! + * @brief This function returns the value of member my_float128 + * @return Value of member my_float128 + */ + eProsima_user_DllExport long double my_float128() const; + + /*! + * @brief This function returns a reference to member my_float128 + * @return Reference to member my_float128 + */ + eProsima_user_DllExport long double& my_float128(); + + + /*! + * @brief This function sets a value in member my_char + * @param _my_char New value for member my_char + */ + eProsima_user_DllExport void my_char( + char _my_char); + + /*! + * @brief This function returns the value of member my_char + * @return Value of member my_char + */ + eProsima_user_DllExport char my_char() const; + + /*! + * @brief This function returns a reference to member my_char + * @return Reference to member my_char + */ + eProsima_user_DllExport char& my_char(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + uint8_t m_my_octet; + int16_t m_my_int16; + int32_t m_my_int32; + int64_t m_my_int64; + uint16_t m_my_uint16; + uint32_t m_my_uint32; + uint64_t m_my_uint64; + float m_my_float32; + double m_my_float64; + long double m_my_float128; + char m_my_char; + std::string m_my_string; + +}; + +typedef std::array MyOctetArray500; + +typedef std::array BSAlias5; + +typedef std::array MA3; + +typedef std::array MyMiniArray; + + + +typedef std::vector MySequenceLong; + + + +/*! + * @brief This class represents the structure ComplexStruct defined by the user in the IDL file. + * @ingroup Test + */ +class ComplexStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ComplexStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ComplexStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ComplexStruct that will be copied. + */ + eProsima_user_DllExport ComplexStruct( + const ComplexStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ComplexStruct that will be copied. + */ + eProsima_user_DllExport ComplexStruct( + ComplexStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ComplexStruct that will be copied. + */ + eProsima_user_DllExport ComplexStruct& operator =( + const ComplexStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ComplexStruct that will be copied. + */ + eProsima_user_DllExport ComplexStruct& operator =( + ComplexStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ComplexStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ComplexStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ComplexStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ComplexStruct& x) const; + + /*! + * @brief This function sets a value in member my_octet + * @param _my_octet New value for member my_octet + */ + eProsima_user_DllExport void my_octet( + uint8_t _my_octet); + + /*! + * @brief This function returns the value of member my_octet + * @return Value of member my_octet + */ + eProsima_user_DllExport uint8_t my_octet() const; + + /*! + * @brief This function returns a reference to member my_octet + * @return Reference to member my_octet + */ + eProsima_user_DllExport uint8_t& my_octet(); + + + /*! + * @brief This function copies the value in member my_basic_struct + * @param _my_basic_struct New value to be copied in member my_basic_struct + */ + eProsima_user_DllExport void my_basic_struct( + const BasicStruct& _my_basic_struct); + + /*! + * @brief This function moves the value in member my_basic_struct + * @param _my_basic_struct New value to be moved in member my_basic_struct + */ + eProsima_user_DllExport void my_basic_struct( + BasicStruct&& _my_basic_struct); + + /*! + * @brief This function returns a constant reference to member my_basic_struct + * @return Constant reference to member my_basic_struct + */ + eProsima_user_DllExport const BasicStruct& my_basic_struct() const; + + /*! + * @brief This function returns a reference to member my_basic_struct + * @return Reference to member my_basic_struct + */ + eProsima_user_DllExport BasicStruct& my_basic_struct(); + + + /*! + * @brief This function sets a value in member my_alias_enum + * @param _my_alias_enum New value for member my_alias_enum + */ + eProsima_user_DllExport void my_alias_enum( + MyAliasEnum _my_alias_enum); + + /*! + * @brief This function returns the value of member my_alias_enum + * @return Value of member my_alias_enum + */ + eProsima_user_DllExport MyAliasEnum my_alias_enum() const; + + /*! + * @brief This function returns a reference to member my_alias_enum + * @return Reference to member my_alias_enum + */ + eProsima_user_DllExport MyAliasEnum& my_alias_enum(); + + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyEnum& my_enum(); + + + /*! + * @brief This function copies the value in member my_sequence_octet + * @param _my_sequence_octet New value to be copied in member my_sequence_octet + */ + eProsima_user_DllExport void my_sequence_octet( + const std::vector& _my_sequence_octet); + + /*! + * @brief This function moves the value in member my_sequence_octet + * @param _my_sequence_octet New value to be moved in member my_sequence_octet + */ + eProsima_user_DllExport void my_sequence_octet( + std::vector&& _my_sequence_octet); + + /*! + * @brief This function returns a constant reference to member my_sequence_octet + * @return Constant reference to member my_sequence_octet + */ + eProsima_user_DllExport const std::vector& my_sequence_octet() const; + + /*! + * @brief This function returns a reference to member my_sequence_octet + * @return Reference to member my_sequence_octet + */ + eProsima_user_DllExport std::vector& my_sequence_octet(); + + + /*! + * @brief This function copies the value in member my_sequence_struct + * @param _my_sequence_struct New value to be copied in member my_sequence_struct + */ + eProsima_user_DllExport void my_sequence_struct( + const std::vector& _my_sequence_struct); + + /*! + * @brief This function moves the value in member my_sequence_struct + * @param _my_sequence_struct New value to be moved in member my_sequence_struct + */ + eProsima_user_DllExport void my_sequence_struct( + std::vector&& _my_sequence_struct); + + /*! + * @brief This function returns a constant reference to member my_sequence_struct + * @return Constant reference to member my_sequence_struct + */ + eProsima_user_DllExport const std::vector& my_sequence_struct() const; + + /*! + * @brief This function returns a reference to member my_sequence_struct + * @return Reference to member my_sequence_struct + */ + eProsima_user_DllExport std::vector& my_sequence_struct(); + + + /*! + * @brief This function copies the value in member my_array_octet + * @param _my_array_octet New value to be copied in member my_array_octet + */ + eProsima_user_DllExport void my_array_octet( + const std::array, 5>, 500>& _my_array_octet); + + /*! + * @brief This function moves the value in member my_array_octet + * @param _my_array_octet New value to be moved in member my_array_octet + */ + eProsima_user_DllExport void my_array_octet( + std::array, 5>, 500>&& _my_array_octet); + + /*! + * @brief This function returns a constant reference to member my_array_octet + * @return Constant reference to member my_array_octet + */ + eProsima_user_DllExport const std::array, 5>, 500>& my_array_octet() const; + + /*! + * @brief This function returns a reference to member my_array_octet + * @return Reference to member my_array_octet + */ + eProsima_user_DllExport std::array, 5>, 500>& my_array_octet(); + + + /*! + * @brief This function copies the value in member my_octet_array_500 + * @param _my_octet_array_500 New value to be copied in member my_octet_array_500 + */ + eProsima_user_DllExport void my_octet_array_500( + const MyOctetArray500& _my_octet_array_500); + + /*! + * @brief This function moves the value in member my_octet_array_500 + * @param _my_octet_array_500 New value to be moved in member my_octet_array_500 + */ + eProsima_user_DllExport void my_octet_array_500( + MyOctetArray500&& _my_octet_array_500); + + /*! + * @brief This function returns a constant reference to member my_octet_array_500 + * @return Constant reference to member my_octet_array_500 + */ + eProsima_user_DllExport const MyOctetArray500& my_octet_array_500() const; + + /*! + * @brief This function returns a reference to member my_octet_array_500 + * @return Reference to member my_octet_array_500 + */ + eProsima_user_DllExport MyOctetArray500& my_octet_array_500(); + + + /*! + * @brief This function copies the value in member my_array_struct + * @param _my_array_struct New value to be copied in member my_array_struct + */ + eProsima_user_DllExport void my_array_struct( + const std::array& _my_array_struct); + + /*! + * @brief This function moves the value in member my_array_struct + * @param _my_array_struct New value to be moved in member my_array_struct + */ + eProsima_user_DllExport void my_array_struct( + std::array&& _my_array_struct); + + /*! + * @brief This function returns a constant reference to member my_array_struct + * @return Constant reference to member my_array_struct + */ + eProsima_user_DllExport const std::array& my_array_struct() const; + + /*! + * @brief This function returns a reference to member my_array_struct + * @return Reference to member my_array_struct + */ + eProsima_user_DllExport std::array& my_array_struct(); + + + /*! + * @brief This function copies the value in member my_map_octet_short + * @param _my_map_octet_short New value to be copied in member my_map_octet_short + */ + eProsima_user_DllExport void my_map_octet_short( + const std::map& _my_map_octet_short); + + /*! + * @brief This function moves the value in member my_map_octet_short + * @param _my_map_octet_short New value to be moved in member my_map_octet_short + */ + eProsima_user_DllExport void my_map_octet_short( + std::map&& _my_map_octet_short); + + /*! + * @brief This function returns a constant reference to member my_map_octet_short + * @return Constant reference to member my_map_octet_short + */ + eProsima_user_DllExport const std::map& my_map_octet_short() const; + + /*! + * @brief This function returns a reference to member my_map_octet_short + * @return Reference to member my_map_octet_short + */ + eProsima_user_DllExport std::map& my_map_octet_short(); + + + /*! + * @brief This function copies the value in member my_map_long_struct + * @param _my_map_long_struct New value to be copied in member my_map_long_struct + */ + eProsima_user_DllExport void my_map_long_struct( + const std::map& _my_map_long_struct); + + /*! + * @brief This function moves the value in member my_map_long_struct + * @param _my_map_long_struct New value to be moved in member my_map_long_struct + */ + eProsima_user_DllExport void my_map_long_struct( + std::map&& _my_map_long_struct); + + /*! + * @brief This function returns a constant reference to member my_map_long_struct + * @return Constant reference to member my_map_long_struct + */ + eProsima_user_DllExport const std::map& my_map_long_struct() const; + + /*! + * @brief This function returns a reference to member my_map_long_struct + * @return Reference to member my_map_long_struct + */ + eProsima_user_DllExport std::map& my_map_long_struct(); + + + /*! + * @brief This function copies the value in member my_map_long_seq_octet + * @param _my_map_long_seq_octet New value to be copied in member my_map_long_seq_octet + */ + eProsima_user_DllExport void my_map_long_seq_octet( + const std::map>>& _my_map_long_seq_octet); + + /*! + * @brief This function moves the value in member my_map_long_seq_octet + * @param _my_map_long_seq_octet New value to be moved in member my_map_long_seq_octet + */ + eProsima_user_DllExport void my_map_long_seq_octet( + std::map>>&& _my_map_long_seq_octet); + + /*! + * @brief This function returns a constant reference to member my_map_long_seq_octet + * @return Constant reference to member my_map_long_seq_octet + */ + eProsima_user_DllExport const std::map>>& my_map_long_seq_octet() const; + + /*! + * @brief This function returns a reference to member my_map_long_seq_octet + * @return Reference to member my_map_long_seq_octet + */ + eProsima_user_DllExport std::map>>& my_map_long_seq_octet(); + + + /*! + * @brief This function copies the value in member my_map_long_octet_array_500 + * @param _my_map_long_octet_array_500 New value to be copied in member my_map_long_octet_array_500 + */ + eProsima_user_DllExport void my_map_long_octet_array_500( + const std::map& _my_map_long_octet_array_500); + + /*! + * @brief This function moves the value in member my_map_long_octet_array_500 + * @param _my_map_long_octet_array_500 New value to be moved in member my_map_long_octet_array_500 + */ + eProsima_user_DllExport void my_map_long_octet_array_500( + std::map&& _my_map_long_octet_array_500); + + /*! + * @brief This function returns a constant reference to member my_map_long_octet_array_500 + * @return Constant reference to member my_map_long_octet_array_500 + */ + eProsima_user_DllExport const std::map& my_map_long_octet_array_500() const; + + /*! + * @brief This function returns a reference to member my_map_long_octet_array_500 + * @return Reference to member my_map_long_octet_array_500 + */ + eProsima_user_DllExport std::map& my_map_long_octet_array_500(); + + + /*! + * @brief This function copies the value in member my_map_long_lol_type + * @param _my_map_long_lol_type New value to be copied in member my_map_long_lol_type + */ + eProsima_user_DllExport void my_map_long_lol_type( + const std::map>& _my_map_long_lol_type); + + /*! + * @brief This function moves the value in member my_map_long_lol_type + * @param _my_map_long_lol_type New value to be moved in member my_map_long_lol_type + */ + eProsima_user_DllExport void my_map_long_lol_type( + std::map>&& _my_map_long_lol_type); + + /*! + * @brief This function returns a constant reference to member my_map_long_lol_type + * @return Constant reference to member my_map_long_lol_type + */ + eProsima_user_DllExport const std::map>& my_map_long_lol_type() const; + + /*! + * @brief This function returns a reference to member my_map_long_lol_type + * @return Reference to member my_map_long_lol_type + */ + eProsima_user_DllExport std::map>& my_map_long_lol_type(); + + + /*! + * @brief This function copies the value in member my_small_string_8 + * @param _my_small_string_8 New value to be copied in member my_small_string_8 + */ + eProsima_user_DllExport void my_small_string_8( + const eprosima::fastrtps::fixed_string<128>& _my_small_string_8); + + /*! + * @brief This function moves the value in member my_small_string_8 + * @param _my_small_string_8 New value to be moved in member my_small_string_8 + */ + eProsima_user_DllExport void my_small_string_8( + eprosima::fastrtps::fixed_string<128>&& _my_small_string_8); + + /*! + * @brief This function returns a constant reference to member my_small_string_8 + * @return Constant reference to member my_small_string_8 + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<128>& my_small_string_8() const; + + /*! + * @brief This function returns a reference to member my_small_string_8 + * @return Reference to member my_small_string_8 + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<128>& my_small_string_8(); + + + /*! + * @brief This function copies the value in member my_large_string_8 + * @param _my_large_string_8 New value to be copied in member my_large_string_8 + */ + eProsima_user_DllExport void my_large_string_8( + const eprosima::fastrtps::fixed_string<500>& _my_large_string_8); + + /*! + * @brief This function moves the value in member my_large_string_8 + * @param _my_large_string_8 New value to be moved in member my_large_string_8 + */ + eProsima_user_DllExport void my_large_string_8( + eprosima::fastrtps::fixed_string<500>&& _my_large_string_8); + + /*! + * @brief This function returns a constant reference to member my_large_string_8 + * @return Constant reference to member my_large_string_8 + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<500>& my_large_string_8() const; + + /*! + * @brief This function returns a reference to member my_large_string_8 + * @return Reference to member my_large_string_8 + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<500>& my_large_string_8(); + + + /*! + * @brief This function copies the value in member my_array_string + * @param _my_array_string New value to be copied in member my_array_string + */ + eProsima_user_DllExport void my_array_string( + const std::array, 5>, 5>& _my_array_string); + + /*! + * @brief This function moves the value in member my_array_string + * @param _my_array_string New value to be moved in member my_array_string + */ + eProsima_user_DllExport void my_array_string( + std::array, 5>, 5>&& _my_array_string); + + /*! + * @brief This function returns a constant reference to member my_array_string + * @return Constant reference to member my_array_string + */ + eProsima_user_DllExport const std::array, 5>, 5>& my_array_string() const; + + /*! + * @brief This function returns a reference to member my_array_string + * @return Reference to member my_array_string + */ + eProsima_user_DllExport std::array, 5>, 5>& my_array_string(); + + + /*! + * @brief This function copies the value in member multi_alias_array_42 + * @param _multi_alias_array_42 New value to be copied in member multi_alias_array_42 + */ + eProsima_user_DllExport void multi_alias_array_42( + const MA3& _multi_alias_array_42); + + /*! + * @brief This function moves the value in member multi_alias_array_42 + * @param _multi_alias_array_42 New value to be moved in member multi_alias_array_42 + */ + eProsima_user_DllExport void multi_alias_array_42( + MA3&& _multi_alias_array_42); + + /*! + * @brief This function returns a constant reference to member multi_alias_array_42 + * @return Constant reference to member multi_alias_array_42 + */ + eProsima_user_DllExport const MA3& multi_alias_array_42() const; + + /*! + * @brief This function returns a reference to member multi_alias_array_42 + * @return Reference to member multi_alias_array_42 + */ + eProsima_user_DllExport MA3& multi_alias_array_42(); + + + /*! + * @brief This function copies the value in member my_array_arrays + * @param _my_array_arrays New value to be copied in member my_array_arrays + */ + eProsima_user_DllExport void my_array_arrays( + const std::array& _my_array_arrays); + + /*! + * @brief This function moves the value in member my_array_arrays + * @param _my_array_arrays New value to be moved in member my_array_arrays + */ + eProsima_user_DllExport void my_array_arrays( + std::array&& _my_array_arrays); + + /*! + * @brief This function returns a constant reference to member my_array_arrays + * @return Constant reference to member my_array_arrays + */ + eProsima_user_DllExport const std::array& my_array_arrays() const; + + /*! + * @brief This function returns a reference to member my_array_arrays + * @return Reference to member my_array_arrays + */ + eProsima_user_DllExport std::array& my_array_arrays(); + + + /*! + * @brief This function copies the value in member my_sequences_array + * @param _my_sequences_array New value to be copied in member my_sequences_array + */ + eProsima_user_DllExport void my_sequences_array( + const std::array& _my_sequences_array); + + /*! + * @brief This function moves the value in member my_sequences_array + * @param _my_sequences_array New value to be moved in member my_sequences_array + */ + eProsima_user_DllExport void my_sequences_array( + std::array&& _my_sequences_array); + + /*! + * @brief This function returns a constant reference to member my_sequences_array + * @return Constant reference to member my_sequences_array + */ + eProsima_user_DllExport const std::array& my_sequences_array() const; + + /*! + * @brief This function returns a reference to member my_sequences_array + * @return Reference to member my_sequences_array + */ + eProsima_user_DllExport std::array& my_sequences_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ComplexStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_my_octet; + BasicStruct m_my_basic_struct; + MyAliasEnum m_my_alias_enum; + MyEnum m_my_enum; + std::vector m_my_sequence_octet; + std::vector m_my_sequence_struct; + std::array, 5>, 500> m_my_array_octet; + MyOctetArray500 m_my_octet_array_500; + std::array m_my_array_struct; + std::map m_my_map_octet_short; + std::map m_my_map_long_struct; + std::map>> m_my_map_long_seq_octet; + std::map m_my_map_long_octet_array_500; + std::map> m_my_map_long_lol_type; + eprosima::fastrtps::fixed_string<128> m_my_small_string_8; + eprosima::fastrtps::fixed_string<500> m_my_large_string_8; + std::array, 5>, 5> m_my_array_string; + MA3 m_multi_alias_array_42; + std::array m_my_array_arrays; + std::array m_my_sequences_array; + +}; + + + +/*! + * @brief This class represents the union MyUnion defined by the user in the IDL file. + * @ingroup Test + */ +class MyUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyUnion that will be copied. + */ + eProsima_user_DllExport MyUnion( + const MyUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyUnion that will be copied. + */ + eProsima_user_DllExport MyUnion( + MyUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyUnion that will be copied. + */ + eProsima_user_DllExport MyUnion& operator =( + const MyUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyUnion that will be copied. + */ + eProsima_user_DllExport MyUnion& operator =( + MyUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x MyUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + MyEnum __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport MyEnum _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport MyEnum& _d(); + + /*! + * @brief This function copies the value in member basic + * @param _basic New value to be copied in member basic + */ + eProsima_user_DllExport void basic( + const BasicStruct& _basic); + + /*! + * @brief This function moves the value in member basic + * @param _basic New value to be moved in member basic + */ + eProsima_user_DllExport void basic( + BasicStruct&& _basic); + + /*! + * @brief This function returns a constant reference to member basic + * @return Constant reference to member basic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const BasicStruct& basic() const; + + /*! + * @brief This function returns a reference to member basic + * @return Reference to member basic + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport BasicStruct& basic(); + + + /*! + * @brief This function copies the value in member complex + * @param _complex New value to be copied in member complex + */ + eProsima_user_DllExport void complex( + const ComplexStruct& _complex); + + /*! + * @brief This function moves the value in member complex + * @param _complex New value to be moved in member complex + */ + eProsima_user_DllExport void complex( + ComplexStruct&& _complex); + + /*! + * @brief This function returns a constant reference to member complex + * @return Constant reference to member complex + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const ComplexStruct& complex() const; + + /*! + * @brief This function returns a reference to member complex + * @return Reference to member complex + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport ComplexStruct& complex(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + MyEnum m__d; + + BasicStruct m_basic; + ComplexStruct m_complex; +}; + + + +/*! + * @brief This class represents the union MyUnion2 defined by the user in the IDL file. + * @ingroup Test + */ +class MyUnion2 +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyUnion2(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyUnion2(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyUnion2 that will be copied. + */ + eProsima_user_DllExport MyUnion2( + const MyUnion2& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyUnion2 that will be copied. + */ + eProsima_user_DllExport MyUnion2( + MyUnion2&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyUnion2 that will be copied. + */ + eProsima_user_DllExport MyUnion2& operator =( + const MyUnion2& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyUnion2 that will be copied. + */ + eProsima_user_DllExport MyUnion2& operator =( + MyUnion2&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyUnion2 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyUnion2& x) const; + + /*! + * @brief Comparison operator. + * @param x MyUnion2 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyUnion2& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport uint8_t& _d(); + + /*! + * @brief This function sets a value in member uno + * @param _uno New value for member uno + */ + eProsima_user_DllExport void uno( + int32_t _uno); + + /*! + * @brief This function returns the value of member uno + * @return Value of member uno + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t uno() const; + + /*! + * @brief This function returns a reference to member uno + * @return Reference to member uno + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& uno(); + + + /*! + * @brief This function copies the value in member imString + * @param _imString New value to be copied in member imString + */ + eProsima_user_DllExport void imString( + const std::string& _imString); + + /*! + * @brief This function moves the value in member imString + * @param _imString New value to be moved in member imString + */ + eProsima_user_DllExport void imString( + std::string&& _imString); + + /*! + * @brief This function returns a constant reference to member imString + * @return Constant reference to member imString + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::string& imString() const; + + /*! + * @brief This function returns a reference to member imString + * @return Reference to member imString + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::string& imString(); + + + /*! + * @brief This function sets a value in member tres + * @param _tres New value for member tres + */ + eProsima_user_DllExport void tres( + int32_t _tres); + + /*! + * @brief This function returns the value of member tres + * @return Value of member tres + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t tres() const; + + /*! + * @brief This function returns a reference to member tres + * @return Reference to member tres + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& tres(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyUnion2& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + uint8_t m__d; + + int32_t m_uno; + std::string m_imString; + int32_t m_tres; +}; + + + +/*! + * @brief This class represents the structure CompleteStruct defined by the user in the IDL file. + * @ingroup Test + */ +class CompleteStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStruct that will be copied. + */ + eProsima_user_DllExport CompleteStruct( + const CompleteStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStruct that will be copied. + */ + eProsima_user_DllExport CompleteStruct( + CompleteStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStruct that will be copied. + */ + eProsima_user_DllExport CompleteStruct& operator =( + const CompleteStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStruct that will be copied. + */ + eProsima_user_DllExport CompleteStruct& operator =( + CompleteStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x CompleteStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x CompleteStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const MyUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + MyUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const MyUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport MyUnion& my_union(); + + + /*! + * @brief This function copies the value in member my_union_2 + * @param _my_union_2 New value to be copied in member my_union_2 + */ + eProsima_user_DllExport void my_union_2( + const MyUnion2& _my_union_2); + + /*! + * @brief This function moves the value in member my_union_2 + * @param _my_union_2 New value to be moved in member my_union_2 + */ + eProsima_user_DllExport void my_union_2( + MyUnion2&& _my_union_2); + + /*! + * @brief This function returns a constant reference to member my_union_2 + * @return Constant reference to member my_union_2 + */ + eProsima_user_DllExport const MyUnion2& my_union_2() const; + + /*! + * @brief This function returns a reference to member my_union_2 + * @return Reference to member my_union_2 + */ + eProsima_user_DllExport MyUnion2& my_union_2(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const CompleteStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyUnion m_my_union; + MyUnion2 m_my_union_2; + +}; + + + +/*! + * @brief This class represents the structure KeyedStruct defined by the user in the IDL file. + * @ingroup Test + */ +class KeyedStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport KeyedStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~KeyedStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object KeyedStruct that will be copied. + */ + eProsima_user_DllExport KeyedStruct( + const KeyedStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object KeyedStruct that will be copied. + */ + eProsima_user_DllExport KeyedStruct( + KeyedStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object KeyedStruct that will be copied. + */ + eProsima_user_DllExport KeyedStruct& operator =( + const KeyedStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object KeyedStruct that will be copied. + */ + eProsima_user_DllExport KeyedStruct& operator =( + KeyedStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x KeyedStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const KeyedStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x KeyedStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const KeyedStruct& x) const; + + /*! + * @brief This function sets a value in member key + * @param _key New value for member key + */ + eProsima_user_DllExport void key( + uint8_t _key); + + /*! + * @brief This function returns the value of member key + * @return Value of member key + */ + eProsima_user_DllExport uint8_t key() const; + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport uint8_t& key(); + + + /*! + * @brief This function copies the value in member basic + * @param _basic New value to be copied in member basic + */ + eProsima_user_DllExport void basic( + const BasicStruct& _basic); + + /*! + * @brief This function moves the value in member basic + * @param _basic New value to be moved in member basic + */ + eProsima_user_DllExport void basic( + BasicStruct&& _basic); + + /*! + * @brief This function returns a constant reference to member basic + * @return Constant reference to member basic + */ + eProsima_user_DllExport const BasicStruct& basic() const; + + /*! + * @brief This function returns a reference to member basic + * @return Reference to member basic + */ + eProsima_user_DllExport BasicStruct& basic(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const KeyedStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_key; + BasicStruct m_basic; + +}; + + +#endif // _FAST_DDS_GENERATED_TEST_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.cxx b/test/unittest/dynamic_types/idl/new_features_4_2.cxx index bf52affd983..17bb0eb11e5 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2.cxx +++ b/test/unittest/dynamic_types/idl/new_features_4_2.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "new_features_4_2.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "new_features_4_2TypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + NewAliases::NewAliases() { - // Just to register all known types registernew_features_4_2Types(); } @@ -90,7 +94,6 @@ NewAliases& NewAliases::operator =( m_int64_ = x.m_int64_; m_uint64_ = x.m_uint64_; m_local_string = x.m_local_string; - return *this; } @@ -107,7 +110,6 @@ NewAliases& NewAliases::operator =( m_int64_ = x.m_int64_; m_uint64_ = x.m_uint64_; m_local_string = std::move(x.m_local_string); - return *this; } @@ -402,6 +404,8 @@ std::string& NewAliases::local_string() } + + WCharUnion::WCharUnion() { m__d = 'a'; @@ -560,6 +564,8 @@ void WCharUnion::_d( } break; + default: + break; } if (!b) @@ -682,6 +688,8 @@ int32_t& WCharUnion::case_one() } + + OctetUnion::OctetUnion() { m__d = 5; @@ -840,6 +848,8 @@ void OctetUnion::_d( } break; + default: + break; } if (!b) @@ -962,6 +972,8 @@ int32_t& OctetUnion::case_seven() } + + Int8Union::Int8Union() { m__d = 3; @@ -1120,6 +1132,8 @@ void Int8Union::_d( } break; + default: + break; } if (!b) @@ -1242,26 +1256,28 @@ int32_t& Int8Union::case_six() } -bitmodule::ParentBitset::ParentBitset(){ +namespace bitmodule { + +ParentBitset::ParentBitset(){ // Just to register all known types registernew_features_4_2Types(); } -bitmodule::ParentBitset::~ParentBitset() +ParentBitset::~ParentBitset() { } -bitmodule::ParentBitset::ParentBitset( +ParentBitset::ParentBitset( const ParentBitset& x){ m_bitset = x.m_bitset; } -bitmodule::ParentBitset::ParentBitset( +ParentBitset::ParentBitset( ParentBitset&& x) noexcept { m_bitset = x.m_bitset; } -bitmodule::ParentBitset& bitmodule::ParentBitset::operator =( +ParentBitset& ParentBitset::operator =( const ParentBitset& x) { @@ -1270,7 +1286,7 @@ bitmodule::ParentBitset& bitmodule::ParentBitset::operator =( return *this; } -bitmodule::ParentBitset& bitmodule::ParentBitset::operator =( +ParentBitset& ParentBitset::operator =( ParentBitset&& x) noexcept { @@ -1279,21 +1295,21 @@ bitmodule::ParentBitset& bitmodule::ParentBitset::operator =( return *this; } -bool bitmodule::ParentBitset::operator ==( +bool ParentBitset::operator ==( const ParentBitset& x) const { return m_bitset == x.m_bitset; } -bool bitmodule::ParentBitset::operator !=( +bool ParentBitset::operator !=( const ParentBitset& x) const { return !(*this == x); } -void bitmodule::ParentBitset::parent_bitfield( +void ParentBitset::parent_bitfield( uint32_t _parent_bitfield) { int base = 0; @@ -1306,7 +1322,7 @@ void bitmodule::ParentBitset::parent_bitfield( } -uint32_t bitmodule::ParentBitset::parent_bitfield() const +uint32_t ParentBitset::parent_bitfield() const { int base = 0; int size = 17; @@ -1320,85 +1336,84 @@ uint32_t bitmodule::ParentBitset::parent_bitfield() const } -std::bitset<17> bitmodule::ParentBitset::bitset() const +std::bitset<17> ParentBitset::bitset() const { std::string str_value; - str_value = m_bitset.to_string() + str_value; return std::bitset<17>(str_value); } -void bitmodule::ParentBitset::bitset(const std::bitset<17>& bitset) +void ParentBitset::bitset( + const std::bitset<17>& bitset) { std::string str_value {bitset.to_string()}; size_t base_diff {0}; size_t last_post {std::string::npos}; - base_diff += 17; m_bitset = std::bitset<17>(str_value.substr(str_value.length() - base_diff, last_post)); } -bitmodule::MyBitset::MyBitset() - : bitmodule::ParentBitset() { +MyBitset::MyBitset() + : bitmodule::ParentBitset(){ // Just to register all known types registernew_features_4_2Types(); } -bitmodule::MyBitset::~MyBitset() +MyBitset::~MyBitset() { } -bitmodule::MyBitset::MyBitset( +MyBitset::MyBitset( const MyBitset& x) - : bitmodule::ParentBitset(x) { + : bitmodule::ParentBitset(x){ m_bitset = x.m_bitset; } -bitmodule::MyBitset::MyBitset( +MyBitset::MyBitset( MyBitset&& x) noexcept - : bitmodule::ParentBitset(std::move(x)) { + : bitmodule::ParentBitset(std::move(x)){ m_bitset = x.m_bitset; } -bitmodule::MyBitset& bitmodule::MyBitset::operator =( +MyBitset& MyBitset::operator =( const MyBitset& x) { - bitmodule::ParentBitset::operator =(x); + bitmodule::ParentBitset::operator =(x); m_bitset = x.m_bitset; return *this; } -bitmodule::MyBitset& bitmodule::MyBitset::operator =( +MyBitset& MyBitset::operator =( MyBitset&& x) noexcept { - bitmodule::ParentBitset::operator =(std::move(x)); + bitmodule::ParentBitset::operator =(std::move(x)); m_bitset = x.m_bitset; return *this; } -bool bitmodule::MyBitset::operator ==( +bool MyBitset::operator ==( const MyBitset& x) const { - if (bitmodule::ParentBitset::operator !=(x)) return false; + if (bitmodule::ParentBitset::operator !=(x)) return false; return m_bitset == x.m_bitset; } -bool bitmodule::MyBitset::operator !=( +bool MyBitset::operator !=( const MyBitset& x) const { return !(*this == x); } -void bitmodule::MyBitset::a( +void MyBitset::a( char _a) { int base = 0; @@ -1411,7 +1426,7 @@ void bitmodule::MyBitset::a( } -char bitmodule::MyBitset::a() const +char MyBitset::a() const { int base = 0; int size = 3; @@ -1425,14 +1440,14 @@ char bitmodule::MyBitset::a() const } -void bitmodule::MyBitset::b( +void MyBitset::b( bool _b) { int base = 3; m_bitset.set(base, _b); } -bool bitmodule::MyBitset::b() const +bool MyBitset::b() const { int base = 3; return m_bitset.test(base); @@ -1440,7 +1455,7 @@ bool bitmodule::MyBitset::b() const -void bitmodule::MyBitset::c( +void MyBitset::c( uint16_t _c) { int base = 8; @@ -1453,7 +1468,7 @@ void bitmodule::MyBitset::c( } -uint16_t bitmodule::MyBitset::c() const +uint16_t MyBitset::c() const { int base = 8; int size = 10; @@ -1467,7 +1482,7 @@ uint16_t bitmodule::MyBitset::c() const } -void bitmodule::MyBitset::d( +void MyBitset::d( int16_t _d) { int base = 18; @@ -1480,7 +1495,7 @@ void bitmodule::MyBitset::d( } -int16_t bitmodule::MyBitset::d() const +int16_t MyBitset::d() const { int base = 18; int size = 5; @@ -1494,7 +1509,7 @@ int16_t bitmodule::MyBitset::d() const } -void bitmodule::MyBitset::e( +void MyBitset::e( int16_t _e) { int base = 23; @@ -1507,7 +1522,7 @@ void bitmodule::MyBitset::e( } -int16_t bitmodule::MyBitset::e() const +int16_t MyBitset::e() const { int base = 23; int size = 5; @@ -1521,7 +1536,7 @@ int16_t bitmodule::MyBitset::e() const } -void bitmodule::MyBitset::f( +void MyBitset::f( int16_t _f) { int base = 28; @@ -1534,7 +1549,7 @@ void bitmodule::MyBitset::f( } -int16_t bitmodule::MyBitset::f() const +int16_t MyBitset::f() const { int base = 28; int size = 5; @@ -1548,90 +1563,88 @@ int16_t bitmodule::MyBitset::f() const } -std::bitset<50> bitmodule::MyBitset::bitset() const +std::bitset<50> MyBitset::bitset() const { std::string str_value; - str_value = static_cast(this)->bitset().to_string() + str_value; - + str_value = static_cast(this)->bitset().to_string() + str_value; str_value = m_bitset.to_string() + str_value; return std::bitset<50>(str_value); } -void bitmodule::MyBitset::bitset(const std::bitset<50>& bitset) +void MyBitset::bitset( + const std::bitset<50>& bitset) { std::string str_value {bitset.to_string()}; size_t base_diff {0}; size_t last_post {std::string::npos}; - { - base_diff += 17; - std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); - static_cast(this)->bitset(internal_bitset); - last_post = base_diff; - } - + { + base_diff += 17; + std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); + static_cast(this)->bitset(internal_bitset); + last_post = base_diff; + } base_diff += 33; m_bitset = std::bitset<33>(str_value.substr(str_value.length() - base_diff, last_post)); } -bitmodule::BitsetBitmask::BitsetBitmask() -{ + +BitsetBitmask::BitsetBitmask() +{ // Just to register all known types registernew_features_4_2Types(); } -bitmodule::BitsetBitmask::~BitsetBitmask() +BitsetBitmask::~BitsetBitmask() { } -bitmodule::BitsetBitmask::BitsetBitmask( +BitsetBitmask::BitsetBitmask( const BitsetBitmask& x) { m_mybitset = x.m_mybitset; m_mybitmask = x.m_mybitmask; } -bitmodule::BitsetBitmask::BitsetBitmask( +BitsetBitmask::BitsetBitmask( BitsetBitmask&& x) noexcept { m_mybitset = std::move(x.m_mybitset); m_mybitmask = std::move(x.m_mybitmask); } -bitmodule::BitsetBitmask& bitmodule::BitsetBitmask::operator =( +BitsetBitmask& BitsetBitmask::operator =( const BitsetBitmask& x) { m_mybitset = x.m_mybitset; m_mybitmask = x.m_mybitmask; - return *this; } -bitmodule::BitsetBitmask& bitmodule::BitsetBitmask::operator =( +BitsetBitmask& BitsetBitmask::operator =( BitsetBitmask&& x) noexcept { m_mybitset = std::move(x.m_mybitset); m_mybitmask = std::move(x.m_mybitmask); - return *this; } -bool bitmodule::BitsetBitmask::operator ==( +bool BitsetBitmask::operator ==( const BitsetBitmask& x) const { return (m_mybitset == x.m_mybitset && m_mybitmask == x.m_mybitmask); } -bool bitmodule::BitsetBitmask::operator !=( +bool BitsetBitmask::operator !=( const BitsetBitmask& x) const { return !(*this == x); @@ -1641,7 +1654,7 @@ bool bitmodule::BitsetBitmask::operator !=( * @brief This function copies the value in member mybitset * @param _mybitset New value to be copied in member mybitset */ -void bitmodule::BitsetBitmask::mybitset( +void BitsetBitmask::mybitset( const bitmodule::MyBitset& _mybitset) { m_mybitset = _mybitset; @@ -1651,7 +1664,7 @@ void bitmodule::BitsetBitmask::mybitset( * @brief This function moves the value in member mybitset * @param _mybitset New value to be moved in member mybitset */ -void bitmodule::BitsetBitmask::mybitset( +void BitsetBitmask::mybitset( bitmodule::MyBitset&& _mybitset) { m_mybitset = std::move(_mybitset); @@ -1661,7 +1674,7 @@ void bitmodule::BitsetBitmask::mybitset( * @brief This function returns a constant reference to member mybitset * @return Constant reference to member mybitset */ -const bitmodule::MyBitset& bitmodule::BitsetBitmask::mybitset() const +const bitmodule::MyBitset& BitsetBitmask::mybitset() const { return m_mybitset; } @@ -1670,7 +1683,7 @@ const bitmodule::MyBitset& bitmodule::BitsetBitmask::mybitset() const * @brief This function returns a reference to member mybitset * @return Reference to member mybitset */ -bitmodule::MyBitset& bitmodule::BitsetBitmask::mybitset() +bitmodule::MyBitset& BitsetBitmask::mybitset() { return m_mybitset; } @@ -1680,7 +1693,7 @@ bitmodule::MyBitset& bitmodule::BitsetBitmask::mybitset() * @brief This function copies the value in member mybitmask * @param _mybitmask New value to be copied in member mybitmask */ -void bitmodule::BitsetBitmask::mybitmask( +void BitsetBitmask::mybitmask( const bitmodule::MyBitMask& _mybitmask) { m_mybitmask = _mybitmask; @@ -1690,7 +1703,7 @@ void bitmodule::BitsetBitmask::mybitmask( * @brief This function moves the value in member mybitmask * @param _mybitmask New value to be moved in member mybitmask */ -void bitmodule::BitsetBitmask::mybitmask( +void BitsetBitmask::mybitmask( bitmodule::MyBitMask&& _mybitmask) { m_mybitmask = std::move(_mybitmask); @@ -1700,7 +1713,7 @@ void bitmodule::BitsetBitmask::mybitmask( * @brief This function returns a constant reference to member mybitmask * @return Constant reference to member mybitmask */ -const bitmodule::MyBitMask& bitmodule::BitsetBitmask::mybitmask() const +const bitmodule::MyBitMask& BitsetBitmask::mybitmask() const { return m_mybitmask; } @@ -1709,35 +1722,36 @@ const bitmodule::MyBitMask& bitmodule::BitsetBitmask::mybitmask() const * @brief This function returns a reference to member mybitmask * @return Reference to member mybitmask */ -bitmodule::MyBitMask& bitmodule::BitsetBitmask::mybitmask() +bitmodule::MyBitMask& BitsetBitmask::mybitmask() { return m_mybitmask; } -bitmodule::BM2::BM2() - : bitmodule::BitsetBitmask() -{ +BM2::BM2() + : bitmodule::BitsetBitmask() + +{ // Just to register all known types registernew_features_4_2Types(); } -bitmodule::BM2::~BM2() +BM2::~BM2() { } -bitmodule::BM2::BM2( +BM2::BM2( const BM2& x) - : bitmodule::BitsetBitmask(x) + : bitmodule::BitsetBitmask(x) { m_two = x.m_two; m_mylong = x.m_mylong; } -bitmodule::BM2::BM2( +BM2::BM2( BM2&& x) noexcept : bitmodule::BitsetBitmask(std::move(x)) @@ -1746,41 +1760,38 @@ bitmodule::BM2::BM2( m_mylong = x.m_mylong; } -bitmodule::BM2& bitmodule::BM2::operator =( +BM2& BM2::operator =( const BM2& x) { bitmodule::BitsetBitmask::operator =(x); m_two = x.m_two; m_mylong = x.m_mylong; - return *this; } -bitmodule::BM2& bitmodule::BM2::operator =( +BM2& BM2::operator =( BM2&& x) noexcept { bitmodule::BitsetBitmask::operator =(std::move(x)); m_two = std::move(x.m_two); m_mylong = x.m_mylong; - return *this; } -bool bitmodule::BM2::operator ==( +bool BM2::operator ==( const BM2& x) const { if (bitmodule::BitsetBitmask::operator !=(x)) { return false; } - return (m_two == x.m_two && m_mylong == x.m_mylong); } -bool bitmodule::BM2::operator !=( +bool BM2::operator !=( const BM2& x) const { return !(*this == x); @@ -1790,7 +1801,7 @@ bool bitmodule::BM2::operator !=( * @brief This function copies the value in member two * @param _two New value to be copied in member two */ -void bitmodule::BM2::two( +void BM2::two( const bitmodule::MyBitMask& _two) { m_two = _two; @@ -1800,7 +1811,7 @@ void bitmodule::BM2::two( * @brief This function moves the value in member two * @param _two New value to be moved in member two */ -void bitmodule::BM2::two( +void BM2::two( bitmodule::MyBitMask&& _two) { m_two = std::move(_two); @@ -1810,7 +1821,7 @@ void bitmodule::BM2::two( * @brief This function returns a constant reference to member two * @return Constant reference to member two */ -const bitmodule::MyBitMask& bitmodule::BM2::two() const +const bitmodule::MyBitMask& BM2::two() const { return m_two; } @@ -1819,7 +1830,7 @@ const bitmodule::MyBitMask& bitmodule::BM2::two() const * @brief This function returns a reference to member two * @return Reference to member two */ -bitmodule::MyBitMask& bitmodule::BM2::two() +bitmodule::MyBitMask& BM2::two() { return m_two; } @@ -1829,7 +1840,7 @@ bitmodule::MyBitMask& bitmodule::BM2::two() * @brief This function sets a value in member mylong * @param _mylong New value for member mylong */ -void bitmodule::BM2::mylong( +void BM2::mylong( int32_t _mylong) { m_mylong = _mylong; @@ -1839,7 +1850,7 @@ void bitmodule::BM2::mylong( * @brief This function returns the value of member mylong * @return Value of member mylong */ -int32_t bitmodule::BM2::mylong() const +int32_t BM2::mylong() const { return m_mylong; } @@ -1848,18 +1859,21 @@ int32_t bitmodule::BM2::mylong() const * @brief This function returns a reference to member mylong * @return Reference to member mylong */ -int32_t& bitmodule::BM2::mylong() +int32_t& BM2::mylong() { return m_mylong; } + +} // namespace bitmodule + + StructTest::StructTest() - : NewAliases() + : NewAliases() { - // Just to register all known types registernew_features_4_2Types(); } @@ -1870,7 +1884,7 @@ StructTest::~StructTest() StructTest::StructTest( const StructTest& x) - : NewAliases(x) + : NewAliases(x) { m_octetUnion = x.m_octetUnion; @@ -1896,7 +1910,6 @@ StructTest& StructTest::operator =( m_octetUnion = x.m_octetUnion; m_int8Union = x.m_int8Union; m_myStructBits = x.m_myStructBits; - return *this; } @@ -1908,7 +1921,6 @@ StructTest& StructTest::operator =( m_octetUnion = std::move(x.m_octetUnion); m_int8Union = std::move(x.m_int8Union); m_myStructBits = std::move(x.m_myStructBits); - return *this; } @@ -1919,7 +1931,6 @@ bool StructTest::operator ==( { return false; } - return (m_octetUnion == x.m_octetUnion && m_int8Union == x.m_int8Union && m_myStructBits == x.m_myStructBits); @@ -2050,3 +2061,5 @@ bitmodule::BM2& StructTest::myStructBits() // Include auxiliary functions like for serializing/deserializing. #include "new_features_4_2CdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2.h b/test/unittest/dynamic_types/idl/new_features_4_2.h index 62f651537fb..de85dadf42c 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2.h +++ b/test/unittest/dynamic_types/idl/new_features_4_2.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "new_features_4_2v1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ #define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -67,6 +73,8 @@ class CdrSizeCalculator; + + /*! * @brief This class represents the structure NewAliases defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -326,6 +334,8 @@ class NewAliases std::string m_local_string; }; + + /*! * @brief This class represents the union WCharUnion defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -456,6 +466,8 @@ class WCharUnion int32_t m_case_zero{0}; int32_t m_case_one{0}; }; + + /*! * @brief This class represents the union OctetUnion defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -586,6 +598,8 @@ class OctetUnion int32_t m_case_five{0}; int32_t m_case_seven{0}; }; + + /*! * @brief This class represents the union Int8Union defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -717,495 +731,505 @@ class Int8Union int32_t m_case_six{0}; }; namespace bitmodule { + +/*! + * @brief This class represents the structure ParentBitset defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class ParentBitset +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ParentBitset(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ParentBitset(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset( + const ParentBitset& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset( + ParentBitset&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset& operator =( + const ParentBitset& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset& operator =( + ParentBitset&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::ParentBitset object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ParentBitset& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::ParentBitset object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ParentBitset& x) const; + + /*! + * @brief This function sets a value in member parent_bitfield + * @param _parent_bitfield New value for member parent_bitfield + */ + eProsima_user_DllExport void parent_bitfield( + uint32_t _parent_bitfield); + + /*! + * @brief This function returns the value of member parent_bitfield + * @return Value of member parent_bitfield + */ + eProsima_user_DllExport uint32_t parent_bitfield() const; + + + eProsima_user_DllExport std::bitset<17> bitset() const; + + eProsima_user_DllExport void bitset( + const std::bitset<17>&); + + + +private: + + std::bitset<17> m_bitset; +}; +/*! + * @brief This class represents the structure MyBitset defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class MyBitset : public bitmodule::ParentBitset +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyBitset(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyBitset(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + const MyBitset& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + MyBitset&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + const MyBitset& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + MyBitset&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::MyBitset object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyBitset& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::MyBitset object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyBitset& x) const; + + /*! + * @brief This function sets a value in member a + * @param _a New value for member a + */ + eProsima_user_DllExport void a( + char _a); + + /*! + * @brief This function returns the value of member a + * @return Value of member a + */ + eProsima_user_DllExport char a() const; + + + /*! + * @brief This function sets a value in member b + * @param _b New value for member b + */ + eProsima_user_DllExport void b( + bool _b); + + /*! + * @brief This function returns the value of member b + * @return Value of member b + */ + eProsima_user_DllExport bool b() const; + + + + /*! + * @brief This function sets a value in member c + * @param _c New value for member c + */ + eProsima_user_DllExport void c( + uint16_t _c); + + /*! + * @brief This function returns the value of member c + * @return Value of member c + */ + eProsima_user_DllExport uint16_t c() const; + + + /*! + * @brief This function sets a value in member d + * @param _d New value for member d + */ + eProsima_user_DllExport void d( + int16_t _d); + + /*! + * @brief This function returns the value of member d + * @return Value of member d + */ + eProsima_user_DllExport int16_t d() const; + + + /*! + * @brief This function sets a value in member e + * @param _e New value for member e + */ + eProsima_user_DllExport void e( + int16_t _e); + + /*! + * @brief This function returns the value of member e + * @return Value of member e + */ + eProsima_user_DllExport int16_t e() const; + + /*! - * @brief This class represents the structure ParentBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class ParentBitset - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ParentBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ParentBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - const ParentBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset( - ParentBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - const ParentBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::ParentBitset that will be copied. - */ - eProsima_user_DllExport ParentBitset& operator =( - ParentBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ParentBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::ParentBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ParentBitset& x) const; - - /*! - * @brief This function sets a value in member parent_bitfield - * @param _parent_bitfield New value for member parent_bitfield - */ - eProsima_user_DllExport void parent_bitfield( - uint32_t _parent_bitfield); - - /*! - * @brief This function returns the value of member parent_bitfield - * @return Value of member parent_bitfield - */ - eProsima_user_DllExport uint32_t parent_bitfield() const; - - - eProsima_user_DllExport std::bitset<17> bitset() const; - - eProsima_user_DllExport void bitset(const std::bitset<17>&); - - - - private: - - std::bitset<17> m_bitset; - }; - /*! - * @brief This class represents the structure MyBitset defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class MyBitset : public bitmodule::ParentBitset - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBitset(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBitset(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - const MyBitset& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset( - MyBitset&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - const MyBitset& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::MyBitset that will be copied. - */ - eProsima_user_DllExport MyBitset& operator =( - MyBitset&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBitset& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::MyBitset object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBitset& x) const; - - /*! - * @brief This function sets a value in member a - * @param _a New value for member a - */ - eProsima_user_DllExport void a( - char _a); - - /*! - * @brief This function returns the value of member a - * @return Value of member a - */ - eProsima_user_DllExport char a() const; - - - /*! - * @brief This function sets a value in member b - * @param _b New value for member b - */ - eProsima_user_DllExport void b( - bool _b); - - /*! - * @brief This function returns the value of member b - * @return Value of member b - */ - eProsima_user_DllExport bool b() const; - - - - /*! - * @brief This function sets a value in member c - * @param _c New value for member c - */ - eProsima_user_DllExport void c( - uint16_t _c); - - /*! - * @brief This function returns the value of member c - * @return Value of member c - */ - eProsima_user_DllExport uint16_t c() const; - - - /*! - * @brief This function sets a value in member d - * @param _d New value for member d - */ - eProsima_user_DllExport void d( - int16_t _d); - - /*! - * @brief This function returns the value of member d - * @return Value of member d - */ - eProsima_user_DllExport int16_t d() const; - - - /*! - * @brief This function sets a value in member e - * @param _e New value for member e - */ - eProsima_user_DllExport void e( - int16_t _e); - - /*! - * @brief This function returns the value of member e - * @return Value of member e - */ - eProsima_user_DllExport int16_t e() const; - - - /*! - * @brief This function sets a value in member f - * @param _f New value for member f - */ - eProsima_user_DllExport void f( - int16_t _f); - - /*! - * @brief This function returns the value of member f - * @return Value of member f - */ - eProsima_user_DllExport int16_t f() const; - - - eProsima_user_DllExport std::bitset<50> bitset() const; - - eProsima_user_DllExport void bitset(const std::bitset<50>&); - - - - private: - - std::bitset<33> m_bitset; - }; - /*! - * @brief This enumeration represents the MyBitMask bitflags defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - enum MyBitMaskBits : uint8_t - { - flag0 = 0x01ull << 0, - flag1 = 0x01ull << 1, - flag4 = 0x01ull << 4, - flag6 = 0x01ull << 6, - flag7 = 0x01ull << 7 - }; - typedef uint8_t MyBitMask; - /*! - * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BitsetBitmask - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BitsetBitmask(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BitsetBitmask(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - const BitsetBitmask& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - const BitsetBitmask& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. - */ - eProsima_user_DllExport BitsetBitmask& operator =( - BitsetBitmask&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BitsetBitmask& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BitsetBitmask object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BitsetBitmask& x) const; - - /*! - * @brief This function copies the value in member mybitset - * @param _mybitset New value to be copied in member mybitset - */ - eProsima_user_DllExport void mybitset( - const bitmodule::MyBitset& _mybitset); - - /*! - * @brief This function moves the value in member mybitset - * @param _mybitset New value to be moved in member mybitset - */ - eProsima_user_DllExport void mybitset( - bitmodule::MyBitset&& _mybitset); - - /*! - * @brief This function returns a constant reference to member mybitset - * @return Constant reference to member mybitset - */ - eProsima_user_DllExport const bitmodule::MyBitset& mybitset() const; - - /*! - * @brief This function returns a reference to member mybitset - * @return Reference to member mybitset - */ - eProsima_user_DllExport bitmodule::MyBitset& mybitset(); - - - /*! - * @brief This function copies the value in member mybitmask - * @param _mybitmask New value to be copied in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - const bitmodule::MyBitMask& _mybitmask); - - /*! - * @brief This function moves the value in member mybitmask - * @param _mybitmask New value to be moved in member mybitmask - */ - eProsima_user_DllExport void mybitmask( - bitmodule::MyBitMask&& _mybitmask); - - /*! - * @brief This function returns a constant reference to member mybitmask - * @return Constant reference to member mybitmask - */ - eProsima_user_DllExport const bitmodule::MyBitMask& mybitmask() const; - - /*! - * @brief This function returns a reference to member mybitmask - * @return Reference to member mybitmask - */ - eProsima_user_DllExport bitmodule::MyBitMask& mybitmask(); - - private: - - bitmodule::MyBitset m_mybitset; - bitmodule::MyBitMask m_mybitmask{0}; - - }; - /*! - * @brief This class represents the structure BM2 defined by the user in the IDL file. - * @ingroup new_features_4_2 - */ - class BM2 : public bitmodule::BitsetBitmask - { - public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BM2(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BM2(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - const BM2& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2( - BM2&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - const BM2& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object bitmodule::BM2 that will be copied. - */ - eProsima_user_DllExport BM2& operator =( - BM2&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BM2& x) const; - - /*! - * @brief Comparison operator. - * @param x bitmodule::BM2 object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BM2& x) const; - - /*! - * @brief This function copies the value in member two - * @param _two New value to be copied in member two - */ - eProsima_user_DllExport void two( - const bitmodule::MyBitMask& _two); - - /*! - * @brief This function moves the value in member two - * @param _two New value to be moved in member two - */ - eProsima_user_DllExport void two( - bitmodule::MyBitMask&& _two); - - /*! - * @brief This function returns a constant reference to member two - * @return Constant reference to member two - */ - eProsima_user_DllExport const bitmodule::MyBitMask& two() const; - - /*! - * @brief This function returns a reference to member two - * @return Reference to member two - */ - eProsima_user_DllExport bitmodule::MyBitMask& two(); - - - /*! - * @brief This function sets a value in member mylong - * @param _mylong New value for member mylong - */ - eProsima_user_DllExport void mylong( - int32_t _mylong); - - /*! - * @brief This function returns the value of member mylong - * @return Value of member mylong - */ - eProsima_user_DllExport int32_t mylong() const; - - /*! - * @brief This function returns a reference to member mylong - * @return Reference to member mylong - */ - eProsima_user_DllExport int32_t& mylong(); - - private: - - bitmodule::MyBitMask m_two{0}; - int32_t m_mylong{0}; - - }; + * @brief This function sets a value in member f + * @param _f New value for member f + */ + eProsima_user_DllExport void f( + int16_t _f); + + /*! + * @brief This function returns the value of member f + * @return Value of member f + */ + eProsima_user_DllExport int16_t f() const; + + + eProsima_user_DllExport std::bitset<50> bitset() const; + + eProsima_user_DllExport void bitset( + const std::bitset<50>&); + + + +private: + + std::bitset<33> m_bitset; +}; +/*! + * @brief This enumeration represents the MyBitMask bitflags defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +enum MyBitMaskBits : uint8_t +{ + flag0 = 0x01ull << 0, + flag1 = 0x01ull << 1, + flag4 = 0x01ull << 4, + flag6 = 0x01ull << 6, + flag7 = 0x01ull << 7 +}; +typedef uint8_t MyBitMask; + + +/*! + * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class BitsetBitmask +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BitsetBitmask(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BitsetBitmask(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask( + const BitsetBitmask& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask( + BitsetBitmask&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask& operator =( + const BitsetBitmask& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask& operator =( + BitsetBitmask&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BitsetBitmask object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BitsetBitmask& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BitsetBitmask object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BitsetBitmask& x) const; + + /*! + * @brief This function copies the value in member mybitset + * @param _mybitset New value to be copied in member mybitset + */ + eProsima_user_DllExport void mybitset( + const bitmodule::MyBitset& _mybitset); + + /*! + * @brief This function moves the value in member mybitset + * @param _mybitset New value to be moved in member mybitset + */ + eProsima_user_DllExport void mybitset( + bitmodule::MyBitset&& _mybitset); + + /*! + * @brief This function returns a constant reference to member mybitset + * @return Constant reference to member mybitset + */ + eProsima_user_DllExport const bitmodule::MyBitset& mybitset() const; + + /*! + * @brief This function returns a reference to member mybitset + * @return Reference to member mybitset + */ + eProsima_user_DllExport bitmodule::MyBitset& mybitset(); + + + /*! + * @brief This function copies the value in member mybitmask + * @param _mybitmask New value to be copied in member mybitmask + */ + eProsima_user_DllExport void mybitmask( + const bitmodule::MyBitMask& _mybitmask); + + /*! + * @brief This function moves the value in member mybitmask + * @param _mybitmask New value to be moved in member mybitmask + */ + eProsima_user_DllExport void mybitmask( + bitmodule::MyBitMask&& _mybitmask); + + /*! + * @brief This function returns a constant reference to member mybitmask + * @return Constant reference to member mybitmask + */ + eProsima_user_DllExport const bitmodule::MyBitMask& mybitmask() const; + + /*! + * @brief This function returns a reference to member mybitmask + * @return Reference to member mybitmask + */ + eProsima_user_DllExport bitmodule::MyBitMask& mybitmask(); + +private: + + bitmodule::MyBitset m_mybitset; + bitmodule::MyBitMask m_mybitmask{0}; + +}; + + +/*! + * @brief This class represents the structure BM2 defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class BM2 : public bitmodule::BitsetBitmask +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BM2(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BM2(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2( + const BM2& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2( + BM2&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2& operator =( + const BM2& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2& operator =( + BM2&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BM2 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BM2& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BM2 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BM2& x) const; + + /*! + * @brief This function copies the value in member two + * @param _two New value to be copied in member two + */ + eProsima_user_DllExport void two( + const bitmodule::MyBitMask& _two); + + /*! + * @brief This function moves the value in member two + * @param _two New value to be moved in member two + */ + eProsima_user_DllExport void two( + bitmodule::MyBitMask&& _two); + + /*! + * @brief This function returns a constant reference to member two + * @return Constant reference to member two + */ + eProsima_user_DllExport const bitmodule::MyBitMask& two() const; + + /*! + * @brief This function returns a reference to member two + * @return Reference to member two + */ + eProsima_user_DllExport bitmodule::MyBitMask& two(); + + + /*! + * @brief This function sets a value in member mylong + * @param _mylong New value for member mylong + */ + eProsima_user_DllExport void mylong( + int32_t _mylong); + + /*! + * @brief This function returns the value of member mylong + * @return Value of member mylong + */ + eProsima_user_DllExport int32_t mylong() const; + + /*! + * @brief This function returns a reference to member mylong + * @return Reference to member mylong + */ + eProsima_user_DllExport int32_t& mylong(); + +private: + + bitmodule::MyBitMask m_two{0}; + int32_t m_mylong{0}; + +}; + } // namespace bitmodule + + /*! * @brief This class represents the structure StructTest defined by the user in the IDL file. * @ingroup new_features_4_2 */ -class StructTest : public NewAliases +class StructTest : public NewAliases { public: @@ -1351,3 +1375,6 @@ class StructTest : public NewAliases #endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp index 6d8e827910f..213ee811979 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp +++ b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.hpp @@ -47,6 +47,8 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const NewAliases& data); @@ -54,15 +56,30 @@ eProsima_user_DllExport void serialize_key( + + + + + + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const bitmodule::BitsetBitmask& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const bitmodule::BM2& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StructTest& data); @@ -71,4 +88,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_HPP_ + diff --git a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp index 5b20e87e012..c8b73b1b452 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp +++ b/test/unittest/dynamic_types/idl/new_features_4_2CdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -102,7 +104,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(6) << data.int64_() << eprosima::fastcdr::MemberId(7) << data.uint64_() ; - scdr.end_serialize_type(current_state); } @@ -171,6 +172,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -201,6 +204,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.case_one(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -232,6 +237,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.case_one(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -264,6 +271,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.case_one(); break; + default: + break; } ret_value = false; break; @@ -272,6 +281,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -302,6 +313,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.case_seven(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -333,6 +346,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.case_seven(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -365,6 +380,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.case_seven(); break; + default: + break; } ret_value = false; break; @@ -373,6 +390,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -403,6 +422,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.case_six(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -434,6 +455,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.case_six(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -466,6 +489,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.case_six(); break; + default: + break; } ret_value = false; break; @@ -480,6 +505,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( const bitmodule::ParentBitset& data, size_t& current_alignment) { + using namespace bitmodule; + return calculator.calculate_serialized_size(data.bitset(), current_alignment); } @@ -488,6 +515,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const bitmodule::ParentBitset& data) { + using namespace bitmodule; + scdr << data.bitset(); } @@ -496,6 +525,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& dcdr, bitmodule::ParentBitset& data) { + using namespace bitmodule; + std::bitset<17> bitset; dcdr >> bitset; data.bitset(bitset); @@ -507,6 +538,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( const bitmodule::MyBitset& data, size_t& current_alignment) { + using namespace bitmodule; + return calculator.calculate_serialized_size(data.bitset(), current_alignment); } @@ -515,6 +548,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const bitmodule::MyBitset& data) { + using namespace bitmodule; + scdr << data.bitset(); } @@ -523,18 +558,24 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& dcdr, bitmodule::MyBitset& data) { + using namespace bitmodule; + std::bitset<50> bitset; dcdr >> bitset; data.bitset(bitset); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const bitmodule::BitsetBitmask& data, size_t& current_alignment) { + using namespace bitmodule; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -562,6 +603,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const bitmodule::BitsetBitmask& data) { + using namespace bitmodule; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -572,7 +615,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(0) << data.mybitset() << eprosima::fastcdr::MemberId(1) << data.mybitmask() ; - scdr.end_serialize_type(current_state); } @@ -581,6 +623,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, bitmodule::BitsetBitmask& data) { + using namespace bitmodule; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -609,17 +653,23 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const bitmodule::BitsetBitmask& data) { + using namespace bitmodule; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, const bitmodule::BM2& data, size_t& current_alignment) { + using namespace bitmodule; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -653,6 +703,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, const bitmodule::BM2& data) { + using namespace bitmodule; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -665,7 +717,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(2) << data.two() << eprosima::fastcdr::MemberId(3) << data.mylong() ; - scdr.end_serialize_type(current_state); } @@ -674,6 +725,8 @@ eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, bitmodule::BM2& data) { + using namespace bitmodule; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -710,12 +763,16 @@ void serialize_key( eprosima::fastcdr::Cdr& scdr, const bitmodule::BM2& data) { + using namespace bitmodule; + static_cast(scdr); static_cast(data); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -796,7 +853,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(10) << data.int8Union() << eprosima::fastcdr::MemberId(11) << data.myStructBits() ; - scdr.end_serialize_type(current_state); } @@ -881,4 +937,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2CDRAUX_IPP_ + diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx index 06bdf45af8e..61982d3150e 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx +++ b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "new_features_4_2PubSubTypes.h" #include "new_features_4_2CdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + NewAliasesPubSubType::NewAliasesPubSubType() { setName("NewAliases"); - uint32_t type_size = NewAliases_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(NewAliases::getMaxCdrSerializedSize()); +#else + NewAliases_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool NewAliasesPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool NewAliasesPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool NewAliasesPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function NewAliasesPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool NewAliasesPubSubType::getKey( NewAliases_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || NewAliases_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -186,11 +222,27 @@ bool NewAliasesPubSubType::getKey( + + + + + + + + + namespace bitmodule { + + BitsetBitmaskPubSubType::BitsetBitmaskPubSubType() { setName("bitmodule::BitsetBitmask"); - uint32_t type_size = bitmodule_BitsetBitmask_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(BitsetBitmask::getMaxCdrSerializedSize()); + #else + bitmodule_BitsetBitmask_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -221,10 +273,12 @@ namespace bitmodule { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -239,7 +293,11 @@ namespace bitmodule { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -256,7 +314,11 @@ namespace bitmodule { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -279,13 +341,26 @@ namespace bitmodule { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -317,12 +392,20 @@ namespace bitmodule { bitmodule_BitsetBitmask_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || bitmodule_BitsetBitmask_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -339,10 +422,17 @@ namespace bitmodule { return true; } + + BM2PubSubType::BM2PubSubType() { setName("bitmodule::BM2"); - uint32_t type_size = bitmodule_BM2_max_cdr_typesize; + uint32_t type_size = + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(BM2::getMaxCdrSerializedSize()); + #else + bitmodule_BM2_max_cdr_typesize; + #endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -373,10 +463,12 @@ namespace bitmodule { data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + #if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); + #endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -391,7 +483,11 @@ namespace bitmodule { } // Get the serialized length + #if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); + #else payload->length = static_cast(ser.get_serialized_data_length()); + #endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -408,7 +504,11 @@ namespace bitmodule { eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN + #if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR + #endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -431,13 +531,26 @@ namespace bitmodule { { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; + #if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; + #else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } + #endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -469,12 +582,20 @@ namespace bitmodule { bitmodule_BM2_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); + #if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); + #else eprosima::fastcdr::serialize_key(ser, *p_type); + #endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || bitmodule_BM2_max_key_cdr_typesize > 16) { m_md5.init(); + #if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); + #else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); + #endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -494,10 +615,17 @@ namespace bitmodule { } //End of namespace bitmodule + + StructTestPubSubType::StructTestPubSubType() { setName("StructTest"); - uint32_t type_size = StructTest_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StructTest::getMaxCdrSerializedSize()); +#else + StructTest_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -528,10 +656,12 @@ bool StructTestPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -546,7 +676,11 @@ bool StructTestPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -563,7 +697,11 @@ bool StructTestPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -586,13 +724,26 @@ std::function StructTestPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -624,12 +775,20 @@ bool StructTestPubSubType::getKey( StructTest_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StructTest_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h index b010b38ceed..03f413ae74f 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h +++ b/test/unittest/dynamic_types/idl/new_features_4_2PubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type NewAliases defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -128,9 +130,20 @@ class NewAliasesPubSubType : public eprosima::fastdds::dds::TopicDataType + + + + + + + + + namespace bitmodule { + + /*! * @brief This class represents the TopicDataType of the type BitsetBitmask defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -219,6 +232,8 @@ namespace bitmodule }; + + /*! * @brief This class represents the TopicDataType of the type BM2 defined by the user in the IDL file. * @ingroup new_features_4_2 @@ -308,6 +323,8 @@ namespace bitmodule }; } + + /*! * @brief This class represents the TopicDataType of the type StructTest defined by the user in the IDL file. * @ingroup new_features_4_2 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx index 05b3540a933..32f204ac131 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx +++ b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -109,6 +107,8 @@ void registernew_features_4_2Types() }); } + + const TypeIdentifier* GetNewAliasesIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("NewAliases", complete); @@ -330,7 +330,6 @@ const TypeObject* GetMinimalNewAliasesObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -346,7 +345,11 @@ const TypeObject* GetMinimalNewAliasesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -570,7 +573,6 @@ const TypeObject* GetCompleteNewAliasesObject() // Header type_object->complete().struct_type().header().detail().type_name("NewAliases"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -586,7 +588,11 @@ const TypeObject* GetCompleteNewAliasesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -600,6 +606,8 @@ const TypeObject* GetCompleteNewAliasesObject() return TypeObjectFactory::get_instance()->get_type_object("NewAliases", true); } + + const TypeIdentifier* GetWCharUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WCharUnion", complete); @@ -717,7 +725,11 @@ const TypeObject* GetMinimalWCharUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -816,7 +828,11 @@ const TypeObject* GetCompleteWCharUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -831,6 +847,8 @@ const TypeObject* GetCompleteWCharUnionObject() return TypeObjectFactory::get_instance()->get_type_object("WCharUnion", true); } + + const TypeIdentifier* GetOctetUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("OctetUnion", complete); @@ -948,7 +966,11 @@ const TypeObject* GetMinimalOctetUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1047,7 +1069,11 @@ const TypeObject* GetCompleteOctetUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1062,6 +1088,8 @@ const TypeObject* GetCompleteOctetUnionObject() return TypeObjectFactory::get_instance()->get_type_object("OctetUnion", true); } + + const TypeIdentifier* GetInt8UnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("Int8Union", complete); @@ -1179,7 +1207,11 @@ const TypeObject* GetMinimalInt8UnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1278,7 +1310,11 @@ const TypeObject* GetCompleteInt8UnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1352,7 +1388,6 @@ namespace bitmodule { type_object->minimal().bitset_type().field_seq().emplace_back(mbf_parent_bitfield); - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1368,7 +1403,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1459,7 +1498,6 @@ namespace bitmodule { type_object->complete().bitset_type().field_seq().emplace_back(cbf_parent_bitfield); - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1475,7 +1513,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1660,7 +1702,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2049,7 +2095,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2200,7 +2250,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2235,6 +2289,28 @@ namespace bitmodule { type_object->complete().bitmask_type().header().common().bit_bound(8); + { + AppliedAnnotation ann; + //ann.annotation_typeid(Getbit_boundIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("bit_bound")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_UINT16); + paramValue.from_string("8"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().bitmask_type().header().detail().ann_custom().push_back(ann); + } + + type_object->complete().bitmask_type().header().detail().type_name("MyBitMask"); CompleteBitflag cbf_flag0; @@ -2513,7 +2589,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2527,6 +2607,8 @@ namespace bitmodule { return TypeObjectFactory::get_instance()->get_type_object("MyBitMask", true); } + + const TypeIdentifier* GetBitsetBitmaskIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BitsetBitmask", complete); @@ -2614,7 +2696,6 @@ namespace bitmodule { // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2630,7 +2711,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2697,7 +2782,6 @@ namespace bitmodule { // Header type_object->complete().struct_type().header().detail().type_name("BitsetBitmask"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2713,7 +2797,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2727,6 +2815,8 @@ namespace bitmodule { return TypeObjectFactory::get_instance()->get_type_object("BitsetBitmask", true); } + + const TypeIdentifier* GetBM2Identifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BM2", complete); @@ -2832,7 +2922,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2917,7 +3011,11 @@ namespace bitmodule { payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; + #if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length + #else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length + #endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2932,6 +3030,8 @@ namespace bitmodule { } } // namespace bitmodule + + const TypeIdentifier* GetStructTestIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StructTest", complete); @@ -3054,7 +3154,11 @@ const TypeObject* GetMinimalStructTestObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3153,7 +3257,11 @@ const TypeObject* GetCompleteStructTestObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h index ddf416cad19..55337a6942d 100644 --- a/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h +++ b/test/unittest/dynamic_types/idl/new_features_4_2TypeObject.h @@ -54,21 +54,29 @@ using namespace eprosima::fastrtps::types; eProsima_user_DllExport void registernew_features_4_2Types(); + + eProsima_user_DllExport const TypeIdentifier* GetNewAliasesIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetNewAliasesObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalNewAliasesObject(); eProsima_user_DllExport const TypeObject* GetCompleteNewAliasesObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWCharUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWCharUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWCharUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteWCharUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetOctetUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetOctetUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalOctetUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteOctetUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetInt8UnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetInt8UnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalInt8UnionObject(); @@ -90,17 +98,23 @@ namespace bitmodule { eProsima_user_DllExport const TypeObject* GetMinimalMyBitMaskObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyBitMaskObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBitsetBitmaskIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBitsetBitmaskObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBitsetBitmaskObject(); eProsima_user_DllExport const TypeObject* GetCompleteBitsetBitmaskObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBM2Identifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBM2Object(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBM2Object(); eProsima_user_DllExport const TypeObject* GetCompleteBM2Object(); } // namespace bitmodule + + eProsima_user_DllExport const TypeIdentifier* GetStructTestIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStructTestObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStructTestObject(); diff --git a/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx b/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx new file mode 100644 index 00000000000..4287df4cf97 --- /dev/null +++ b/test/unittest/dynamic_types/idl/new_features_4_2v1.cxx @@ -0,0 +1,2905 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file new_features_4_2.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "new_features_4_2.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "new_features_4_2TypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define bitmodule_BM2_max_cdr_typesize 24ULL; +#define NewAliases_max_cdr_typesize 40ULL; + +#define StructTest_max_cdr_typesize 88ULL; + + + +#define bitmodule_BitsetBitmask_max_cdr_typesize 17ULL; + + + + +NewAliases::NewAliases() +{ + // int8 m_int8_ + m_int8_ = 0; + // uint8 m_uint8_ + m_uint8_ = 0; + // short m_int16_ + m_int16_ = 0; + // unsigned short m_uint16_ + m_uint16_ = 0; + // long m_int32_ + m_int32_ = 0; + // unsigned long m_uint32_ + m_uint32_ = 0; + // long long m_int64_ + m_int64_ = 0; + // unsigned long long m_uint64_ + m_uint64_ = 555; + // /type_d() m_local_string + + + // Just to register all known types + registernew_features_4_2Types(); +} + +NewAliases::~NewAliases() +{ +} + +NewAliases::NewAliases( + const NewAliases& x) +{ + m_int8_ = x.m_int8_; + + + m_uint8_ = x.m_uint8_; + + + m_int16_ = x.m_int16_; + + + m_uint16_ = x.m_uint16_; + + + m_int32_ = x.m_int32_; + + + m_uint32_ = x.m_uint32_; + + + m_int64_ = x.m_int64_; + + + m_uint64_ = x.m_uint64_; + + + m_local_string = x.m_local_string; + +} + +NewAliases::NewAliases( + NewAliases&& x) noexcept +{ + m_int8_ = x.m_int8_; + + + m_uint8_ = x.m_uint8_; + + + m_int16_ = x.m_int16_; + + + m_uint16_ = x.m_uint16_; + + + m_int32_ = x.m_int32_; + + + m_uint32_ = x.m_uint32_; + + + m_int64_ = x.m_int64_; + + + m_uint64_ = x.m_uint64_; + + + m_local_string = std::move(x.m_local_string); + +} + +NewAliases& NewAliases::operator =( + const NewAliases& x) +{ + m_int8_ = x.m_int8_; + + + m_uint8_ = x.m_uint8_; + + + m_int16_ = x.m_int16_; + + + m_uint16_ = x.m_uint16_; + + + m_int32_ = x.m_int32_; + + + m_uint32_ = x.m_uint32_; + + + m_int64_ = x.m_int64_; + + + m_uint64_ = x.m_uint64_; + + + m_local_string = x.m_local_string; + + return *this; +} + +NewAliases& NewAliases::operator =( + NewAliases&& x) noexcept +{ + m_int8_ = x.m_int8_; + + + m_uint8_ = x.m_uint8_; + + + m_int16_ = x.m_int16_; + + + m_uint16_ = x.m_uint16_; + + + m_int32_ = x.m_int32_; + + + m_uint32_ = x.m_uint32_; + + + m_int64_ = x.m_int64_; + + + m_uint64_ = x.m_uint64_; + + + m_local_string = std::move(x.m_local_string); + + return *this; +} + +bool NewAliases::operator ==( + const NewAliases& x) const +{ + return (m_int8_ == x.m_int8_ && + m_uint8_ == x.m_uint8_ && + m_int16_ == x.m_int16_ && + m_uint16_ == x.m_uint16_ && + m_int32_ == x.m_int32_ && + m_uint32_ == x.m_uint32_ && + m_int64_ == x.m_int64_ && + m_uint64_ == x.m_uint64_ && + m_local_string == x.m_local_string); +} + +bool NewAliases::operator !=( + const NewAliases& x) const +{ + return !(*this == x); +} + +size_t NewAliases::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return NewAliases_max_cdr_typesize; +} + +size_t NewAliases::getCdrSerializedSize( + const NewAliases& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + + + return current_alignment - initial_alignment; +} + + +void NewAliases::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_int8_; + + scdr << m_uint8_; + + scdr << m_int16_; + + scdr << m_uint16_; + + scdr << m_int32_; + + scdr << m_uint32_; + + scdr << m_int64_; + + scdr << m_uint64_; + +} + +void NewAliases::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_int8_; + + + + dcdr >> m_uint8_; + + + + dcdr >> m_int16_; + + + + dcdr >> m_uint16_; + + + + dcdr >> m_int32_; + + + + dcdr >> m_uint32_; + + + + dcdr >> m_int64_; + + + + dcdr >> m_uint64_; + + + +} + + +bool NewAliases::isKeyDefined() +{ + return false; +} + +void NewAliases::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member int8_ + * @param _int8_ New value for member int8_ + */ +void NewAliases::int8_( + int8_t _int8_) +{ + m_int8_ = _int8_; +} + +/*! + * @brief This function returns the value of member int8_ + * @return Value of member int8_ + */ +int8_t NewAliases::int8_() const +{ + return m_int8_; +} + +/*! + * @brief This function returns a reference to member int8_ + * @return Reference to member int8_ + */ +int8_t& NewAliases::int8_() +{ + return m_int8_; +} + + +/*! + * @brief This function sets a value in member uint8_ + * @param _uint8_ New value for member uint8_ + */ +void NewAliases::uint8_( + uint8_t _uint8_) +{ + m_uint8_ = _uint8_; +} + +/*! + * @brief This function returns the value of member uint8_ + * @return Value of member uint8_ + */ +uint8_t NewAliases::uint8_() const +{ + return m_uint8_; +} + +/*! + * @brief This function returns a reference to member uint8_ + * @return Reference to member uint8_ + */ +uint8_t& NewAliases::uint8_() +{ + return m_uint8_; +} + + +/*! + * @brief This function sets a value in member int16_ + * @param _int16_ New value for member int16_ + */ +void NewAliases::int16_( + int16_t _int16_) +{ + m_int16_ = _int16_; +} + +/*! + * @brief This function returns the value of member int16_ + * @return Value of member int16_ + */ +int16_t NewAliases::int16_() const +{ + return m_int16_; +} + +/*! + * @brief This function returns a reference to member int16_ + * @return Reference to member int16_ + */ +int16_t& NewAliases::int16_() +{ + return m_int16_; +} + + +/*! + * @brief This function sets a value in member uint16_ + * @param _uint16_ New value for member uint16_ + */ +void NewAliases::uint16_( + uint16_t _uint16_) +{ + m_uint16_ = _uint16_; +} + +/*! + * @brief This function returns the value of member uint16_ + * @return Value of member uint16_ + */ +uint16_t NewAliases::uint16_() const +{ + return m_uint16_; +} + +/*! + * @brief This function returns a reference to member uint16_ + * @return Reference to member uint16_ + */ +uint16_t& NewAliases::uint16_() +{ + return m_uint16_; +} + + +/*! + * @brief This function sets a value in member int32_ + * @param _int32_ New value for member int32_ + */ +void NewAliases::int32_( + int32_t _int32_) +{ + m_int32_ = _int32_; +} + +/*! + * @brief This function returns the value of member int32_ + * @return Value of member int32_ + */ +int32_t NewAliases::int32_() const +{ + return m_int32_; +} + +/*! + * @brief This function returns a reference to member int32_ + * @return Reference to member int32_ + */ +int32_t& NewAliases::int32_() +{ + return m_int32_; +} + + +/*! + * @brief This function sets a value in member uint32_ + * @param _uint32_ New value for member uint32_ + */ +void NewAliases::uint32_( + uint32_t _uint32_) +{ + m_uint32_ = _uint32_; +} + +/*! + * @brief This function returns the value of member uint32_ + * @return Value of member uint32_ + */ +uint32_t NewAliases::uint32_() const +{ + return m_uint32_; +} + +/*! + * @brief This function returns a reference to member uint32_ + * @return Reference to member uint32_ + */ +uint32_t& NewAliases::uint32_() +{ + return m_uint32_; +} + + +/*! + * @brief This function sets a value in member int64_ + * @param _int64_ New value for member int64_ + */ +void NewAliases::int64_( + int64_t _int64_) +{ + m_int64_ = _int64_; +} + +/*! + * @brief This function returns the value of member int64_ + * @return Value of member int64_ + */ +int64_t NewAliases::int64_() const +{ + return m_int64_; +} + +/*! + * @brief This function returns a reference to member int64_ + * @return Reference to member int64_ + */ +int64_t& NewAliases::int64_() +{ + return m_int64_; +} + + +/*! + * @brief This function sets a value in member uint64_ + * @param _uint64_ New value for member uint64_ + */ +void NewAliases::uint64_( + uint64_t _uint64_) +{ + m_uint64_ = _uint64_; +} + +/*! + * @brief This function returns the value of member uint64_ + * @return Value of member uint64_ + */ +uint64_t NewAliases::uint64_() const +{ + return m_uint64_; +} + +/*! + * @brief This function returns a reference to member uint64_ + * @return Reference to member uint64_ + */ +uint64_t& NewAliases::uint64_() +{ + return m_uint64_; +} + + +/*! + * @brief This function copies the value in member local_string + * @param _local_string New value to be copied in member local_string + */ +void NewAliases::local_string( + const std::string& _local_string) +{ + m_local_string = _local_string; +} + +/*! + * @brief This function moves the value in member local_string + * @param _local_string New value to be moved in member local_string + */ +void NewAliases::local_string( + std::string&& _local_string) +{ + m_local_string = std::move(_local_string); +} + +/*! + * @brief This function returns a constant reference to member local_string + * @return Constant reference to member local_string + */ +const std::string& NewAliases::local_string() const +{ + return m_local_string; +} + +/*! + * @brief This function returns a reference to member local_string + * @return Reference to member local_string + */ +std::string& NewAliases::local_string() +{ + return m_local_string; +} + + + + + +WCharUnion::WCharUnion() +{ + m__d = 'a'; + // long m_case_zero + m_case_zero = 0; + // long m_case_one + m_case_one = 0; +} + +WCharUnion::~WCharUnion() +{ +} + +WCharUnion::WCharUnion( + const WCharUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 'a': + m_case_zero = x.m_case_zero; + break; + + + case 'b': + m_case_one = x.m_case_one; + break; + + default: + break; + } +} + +WCharUnion::WCharUnion( + WCharUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 'a': + m_case_zero = x.m_case_zero; + break; + + + case 'b': + m_case_one = x.m_case_one; + break; + + default: + break; + } +} + +WCharUnion& WCharUnion::operator =( + const WCharUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 'a': + m_case_zero = x.m_case_zero; + break; + + + case 'b': + m_case_one = x.m_case_one; + break; + + default: + break; + } + + return *this; +} + +WCharUnion& WCharUnion::operator =( + WCharUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 'a': + m_case_zero = x.m_case_zero; + break; + + + case 'b': + m_case_one = x.m_case_one; + break; + + default: + break; + } + + return *this; +} + +bool WCharUnion::operator ==( + const WCharUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case 'a': + return (m_case_zero == x.m_case_zero); + break; + + + case 'b': + return (m_case_one == x.m_case_one); + break; + + default: + break; + } + return false; +} + +bool WCharUnion::operator !=( + const WCharUnion& x) const +{ + return !(*this == x); +} + +void WCharUnion::_d( + wchar_t __d) +{ + bool b = false; + + switch(m__d) + { + case 'a': + switch(__d) + { + case 'a': + b = true; + break; + default: + break; + } + break; + + + case 'b': + switch(__d) + { + case 'b': + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +wchar_t WCharUnion::_d() const +{ + return m__d; +} + +wchar_t& WCharUnion::_d() +{ + return m__d; +} + +void WCharUnion::case_zero( + int32_t _case_zero) +{ + m_case_zero = _case_zero; + m__d = 'a'; + +} + +int32_t WCharUnion::case_zero() const +{ + bool b = false; + + switch(m__d) + { + case 'a': + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_zero; +} + +int32_t& WCharUnion::case_zero() +{ + bool b = false; + + switch(m__d) + { + case 'a': + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_zero; +} + + +void WCharUnion::case_one( + int32_t _case_one) +{ + m_case_one = _case_one; + m__d = 'b'; + +} + +int32_t WCharUnion::case_one() const +{ + bool b = false; + + switch(m__d) + { + case 'b': + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_one; +} + +int32_t& WCharUnion::case_one() +{ + bool b = false; + + switch(m__d) + { + case 'b': + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_one; +} + + +// TODO(Ricardo) Review +size_t WCharUnion::getCdrSerializedSize( + const WCharUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case 'a': + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case 'b': + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void WCharUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case 'a': + scdr << m_case_zero; + + break; + + + case 'b': + scdr << m_case_one; + + break; + + default: + break; + } +} + +void WCharUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case 'a': + dcdr >> m_case_zero; + + + break; + + + case 'b': + dcdr >> m_case_one; + + + break; + + default: + break; + } +} + + + + + +OctetUnion::OctetUnion() +{ + m__d = 5; + // long m_case_five + m_case_five = 0; + // long m_case_seven + m_case_seven = 0; +} + +OctetUnion::~OctetUnion() +{ +} + +OctetUnion::OctetUnion( + const OctetUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 5: + m_case_five = x.m_case_five; + break; + + + case 7: + m_case_seven = x.m_case_seven; + break; + + default: + break; + } +} + +OctetUnion::OctetUnion( + OctetUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 5: + m_case_five = x.m_case_five; + break; + + + case 7: + m_case_seven = x.m_case_seven; + break; + + default: + break; + } +} + +OctetUnion& OctetUnion::operator =( + const OctetUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 5: + m_case_five = x.m_case_five; + break; + + + case 7: + m_case_seven = x.m_case_seven; + break; + + default: + break; + } + + return *this; +} + +OctetUnion& OctetUnion::operator =( + OctetUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 5: + m_case_five = x.m_case_five; + break; + + + case 7: + m_case_seven = x.m_case_seven; + break; + + default: + break; + } + + return *this; +} + +bool OctetUnion::operator ==( + const OctetUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case 5: + return (m_case_five == x.m_case_five); + break; + + + case 7: + return (m_case_seven == x.m_case_seven); + break; + + default: + break; + } + return false; +} + +bool OctetUnion::operator !=( + const OctetUnion& x) const +{ + return !(*this == x); +} + +void OctetUnion::_d( + uint8_t __d) +{ + bool b = false; + + switch(m__d) + { + case 5: + switch(__d) + { + case 5: + b = true; + break; + default: + break; + } + break; + + + case 7: + switch(__d) + { + case 7: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +uint8_t OctetUnion::_d() const +{ + return m__d; +} + +uint8_t& OctetUnion::_d() +{ + return m__d; +} + +void OctetUnion::case_five( + int32_t _case_five) +{ + m_case_five = _case_five; + m__d = 5; + +} + +int32_t OctetUnion::case_five() const +{ + bool b = false; + + switch(m__d) + { + case 5: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_five; +} + +int32_t& OctetUnion::case_five() +{ + bool b = false; + + switch(m__d) + { + case 5: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_five; +} + + +void OctetUnion::case_seven( + int32_t _case_seven) +{ + m_case_seven = _case_seven; + m__d = 7; + +} + +int32_t OctetUnion::case_seven() const +{ + bool b = false; + + switch(m__d) + { + case 7: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_seven; +} + +int32_t& OctetUnion::case_seven() +{ + bool b = false; + + switch(m__d) + { + case 7: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_seven; +} + + +// TODO(Ricardo) Review +size_t OctetUnion::getCdrSerializedSize( + const OctetUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + switch(data.m__d) + { + case 5: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case 7: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void OctetUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case 5: + scdr << m_case_five; + + break; + + + case 7: + scdr << m_case_seven; + + break; + + default: + break; + } +} + +void OctetUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case 5: + dcdr >> m_case_five; + + + break; + + + case 7: + dcdr >> m_case_seven; + + + break; + + default: + break; + } +} + + + + + +Int8Union::Int8Union() +{ + m__d = 3; + // long m_case_three + m_case_three = 0; + // long m_case_six + m_case_six = 0; +} + +Int8Union::~Int8Union() +{ +} + +Int8Union::Int8Union( + const Int8Union& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 3: + m_case_three = x.m_case_three; + break; + + + case 6: + m_case_six = x.m_case_six; + break; + + default: + break; + } +} + +Int8Union::Int8Union( + Int8Union&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 3: + m_case_three = x.m_case_three; + break; + + + case 6: + m_case_six = x.m_case_six; + break; + + default: + break; + } +} + +Int8Union& Int8Union::operator =( + const Int8Union& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 3: + m_case_three = x.m_case_three; + break; + + + case 6: + m_case_six = x.m_case_six; + break; + + default: + break; + } + + return *this; +} + +Int8Union& Int8Union::operator =( + Int8Union&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 3: + m_case_three = x.m_case_three; + break; + + + case 6: + m_case_six = x.m_case_six; + break; + + default: + break; + } + + return *this; +} + +bool Int8Union::operator ==( + const Int8Union& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case 3: + return (m_case_three == x.m_case_three); + break; + + + case 6: + return (m_case_six == x.m_case_six); + break; + + default: + break; + } + return false; +} + +bool Int8Union::operator !=( + const Int8Union& x) const +{ + return !(*this == x); +} + +void Int8Union::_d( + int8_t __d) +{ + bool b = false; + + switch(m__d) + { + case 3: + switch(__d) + { + case 3: + b = true; + break; + default: + break; + } + break; + + + case 6: + switch(__d) + { + case 6: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int8_t Int8Union::_d() const +{ + return m__d; +} + +int8_t& Int8Union::_d() +{ + return m__d; +} + +void Int8Union::case_three( + int32_t _case_three) +{ + m_case_three = _case_three; + m__d = 3; + +} + +int32_t Int8Union::case_three() const +{ + bool b = false; + + switch(m__d) + { + case 3: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_three; +} + +int32_t& Int8Union::case_three() +{ + bool b = false; + + switch(m__d) + { + case 3: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_three; +} + + +void Int8Union::case_six( + int32_t _case_six) +{ + m_case_six = _case_six; + m__d = 6; + +} + +int32_t Int8Union::case_six() const +{ + bool b = false; + + switch(m__d) + { + case 6: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_six; +} + +int32_t& Int8Union::case_six() +{ + bool b = false; + + switch(m__d) + { + case 6: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_case_six; +} + + +// TODO(Ricardo) Review +size_t Int8Union::getCdrSerializedSize( + const Int8Union& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + switch(data.m__d) + { + case 3: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case 6: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void Int8Union::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case 3: + scdr << m_case_three; + + break; + + + case 6: + scdr << m_case_six; + + break; + + default: + break; + } +} + +void Int8Union::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case 3: + dcdr >> m_case_three; + + + break; + + + case 6: + dcdr >> m_case_six; + + + break; + + default: + break; + } +} + + + +namespace bitmodule { + +ParentBitset::ParentBitset() +{ + // Just to register all known types + registernew_features_4_2Types(); +} + +ParentBitset::~ParentBitset() +{ +} + +ParentBitset::ParentBitset( + const ParentBitset& x) +{ + m_bitset = x.m_bitset; +} + +ParentBitset::ParentBitset( + ParentBitset&& x) noexcept +{ + m_bitset = x.m_bitset; +} + +ParentBitset& ParentBitset::operator =( + const ParentBitset& x) +{ + m_bitset = x.m_bitset; + + return *this; +} + +ParentBitset& ParentBitset::operator =( + ParentBitset&& x) noexcept +{ + m_bitset = x.m_bitset; + + return *this; +} + +bool ParentBitset::operator ==( + const ParentBitset& x) const +{ + return m_bitset == x.m_bitset; +} + +bool ParentBitset::operator !=( + const ParentBitset& x) const +{ + return !(*this == x); +} + +size_t ParentBitset::getCdrSerializedSize( + const ParentBitset&, + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + current_alignment += sizeof(helper::FindType<17>::type) + + eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<17>::type)); + + return current_alignment - initial_alignment; +} + + +void ParentBitset::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + using namespace bitmodule; + + helper::FindType<17>::type bits = static_cast::type>(bitset().to_ullong()); + scdr << bits; +} + +void ParentBitset::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + using namespace bitmodule; + + helper::FindType<17>::type bits; + dcdr >> bits; + bitset(std::bitset<17>(bits)); +} + + + +void bitmodule::ParentBitset::parent_bitfield( + uint32_t _parent_bitfield) +{ + int base = 0; + int size = 17; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_parent_bitfield & 0x01)); + _parent_bitfield = _parent_bitfield >> 1; + } + +} + +uint32_t bitmodule::ParentBitset::parent_bitfield() const +{ + int base = 0; + int size = 17; + std::bitset<17> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +std::bitset<17> ParentBitset::bitset() const +{ + std::string str_value; + + str_value = m_bitset.to_string() + str_value; + + return std::bitset<17>(str_value); +} + +void ParentBitset::bitset( + const std::bitset<17>& bitset) +{ + std::string str_value {bitset.to_string()}; + size_t base_diff {0}; + size_t last_post {std::string::npos}; + + base_diff += 17; + m_bitset = std::bitset<17>(str_value.substr(str_value.length() - base_diff, last_post)); +} + +MyBitset::MyBitset() + : bitmodule::ParentBitset() +{ + // Just to register all known types + registernew_features_4_2Types(); +} + +MyBitset::~MyBitset() +{ +} + +MyBitset::MyBitset( + const MyBitset& x) + : bitmodule::ParentBitset(x) +{ + m_bitset = x.m_bitset; +} + +MyBitset::MyBitset( + MyBitset&& x) noexcept + : bitmodule::ParentBitset(std::move(x)) +{ + m_bitset = x.m_bitset; +} + +MyBitset& MyBitset::operator =( + const MyBitset& x) +{ + bitmodule::ParentBitset::operator =(x); + + m_bitset = x.m_bitset; + + return *this; +} + +MyBitset& MyBitset::operator =( + MyBitset&& x) noexcept +{ + bitmodule::ParentBitset::operator =(std::move(x)); + + m_bitset = x.m_bitset; + + return *this; +} + +bool MyBitset::operator ==( + const MyBitset& x) const +{ + if (bitmodule::ParentBitset::operator !=(x)) return false; + + return m_bitset == x.m_bitset; +} + +bool MyBitset::operator !=( + const MyBitset& x) const +{ + return !(*this == x); +} + +size_t MyBitset::getCdrSerializedSize( + const MyBitset&, + size_t current_alignment) +{ + size_t initial_alignment = current_alignment; + + current_alignment += sizeof(helper::FindType<50>::type) + + eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(helper::FindType<50>::type)); + + return current_alignment - initial_alignment; +} + + +void MyBitset::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + using namespace bitmodule; + + helper::FindType<50>::type bits = static_cast::type>(bitset().to_ullong()); + scdr << bits; +} + +void MyBitset::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + using namespace bitmodule; + + helper::FindType<50>::type bits; + dcdr >> bits; + bitset(std::bitset<50>(bits)); +} + + + +void bitmodule::MyBitset::a( + char _a) +{ + int base = 0; + int size = 3; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_a & 0x01)); + _a = _a >> 1; + } + +} + +char bitmodule::MyBitset::a() const +{ + int base = 0; + int size = 3; + std::bitset<3> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +void bitmodule::MyBitset::b( + bool _b) +{ + int base = 3; + m_bitset.set(base, _b); +} + +bool bitmodule::MyBitset::b() const +{ + int base = 3; + return m_bitset.test(base); +} + + + +void bitmodule::MyBitset::c( + uint16_t _c) +{ + int base = 8; + int size = 10; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_c & 0x01)); + _c = _c >> 1; + } + +} + +uint16_t bitmodule::MyBitset::c() const +{ + int base = 8; + int size = 10; + std::bitset<10> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +void bitmodule::MyBitset::d( + int16_t _d) +{ + int base = 18; + int size = 5; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_d & 0x01)); + _d = _d >> 1; + } + +} + +int16_t bitmodule::MyBitset::d() const +{ + int base = 18; + int size = 5; + std::bitset<5> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +void bitmodule::MyBitset::e( + int16_t _e) +{ + int base = 23; + int size = 5; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_e & 0x01)); + _e = _e >> 1; + } + +} + +int16_t bitmodule::MyBitset::e() const +{ + int base = 23; + int size = 5; + std::bitset<5> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +void bitmodule::MyBitset::f( + int16_t _f) +{ + int base = 28; + int size = 5; + for (int i = base; i < base + size; ++i) + { + m_bitset.set(i, !!(_f & 0x01)); + _f = _f >> 1; + } + +} + +int16_t bitmodule::MyBitset::f() const +{ + int base = 28; + int size = 5; + std::bitset<5> aux; + for (int i = 0; i < size; ++i) + { + aux.set(i, m_bitset.test(i + base)); + } + return static_cast(aux.to_ullong()); + +} + + +std::bitset<50> MyBitset::bitset() const +{ + std::string str_value; + + str_value = static_cast(this)->bitset().to_string() + str_value; + + str_value = m_bitset.to_string() + str_value; + + return std::bitset<50>(str_value); +} + +void MyBitset::bitset( + const std::bitset<50>& bitset) +{ + std::string str_value {bitset.to_string()}; + size_t base_diff {0}; + size_t last_post {std::string::npos}; + + { + base_diff += 17; + std::bitset<17> internal_bitset(str_value.substr(str_value.length() - base_diff, last_post)); + static_cast(this)->bitset(internal_bitset); + last_post = base_diff; + } + + base_diff += 33; + m_bitset = std::bitset<33>(str_value.substr(str_value.length() - base_diff, last_post)); +} + + + + +BitsetBitmask::BitsetBitmask() +{ + // bitmodule::MyBitset m_mybitset + + // bitmodule::MyBitMask m_mybitmask + + + // Just to register all known types + registernew_features_4_2Types(); +} + +BitsetBitmask::~BitsetBitmask() +{ +} + +BitsetBitmask::BitsetBitmask( + const BitsetBitmask& x) +{ + m_mybitset = x.m_mybitset; + + + m_mybitmask = x.m_mybitmask; + +} + +BitsetBitmask::BitsetBitmask( + BitsetBitmask&& x) noexcept +{ + m_mybitset = std::move(x.m_mybitset); + + + m_mybitmask = std::move(x.m_mybitmask); + +} + +BitsetBitmask& BitsetBitmask::operator =( + const BitsetBitmask& x) +{ + m_mybitset = x.m_mybitset; + + + m_mybitmask = x.m_mybitmask; + + return *this; +} + +BitsetBitmask& BitsetBitmask::operator =( + BitsetBitmask&& x) noexcept +{ + m_mybitset = std::move(x.m_mybitset); + + + m_mybitmask = std::move(x.m_mybitmask); + + return *this; +} + +bool BitsetBitmask::operator ==( + const BitsetBitmask& x) const +{ + return (m_mybitset == x.m_mybitset && + m_mybitmask == x.m_mybitmask); +} + +bool BitsetBitmask::operator !=( + const BitsetBitmask& x) const +{ + return !(*this == x); +} + +size_t BitsetBitmask::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return bitmodule_BitsetBitmask_max_cdr_typesize; +} + +size_t BitsetBitmask::getCdrSerializedSize( + const BitsetBitmask& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += bitmodule::MyBitset::getCdrSerializedSize(data.mybitset(), current_alignment); + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + return current_alignment - initial_alignment; +} + + +void BitsetBitmask::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_mybitset; + + scdr << (uint8_t)m_mybitmask; + +} + +void BitsetBitmask::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_mybitset; + + + + { + uint8_t bitmask_value = 0; + dcdr >> bitmask_value; + m_mybitmask = (bitmodule::MyBitMask)bitmask_value; + } + + + +} + + +bool BitsetBitmask::isKeyDefined() +{ + return false; +} + +void BitsetBitmask::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member mybitset + * @param _mybitset New value to be copied in member mybitset + */ +void BitsetBitmask::mybitset( + const bitmodule::MyBitset& _mybitset) +{ + m_mybitset = _mybitset; +} + +/*! + * @brief This function moves the value in member mybitset + * @param _mybitset New value to be moved in member mybitset + */ +void BitsetBitmask::mybitset( + bitmodule::MyBitset&& _mybitset) +{ + m_mybitset = std::move(_mybitset); +} + +/*! + * @brief This function returns a constant reference to member mybitset + * @return Constant reference to member mybitset + */ +const bitmodule::MyBitset& BitsetBitmask::mybitset() const +{ + return m_mybitset; +} + +/*! + * @brief This function returns a reference to member mybitset + * @return Reference to member mybitset + */ +bitmodule::MyBitset& BitsetBitmask::mybitset() +{ + return m_mybitset; +} + + +/*! + * @brief This function copies the value in member mybitmask + * @param _mybitmask New value to be copied in member mybitmask + */ +void BitsetBitmask::mybitmask( + const bitmodule::MyBitMask& _mybitmask) +{ + m_mybitmask = _mybitmask; +} + +/*! + * @brief This function moves the value in member mybitmask + * @param _mybitmask New value to be moved in member mybitmask + */ +void BitsetBitmask::mybitmask( + bitmodule::MyBitMask&& _mybitmask) +{ + m_mybitmask = std::move(_mybitmask); +} + +/*! + * @brief This function returns a constant reference to member mybitmask + * @return Constant reference to member mybitmask + */ +const bitmodule::MyBitMask& BitsetBitmask::mybitmask() const +{ + return m_mybitmask; +} + +/*! + * @brief This function returns a reference to member mybitmask + * @return Reference to member mybitmask + */ +bitmodule::MyBitMask& BitsetBitmask::mybitmask() +{ + return m_mybitmask; +} + + + + + +BM2::BM2() + : bitmodule::BitsetBitmask() +{ + // bitmodule::MyBitMask m_two + + // long m_mylong + m_mylong = 0; + + // Just to register all known types + registernew_features_4_2Types(); +} + +BM2::~BM2() +{ +} + +BM2::BM2( + const BM2& x) + : bitmodule::BitsetBitmask(x) +{ + m_two = x.m_two; + + + m_mylong = x.m_mylong; + +} + +BM2::BM2( + BM2&& x) noexcept + : bitmodule::BitsetBitmask(std::move(x)) +{ + m_two = std::move(x.m_two); + + + m_mylong = x.m_mylong; + +} + +BM2& BM2::operator =( + const BM2& x) +{ + bitmodule::BitsetBitmask::operator =(x); + + m_two = x.m_two; + + + m_mylong = x.m_mylong; + + return *this; +} + +BM2& BM2::operator =( + BM2&& x) noexcept +{ + bitmodule::BitsetBitmask::operator =(std::move(x)); + + m_two = std::move(x.m_two); + + + m_mylong = x.m_mylong; + + return *this; +} + +bool BM2::operator ==( + const BM2& x) const +{ + if (bitmodule::BitsetBitmask::operator !=(x)) return false; + + return (m_two == x.m_two && + m_mylong == x.m_mylong); +} + +bool BM2::operator !=( + const BM2& x) const +{ + return !(*this == x); +} + +size_t BM2::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return bitmodule_BM2_max_cdr_typesize; +} + +size_t BM2::getCdrSerializedSize( + const BM2& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += bitmodule::BitsetBitmask::getCdrSerializedSize(data, current_alignment); + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void BM2::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + bitmodule::BitsetBitmask::serialize(scdr); + + scdr << (uint8_t)m_two; + + scdr << m_mylong; + +} + +void BM2::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + bitmodule::BitsetBitmask::deserialize(dcdr); + + { + uint8_t bitmask_value = 0; + dcdr >> bitmask_value; + m_two = (bitmodule::MyBitMask)bitmask_value; + } + + + + + dcdr >> m_mylong; + + +} + + +bool BM2::isKeyDefined() +{ + if (bitmodule::BitsetBitmask::isKeyDefined()) + return true; + + return false; +} + +void BM2::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + bitmodule::BitsetBitmask::serializeKey(scdr); +} + +/*! + * @brief This function copies the value in member two + * @param _two New value to be copied in member two + */ +void BM2::two( + const bitmodule::MyBitMask& _two) +{ + m_two = _two; +} + +/*! + * @brief This function moves the value in member two + * @param _two New value to be moved in member two + */ +void BM2::two( + bitmodule::MyBitMask&& _two) +{ + m_two = std::move(_two); +} + +/*! + * @brief This function returns a constant reference to member two + * @return Constant reference to member two + */ +const bitmodule::MyBitMask& BM2::two() const +{ + return m_two; +} + +/*! + * @brief This function returns a reference to member two + * @return Reference to member two + */ +bitmodule::MyBitMask& BM2::two() +{ + return m_two; +} + + +/*! + * @brief This function sets a value in member mylong + * @param _mylong New value for member mylong + */ +void BM2::mylong( + int32_t _mylong) +{ + m_mylong = _mylong; +} + +/*! + * @brief This function returns the value of member mylong + * @return Value of member mylong + */ +int32_t BM2::mylong() const +{ + return m_mylong; +} + +/*! + * @brief This function returns a reference to member mylong + * @return Reference to member mylong + */ +int32_t& BM2::mylong() +{ + return m_mylong; +} + + + + + +} // namespace bitmodule + + +StructTest::StructTest() + : NewAliases() +{ + // OctetUnion m_octetUnion + + // Int8Union m_int8Union + + // bitmodule::BM2 m_myStructBits + + + // Just to register all known types + registernew_features_4_2Types(); +} + +StructTest::~StructTest() +{ +} + +StructTest::StructTest( + const StructTest& x) + : NewAliases(x) +{ + m_octetUnion = x.m_octetUnion; + + + m_int8Union = x.m_int8Union; + + + m_myStructBits = x.m_myStructBits; + +} + +StructTest::StructTest( + StructTest&& x) noexcept + : NewAliases(std::move(x)) +{ + m_octetUnion = std::move(x.m_octetUnion); + + + m_int8Union = std::move(x.m_int8Union); + + + m_myStructBits = std::move(x.m_myStructBits); + +} + +StructTest& StructTest::operator =( + const StructTest& x) +{ + NewAliases::operator =(x); + + m_octetUnion = x.m_octetUnion; + + + m_int8Union = x.m_int8Union; + + + m_myStructBits = x.m_myStructBits; + + return *this; +} + +StructTest& StructTest::operator =( + StructTest&& x) noexcept +{ + NewAliases::operator =(std::move(x)); + + m_octetUnion = std::move(x.m_octetUnion); + + + m_int8Union = std::move(x.m_int8Union); + + + m_myStructBits = std::move(x.m_myStructBits); + + return *this; +} + +bool StructTest::operator ==( + const StructTest& x) const +{ + if (NewAliases::operator !=(x)) return false; + + return (m_octetUnion == x.m_octetUnion && + m_int8Union == x.m_int8Union && + m_myStructBits == x.m_myStructBits); +} + +bool StructTest::operator !=( + const StructTest& x) const +{ + return !(*this == x); +} + +size_t StructTest::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StructTest_max_cdr_typesize; +} + +size_t StructTest::getCdrSerializedSize( + const StructTest& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += NewAliases::getCdrSerializedSize(data, current_alignment); + + current_alignment += OctetUnion::getCdrSerializedSize(data.octetUnion(), current_alignment); + + + current_alignment += Int8Union::getCdrSerializedSize(data.int8Union(), current_alignment); + + + current_alignment += bitmodule::BM2::getCdrSerializedSize(data.myStructBits(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void StructTest::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + NewAliases::serialize(scdr); + + scdr << m_octetUnion; + + scdr << m_int8Union; + + scdr << m_myStructBits; + +} + +void StructTest::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + NewAliases::deserialize(dcdr); + + dcdr >> m_octetUnion; + + + + dcdr >> m_int8Union; + + + + dcdr >> m_myStructBits; + + +} + + +bool StructTest::isKeyDefined() +{ + if (NewAliases::isKeyDefined()) + return true; + + return false; +} + +void StructTest::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; + NewAliases::serializeKey(scdr); +} + +/*! + * @brief This function copies the value in member octetUnion + * @param _octetUnion New value to be copied in member octetUnion + */ +void StructTest::octetUnion( + const OctetUnion& _octetUnion) +{ + m_octetUnion = _octetUnion; +} + +/*! + * @brief This function moves the value in member octetUnion + * @param _octetUnion New value to be moved in member octetUnion + */ +void StructTest::octetUnion( + OctetUnion&& _octetUnion) +{ + m_octetUnion = std::move(_octetUnion); +} + +/*! + * @brief This function returns a constant reference to member octetUnion + * @return Constant reference to member octetUnion + */ +const OctetUnion& StructTest::octetUnion() const +{ + return m_octetUnion; +} + +/*! + * @brief This function returns a reference to member octetUnion + * @return Reference to member octetUnion + */ +OctetUnion& StructTest::octetUnion() +{ + return m_octetUnion; +} + + +/*! + * @brief This function copies the value in member int8Union + * @param _int8Union New value to be copied in member int8Union + */ +void StructTest::int8Union( + const Int8Union& _int8Union) +{ + m_int8Union = _int8Union; +} + +/*! + * @brief This function moves the value in member int8Union + * @param _int8Union New value to be moved in member int8Union + */ +void StructTest::int8Union( + Int8Union&& _int8Union) +{ + m_int8Union = std::move(_int8Union); +} + +/*! + * @brief This function returns a constant reference to member int8Union + * @return Constant reference to member int8Union + */ +const Int8Union& StructTest::int8Union() const +{ + return m_int8Union; +} + +/*! + * @brief This function returns a reference to member int8Union + * @return Reference to member int8Union + */ +Int8Union& StructTest::int8Union() +{ + return m_int8Union; +} + + +/*! + * @brief This function copies the value in member myStructBits + * @param _myStructBits New value to be copied in member myStructBits + */ +void StructTest::myStructBits( + const bitmodule::BM2& _myStructBits) +{ + m_myStructBits = _myStructBits; +} + +/*! + * @brief This function moves the value in member myStructBits + * @param _myStructBits New value to be moved in member myStructBits + */ +void StructTest::myStructBits( + bitmodule::BM2&& _myStructBits) +{ + m_myStructBits = std::move(_myStructBits); +} + +/*! + * @brief This function returns a constant reference to member myStructBits + * @return Constant reference to member myStructBits + */ +const bitmodule::BM2& StructTest::myStructBits() const +{ + return m_myStructBits; +} + +/*! + * @brief This function returns a reference to member myStructBits + * @return Reference to member myStructBits + */ +bitmodule::BM2& StructTest::myStructBits() +{ + return m_myStructBits; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/dynamic_types/idl/new_features_4_2v1.h b/test/unittest/dynamic_types/idl/new_features_4_2v1.h new file mode 100644 index 00000000000..4a659ada31e --- /dev/null +++ b/test/unittest/dynamic_types/idl/new_features_4_2v1.h @@ -0,0 +1,1737 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file new_features_4_2.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ +#define _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(NEW_FEATURES_4_2_SOURCE) +#define NEW_FEATURES_4_2_DllAPI __declspec( dllexport ) +#else +#define NEW_FEATURES_4_2_DllAPI __declspec( dllimport ) +#endif // NEW_FEATURES_4_2_SOURCE +#else +#define NEW_FEATURES_4_2_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define NEW_FEATURES_4_2_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + + + +/*! + * @brief This class represents the structure NewAliases defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class NewAliases +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport NewAliases(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~NewAliases(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object NewAliases that will be copied. + */ + eProsima_user_DllExport NewAliases( + const NewAliases& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object NewAliases that will be copied. + */ + eProsima_user_DllExport NewAliases( + NewAliases&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object NewAliases that will be copied. + */ + eProsima_user_DllExport NewAliases& operator =( + const NewAliases& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object NewAliases that will be copied. + */ + eProsima_user_DllExport NewAliases& operator =( + NewAliases&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x NewAliases object to compare. + */ + eProsima_user_DllExport bool operator ==( + const NewAliases& x) const; + + /*! + * @brief Comparison operator. + * @param x NewAliases object to compare. + */ + eProsima_user_DllExport bool operator !=( + const NewAliases& x) const; + + /*! + * @brief This function sets a value in member int8_ + * @param _int8_ New value for member int8_ + */ + eProsima_user_DllExport void int8_( + int8_t _int8_); + + /*! + * @brief This function returns the value of member int8_ + * @return Value of member int8_ + */ + eProsima_user_DllExport int8_t int8_() const; + + /*! + * @brief This function returns a reference to member int8_ + * @return Reference to member int8_ + */ + eProsima_user_DllExport int8_t& int8_(); + + + /*! + * @brief This function sets a value in member uint8_ + * @param _uint8_ New value for member uint8_ + */ + eProsima_user_DllExport void uint8_( + uint8_t _uint8_); + + /*! + * @brief This function returns the value of member uint8_ + * @return Value of member uint8_ + */ + eProsima_user_DllExport uint8_t uint8_() const; + + /*! + * @brief This function returns a reference to member uint8_ + * @return Reference to member uint8_ + */ + eProsima_user_DllExport uint8_t& uint8_(); + + + /*! + * @brief This function sets a value in member int16_ + * @param _int16_ New value for member int16_ + */ + eProsima_user_DllExport void int16_( + int16_t _int16_); + + /*! + * @brief This function returns the value of member int16_ + * @return Value of member int16_ + */ + eProsima_user_DllExport int16_t int16_() const; + + /*! + * @brief This function returns a reference to member int16_ + * @return Reference to member int16_ + */ + eProsima_user_DllExport int16_t& int16_(); + + + /*! + * @brief This function sets a value in member uint16_ + * @param _uint16_ New value for member uint16_ + */ + eProsima_user_DllExport void uint16_( + uint16_t _uint16_); + + /*! + * @brief This function returns the value of member uint16_ + * @return Value of member uint16_ + */ + eProsima_user_DllExport uint16_t uint16_() const; + + /*! + * @brief This function returns a reference to member uint16_ + * @return Reference to member uint16_ + */ + eProsima_user_DllExport uint16_t& uint16_(); + + + /*! + * @brief This function sets a value in member int32_ + * @param _int32_ New value for member int32_ + */ + eProsima_user_DllExport void int32_( + int32_t _int32_); + + /*! + * @brief This function returns the value of member int32_ + * @return Value of member int32_ + */ + eProsima_user_DllExport int32_t int32_() const; + + /*! + * @brief This function returns a reference to member int32_ + * @return Reference to member int32_ + */ + eProsima_user_DllExport int32_t& int32_(); + + + /*! + * @brief This function sets a value in member uint32_ + * @param _uint32_ New value for member uint32_ + */ + eProsima_user_DllExport void uint32_( + uint32_t _uint32_); + + /*! + * @brief This function returns the value of member uint32_ + * @return Value of member uint32_ + */ + eProsima_user_DllExport uint32_t uint32_() const; + + /*! + * @brief This function returns a reference to member uint32_ + * @return Reference to member uint32_ + */ + eProsima_user_DllExport uint32_t& uint32_(); + + + /*! + * @brief This function sets a value in member int64_ + * @param _int64_ New value for member int64_ + */ + eProsima_user_DllExport void int64_( + int64_t _int64_); + + /*! + * @brief This function returns the value of member int64_ + * @return Value of member int64_ + */ + eProsima_user_DllExport int64_t int64_() const; + + /*! + * @brief This function returns a reference to member int64_ + * @return Reference to member int64_ + */ + eProsima_user_DllExport int64_t& int64_(); + + + /*! + * @brief This function sets a value in member uint64_ + * @param _uint64_ New value for member uint64_ + */ + eProsima_user_DllExport void uint64_( + uint64_t _uint64_); + + /*! + * @brief This function returns the value of member uint64_ + * @return Value of member uint64_ + */ + eProsima_user_DllExport uint64_t uint64_() const; + + /*! + * @brief This function returns a reference to member uint64_ + * @return Reference to member uint64_ + */ + eProsima_user_DllExport uint64_t& uint64_(); + + + /*! + * @brief This function copies the value in member local_string + * @param _local_string New value to be copied in member local_string + */ + eProsima_user_DllExport void local_string( + const std::string& _local_string); + + /*! + * @brief This function moves the value in member local_string + * @param _local_string New value to be moved in member local_string + */ + eProsima_user_DllExport void local_string( + std::string&& _local_string); + + /*! + * @brief This function returns a constant reference to member local_string + * @return Constant reference to member local_string + */ + eProsima_user_DllExport const std::string& local_string() const; + + /*! + * @brief This function returns a reference to member local_string + * @return Reference to member local_string + */ + eProsima_user_DllExport std::string& local_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const NewAliases& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int8_t m_int8_; + uint8_t m_uint8_; + int16_t m_int16_; + uint16_t m_uint16_; + int32_t m_int32_; + uint32_t m_uint32_; + int64_t m_int64_; + uint64_t m_uint64_; + std::string m_local_string; + +}; + + + +/*! + * @brief This class represents the union WCharUnion defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class WCharUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WCharUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WCharUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion( + const WCharUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion( + WCharUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion& operator =( + const WCharUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WCharUnion that will be copied. + */ + eProsima_user_DllExport WCharUnion& operator =( + WCharUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WCharUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WCharUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x WCharUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WCharUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + wchar_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport wchar_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport wchar_t& _d(); + + /*! + * @brief This function sets a value in member case_zero + * @param _case_zero New value for member case_zero + */ + eProsima_user_DllExport void case_zero( + int32_t _case_zero); + + /*! + * @brief This function returns the value of member case_zero + * @return Value of member case_zero + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_zero() const; + + /*! + * @brief This function returns a reference to member case_zero + * @return Reference to member case_zero + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_zero(); + + + /*! + * @brief This function sets a value in member case_one + * @param _case_one New value for member case_one + */ + eProsima_user_DllExport void case_one( + int32_t _case_one); + + /*! + * @brief This function returns the value of member case_one + * @return Value of member case_one + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_one() const; + + /*! + * @brief This function returns a reference to member case_one + * @return Reference to member case_one + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_one(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WCharUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + wchar_t m__d; + + int32_t m_case_zero; + int32_t m_case_one; +}; + + + +/*! + * @brief This class represents the union OctetUnion defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class OctetUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport OctetUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~OctetUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object OctetUnion that will be copied. + */ + eProsima_user_DllExport OctetUnion( + const OctetUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object OctetUnion that will be copied. + */ + eProsima_user_DllExport OctetUnion( + OctetUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object OctetUnion that will be copied. + */ + eProsima_user_DllExport OctetUnion& operator =( + const OctetUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object OctetUnion that will be copied. + */ + eProsima_user_DllExport OctetUnion& operator =( + OctetUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x OctetUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const OctetUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x OctetUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const OctetUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport uint8_t& _d(); + + /*! + * @brief This function sets a value in member case_five + * @param _case_five New value for member case_five + */ + eProsima_user_DllExport void case_five( + int32_t _case_five); + + /*! + * @brief This function returns the value of member case_five + * @return Value of member case_five + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_five() const; + + /*! + * @brief This function returns a reference to member case_five + * @return Reference to member case_five + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_five(); + + + /*! + * @brief This function sets a value in member case_seven + * @param _case_seven New value for member case_seven + */ + eProsima_user_DllExport void case_seven( + int32_t _case_seven); + + /*! + * @brief This function returns the value of member case_seven + * @return Value of member case_seven + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_seven() const; + + /*! + * @brief This function returns a reference to member case_seven + * @return Reference to member case_seven + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_seven(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const OctetUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + uint8_t m__d; + + int32_t m_case_five; + int32_t m_case_seven; +}; + + + +/*! + * @brief This class represents the union Int8Union defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class Int8Union +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport Int8Union(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~Int8Union(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object Int8Union that will be copied. + */ + eProsima_user_DllExport Int8Union( + const Int8Union& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object Int8Union that will be copied. + */ + eProsima_user_DllExport Int8Union( + Int8Union&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object Int8Union that will be copied. + */ + eProsima_user_DllExport Int8Union& operator =( + const Int8Union& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object Int8Union that will be copied. + */ + eProsima_user_DllExport Int8Union& operator =( + Int8Union&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x Int8Union object to compare. + */ + eProsima_user_DllExport bool operator ==( + const Int8Union& x) const; + + /*! + * @brief Comparison operator. + * @param x Int8Union object to compare. + */ + eProsima_user_DllExport bool operator !=( + const Int8Union& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int8_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int8_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int8_t& _d(); + + /*! + * @brief This function sets a value in member case_three + * @param _case_three New value for member case_three + */ + eProsima_user_DllExport void case_three( + int32_t _case_three); + + /*! + * @brief This function returns the value of member case_three + * @return Value of member case_three + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_three() const; + + /*! + * @brief This function returns a reference to member case_three + * @return Reference to member case_three + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_three(); + + + /*! + * @brief This function sets a value in member case_six + * @param _case_six New value for member case_six + */ + eProsima_user_DllExport void case_six( + int32_t _case_six); + + /*! + * @brief This function returns the value of member case_six + * @return Value of member case_six + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t case_six() const; + + /*! + * @brief This function returns a reference to member case_six + * @return Reference to member case_six + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& case_six(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const Int8Union& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int8_t m__d; + + int32_t m_case_three; + int32_t m_case_six; +}; + +namespace bitmodule { + /*! + * @brief This class represents the structure ParentBitset defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ + class ParentBitset + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ParentBitset(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ParentBitset(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset( + const ParentBitset& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset( + ParentBitset&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset& operator =( + const ParentBitset& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::ParentBitset that will be copied. + */ + eProsima_user_DllExport ParentBitset& operator =( + ParentBitset&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::ParentBitset object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ParentBitset& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::ParentBitset object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ParentBitset& x) const; + + /*! + * @brief This function sets a value in member parent_bitfield + * @param _parent_bitfield New value for member parent_bitfield + */ + eProsima_user_DllExport void parent_bitfield( + uint32_t _parent_bitfield); + + /*! + * @brief This function returns the value of member parent_bitfield + * @return Value of member parent_bitfield + */ + eProsima_user_DllExport uint32_t parent_bitfield() const; + + + eProsima_user_DllExport std::bitset<17> bitset() const; + + eProsima_user_DllExport void bitset( + const std::bitset<17>&); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const bitmodule::ParentBitset& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + + private: + + std::bitset<17> m_bitset; + }; + /*! + * @brief This class represents the structure MyBitset defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ + class MyBitset : public bitmodule::ParentBitset + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyBitset(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyBitset(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + const MyBitset& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset( + MyBitset&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + const MyBitset& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::MyBitset that will be copied. + */ + eProsima_user_DllExport MyBitset& operator =( + MyBitset&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::MyBitset object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyBitset& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::MyBitset object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyBitset& x) const; + + /*! + * @brief This function sets a value in member a + * @param _a New value for member a + */ + eProsima_user_DllExport void a( + char _a); + + /*! + * @brief This function returns the value of member a + * @return Value of member a + */ + eProsima_user_DllExport char a() const; + + + /*! + * @brief This function sets a value in member b + * @param _b New value for member b + */ + eProsima_user_DllExport void b( + bool _b); + + /*! + * @brief This function returns the value of member b + * @return Value of member b + */ + eProsima_user_DllExport bool b() const; + + + + /*! + * @brief This function sets a value in member c + * @param _c New value for member c + */ + eProsima_user_DllExport void c( + uint16_t _c); + + /*! + * @brief This function returns the value of member c + * @return Value of member c + */ + eProsima_user_DllExport uint16_t c() const; + + + /*! + * @brief This function sets a value in member d + * @param _d New value for member d + */ + eProsima_user_DllExport void d( + int16_t _d); + + /*! + * @brief This function returns the value of member d + * @return Value of member d + */ + eProsima_user_DllExport int16_t d() const; + + + /*! + * @brief This function sets a value in member e + * @param _e New value for member e + */ + eProsima_user_DllExport void e( + int16_t _e); + + /*! + * @brief This function returns the value of member e + * @return Value of member e + */ + eProsima_user_DllExport int16_t e() const; + + + /*! + * @brief This function sets a value in member f + * @param _f New value for member f + */ + eProsima_user_DllExport void f( + int16_t _f); + + /*! + * @brief This function returns the value of member f + * @return Value of member f + */ + eProsima_user_DllExport int16_t f() const; + + + eProsima_user_DllExport std::bitset<50> bitset() const; + + eProsima_user_DllExport void bitset( + const std::bitset<50>&); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const bitmodule::MyBitset& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + + private: + + std::bitset<33> m_bitset; + }; + /*! + * @brief This class represents the bitmask MyBitMask defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ + enum MyBitMaskBits : uint8_t + { + flag0 = 0x01ull << 0, + flag1 = 0x01ull << 1, + flag4 = 0x01ull << 4, + flag6 = 0x01ull << 6, + flag7 = 0x01ull << 7 + }; + typedef uint8_t MyBitMask; + + + /*! + * @brief This class represents the structure BitsetBitmask defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ + class BitsetBitmask + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BitsetBitmask(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BitsetBitmask(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask( + const BitsetBitmask& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask( + BitsetBitmask&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask& operator =( + const BitsetBitmask& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::BitsetBitmask that will be copied. + */ + eProsima_user_DllExport BitsetBitmask& operator =( + BitsetBitmask&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BitsetBitmask object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BitsetBitmask& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BitsetBitmask object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BitsetBitmask& x) const; + + /*! + * @brief This function copies the value in member mybitset + * @param _mybitset New value to be copied in member mybitset + */ + eProsima_user_DllExport void mybitset( + const bitmodule::MyBitset& _mybitset); + + /*! + * @brief This function moves the value in member mybitset + * @param _mybitset New value to be moved in member mybitset + */ + eProsima_user_DllExport void mybitset( + bitmodule::MyBitset&& _mybitset); + + /*! + * @brief This function returns a constant reference to member mybitset + * @return Constant reference to member mybitset + */ + eProsima_user_DllExport const bitmodule::MyBitset& mybitset() const; + + /*! + * @brief This function returns a reference to member mybitset + * @return Reference to member mybitset + */ + eProsima_user_DllExport bitmodule::MyBitset& mybitset(); + + + /*! + * @brief This function copies the value in member mybitmask + * @param _mybitmask New value to be copied in member mybitmask + */ + eProsima_user_DllExport void mybitmask( + const bitmodule::MyBitMask& _mybitmask); + + /*! + * @brief This function moves the value in member mybitmask + * @param _mybitmask New value to be moved in member mybitmask + */ + eProsima_user_DllExport void mybitmask( + bitmodule::MyBitMask&& _mybitmask); + + /*! + * @brief This function returns a constant reference to member mybitmask + * @return Constant reference to member mybitmask + */ + eProsima_user_DllExport const bitmodule::MyBitMask& mybitmask() const; + + /*! + * @brief This function returns a reference to member mybitmask + * @return Reference to member mybitmask + */ + eProsima_user_DllExport bitmodule::MyBitMask& mybitmask(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const bitmodule::BitsetBitmask& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + bitmodule::MyBitset m_mybitset; + bitmodule::MyBitMask m_mybitmask; + + }; + + + + /*! + * @brief This class represents the structure BM2 defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ + class BM2 : public bitmodule::BitsetBitmask + { + public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BM2(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BM2(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2( + const BM2& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2( + BM2&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2& operator =( + const BM2& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object bitmodule::BM2 that will be copied. + */ + eProsima_user_DllExport BM2& operator =( + BM2&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BM2 object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BM2& x) const; + + /*! + * @brief Comparison operator. + * @param x bitmodule::BM2 object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BM2& x) const; + + /*! + * @brief This function copies the value in member two + * @param _two New value to be copied in member two + */ + eProsima_user_DllExport void two( + const bitmodule::MyBitMask& _two); + + /*! + * @brief This function moves the value in member two + * @param _two New value to be moved in member two + */ + eProsima_user_DllExport void two( + bitmodule::MyBitMask&& _two); + + /*! + * @brief This function returns a constant reference to member two + * @return Constant reference to member two + */ + eProsima_user_DllExport const bitmodule::MyBitMask& two() const; + + /*! + * @brief This function returns a reference to member two + * @return Reference to member two + */ + eProsima_user_DllExport bitmodule::MyBitMask& two(); + + + /*! + * @brief This function sets a value in member mylong + * @param _mylong New value for member mylong + */ + eProsima_user_DllExport void mylong( + int32_t _mylong); + + /*! + * @brief This function returns the value of member mylong + * @return Value of member mylong + */ + eProsima_user_DllExport int32_t mylong() const; + + /*! + * @brief This function returns a reference to member mylong + * @return Reference to member mylong + */ + eProsima_user_DllExport int32_t& mylong(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const bitmodule::BM2& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + + private: + + bitmodule::MyBitMask m_two; + int32_t m_mylong; + + }; + +} // namespace bitmodule + + +/*! + * @brief This class represents the structure StructTest defined by the user in the IDL file. + * @ingroup new_features_4_2 + */ +class StructTest : public NewAliases +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StructTest(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StructTest(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StructTest that will be copied. + */ + eProsima_user_DllExport StructTest( + const StructTest& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StructTest that will be copied. + */ + eProsima_user_DllExport StructTest( + StructTest&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StructTest that will be copied. + */ + eProsima_user_DllExport StructTest& operator =( + const StructTest& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StructTest that will be copied. + */ + eProsima_user_DllExport StructTest& operator =( + StructTest&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StructTest object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StructTest& x) const; + + /*! + * @brief Comparison operator. + * @param x StructTest object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StructTest& x) const; + + /*! + * @brief This function copies the value in member octetUnion + * @param _octetUnion New value to be copied in member octetUnion + */ + eProsima_user_DllExport void octetUnion( + const OctetUnion& _octetUnion); + + /*! + * @brief This function moves the value in member octetUnion + * @param _octetUnion New value to be moved in member octetUnion + */ + eProsima_user_DllExport void octetUnion( + OctetUnion&& _octetUnion); + + /*! + * @brief This function returns a constant reference to member octetUnion + * @return Constant reference to member octetUnion + */ + eProsima_user_DllExport const OctetUnion& octetUnion() const; + + /*! + * @brief This function returns a reference to member octetUnion + * @return Reference to member octetUnion + */ + eProsima_user_DllExport OctetUnion& octetUnion(); + + + /*! + * @brief This function copies the value in member int8Union + * @param _int8Union New value to be copied in member int8Union + */ + eProsima_user_DllExport void int8Union( + const Int8Union& _int8Union); + + /*! + * @brief This function moves the value in member int8Union + * @param _int8Union New value to be moved in member int8Union + */ + eProsima_user_DllExport void int8Union( + Int8Union&& _int8Union); + + /*! + * @brief This function returns a constant reference to member int8Union + * @return Constant reference to member int8Union + */ + eProsima_user_DllExport const Int8Union& int8Union() const; + + /*! + * @brief This function returns a reference to member int8Union + * @return Reference to member int8Union + */ + eProsima_user_DllExport Int8Union& int8Union(); + + + /*! + * @brief This function copies the value in member myStructBits + * @param _myStructBits New value to be copied in member myStructBits + */ + eProsima_user_DllExport void myStructBits( + const bitmodule::BM2& _myStructBits); + + /*! + * @brief This function moves the value in member myStructBits + * @param _myStructBits New value to be moved in member myStructBits + */ + eProsima_user_DllExport void myStructBits( + bitmodule::BM2&& _myStructBits); + + /*! + * @brief This function returns a constant reference to member myStructBits + * @return Constant reference to member myStructBits + */ + eProsima_user_DllExport const bitmodule::BM2& myStructBits() const; + + /*! + * @brief This function returns a reference to member myStructBits + * @return Reference to member myStructBits + */ + eProsima_user_DllExport bitmodule::BM2& myStructBits(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StructTest& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + OctetUnion m_octetUnion; + Int8Union m_int8Union; + bitmodule::BM2 m_myStructBits; + +}; + + +#endif // _FAST_DDS_GENERATED_NEW_FEATURES_4_2_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/rtps/writer/RTPSWriterTests.cpp b/test/unittest/rtps/writer/RTPSWriterTests.cpp index 6115c4bddb5..514a867d2fc 100644 --- a/test/unittest/rtps/writer/RTPSWriterTests.cpp +++ b/test/unittest/rtps/writer/RTPSWriterTests.cpp @@ -85,6 +85,15 @@ class TestDataType public: constexpr static size_t data_size = 250; + +#if FASTCDR_VERSION_MAJOR == 1 + static size_t getCdrSerializedSize( + const TestDataType&) + { + return TestDataType::data_size; + } +#endif + }; void pool_initialization_test ( diff --git a/test/unittest/statistics/dds/CMakeLists.txt b/test/unittest/statistics/dds/CMakeLists.txt index 8e001e00892..cf6cdc34777 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -26,7 +26,9 @@ endif(TINYXML2_INCLUDE_DIR) set(STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE StatisticsDomainParticipantTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx) + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ) add_executable(StatisticsDomainParticipantTests ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) target_compile_definitions(StatisticsDomainParticipantTests PRIVATE @@ -71,6 +73,7 @@ if (FASTDDS_STATISTICS) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ${TINYXML2_SOURCES} @@ -268,6 +271,7 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp diff --git a/test/unittest/statistics/rtps/CMakeLists.txt b/test/unittest/statistics/rtps/CMakeLists.txt index 7ea0f1a216b..99b7f08ae3d 100644 --- a/test/unittest/statistics/rtps/CMakeLists.txt +++ b/test/unittest/statistics/rtps/CMakeLists.txt @@ -19,6 +19,7 @@ endif() set(STATISTICS_RTPS_TESTS_SOURCE RTPSStatisticsTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ) add_executable(RTPSStatisticsTests ${STATISTICS_RTPS_TESTS_SOURCE}) @@ -44,4 +45,4 @@ if(QNX) endif() if(ANDROID) set_property(TARGET RTPSStatisticsTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&") -endif() \ No newline at end of file +endif() diff --git a/test/unittest/xtypes/CMakeLists.txt b/test/unittest/xtypes/CMakeLists.txt index c33f23c1b11..cf79c059d67 100644 --- a/test/unittest/xtypes/CMakeLists.txt +++ b/test/unittest/xtypes/CMakeLists.txt @@ -56,8 +56,10 @@ set(XTYPES_TEST_SOURCE XTypesTests.cpp idl/TypesTypeObject.cxx idl/Types.cxx + idl/Typesv1.cxx idl/WideEnumTypeObject.cxx idl/WideEnum.cxx + idl/WideEnumv1.cxx ${XTYPES_SOURCE} ) @@ -93,4 +95,4 @@ add_gtest(XTypesTests SOURCES ${XTYPES_TEST_SOURCE}) if(ANDROID) set_property(TARGET XTypesTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&") -endif() \ No newline at end of file +endif() diff --git a/test/unittest/xtypes/idl/Types.cxx b/test/unittest/xtypes/idl/Types.cxx index de7075654cf..d0ee9153b8d 100644 --- a/test/unittest/xtypes/idl/Types.cxx +++ b/test/unittest/xtypes/idl/Types.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Types.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "TypesTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + MyEnumStruct::MyEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -66,7 +70,6 @@ MyEnumStruct& MyEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -75,7 +78,6 @@ MyEnumStruct& MyEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -120,9 +122,10 @@ MyEnum& MyEnumStruct::my_enum() } + + MyBadEnumStruct::MyBadEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -148,7 +151,6 @@ MyBadEnumStruct& MyBadEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -157,7 +159,6 @@ MyBadEnumStruct& MyBadEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -203,9 +204,10 @@ MyBadEnum& MyBadEnumStruct::my_enum() + + MyAliasEnumStruct::MyAliasEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -231,7 +233,6 @@ MyAliasEnumStruct& MyAliasEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -240,7 +241,6 @@ MyAliasEnumStruct& MyAliasEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -285,9 +285,10 @@ MyAliasEnum& MyAliasEnumStruct::my_enum() } + + BasicStruct::BasicStruct() { - // Just to register all known types registerTypesTypes(); } @@ -319,7 +320,6 @@ BasicStruct& BasicStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -330,7 +330,6 @@ BasicStruct& BasicStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -445,9 +444,10 @@ std::string& BasicStruct::my_string() } + + BasicNamesStruct::BasicNamesStruct() { - // Just to register all known types registerTypesTypes(); } @@ -479,7 +479,6 @@ BasicNamesStruct& BasicNamesStruct::operator =( m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; m_my_string_name = x.m_my_string_name; - return *this; } @@ -490,7 +489,6 @@ BasicNamesStruct& BasicNamesStruct::operator =( m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; m_my_string_name = std::move(x.m_my_string_name); - return *this; } @@ -605,9 +603,10 @@ std::string& BasicNamesStruct::my_string_name() } + + BasicBadStruct::BasicBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -639,7 +638,6 @@ BasicBadStruct& BasicBadStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -650,7 +648,6 @@ BasicBadStruct& BasicBadStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -765,9 +762,10 @@ std::string& BasicBadStruct::my_string() } + + BasicWideStruct::BasicWideStruct() { - // Just to register all known types registerTypesTypes(); } @@ -805,7 +803,6 @@ BasicWideStruct& BasicWideStruct::operator =( m_my_string = x.m_my_string; m_new_int32 = x.m_new_int32; m_new_string = x.m_new_string; - return *this; } @@ -818,7 +815,6 @@ BasicWideStruct& BasicWideStruct::operator =( m_my_string = std::move(x.m_my_string); m_new_int32 = x.m_new_int32; m_new_string = std::move(x.m_new_string); - return *this; } @@ -1003,9 +999,10 @@ std::string& BasicWideStruct::new_string() } + + BadBasicWideStruct::BadBasicWideStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1043,7 +1040,6 @@ BadBasicWideStruct& BadBasicWideStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -1056,7 +1052,6 @@ BadBasicWideStruct& BadBasicWideStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -1241,9 +1236,10 @@ std::string& BadBasicWideStruct::my_string() } + + StringStruct::StringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1269,7 +1265,6 @@ StringStruct& StringStruct::operator =( { m_my_string = x.m_my_string; - return *this; } @@ -1278,7 +1273,6 @@ StringStruct& StringStruct::operator =( { m_my_string = std::move(x.m_my_string); - return *this; } @@ -1333,9 +1327,10 @@ std::string& StringStruct::my_string() } + + LargeStringStruct::LargeStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1361,7 +1356,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = x.m_my_large_string; - return *this; } @@ -1370,7 +1364,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = std::move(x.m_my_large_string); - return *this; } @@ -1425,9 +1418,10 @@ eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() } + + WStringStruct::WStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1453,7 +1447,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = x.m_my_wstring; - return *this; } @@ -1462,7 +1455,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = std::move(x.m_my_wstring); - return *this; } @@ -1517,9 +1509,10 @@ std::wstring& WStringStruct::my_wstring() } + + LargeWStringStruct::LargeWStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1545,7 +1538,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = x.m_my_large_wstring; - return *this; } @@ -1554,7 +1546,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; } @@ -1609,9 +1600,10 @@ std::wstring& LargeWStringStruct::my_large_wstring() } + + ArrayStruct::ArrayStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1637,7 +1629,6 @@ ArrayStruct& ArrayStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1646,7 +1637,6 @@ ArrayStruct& ArrayStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1701,9 +1691,10 @@ std::array& ArrayStruct::my_array() } + + ArrayStructEqual::ArrayStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -1729,7 +1720,6 @@ ArrayStructEqual& ArrayStructEqual::operator =( { m_my_array_equal = x.m_my_array_equal; - return *this; } @@ -1738,7 +1728,6 @@ ArrayStructEqual& ArrayStructEqual::operator =( { m_my_array_equal = std::move(x.m_my_array_equal); - return *this; } @@ -1793,9 +1782,10 @@ std::array& ArrayStructEqual::my_array_equal() } + + ArrayBadStruct::ArrayBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1821,7 +1811,6 @@ ArrayBadStruct& ArrayBadStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1830,7 +1819,6 @@ ArrayBadStruct& ArrayBadStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1885,9 +1873,10 @@ std::array& ArrayBadStruct::my_array() } + + ArrayDimensionsStruct::ArrayDimensionsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1913,7 +1902,6 @@ ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1922,7 +1910,6 @@ ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1977,9 +1964,10 @@ std::array, 2>& ArrayDimensionsStruct::my_array() } + + ArraySizeStruct::ArraySizeStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2005,7 +1993,6 @@ ArraySizeStruct& ArraySizeStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -2014,7 +2001,6 @@ ArraySizeStruct& ArraySizeStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -2069,9 +2055,12 @@ std::array& ArraySizeStruct::my_array() } + + + + SequenceStruct::SequenceStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2097,7 +2086,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2106,7 +2094,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2161,9 +2148,12 @@ std::vector& SequenceStruct::my_sequence() } + + + + SequenceStructEqual::SequenceStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -2189,7 +2179,6 @@ SequenceStructEqual& SequenceStructEqual::operator =( { m_my_sequence_equal = x.m_my_sequence_equal; - return *this; } @@ -2198,7 +2187,6 @@ SequenceStructEqual& SequenceStructEqual::operator =( { m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; } @@ -2253,9 +2241,12 @@ std::vector& SequenceStructEqual::my_sequence_equal() } + + + + SequenceBadStruct::SequenceBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2281,7 +2272,6 @@ SequenceBadStruct& SequenceBadStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2290,7 +2280,6 @@ SequenceBadStruct& SequenceBadStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2345,9 +2334,12 @@ std::vector& SequenceBadStruct::my_sequence() } + + + + SequenceBoundsStruct::SequenceBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2373,7 +2365,6 @@ SequenceBoundsStruct& SequenceBoundsStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2382,7 +2373,6 @@ SequenceBoundsStruct& SequenceBoundsStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2437,9 +2427,14 @@ std::vector& SequenceBoundsStruct::my_sequence() } + + + + + + SequenceSequenceStruct::SequenceSequenceStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2465,7 +2460,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; } @@ -2474,7 +2468,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; } @@ -2529,9 +2522,14 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( } + + + + + + SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2557,7 +2555,6 @@ SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( { m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; } @@ -2566,7 +2563,6 @@ SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; } @@ -2621,9 +2617,12 @@ std::vector>& SequenceSequenceBoundsStruct::my_sequence_seq } + + + + MapStruct::MapStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2649,7 +2648,6 @@ MapStruct& MapStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2658,7 +2656,6 @@ MapStruct& MapStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2713,9 +2710,12 @@ std::map& MapStruct::my_map() } + + + + MapStructEqual::MapStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -2741,7 +2741,6 @@ MapStructEqual& MapStructEqual::operator =( { m_my_map_equal = x.m_my_map_equal; - return *this; } @@ -2750,7 +2749,6 @@ MapStructEqual& MapStructEqual::operator =( { m_my_map_equal = std::move(x.m_my_map_equal); - return *this; } @@ -2805,9 +2803,12 @@ std::map& MapStructEqual::my_map_equal() } + + + + MapBadKeyStruct::MapBadKeyStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2833,7 +2834,6 @@ MapBadKeyStruct& MapBadKeyStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2842,7 +2842,6 @@ MapBadKeyStruct& MapBadKeyStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2897,9 +2896,12 @@ std::map& MapBadKeyStruct::my_map() } + + + + MapBadElemStruct::MapBadElemStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2925,7 +2927,6 @@ MapBadElemStruct& MapBadElemStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2934,7 +2935,6 @@ MapBadElemStruct& MapBadElemStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2989,9 +2989,12 @@ std::map& MapBadElemStruct::my_map() } + + + + MapBoundsStruct::MapBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3017,7 +3020,6 @@ MapBoundsStruct& MapBoundsStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -3026,7 +3028,6 @@ MapBoundsStruct& MapBoundsStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -3081,9 +3082,14 @@ std::map& MapBoundsStruct::my_map() } + + + + + + MapMapStruct::MapMapStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3109,7 +3115,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = x.m_my_map_map; - return *this; } @@ -3118,7 +3123,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = std::move(x.m_my_map_map); - return *this; } @@ -3173,9 +3177,14 @@ std::map>& MapMapStruct::my_map_map() } + + + + + + MapMapBoundsStruct::MapMapBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3201,7 +3210,6 @@ MapMapBoundsStruct& MapMapBoundsStruct::operator =( { m_my_map_map = x.m_my_map_map; - return *this; } @@ -3210,7 +3218,6 @@ MapMapBoundsStruct& MapMapBoundsStruct::operator =( { m_my_map_map = std::move(x.m_my_map_map); - return *this; } @@ -3265,6 +3272,8 @@ std::map>& MapMapBoundsStruct::my_map_map() } + + SimpleUnion::SimpleUnion() { m__d = A; @@ -3423,6 +3432,8 @@ void SimpleUnion::_d( } break; + default: + break; } if (!b) @@ -3545,6 +3556,8 @@ int64_t& SimpleUnion::second() } + + SimpleUnionNames::SimpleUnionNames() { m__d = A; @@ -3703,6 +3716,8 @@ void SimpleUnionNames::_d( } break; + default: + break; } if (!b) @@ -3825,6 +3840,8 @@ int64_t& SimpleUnionNames::second_case() } + + SimpleTypeUnion::SimpleTypeUnion() { m__d = A; @@ -3983,6 +4000,8 @@ void SimpleTypeUnion::_d( } break; + default: + break; } if (!b) @@ -4105,6 +4124,8 @@ int64_t& SimpleTypeUnion::second() } + + SimpleBadUnion::SimpleBadUnion() { m__d = A; @@ -4263,6 +4284,8 @@ void SimpleBadUnion::_d( } break; + default: + break; } if (!b) @@ -4385,6 +4408,8 @@ int64_t& SimpleBadUnion::second() } + + SimpleBadDiscUnion::SimpleBadDiscUnion() { m__d = 0; @@ -4543,6 +4568,8 @@ void SimpleBadDiscUnion::_d( } break; + default: + break; } if (!b) @@ -4665,9 +4692,10 @@ int64_t& SimpleBadDiscUnion::second() } + + SimpleUnionStruct::SimpleUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4693,7 +4721,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4702,7 +4729,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -4757,9 +4783,10 @@ SimpleUnion& SimpleUnionStruct::my_union() } + + SimpleUnionStructEqual::SimpleUnionStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -4785,7 +4812,6 @@ SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( { m_my_union_equal = x.m_my_union_equal; - return *this; } @@ -4794,7 +4820,6 @@ SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( { m_my_union_equal = std::move(x.m_my_union_equal); - return *this; } @@ -4849,9 +4874,10 @@ SimpleUnion& SimpleUnionStructEqual::my_union_equal() } + + SimpleUnionNamesStruct::SimpleUnionNamesStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4877,7 +4903,6 @@ SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4886,7 +4911,6 @@ SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -4941,9 +4965,10 @@ SimpleUnionNames& SimpleUnionNamesStruct::my_union() } + + SimpleTypeUnionStruct::SimpleTypeUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4969,7 +4994,6 @@ SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4978,7 +5002,6 @@ SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5033,9 +5056,10 @@ SimpleTypeUnion& SimpleTypeUnionStruct::my_union() } + + SimpleBadUnionStruct::SimpleBadUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -5061,7 +5085,6 @@ SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -5070,7 +5093,6 @@ SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5125,9 +5147,10 @@ SimpleBadUnion& SimpleBadUnionStruct::my_union() } + + SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -5153,7 +5176,6 @@ SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -5162,7 +5184,6 @@ SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5219,3 +5240,5 @@ SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() // Include auxiliary functions like for serializing/deserializing. #include "TypesCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/Types.h b/test/unittest/xtypes/idl/Types.h index 73e00b2ec7c..e482676e515 100644 --- a/test/unittest/xtypes/idl/Types.h +++ b/test/unittest/xtypes/idl/Types.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Typesv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TYPES_H_ #define _FAST_DDS_GENERATED_TYPES_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -87,6 +93,8 @@ enum MyBadEnum : uint32_t B1, C1 }; + + /*! * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -171,6 +179,8 @@ class MyEnumStruct MyEnum m_my_enum{::A}; }; + + /*! * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -257,6 +267,8 @@ class MyBadEnumStruct }; typedef MyEnum MyAliasEnum; + + /*! * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -341,6 +353,8 @@ class MyAliasEnumStruct MyAliasEnum m_my_enum{::A}; }; + + /*! * @brief This class represents the structure BasicStruct defined by the user in the IDL file. * @ingroup Types @@ -474,6 +488,8 @@ class BasicStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -607,6 +623,8 @@ class BasicNamesStruct std::string m_my_string_name; }; + + /*! * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. * @ingroup Types @@ -740,6 +758,8 @@ class BasicBadStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -922,6 +942,8 @@ class BasicWideStruct std::string m_new_string; }; + + /*! * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -1104,6 +1126,8 @@ class BadBasicWideStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. * @ingroup Types @@ -1195,6 +1219,8 @@ class StringStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1286,6 +1312,8 @@ class LargeStringStruct eprosima::fastcdr::fixed_string<41925> m_my_large_string; }; + + /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1377,6 +1405,8 @@ class WStringStruct std::wstring m_my_wstring; }; + + /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1468,6 +1498,8 @@ class LargeWStringStruct std::wstring m_my_large_wstring; }; + + /*! * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. * @ingroup Types @@ -1559,6 +1591,8 @@ class ArrayStruct std::array m_my_array{0}; }; + + /*! * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1650,6 +1684,8 @@ class ArrayStructEqual std::array m_my_array_equal{0}; }; + + /*! * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1741,6 +1777,8 @@ class ArrayBadStruct std::array m_my_array{0}; }; + + /*! * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. * @ingroup Types @@ -1829,9 +1867,11 @@ class ArrayDimensionsStruct private: - std::array, 2> m_my_array { {{0}} }; + std::array, 2> m_my_array{ {{0}} }; }; + + /*! * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. * @ingroup Types @@ -1923,6 +1963,10 @@ class ArraySizeStruct std::array m_my_array{0}; }; + + + + /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -2014,6 +2058,10 @@ class SequenceStruct std::vector m_my_sequence; }; + + + + /*! * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2105,6 +2153,10 @@ class SequenceStructEqual std::vector m_my_sequence_equal; }; + + + + /*! * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. * @ingroup Types @@ -2196,6 +2248,10 @@ class SequenceBadStruct std::vector m_my_sequence; }; + + + + /*! * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2287,6 +2343,12 @@ class SequenceBoundsStruct std::vector m_my_sequence; }; + + + + + + /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -2378,6 +2440,12 @@ class SequenceSequenceStruct std::vector> m_my_sequence_sequence; }; + + + + + + /*! * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2469,6 +2537,10 @@ class SequenceSequenceBoundsStruct std::vector> m_my_sequence_sequence; }; + + + + /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. * @ingroup Types @@ -2560,6 +2632,10 @@ class MapStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2651,6 +2727,10 @@ class MapStructEqual std::map m_my_map_equal; }; + + + + /*! * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. * @ingroup Types @@ -2742,6 +2822,10 @@ class MapBadKeyStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. * @ingroup Types @@ -2833,6 +2917,10 @@ class MapBadElemStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2924,6 +3012,12 @@ class MapBoundsStruct std::map m_my_map; }; + + + + + + /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. * @ingroup Types @@ -3015,6 +3109,12 @@ class MapMapStruct std::map> m_my_map_map; }; + + + + + + /*! * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -3106,6 +3206,8 @@ class MapMapBoundsStruct std::map> m_my_map_map; }; + + /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. * @ingroup Types @@ -3236,6 +3338,8 @@ class SimpleUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. * @ingroup Types @@ -3366,6 +3470,8 @@ class SimpleUnionNames int32_t m_first_case{0}; int64_t m_second_case{0}; }; + + /*! * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. * @ingroup Types @@ -3496,6 +3602,8 @@ class SimpleTypeUnion uint8_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. * @ingroup Types @@ -3626,6 +3734,8 @@ class SimpleBadUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. * @ingroup Types @@ -3756,6 +3866,8 @@ class SimpleBadDiscUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3847,6 +3959,8 @@ class SimpleUnionStruct SimpleUnion m_my_union; }; + + /*! * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. * @ingroup Types @@ -3938,6 +4052,8 @@ class SimpleUnionStructEqual SimpleUnion m_my_union_equal; }; + + /*! * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -4029,6 +4145,8 @@ class SimpleUnionNamesStruct SimpleUnionNames m_my_union; }; + + /*! * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4120,6 +4238,8 @@ class SimpleTypeUnionStruct SimpleTypeUnion m_my_union; }; + + /*! * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4211,6 +4331,8 @@ class SimpleBadUnionStruct SimpleBadUnion m_my_union; }; + + /*! * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4305,3 +4427,6 @@ class SimplBadDiscUnionStruct #endif // _FAST_DDS_GENERATED_TYPES_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/TypesCdrAux.hpp b/test/unittest/xtypes/idl/TypesCdrAux.hpp index f48f11b2bf8..14992724933 100644 --- a/test/unittest/xtypes/idl/TypesCdrAux.hpp +++ b/test/unittest/xtypes/idl/TypesCdrAux.hpp @@ -147,129 +147,241 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyEnumStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyBadEnumStruct& data); + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyAliasEnumStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicNamesStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicBadStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicWideStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BadBasicWideStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const WStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeWStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayStructEqual& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayBadStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayDimensionsStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArraySizeStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceStructEqual& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceBadStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceBoundsStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceSequenceStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceSequenceBoundsStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapStructEqual& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBadKeyStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBadElemStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBoundsStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapMapStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapMapBoundsStruct& data); + + + + + + + + + + + + + + + + + @@ -277,22 +389,32 @@ eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionStructEqual& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionNamesStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleTypeUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleBadUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimplBadDiscUnionStruct& data); @@ -301,4 +423,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ + diff --git a/test/unittest/xtypes/idl/TypesCdrAux.ipp b/test/unittest/xtypes/idl/TypesCdrAux.ipp index 9af89efac1a..837c42573bb 100644 --- a/test/unittest/xtypes/idl/TypesCdrAux.ipp +++ b/test/unittest/xtypes/idl/TypesCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -111,6 +112,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -150,7 +153,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -189,6 +191,9 @@ void serialize_key( + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -228,7 +233,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -266,6 +270,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -313,7 +319,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32() << eprosima::fastcdr::MemberId(2) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -359,6 +364,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -406,7 +413,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32_name() << eprosima::fastcdr::MemberId(2) << data.my_string_name() ; - scdr.end_serialize_type(current_state); } @@ -452,6 +458,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -499,7 +507,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32() << eprosima::fastcdr::MemberId(2) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -545,6 +552,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -600,7 +609,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.new_int32() << eprosima::fastcdr::MemberId(4) << data.new_string() ; - scdr.end_serialize_type(current_state); } @@ -654,6 +662,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -709,7 +719,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.my_int32() << eprosima::fastcdr::MemberId(4) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -763,6 +772,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -802,7 +813,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -840,6 +850,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -879,7 +891,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_string() ; - scdr.end_serialize_type(current_state); } @@ -917,6 +928,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -956,7 +969,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_wstring() ; - scdr.end_serialize_type(current_state); } @@ -994,6 +1006,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1033,7 +1047,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() ; - scdr.end_serialize_type(current_state); } @@ -1071,6 +1084,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1110,7 +1125,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1148,6 +1162,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1187,7 +1203,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array_equal() ; - scdr.end_serialize_type(current_state); } @@ -1225,6 +1240,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1264,7 +1281,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1302,6 +1318,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1341,7 +1359,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1379,6 +1396,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1418,7 +1437,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1456,6 +1474,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1495,7 +1517,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1533,6 +1554,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1572,7 +1597,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_equal() ; - scdr.end_serialize_type(current_state); } @@ -1610,6 +1634,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1649,7 +1677,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1687,6 +1714,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1726,7 +1757,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1764,6 +1794,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1803,7 +1839,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1841,6 +1876,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1880,7 +1921,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1918,6 +1958,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1957,7 +2001,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -1995,6 +2038,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2034,7 +2081,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_equal() ; - scdr.end_serialize_type(current_state); } @@ -2072,6 +2118,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2111,7 +2161,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2149,6 +2198,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2188,7 +2241,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2226,6 +2278,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2265,7 +2321,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2303,6 +2358,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2342,7 +2403,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_map() ; - scdr.end_serialize_type(current_state); } @@ -2380,6 +2440,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2419,7 +2485,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_map() ; - scdr.end_serialize_type(current_state); } @@ -2457,6 +2522,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2487,6 +2554,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2518,6 +2587,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2550,6 +2621,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2558,6 +2631,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2588,6 +2663,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second_case(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2619,6 +2696,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second_case(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2651,6 +2730,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second_case(); break; + default: + break; } ret_value = false; break; @@ -2659,6 +2740,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2689,6 +2772,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2720,6 +2805,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2752,6 +2839,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2760,6 +2849,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2790,6 +2881,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2821,6 +2914,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2853,6 +2948,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2861,6 +2958,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2891,6 +2990,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2922,6 +3023,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2954,6 +3057,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2962,6 +3067,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3001,7 +3108,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3039,6 +3145,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3078,7 +3186,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union_equal() ; - scdr.end_serialize_type(current_state); } @@ -3116,6 +3223,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3155,7 +3264,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3193,6 +3301,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3232,7 +3342,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3270,6 +3379,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3309,7 +3420,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3347,6 +3457,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3386,7 +3498,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3428,4 +3539,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ + diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx b/test/unittest/xtypes/idl/TypesPubSubTypes.cxx index 3a0c01bd2b4..0c0a8f0363e 100644 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx +++ b/test/unittest/xtypes/idl/TypesPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TypesPubSubTypes.h" #include "TypesCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + MyEnumStructPubSubType::MyEnumStructPubSubType() { setName("MyEnumStruct"); - uint32_t type_size = MyEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyEnumStruct::getMaxCdrSerializedSize()); +#else + MyEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool MyEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool MyEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool MyEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function MyEnumStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool MyEnumStructPubSubType::getKey( MyEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -183,10 +219,17 @@ bool MyEnumStructPubSubType::getKey( return true; } + + MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() { setName("MyBadEnumStruct"); - uint32_t type_size = MyBadEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); +#else + MyBadEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -217,10 +260,12 @@ bool MyBadEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -235,7 +280,11 @@ bool MyBadEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -252,7 +301,11 @@ bool MyBadEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -275,13 +328,26 @@ std::function MyBadEnumStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -313,12 +379,20 @@ bool MyBadEnumStructPubSubType::getKey( MyBadEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyBadEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -336,10 +410,18 @@ bool MyBadEnumStructPubSubType::getKey( } + + + MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() { setName("MyAliasEnumStruct"); - uint32_t type_size = MyAliasEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); +#else + MyAliasEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -370,10 +452,12 @@ bool MyAliasEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -388,7 +472,11 @@ bool MyAliasEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -405,7 +493,11 @@ bool MyAliasEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -428,13 +520,26 @@ std::function MyAliasEnumStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -466,12 +571,20 @@ bool MyAliasEnumStructPubSubType::getKey( MyAliasEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyAliasEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -488,10 +601,17 @@ bool MyAliasEnumStructPubSubType::getKey( return true; } + + BasicStructPubSubType::BasicStructPubSubType() { setName("BasicStruct"); - uint32_t type_size = BasicStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicStruct::getMaxCdrSerializedSize()); +#else + BasicStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -522,10 +642,12 @@ bool BasicStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -540,7 +662,11 @@ bool BasicStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -557,7 +683,11 @@ bool BasicStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -580,13 +710,26 @@ std::function BasicStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -618,12 +761,20 @@ bool BasicStructPubSubType::getKey( BasicStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -640,10 +791,17 @@ bool BasicStructPubSubType::getKey( return true; } + + BasicNamesStructPubSubType::BasicNamesStructPubSubType() { setName("BasicNamesStruct"); - uint32_t type_size = BasicNamesStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); +#else + BasicNamesStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -674,10 +832,12 @@ bool BasicNamesStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -692,7 +852,11 @@ bool BasicNamesStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -709,7 +873,11 @@ bool BasicNamesStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -732,13 +900,26 @@ std::function BasicNamesStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -770,12 +951,20 @@ bool BasicNamesStructPubSubType::getKey( BasicNamesStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicNamesStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -792,10 +981,17 @@ bool BasicNamesStructPubSubType::getKey( return true; } + + BasicBadStructPubSubType::BasicBadStructPubSubType() { setName("BasicBadStruct"); - uint32_t type_size = BasicBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicBadStruct::getMaxCdrSerializedSize()); +#else + BasicBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -826,10 +1022,12 @@ bool BasicBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -844,7 +1042,11 @@ bool BasicBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -861,7 +1063,11 @@ bool BasicBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -884,13 +1090,26 @@ std::function BasicBadStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -922,12 +1141,20 @@ bool BasicBadStructPubSubType::getKey( BasicBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -944,10 +1171,17 @@ bool BasicBadStructPubSubType::getKey( return true; } + + BasicWideStructPubSubType::BasicWideStructPubSubType() { setName("BasicWideStruct"); - uint32_t type_size = BasicWideStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicWideStruct::getMaxCdrSerializedSize()); +#else + BasicWideStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -978,10 +1212,12 @@ bool BasicWideStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -996,7 +1232,11 @@ bool BasicWideStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1013,7 +1253,11 @@ bool BasicWideStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1036,13 +1280,26 @@ std::function BasicWideStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1074,12 +1331,20 @@ bool BasicWideStructPubSubType::getKey( BasicWideStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicWideStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1096,10 +1361,17 @@ bool BasicWideStructPubSubType::getKey( return true; } + + BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() { setName("BadBasicWideStruct"); - uint32_t type_size = BadBasicWideStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); +#else + BadBasicWideStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1130,10 +1402,12 @@ bool BadBasicWideStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1148,7 +1422,11 @@ bool BadBasicWideStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1165,7 +1443,11 @@ bool BadBasicWideStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1188,13 +1470,26 @@ std::function BadBasicWideStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1226,12 +1521,20 @@ bool BadBasicWideStructPubSubType::getKey( BadBasicWideStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BadBasicWideStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1248,10 +1551,17 @@ bool BadBasicWideStructPubSubType::getKey( return true; } + + StringStructPubSubType::StringStructPubSubType() { setName("StringStruct"); - uint32_t type_size = StringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringStruct::getMaxCdrSerializedSize()); +#else + StringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1282,10 +1592,12 @@ bool StringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1300,7 +1612,11 @@ bool StringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1317,7 +1633,11 @@ bool StringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1340,13 +1660,26 @@ std::function StringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1378,12 +1711,20 @@ bool StringStructPubSubType::getKey( StringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1400,10 +1741,17 @@ bool StringStructPubSubType::getKey( return true; } + + LargeStringStructPubSubType::LargeStringStructPubSubType() { setName("LargeStringStruct"); - uint32_t type_size = LargeStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeStringStruct::getMaxCdrSerializedSize()); +#else + LargeStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1434,10 +1782,12 @@ bool LargeStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1452,7 +1802,11 @@ bool LargeStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1469,7 +1823,11 @@ bool LargeStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1492,13 +1850,26 @@ std::function LargeStringStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1530,12 +1901,20 @@ bool LargeStringStructPubSubType::getKey( LargeStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1552,10 +1931,17 @@ bool LargeStringStructPubSubType::getKey( return true; } + + WStringStructPubSubType::WStringStructPubSubType() { setName("WStringStruct"); - uint32_t type_size = WStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(WStringStruct::getMaxCdrSerializedSize()); +#else + WStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1586,10 +1972,12 @@ bool WStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1604,7 +1992,11 @@ bool WStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1621,7 +2013,11 @@ bool WStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1644,13 +2040,26 @@ std::function WStringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1682,12 +2091,20 @@ bool WStringStructPubSubType::getKey( WStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || WStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1704,10 +2121,17 @@ bool WStringStructPubSubType::getKey( return true; } + + LargeWStringStructPubSubType::LargeWStringStructPubSubType() { setName("LargeWStringStruct"); - uint32_t type_size = LargeWStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); +#else + LargeWStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1738,10 +2162,12 @@ bool LargeWStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1756,7 +2182,11 @@ bool LargeWStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1773,7 +2203,11 @@ bool LargeWStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1796,13 +2230,26 @@ std::function LargeWStringStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1834,12 +2281,20 @@ bool LargeWStringStructPubSubType::getKey( LargeWStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeWStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1856,10 +2311,17 @@ bool LargeWStringStructPubSubType::getKey( return true; } + + ArrayStructPubSubType::ArrayStructPubSubType() { setName("ArrayStruct"); - uint32_t type_size = ArrayStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayStruct::getMaxCdrSerializedSize()); +#else + ArrayStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1890,10 +2352,12 @@ bool ArrayStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1908,7 +2372,11 @@ bool ArrayStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1925,7 +2393,11 @@ bool ArrayStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1948,13 +2420,26 @@ std::function ArrayStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1986,12 +2471,20 @@ bool ArrayStructPubSubType::getKey( ArrayStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2008,10 +2501,17 @@ bool ArrayStructPubSubType::getKey( return true; } + + ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() { setName("ArrayStructEqual"); - uint32_t type_size = ArrayStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); +#else + ArrayStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2042,10 +2542,12 @@ bool ArrayStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2060,7 +2562,11 @@ bool ArrayStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2077,7 +2583,11 @@ bool ArrayStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2100,13 +2610,26 @@ std::function ArrayStructEqualPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2138,12 +2661,20 @@ bool ArrayStructEqualPubSubType::getKey( ArrayStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2160,10 +2691,17 @@ bool ArrayStructEqualPubSubType::getKey( return true; } + + ArrayBadStructPubSubType::ArrayBadStructPubSubType() { setName("ArrayBadStruct"); - uint32_t type_size = ArrayBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); +#else + ArrayBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2194,10 +2732,12 @@ bool ArrayBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2212,7 +2752,11 @@ bool ArrayBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2229,7 +2773,11 @@ bool ArrayBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2252,13 +2800,26 @@ std::function ArrayBadStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2290,12 +2851,20 @@ bool ArrayBadStructPubSubType::getKey( ArrayBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2312,10 +2881,17 @@ bool ArrayBadStructPubSubType::getKey( return true; } + + ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() { setName("ArrayDimensionsStruct"); - uint32_t type_size = ArrayDimensionsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); +#else + ArrayDimensionsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2346,10 +2922,12 @@ bool ArrayDimensionsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2364,7 +2942,11 @@ bool ArrayDimensionsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2381,7 +2963,11 @@ bool ArrayDimensionsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2404,13 +2990,26 @@ std::function ArrayDimensionsStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2442,12 +3041,20 @@ bool ArrayDimensionsStructPubSubType::getKey( ArrayDimensionsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayDimensionsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2464,10 +3071,17 @@ bool ArrayDimensionsStructPubSubType::getKey( return true; } + + ArraySizeStructPubSubType::ArraySizeStructPubSubType() { setName("ArraySizeStruct"); - uint32_t type_size = ArraySizeStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); +#else + ArraySizeStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2498,10 +3112,12 @@ bool ArraySizeStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2516,7 +3132,11 @@ bool ArraySizeStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2533,7 +3153,11 @@ bool ArraySizeStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2556,13 +3180,26 @@ std::function ArraySizeStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2594,12 +3231,20 @@ bool ArraySizeStructPubSubType::getKey( ArraySizeStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArraySizeStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2616,10 +3261,19 @@ bool ArraySizeStructPubSubType::getKey( return true; } + + + + SequenceStructPubSubType::SequenceStructPubSubType() { setName("SequenceStruct"); - uint32_t type_size = SequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2650,10 +3304,12 @@ bool SequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2668,7 +3324,11 @@ bool SequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2685,7 +3345,11 @@ bool SequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2708,13 +3372,26 @@ std::function SequenceStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2746,12 +3423,20 @@ bool SequenceStructPubSubType::getKey( SequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2768,10 +3453,19 @@ bool SequenceStructPubSubType::getKey( return true; } + + + + SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() { setName("SequenceStructEqual"); - uint32_t type_size = SequenceStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); +#else + SequenceStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2802,10 +3496,12 @@ bool SequenceStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2820,7 +3516,11 @@ bool SequenceStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2837,7 +3537,11 @@ bool SequenceStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2860,13 +3564,26 @@ std::function SequenceStructEqualPubSubType::getSerializedSizeProvid { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2898,12 +3615,20 @@ bool SequenceStructEqualPubSubType::getKey( SequenceStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2920,10 +3645,19 @@ bool SequenceStructEqualPubSubType::getKey( return true; } + + + + SequenceBadStructPubSubType::SequenceBadStructPubSubType() { setName("SequenceBadStruct"); - uint32_t type_size = SequenceBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); +#else + SequenceBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2954,10 +3688,12 @@ bool SequenceBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2972,7 +3708,11 @@ bool SequenceBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2989,7 +3729,11 @@ bool SequenceBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3012,13 +3756,26 @@ std::function SequenceBadStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3050,12 +3807,20 @@ bool SequenceBadStructPubSubType::getKey( SequenceBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3072,10 +3837,19 @@ bool SequenceBadStructPubSubType::getKey( return true; } + + + + SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() { setName("SequenceBoundsStruct"); - uint32_t type_size = SequenceBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); +#else + SequenceBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3106,10 +3880,12 @@ bool SequenceBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3124,7 +3900,11 @@ bool SequenceBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3141,7 +3921,11 @@ bool SequenceBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3164,13 +3948,26 @@ std::function SequenceBoundsStructPubSubType::getSerializedSizeProvi { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3202,12 +3999,20 @@ bool SequenceBoundsStructPubSubType::getKey( SequenceBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3224,10 +4029,21 @@ bool SequenceBoundsStructPubSubType::getKey( return true; } + + + + + + SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() { setName("SequenceSequenceStruct"); - uint32_t type_size = SequenceSequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceSequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3258,10 +4074,12 @@ bool SequenceSequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3276,7 +4094,11 @@ bool SequenceSequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3293,7 +4115,11 @@ bool SequenceSequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3316,13 +4142,26 @@ std::function SequenceSequenceStructPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3354,12 +4193,20 @@ bool SequenceSequenceStructPubSubType::getKey( SequenceSequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceSequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3376,10 +4223,21 @@ bool SequenceSequenceStructPubSubType::getKey( return true; } + + + + + + SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() { setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = SequenceSequenceBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); +#else + SequenceSequenceBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3410,10 +4268,12 @@ bool SequenceSequenceBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3428,7 +4288,11 @@ bool SequenceSequenceBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3445,7 +4309,11 @@ bool SequenceSequenceBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3468,13 +4336,26 @@ std::function SequenceSequenceBoundsStructPubSubType::getSerializedS { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3506,12 +4387,20 @@ bool SequenceSequenceBoundsStructPubSubType::getKey( SequenceSequenceBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3528,10 +4417,19 @@ bool SequenceSequenceBoundsStructPubSubType::getKey( return true; } + + + + MapStructPubSubType::MapStructPubSubType() { setName("MapStruct"); - uint32_t type_size = MapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapStruct::getMaxCdrSerializedSize()); +#else + MapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3562,10 +4460,12 @@ bool MapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3580,7 +4480,11 @@ bool MapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3597,7 +4501,11 @@ bool MapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3620,13 +4528,26 @@ std::function MapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3658,12 +4579,20 @@ bool MapStructPubSubType::getKey( MapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3680,10 +4609,19 @@ bool MapStructPubSubType::getKey( return true; } + + + + MapStructEqualPubSubType::MapStructEqualPubSubType() { setName("MapStructEqual"); - uint32_t type_size = MapStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapStructEqual::getMaxCdrSerializedSize()); +#else + MapStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3714,10 +4652,12 @@ bool MapStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3732,7 +4672,11 @@ bool MapStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3749,7 +4693,11 @@ bool MapStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3772,13 +4720,26 @@ std::function MapStructEqualPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3810,12 +4771,20 @@ bool MapStructEqualPubSubType::getKey( MapStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3832,10 +4801,19 @@ bool MapStructEqualPubSubType::getKey( return true; } + + + + MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() { setName("MapBadKeyStruct"); - uint32_t type_size = MapBadKeyStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); +#else + MapBadKeyStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3866,10 +4844,12 @@ bool MapBadKeyStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3884,7 +4864,11 @@ bool MapBadKeyStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3901,7 +4885,11 @@ bool MapBadKeyStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3924,13 +4912,26 @@ std::function MapBadKeyStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3962,12 +4963,20 @@ bool MapBadKeyStructPubSubType::getKey( MapBadKeyStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBadKeyStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3984,10 +4993,19 @@ bool MapBadKeyStructPubSubType::getKey( return true; } + + + + MapBadElemStructPubSubType::MapBadElemStructPubSubType() { setName("MapBadElemStruct"); - uint32_t type_size = MapBadElemStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); +#else + MapBadElemStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4018,10 +5036,12 @@ bool MapBadElemStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4036,7 +5056,11 @@ bool MapBadElemStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4053,7 +5077,11 @@ bool MapBadElemStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4076,13 +5104,26 @@ std::function MapBadElemStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4114,12 +5155,20 @@ bool MapBadElemStructPubSubType::getKey( MapBadElemStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBadElemStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4136,10 +5185,19 @@ bool MapBadElemStructPubSubType::getKey( return true; } + + + + MapBoundsStructPubSubType::MapBoundsStructPubSubType() { setName("MapBoundsStruct"); - uint32_t type_size = MapBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); +#else + MapBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4170,10 +5228,12 @@ bool MapBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4188,7 +5248,11 @@ bool MapBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4205,7 +5269,11 @@ bool MapBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4228,13 +5296,26 @@ std::function MapBoundsStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4266,12 +5347,20 @@ bool MapBoundsStructPubSubType::getKey( MapBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4288,10 +5377,21 @@ bool MapBoundsStructPubSubType::getKey( return true; } + + + + + + MapMapStructPubSubType::MapMapStructPubSubType() { setName("MapMapStruct"); - uint32_t type_size = MapMapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapMapStruct::getMaxCdrSerializedSize()); +#else + MapMapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4322,10 +5422,12 @@ bool MapMapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4340,7 +5442,11 @@ bool MapMapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4357,7 +5463,11 @@ bool MapMapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4380,13 +5490,26 @@ std::function MapMapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4418,12 +5541,20 @@ bool MapMapStructPubSubType::getKey( MapMapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapMapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4440,10 +5571,21 @@ bool MapMapStructPubSubType::getKey( return true; } + + + + + + MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() { setName("MapMapBoundsStruct"); - uint32_t type_size = MapMapBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); +#else + MapMapBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4474,10 +5616,12 @@ bool MapMapBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4492,7 +5636,11 @@ bool MapMapBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4509,7 +5657,11 @@ bool MapMapBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4532,13 +5684,26 @@ std::function MapMapBoundsStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4570,12 +5735,20 @@ bool MapMapBoundsStructPubSubType::getKey( MapMapBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapMapBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4594,13 +5767,35 @@ bool MapMapBoundsStructPubSubType::getKey( + + + + + + + + + + + + + + + + + SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() { setName("SimpleUnionStruct"); - uint32_t type_size = SimpleUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4631,10 +5826,12 @@ bool SimpleUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4649,7 +5846,11 @@ bool SimpleUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4666,7 +5867,11 @@ bool SimpleUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4689,13 +5894,26 @@ std::function SimpleUnionStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4727,12 +5945,20 @@ bool SimpleUnionStructPubSubType::getKey( SimpleUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4749,10 +5975,17 @@ bool SimpleUnionStructPubSubType::getKey( return true; } + + SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() { setName("SimpleUnionStructEqual"); - uint32_t type_size = SimpleUnionStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); +#else + SimpleUnionStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4783,10 +6016,12 @@ bool SimpleUnionStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4801,7 +6036,11 @@ bool SimpleUnionStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4818,7 +6057,11 @@ bool SimpleUnionStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4841,13 +6084,26 @@ std::function SimpleUnionStructEqualPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4879,12 +6135,20 @@ bool SimpleUnionStructEqualPubSubType::getKey( SimpleUnionStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4901,10 +6165,17 @@ bool SimpleUnionStructEqualPubSubType::getKey( return true; } + + SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() { setName("SimpleUnionNamesStruct"); - uint32_t type_size = SimpleUnionNamesStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); +#else + SimpleUnionNamesStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4935,10 +6206,12 @@ bool SimpleUnionNamesStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4953,7 +6226,11 @@ bool SimpleUnionNamesStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4970,7 +6247,11 @@ bool SimpleUnionNamesStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4993,13 +6274,26 @@ std::function SimpleUnionNamesStructPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5031,12 +6325,20 @@ bool SimpleUnionNamesStructPubSubType::getKey( SimpleUnionNamesStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionNamesStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5053,10 +6355,17 @@ bool SimpleUnionNamesStructPubSubType::getKey( return true; } + + SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() { setName("SimpleTypeUnionStruct"); - uint32_t type_size = SimpleTypeUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleTypeUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5087,10 +6396,12 @@ bool SimpleTypeUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5105,7 +6416,11 @@ bool SimpleTypeUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5122,7 +6437,11 @@ bool SimpleTypeUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5145,13 +6464,26 @@ std::function SimpleTypeUnionStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5183,12 +6515,20 @@ bool SimpleTypeUnionStructPubSubType::getKey( SimpleTypeUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleTypeUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5205,10 +6545,17 @@ bool SimpleTypeUnionStructPubSubType::getKey( return true; } + + SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() { setName("SimpleBadUnionStruct"); - uint32_t type_size = SimpleBadUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleBadUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5239,10 +6586,12 @@ bool SimpleBadUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5257,7 +6606,11 @@ bool SimpleBadUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5274,7 +6627,11 @@ bool SimpleBadUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5297,13 +6654,26 @@ std::function SimpleBadUnionStructPubSubType::getSerializedSizeProvi { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5335,12 +6705,20 @@ bool SimpleBadUnionStructPubSubType::getKey( SimpleBadUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleBadUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5357,10 +6735,17 @@ bool SimpleBadUnionStructPubSubType::getKey( return true; } + + SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() { setName("SimplBadDiscUnionStruct"); - uint32_t type_size = SimplBadDiscUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); +#else + SimplBadDiscUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5391,10 +6776,12 @@ bool SimplBadDiscUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5409,7 +6796,11 @@ bool SimplBadDiscUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5426,7 +6817,11 @@ bool SimplBadDiscUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5449,13 +6844,26 @@ std::function SimplBadDiscUnionStructPubSubType::getSerializedSizePr { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5487,12 +6895,20 @@ bool SimplBadDiscUnionStructPubSubType::getKey( SimplBadDiscUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimplBadDiscUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.h b/test/unittest/xtypes/idl/TypesPubSubTypes.h index 56b444310e3..6a934f82843 100644 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.h +++ b/test/unittest/xtypes/idl/TypesPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -126,6 +128,8 @@ class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -215,6 +219,8 @@ class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; typedef MyEnum MyAliasEnum; + + /*! * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -303,6 +309,8 @@ class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. * @ingroup Types @@ -391,6 +399,8 @@ class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -479,6 +489,8 @@ class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. * @ingroup Types @@ -567,6 +579,8 @@ class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -655,6 +669,8 @@ class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -743,6 +759,8 @@ class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp }; + + /*! * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. * @ingroup Types @@ -831,6 +849,8 @@ class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. * @ingroup Types @@ -919,6 +939,8 @@ class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1007,6 +1029,8 @@ class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1095,6 +1119,8 @@ class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp }; + + /*! * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. * @ingroup Types @@ -1183,6 +1209,8 @@ class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1271,6 +1299,8 @@ class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1359,6 +1389,8 @@ class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. * @ingroup Types @@ -1447,6 +1479,8 @@ class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicData }; + + /*! * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. * @ingroup Types @@ -1535,6 +1569,10 @@ class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -1623,6 +1661,10 @@ class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1711,6 +1753,10 @@ class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataTy }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1799,6 +1845,10 @@ class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -1887,6 +1937,12 @@ class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataT }; + + + + + + /*! * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -1975,6 +2031,12 @@ class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDat }; + + + + + + /*! * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2063,6 +2125,10 @@ class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::To }; + + + + /*! * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. * @ingroup Types @@ -2151,6 +2217,10 @@ class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2239,6 +2309,10 @@ class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. * @ingroup Types @@ -2327,6 +2401,10 @@ class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. * @ingroup Types @@ -2415,6 +2493,10 @@ class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2503,6 +2585,12 @@ class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. * @ingroup Types @@ -2591,6 +2679,12 @@ class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2681,6 +2775,23 @@ class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp + + + + + + + + + + + + + + + + + @@ -2772,6 +2883,8 @@ class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2860,6 +2973,8 @@ class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDat }; + + /*! * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -2948,6 +3063,8 @@ class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDat }; + + /*! * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3036,6 +3153,8 @@ class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicData }; + + /*! * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3124,6 +3243,8 @@ class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataT }; + + /*! * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. * @ingroup Types diff --git a/test/unittest/xtypes/idl/TypesTypeObject.cxx b/test/unittest/xtypes/idl/TypesTypeObject.cxx index 38779b7bcab..bcefed47249 100644 --- a/test/unittest/xtypes/idl/TypesTypeObject.cxx +++ b/test/unittest/xtypes/idl/TypesTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -425,7 +423,11 @@ const TypeObject* GetMinimalMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -517,7 +519,11 @@ const TypeObject* GetCompleteMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -644,7 +650,11 @@ const TypeObject* GetMinimalMyBadEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -736,7 +746,11 @@ const TypeObject* GetCompleteMyBadEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -750,6 +764,8 @@ const TypeObject* GetCompleteMyBadEnumObject() return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); } + + const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); @@ -819,7 +835,6 @@ const TypeObject* GetMinimalMyEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -835,7 +850,11 @@ const TypeObject* GetMinimalMyEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -887,7 +906,6 @@ const TypeObject* GetCompleteMyEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -903,7 +921,11 @@ const TypeObject* GetCompleteMyEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -917,6 +939,8 @@ const TypeObject* GetCompleteMyEnumStructObject() return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); } + + const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); @@ -986,7 +1010,6 @@ const TypeObject* GetMinimalMyBadEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1002,7 +1025,11 @@ const TypeObject* GetMinimalMyBadEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1054,7 +1081,6 @@ const TypeObject* GetCompleteMyBadEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1070,7 +1096,11 @@ const TypeObject* GetCompleteMyBadEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1173,7 +1203,11 @@ const TypeObject* GetMinimalMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1257,7 +1291,11 @@ const TypeObject* GetCompleteMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1274,6 +1312,8 @@ const TypeObject* GetCompleteMyAliasEnumObject() return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); } + + const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); @@ -1343,7 +1383,6 @@ const TypeObject* GetMinimalMyAliasEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1359,7 +1398,11 @@ const TypeObject* GetMinimalMyAliasEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1411,7 +1454,6 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1427,7 +1469,11 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1441,6 +1487,8 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); } + + const TypeIdentifier* GetBasicStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); @@ -1548,7 +1596,6 @@ const TypeObject* GetMinimalBasicStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1564,7 +1611,11 @@ const TypeObject* GetMinimalBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1648,7 +1699,6 @@ const TypeObject* GetCompleteBasicStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1664,7 +1714,11 @@ const TypeObject* GetCompleteBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1678,6 +1732,8 @@ const TypeObject* GetCompleteBasicStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); } + + const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); @@ -1785,7 +1841,6 @@ const TypeObject* GetMinimalBasicNamesStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1801,7 +1856,11 @@ const TypeObject* GetMinimalBasicNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1885,7 +1944,6 @@ const TypeObject* GetCompleteBasicNamesStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1901,7 +1959,11 @@ const TypeObject* GetCompleteBasicNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1915,6 +1977,8 @@ const TypeObject* GetCompleteBasicNamesStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); } + + const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); @@ -2022,7 +2086,6 @@ const TypeObject* GetMinimalBasicBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2038,7 +2101,11 @@ const TypeObject* GetMinimalBasicBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2122,7 +2189,6 @@ const TypeObject* GetCompleteBasicBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2138,7 +2204,11 @@ const TypeObject* GetCompleteBasicBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2152,6 +2222,8 @@ const TypeObject* GetCompleteBasicBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); } + + const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); @@ -2296,7 +2368,6 @@ const TypeObject* GetMinimalBasicWideStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2312,7 +2383,11 @@ const TypeObject* GetMinimalBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2427,7 +2502,6 @@ const TypeObject* GetCompleteBasicWideStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2443,7 +2517,11 @@ const TypeObject* GetCompleteBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2457,6 +2535,8 @@ const TypeObject* GetCompleteBasicWideStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); } + + const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); @@ -2601,7 +2681,6 @@ const TypeObject* GetMinimalBadBasicWideStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2617,7 +2696,11 @@ const TypeObject* GetMinimalBadBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2732,7 +2815,6 @@ const TypeObject* GetCompleteBadBasicWideStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2748,7 +2830,11 @@ const TypeObject* GetCompleteBadBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2762,6 +2848,8 @@ const TypeObject* GetCompleteBadBasicWideStructObject() return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); } + + const TypeIdentifier* GetStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); @@ -2831,7 +2919,6 @@ const TypeObject* GetMinimalStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2847,7 +2934,11 @@ const TypeObject* GetMinimalStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2899,7 +2990,6 @@ const TypeObject* GetCompleteStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("StringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2915,7 +3005,11 @@ const TypeObject* GetCompleteStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2929,6 +3023,8 @@ const TypeObject* GetCompleteStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); } + + const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); @@ -2998,7 +3094,6 @@ const TypeObject* GetMinimalLargeStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3014,7 +3109,11 @@ const TypeObject* GetMinimalLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3066,7 +3165,6 @@ const TypeObject* GetCompleteLargeStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3082,7 +3180,11 @@ const TypeObject* GetCompleteLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3096,6 +3198,8 @@ const TypeObject* GetCompleteLargeStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); } + + const TypeIdentifier* GetWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); @@ -3165,7 +3269,6 @@ const TypeObject* GetMinimalWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3181,7 +3284,11 @@ const TypeObject* GetMinimalWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3233,7 +3340,6 @@ const TypeObject* GetCompleteWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("WStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3249,7 +3355,11 @@ const TypeObject* GetCompleteWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3263,6 +3373,8 @@ const TypeObject* GetCompleteWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); } + + const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); @@ -3332,7 +3444,6 @@ const TypeObject* GetMinimalLargeWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3348,7 +3459,11 @@ const TypeObject* GetMinimalLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3400,7 +3515,6 @@ const TypeObject* GetCompleteLargeWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3416,7 +3530,11 @@ const TypeObject* GetCompleteLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3430,6 +3548,8 @@ const TypeObject* GetCompleteLargeWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); } + + const TypeIdentifier* GetArrayStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); @@ -3499,7 +3619,6 @@ const TypeObject* GetMinimalArrayStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3515,7 +3634,11 @@ const TypeObject* GetMinimalArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3567,7 +3690,6 @@ const TypeObject* GetCompleteArrayStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3583,7 +3705,11 @@ const TypeObject* GetCompleteArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3597,6 +3723,8 @@ const TypeObject* GetCompleteArrayStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); } + + const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); @@ -3666,7 +3794,6 @@ const TypeObject* GetMinimalArrayStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3682,7 +3809,11 @@ const TypeObject* GetMinimalArrayStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3734,7 +3865,6 @@ const TypeObject* GetCompleteArrayStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3750,7 +3880,11 @@ const TypeObject* GetCompleteArrayStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3764,6 +3898,8 @@ const TypeObject* GetCompleteArrayStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); } + + const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); @@ -3833,7 +3969,6 @@ const TypeObject* GetMinimalArrayBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3849,7 +3984,11 @@ const TypeObject* GetMinimalArrayBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3901,7 +4040,6 @@ const TypeObject* GetCompleteArrayBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3917,7 +4055,11 @@ const TypeObject* GetCompleteArrayBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3931,6 +4073,8 @@ const TypeObject* GetCompleteArrayBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); } + + const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); @@ -4000,7 +4144,6 @@ const TypeObject* GetMinimalArrayDimensionsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4016,7 +4159,11 @@ const TypeObject* GetMinimalArrayDimensionsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4068,7 +4215,6 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4084,7 +4230,11 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4098,6 +4248,8 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); } + + const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); @@ -4167,7 +4319,6 @@ const TypeObject* GetMinimalArraySizeStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4183,7 +4334,11 @@ const TypeObject* GetMinimalArraySizeStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4235,7 +4390,6 @@ const TypeObject* GetCompleteArraySizeStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4251,7 +4405,11 @@ const TypeObject* GetCompleteArraySizeStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4265,6 +4423,10 @@ const TypeObject* GetCompleteArraySizeStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); } + + + + const TypeIdentifier* GetSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); @@ -4334,7 +4496,6 @@ const TypeObject* GetMinimalSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4350,7 +4511,11 @@ const TypeObject* GetMinimalSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4402,7 +4567,6 @@ const TypeObject* GetCompleteSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4418,7 +4582,11 @@ const TypeObject* GetCompleteSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4432,6 +4600,10 @@ const TypeObject* GetCompleteSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); } + + + + const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); @@ -4501,7 +4673,6 @@ const TypeObject* GetMinimalSequenceStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4517,7 +4688,11 @@ const TypeObject* GetMinimalSequenceStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4569,7 +4744,6 @@ const TypeObject* GetCompleteSequenceStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4585,7 +4759,11 @@ const TypeObject* GetCompleteSequenceStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4599,6 +4777,10 @@ const TypeObject* GetCompleteSequenceStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); } + + + + const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); @@ -4668,7 +4850,6 @@ const TypeObject* GetMinimalSequenceBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4684,7 +4865,11 @@ const TypeObject* GetMinimalSequenceBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4736,7 +4921,6 @@ const TypeObject* GetCompleteSequenceBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4752,7 +4936,11 @@ const TypeObject* GetCompleteSequenceBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4766,6 +4954,10 @@ const TypeObject* GetCompleteSequenceBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); } + + + + const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); @@ -4835,7 +5027,6 @@ const TypeObject* GetMinimalSequenceBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4851,7 +5042,11 @@ const TypeObject* GetMinimalSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4903,7 +5098,6 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4919,7 +5113,11 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4933,6 +5131,12 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); } + + + + + + const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); @@ -5002,7 +5206,6 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5018,7 +5221,11 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5070,7 +5277,6 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5086,7 +5292,11 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5100,6 +5310,12 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); } + + + + + + const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); @@ -5169,7 +5385,6 @@ const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5185,7 +5400,11 @@ const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5237,7 +5456,6 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5253,7 +5471,11 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5267,6 +5489,10 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); } + + + + const TypeIdentifier* GetMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); @@ -5336,7 +5562,6 @@ const TypeObject* GetMinimalMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5352,7 +5577,11 @@ const TypeObject* GetMinimalMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5404,7 +5633,6 @@ const TypeObject* GetCompleteMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5420,7 +5648,11 @@ const TypeObject* GetCompleteMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5434,6 +5666,10 @@ const TypeObject* GetCompleteMapStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); } + + + + const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); @@ -5503,7 +5739,6 @@ const TypeObject* GetMinimalMapStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5519,7 +5754,11 @@ const TypeObject* GetMinimalMapStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5571,7 +5810,6 @@ const TypeObject* GetCompleteMapStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5587,7 +5825,11 @@ const TypeObject* GetCompleteMapStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5601,6 +5843,10 @@ const TypeObject* GetCompleteMapStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); } + + + + const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); @@ -5670,7 +5916,6 @@ const TypeObject* GetMinimalMapBadKeyStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5686,7 +5931,11 @@ const TypeObject* GetMinimalMapBadKeyStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5738,7 +5987,6 @@ const TypeObject* GetCompleteMapBadKeyStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5754,7 +6002,11 @@ const TypeObject* GetCompleteMapBadKeyStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5768,6 +6020,10 @@ const TypeObject* GetCompleteMapBadKeyStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); } + + + + const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); @@ -5837,7 +6093,6 @@ const TypeObject* GetMinimalMapBadElemStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5853,7 +6108,11 @@ const TypeObject* GetMinimalMapBadElemStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5905,7 +6164,6 @@ const TypeObject* GetCompleteMapBadElemStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5921,7 +6179,11 @@ const TypeObject* GetCompleteMapBadElemStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5935,6 +6197,10 @@ const TypeObject* GetCompleteMapBadElemStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); } + + + + const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); @@ -6004,7 +6270,6 @@ const TypeObject* GetMinimalMapBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6020,7 +6285,11 @@ const TypeObject* GetMinimalMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6072,7 +6341,6 @@ const TypeObject* GetCompleteMapBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6088,7 +6356,11 @@ const TypeObject* GetCompleteMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6102,6 +6374,12 @@ const TypeObject* GetCompleteMapBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); } + + + + + + const TypeIdentifier* GetMapMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); @@ -6171,7 +6449,6 @@ const TypeObject* GetMinimalMapMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6187,7 +6464,11 @@ const TypeObject* GetMinimalMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6239,7 +6520,6 @@ const TypeObject* GetCompleteMapMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6255,7 +6535,11 @@ const TypeObject* GetCompleteMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6269,6 +6553,12 @@ const TypeObject* GetCompleteMapMapStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); } + + + + + + const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); @@ -6338,7 +6628,6 @@ const TypeObject* GetMinimalMapMapBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6354,7 +6643,11 @@ const TypeObject* GetMinimalMapMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6406,7 +6699,6 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6422,7 +6714,11 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6436,6 +6732,8 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); } + + const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); @@ -6553,7 +6851,11 @@ const TypeObject* GetMinimalSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6652,7 +6954,11 @@ const TypeObject* GetCompleteSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6667,6 +6973,8 @@ const TypeObject* GetCompleteSimpleUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); } + + const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); @@ -6784,7 +7092,11 @@ const TypeObject* GetMinimalSimpleUnionNamesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6883,7 +7195,11 @@ const TypeObject* GetCompleteSimpleUnionNamesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6898,6 +7214,8 @@ const TypeObject* GetCompleteSimpleUnionNamesObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); } + + const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); @@ -7015,7 +7333,11 @@ const TypeObject* GetMinimalSimpleTypeUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7114,7 +7436,11 @@ const TypeObject* GetCompleteSimpleTypeUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7129,6 +7455,8 @@ const TypeObject* GetCompleteSimpleTypeUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); } + + const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); @@ -7246,7 +7574,11 @@ const TypeObject* GetMinimalSimpleBadUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7345,7 +7677,11 @@ const TypeObject* GetCompleteSimpleBadUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7360,6 +7696,8 @@ const TypeObject* GetCompleteSimpleBadUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); } + + const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); @@ -7477,7 +7815,11 @@ const TypeObject* GetMinimalSimpleBadDiscUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7576,7 +7918,11 @@ const TypeObject* GetCompleteSimpleBadDiscUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7591,6 +7937,8 @@ const TypeObject* GetCompleteSimpleBadDiscUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); } + + const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); @@ -7660,7 +8008,6 @@ const TypeObject* GetMinimalSimpleUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7676,7 +8023,11 @@ const TypeObject* GetMinimalSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7728,7 +8079,6 @@ const TypeObject* GetCompleteSimpleUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7744,7 +8094,11 @@ const TypeObject* GetCompleteSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7758,6 +8112,8 @@ const TypeObject* GetCompleteSimpleUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); } + + const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); @@ -7827,7 +8183,6 @@ const TypeObject* GetMinimalSimpleUnionStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7843,7 +8198,11 @@ const TypeObject* GetMinimalSimpleUnionStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7895,7 +8254,6 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7911,7 +8269,11 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7925,6 +8287,8 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); } + + const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); @@ -7994,7 +8358,6 @@ const TypeObject* GetMinimalSimpleUnionNamesStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8010,7 +8373,11 @@ const TypeObject* GetMinimalSimpleUnionNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8062,7 +8429,6 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8078,7 +8444,11 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8092,6 +8462,8 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); } + + const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); @@ -8161,7 +8533,6 @@ const TypeObject* GetMinimalSimpleTypeUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8177,7 +8548,11 @@ const TypeObject* GetMinimalSimpleTypeUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8229,7 +8604,6 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8245,7 +8619,11 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8259,6 +8637,8 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); } + + const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); @@ -8328,7 +8708,6 @@ const TypeObject* GetMinimalSimpleBadUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8344,7 +8723,11 @@ const TypeObject* GetMinimalSimpleBadUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8396,7 +8779,6 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8412,7 +8794,11 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8426,6 +8812,8 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); } + + const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); @@ -8495,7 +8883,6 @@ const TypeObject* GetMinimalSimplBadDiscUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8511,7 +8898,11 @@ const TypeObject* GetMinimalSimplBadDiscUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8563,7 +8954,6 @@ const TypeObject* GetCompleteSimplBadDiscUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8579,7 +8969,11 @@ const TypeObject* GetCompleteSimplBadDiscUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/xtypes/idl/TypesTypeObject.h b/test/unittest/xtypes/idl/TypesTypeObject.h index 79af54dad4f..2f615b62792 100644 --- a/test/unittest/xtypes/idl/TypesTypeObject.h +++ b/test/unittest/xtypes/idl/TypesTypeObject.h @@ -64,11 +64,15 @@ eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = fal eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); @@ -79,196 +83,308 @@ eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = f eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); diff --git a/test/unittest/xtypes/idl/Typesv1.cxx b/test/unittest/xtypes/idl/Typesv1.cxx new file mode 100644 index 00000000000..54b0d494ecc --- /dev/null +++ b/test/unittest/xtypes/idl/Typesv1.cxx @@ -0,0 +1,8202 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Types.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "TypesTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define SimpleUnionStruct_max_cdr_typesize 24ULL; +#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; + +#define MyAliasEnumStruct_max_cdr_typesize 8ULL; +#define ArrayBadStruct_max_cdr_typesize 6ULL; +#define MapBadKeyStruct_max_cdr_typesize 24ULL; +#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; +#define MyEnumStruct_max_cdr_typesize 8ULL; + +#define ArrayStructEqual_max_cdr_typesize 12ULL; +#define LargeWStringStruct_max_cdr_typesize 167708ULL; + +#define WStringStruct_max_cdr_typesize 1028ULL; +#define SequenceStruct_max_cdr_typesize 16ULL; +#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; + +#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; +#define SequenceSequenceStruct_max_cdr_typesize 48ULL; +#define MapBoundsStruct_max_cdr_typesize 40ULL; +#define SequenceStructEqual_max_cdr_typesize 16ULL; +#define MapStructEqual_max_cdr_typesize 24ULL; +#define BasicStruct_max_cdr_typesize 272ULL; +#define SequenceBoundsStruct_max_cdr_typesize 24ULL; +#define MapMapStruct_max_cdr_typesize 60ULL; +#define BasicWideStruct_max_cdr_typesize 536ULL; + +#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; +#define MapStruct_max_cdr_typesize 24ULL; + +#define MyBadEnumStruct_max_cdr_typesize 8ULL; +#define SequenceBadStruct_max_cdr_typesize 10ULL; +#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; +#define LargeStringStruct_max_cdr_typesize 41934ULL; +#define ArrayStruct_max_cdr_typesize 12ULL; +#define BadBasicWideStruct_max_cdr_typesize 536ULL; +#define ArraySizeStruct_max_cdr_typesize 24ULL; + +#define MapBadElemStruct_max_cdr_typesize 40ULL; +#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; +#define BasicBadStruct_max_cdr_typesize 272ULL; +#define BasicNamesStruct_max_cdr_typesize 272ULL; +#define StringStruct_max_cdr_typesize 264ULL; + +#define MapMapBoundsStruct_max_cdr_typesize 108ULL; + + + + +MyEnumStruct::MyEnumStruct() +{ + // MyEnum m_my_enum + m_my_enum = ::A; + + // Just to register all known types + registerTypesTypes(); +} + +MyEnumStruct::~MyEnumStruct() +{ +} + +MyEnumStruct::MyEnumStruct( + const MyEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyEnumStruct::MyEnumStruct( + MyEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyEnumStruct& MyEnumStruct::operator =( + const MyEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyEnumStruct& MyEnumStruct::operator =( + MyEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyEnumStruct::operator ==( + const MyEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyEnumStruct::operator !=( + const MyEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyEnumStruct_max_cdr_typesize; +} + +size_t MyEnumStruct::getCdrSerializedSize( + const MyEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyEnum)enum_value; + } + + +} + + +bool MyEnumStruct::isKeyDefined() +{ + return false; +} + +void MyEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyEnumStruct::my_enum( + MyEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyEnum MyEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyEnum& MyEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + +MyBadEnumStruct::MyBadEnumStruct() +{ + // MyBadEnum m_my_enum + m_my_enum = ::A1; + + // Just to register all known types + registerTypesTypes(); +} + +MyBadEnumStruct::~MyBadEnumStruct() +{ +} + +MyBadEnumStruct::MyBadEnumStruct( + const MyBadEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyBadEnumStruct::MyBadEnumStruct( + MyBadEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyBadEnumStruct& MyBadEnumStruct::operator =( + const MyBadEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyBadEnumStruct& MyBadEnumStruct::operator =( + MyBadEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyBadEnumStruct::operator ==( + const MyBadEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyBadEnumStruct::operator !=( + const MyBadEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyBadEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyBadEnumStruct_max_cdr_typesize; +} + +size_t MyBadEnumStruct::getCdrSerializedSize( + const MyBadEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyBadEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyBadEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyBadEnum)enum_value; + } + + +} + + +bool MyBadEnumStruct::isKeyDefined() +{ + return false; +} + +void MyBadEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyBadEnumStruct::my_enum( + MyBadEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyBadEnum MyBadEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyBadEnum& MyBadEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + + +MyAliasEnumStruct::MyAliasEnumStruct() +{ + // MyAliasEnum m_my_enum + m_my_enum = ::A; + + // Just to register all known types + registerTypesTypes(); +} + +MyAliasEnumStruct::~MyAliasEnumStruct() +{ +} + +MyAliasEnumStruct::MyAliasEnumStruct( + const MyAliasEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyAliasEnumStruct::MyAliasEnumStruct( + MyAliasEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyAliasEnumStruct& MyAliasEnumStruct::operator =( + const MyAliasEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyAliasEnumStruct& MyAliasEnumStruct::operator =( + MyAliasEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyAliasEnumStruct::operator ==( + const MyAliasEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyAliasEnumStruct::operator !=( + const MyAliasEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyAliasEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyAliasEnumStruct_max_cdr_typesize; +} + +size_t MyAliasEnumStruct::getCdrSerializedSize( + const MyAliasEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyAliasEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyAliasEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyAliasEnum)enum_value; + } + + +} + + +bool MyAliasEnumStruct::isKeyDefined() +{ + return false; +} + +void MyAliasEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyAliasEnumStruct::my_enum( + MyAliasEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyAliasEnum MyAliasEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyAliasEnum& MyAliasEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + +BasicStruct::BasicStruct() +{ + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicStruct::~BasicStruct() +{ +} + +BasicStruct::BasicStruct( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BasicStruct::BasicStruct( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BasicStruct& BasicStruct::operator =( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BasicStruct& BasicStruct::operator =( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BasicStruct::operator ==( + const BasicStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BasicStruct::operator !=( + const BasicStruct& x) const +{ + return !(*this == x); +} + +size_t BasicStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; +} + +size_t BasicStruct::getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BasicStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BasicStruct::isKeyDefined() +{ + return false; +} + +void BasicStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BasicStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BasicStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicStruct::my_string() +{ + return m_my_string; +} + + + + + +BasicNamesStruct::BasicNamesStruct() +{ + // boolean m_my_bool_name + m_my_bool_name = false; + // long m_my_int32_name + m_my_int32_name = 0; + // /type_d() m_my_string_name + + + // Just to register all known types + registerTypesTypes(); +} + +BasicNamesStruct::~BasicNamesStruct() +{ +} + +BasicNamesStruct::BasicNamesStruct( + const BasicNamesStruct& x) +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = x.m_my_string_name; + +} + +BasicNamesStruct::BasicNamesStruct( + BasicNamesStruct&& x) noexcept +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = std::move(x.m_my_string_name); + +} + +BasicNamesStruct& BasicNamesStruct::operator =( + const BasicNamesStruct& x) +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = x.m_my_string_name; + + return *this; +} + +BasicNamesStruct& BasicNamesStruct::operator =( + BasicNamesStruct&& x) noexcept +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = std::move(x.m_my_string_name); + + return *this; +} + +bool BasicNamesStruct::operator ==( + const BasicNamesStruct& x) const +{ + return (m_my_bool_name == x.m_my_bool_name && + m_my_int32_name == x.m_my_int32_name && + m_my_string_name == x.m_my_string_name); +} + +bool BasicNamesStruct::operator !=( + const BasicNamesStruct& x) const +{ + return !(*this == x); +} + +size_t BasicNamesStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicNamesStruct_max_cdr_typesize; +} + +size_t BasicNamesStruct::getCdrSerializedSize( + const BasicNamesStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicNamesStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool_name; + + scdr << m_my_int32_name; + + scdr << m_my_string_name.c_str(); + +} + +void BasicNamesStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool_name; + + + + dcdr >> m_my_int32_name; + + + + dcdr >> m_my_string_name; + + +} + + +bool BasicNamesStruct::isKeyDefined() +{ + return false; +} + +void BasicNamesStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool_name + * @param _my_bool_name New value for member my_bool_name + */ +void BasicNamesStruct::my_bool_name( + bool _my_bool_name) +{ + m_my_bool_name = _my_bool_name; +} + +/*! + * @brief This function returns the value of member my_bool_name + * @return Value of member my_bool_name + */ +bool BasicNamesStruct::my_bool_name() const +{ + return m_my_bool_name; +} + +/*! + * @brief This function returns a reference to member my_bool_name + * @return Reference to member my_bool_name + */ +bool& BasicNamesStruct::my_bool_name() +{ + return m_my_bool_name; +} + + +/*! + * @brief This function sets a value in member my_int32_name + * @param _my_int32_name New value for member my_int32_name + */ +void BasicNamesStruct::my_int32_name( + int32_t _my_int32_name) +{ + m_my_int32_name = _my_int32_name; +} + +/*! + * @brief This function returns the value of member my_int32_name + * @return Value of member my_int32_name + */ +int32_t BasicNamesStruct::my_int32_name() const +{ + return m_my_int32_name; +} + +/*! + * @brief This function returns a reference to member my_int32_name + * @return Reference to member my_int32_name + */ +int32_t& BasicNamesStruct::my_int32_name() +{ + return m_my_int32_name; +} + + +/*! + * @brief This function copies the value in member my_string_name + * @param _my_string_name New value to be copied in member my_string_name + */ +void BasicNamesStruct::my_string_name( + const std::string& _my_string_name) +{ + m_my_string_name = _my_string_name; +} + +/*! + * @brief This function moves the value in member my_string_name + * @param _my_string_name New value to be moved in member my_string_name + */ +void BasicNamesStruct::my_string_name( + std::string&& _my_string_name) +{ + m_my_string_name = std::move(_my_string_name); +} + +/*! + * @brief This function returns a constant reference to member my_string_name + * @return Constant reference to member my_string_name + */ +const std::string& BasicNamesStruct::my_string_name() const +{ + return m_my_string_name; +} + +/*! + * @brief This function returns a reference to member my_string_name + * @return Reference to member my_string_name + */ +std::string& BasicNamesStruct::my_string_name() +{ + return m_my_string_name; +} + + + + + +BasicBadStruct::BasicBadStruct() +{ + // octet m_my_bool + m_my_bool = 0; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicBadStruct::~BasicBadStruct() +{ +} + +BasicBadStruct::BasicBadStruct( + const BasicBadStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BasicBadStruct::BasicBadStruct( + BasicBadStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BasicBadStruct& BasicBadStruct::operator =( + const BasicBadStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BasicBadStruct& BasicBadStruct::operator =( + BasicBadStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BasicBadStruct::operator ==( + const BasicBadStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BasicBadStruct::operator !=( + const BasicBadStruct& x) const +{ + return !(*this == x); +} + +size_t BasicBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicBadStruct_max_cdr_typesize; +} + +size_t BasicBadStruct::getCdrSerializedSize( + const BasicBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BasicBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BasicBadStruct::isKeyDefined() +{ + return false; +} + +void BasicBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicBadStruct::my_bool( + uint8_t _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +uint8_t BasicBadStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +uint8_t& BasicBadStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicBadStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicBadStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicBadStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicBadStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicBadStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicBadStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicBadStruct::my_string() +{ + return m_my_string; +} + + + + + +BasicWideStruct::BasicWideStruct() +{ + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + // long m_new_int32 + m_new_int32 = 0; + // /type_d() m_new_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicWideStruct::~BasicWideStruct() +{ +} + +BasicWideStruct::BasicWideStruct( + const BasicWideStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + +} + +BasicWideStruct::BasicWideStruct( + BasicWideStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + +} + +BasicWideStruct& BasicWideStruct::operator =( + const BasicWideStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + return *this; +} + +BasicWideStruct& BasicWideStruct::operator =( + BasicWideStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + return *this; +} + +bool BasicWideStruct::operator ==( + const BasicWideStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string && + m_new_int32 == x.m_new_int32 && + m_new_string == x.m_new_string); +} + +bool BasicWideStruct::operator !=( + const BasicWideStruct& x) const +{ + return !(*this == x); +} + +size_t BasicWideStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicWideStruct_max_cdr_typesize; +} + +size_t BasicWideStruct::getCdrSerializedSize( + const BasicWideStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicWideStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + + scdr << m_new_int32; + + scdr << m_new_string.c_str(); + +} + +void BasicWideStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + + + dcdr >> m_new_int32; + + + + dcdr >> m_new_string; + + +} + + +bool BasicWideStruct::isKeyDefined() +{ + return false; +} + +void BasicWideStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicWideStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BasicWideStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BasicWideStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicWideStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicWideStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicWideStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicWideStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicWideStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicWideStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicWideStruct::my_string() +{ + return m_my_string; +} + + +/*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ +void BasicWideStruct::new_int32( + int32_t _new_int32) +{ + m_new_int32 = _new_int32; +} + +/*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ +int32_t BasicWideStruct::new_int32() const +{ + return m_new_int32; +} + +/*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ +int32_t& BasicWideStruct::new_int32() +{ + return m_new_int32; +} + + +/*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ +void BasicWideStruct::new_string( + const std::string& _new_string) +{ + m_new_string = _new_string; +} + +/*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ +void BasicWideStruct::new_string( + std::string&& _new_string) +{ + m_new_string = std::move(_new_string); +} + +/*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ +const std::string& BasicWideStruct::new_string() const +{ + return m_new_string; +} + +/*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ +std::string& BasicWideStruct::new_string() +{ + return m_new_string; +} + + + + + +BadBasicWideStruct::BadBasicWideStruct() +{ + // long m_new_int32 + m_new_int32 = 0; + // /type_d() m_new_string + + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BadBasicWideStruct::~BadBasicWideStruct() +{ +} + +BadBasicWideStruct::BadBasicWideStruct( + const BadBasicWideStruct& x) +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BadBasicWideStruct::BadBasicWideStruct( + BadBasicWideStruct&& x) noexcept +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BadBasicWideStruct& BadBasicWideStruct::operator =( + const BadBasicWideStruct& x) +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BadBasicWideStruct& BadBasicWideStruct::operator =( + BadBasicWideStruct&& x) noexcept +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BadBasicWideStruct::operator ==( + const BadBasicWideStruct& x) const +{ + return (m_new_int32 == x.m_new_int32 && + m_new_string == x.m_new_string && + m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BadBasicWideStruct::operator !=( + const BadBasicWideStruct& x) const +{ + return !(*this == x); +} + +size_t BadBasicWideStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BadBasicWideStruct_max_cdr_typesize; +} + +size_t BadBasicWideStruct::getCdrSerializedSize( + const BadBasicWideStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BadBasicWideStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_new_int32; + + scdr << m_new_string.c_str(); + + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BadBasicWideStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_new_int32; + + + + dcdr >> m_new_string; + + + + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BadBasicWideStruct::isKeyDefined() +{ + return false; +} + +void BadBasicWideStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ +void BadBasicWideStruct::new_int32( + int32_t _new_int32) +{ + m_new_int32 = _new_int32; +} + +/*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ +int32_t BadBasicWideStruct::new_int32() const +{ + return m_new_int32; +} + +/*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ +int32_t& BadBasicWideStruct::new_int32() +{ + return m_new_int32; +} + + +/*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ +void BadBasicWideStruct::new_string( + const std::string& _new_string) +{ + m_new_string = _new_string; +} + +/*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ +void BadBasicWideStruct::new_string( + std::string&& _new_string) +{ + m_new_string = std::move(_new_string); +} + +/*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ +const std::string& BadBasicWideStruct::new_string() const +{ + return m_new_string; +} + +/*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ +std::string& BadBasicWideStruct::new_string() +{ + return m_new_string; +} + + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BadBasicWideStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BadBasicWideStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BadBasicWideStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BadBasicWideStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BadBasicWideStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BadBasicWideStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BadBasicWideStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BadBasicWideStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BadBasicWideStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BadBasicWideStruct::my_string() +{ + return m_my_string; +} + + + + + +StringStruct::StringStruct() +{ + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +StringStruct::~StringStruct() +{ +} + +StringStruct::StringStruct( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + +} + +StringStruct::StringStruct( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + +} + +StringStruct& StringStruct::operator =( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + + return *this; +} + +StringStruct& StringStruct::operator =( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool StringStruct::operator ==( + const StringStruct& x) const +{ + return (m_my_string == x.m_my_string); +} + +bool StringStruct::operator !=( + const StringStruct& x) const +{ + return !(*this == x); +} + +size_t StringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; +} + +size_t StringStruct::getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void StringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_string.c_str(); + +} + +void StringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_string; + + +} + + +bool StringStruct::isKeyDefined() +{ + return false; +} + +void StringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void StringStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void StringStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& StringStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& StringStruct::my_string() +{ + return m_my_string; +} + + + + + +LargeStringStruct::LargeStringStruct() +{ + // /type_d() m_my_large_string + + + // Just to register all known types + registerTypesTypes(); +} + +LargeStringStruct::~LargeStringStruct() +{ +} + +LargeStringStruct::LargeStringStruct( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + +} + +LargeStringStruct::LargeStringStruct( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + +} + +LargeStringStruct& LargeStringStruct::operator =( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + + return *this; +} + +LargeStringStruct& LargeStringStruct::operator =( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + + return *this; +} + +bool LargeStringStruct::operator ==( + const LargeStringStruct& x) const +{ + return (m_my_large_string == x.m_my_large_string); +} + +bool LargeStringStruct::operator !=( + const LargeStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; +} + +size_t LargeStringStruct::getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void LargeStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_string.c_str(); + +} + +void LargeStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + std::string aux; + dcdr >> aux; + m_my_large_string = aux.c_str(); + } + + +} + + +bool LargeStringStruct::isKeyDefined() +{ + return false; +} + +void LargeStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ +void LargeStringStruct::my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string) +{ + m_my_large_string = _my_large_string; +} + +/*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ +void LargeStringStruct::my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string) +{ + m_my_large_string = std::move(_my_large_string); +} + +/*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ +const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const +{ + return m_my_large_string; +} + +/*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ +eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() +{ + return m_my_large_string; +} + + + + + +WStringStruct::WStringStruct() +{ + // /type_15() m_my_wstring + + + // Just to register all known types + registerTypesTypes(); +} + +WStringStruct::~WStringStruct() +{ +} + +WStringStruct::WStringStruct( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + +} + +WStringStruct::WStringStruct( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + +} + +WStringStruct& WStringStruct::operator =( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + + return *this; +} + +WStringStruct& WStringStruct::operator =( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + + return *this; +} + +bool WStringStruct::operator ==( + const WStringStruct& x) const +{ + return (m_my_wstring == x.m_my_wstring); +} + +bool WStringStruct::operator !=( + const WStringStruct& x) const +{ + return !(*this == x); +} + +size_t WStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; +} + +size_t WStringStruct::getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void WStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_wstring; + +} + +void WStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_wstring; + + +} + + +bool WStringStruct::isKeyDefined() +{ + return false; +} + +void WStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ +void WStringStruct::my_wstring( + const std::wstring& _my_wstring) +{ + m_my_wstring = _my_wstring; +} + +/*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ +void WStringStruct::my_wstring( + std::wstring&& _my_wstring) +{ + m_my_wstring = std::move(_my_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ +const std::wstring& WStringStruct::my_wstring() const +{ + return m_my_wstring; +} + +/*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ +std::wstring& WStringStruct::my_wstring() +{ + return m_my_wstring; +} + + + + + +LargeWStringStruct::LargeWStringStruct() +{ + // /type_15() m_my_large_wstring + + + // Just to register all known types + registerTypesTypes(); +} + +LargeWStringStruct::~LargeWStringStruct() +{ +} + +LargeWStringStruct::LargeWStringStruct( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + +} + +LargeWStringStruct::LargeWStringStruct( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + +} + +LargeWStringStruct& LargeWStringStruct::operator =( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + + return *this; +} + +LargeWStringStruct& LargeWStringStruct::operator =( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + + return *this; +} + +bool LargeWStringStruct::operator ==( + const LargeWStringStruct& x) const +{ + return (m_my_large_wstring == x.m_my_large_wstring); +} + +bool LargeWStringStruct::operator !=( + const LargeWStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeWStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; +} + +size_t LargeWStringStruct::getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void LargeWStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_wstring; + +} + +void LargeWStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_large_wstring; + + +} + + +bool LargeWStringStruct::isKeyDefined() +{ + return false; +} + +void LargeWStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + const std::wstring& _my_large_wstring) +{ + m_my_large_wstring = _my_large_wstring; +} + +/*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + std::wstring&& _my_large_wstring) +{ + m_my_large_wstring = std::move(_my_large_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ +const std::wstring& LargeWStringStruct::my_large_wstring() const +{ + return m_my_large_wstring; +} + +/*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ +std::wstring& LargeWStringStruct::my_large_wstring() +{ + return m_my_large_wstring; +} + + + + + +ArrayStruct::ArrayStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayStruct::~ArrayStruct() +{ +} + +ArrayStruct::ArrayStruct( + const ArrayStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayStruct::ArrayStruct( + ArrayStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayStruct& ArrayStruct::operator =( + const ArrayStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayStruct& ArrayStruct::operator =( + ArrayStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayStruct::operator ==( + const ArrayStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayStruct::operator !=( + const ArrayStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayStruct_max_cdr_typesize; +} + +size_t ArrayStruct::getCdrSerializedSize( + const ArrayStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArrayStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArrayStruct::isKeyDefined() +{ + return false; +} + +void ArrayStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArrayStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArrayStruct::my_array() +{ + return m_my_array; +} + + + + + +ArrayStructEqual::ArrayStructEqual() +{ + // long m_my_array_equal + memset(&m_my_array_equal, 0, ((2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayStructEqual::~ArrayStructEqual() +{ +} + +ArrayStructEqual::ArrayStructEqual( + const ArrayStructEqual& x) +{ + m_my_array_equal = x.m_my_array_equal; + +} + +ArrayStructEqual::ArrayStructEqual( + ArrayStructEqual&& x) noexcept +{ + m_my_array_equal = std::move(x.m_my_array_equal); + +} + +ArrayStructEqual& ArrayStructEqual::operator =( + const ArrayStructEqual& x) +{ + m_my_array_equal = x.m_my_array_equal; + + return *this; +} + +ArrayStructEqual& ArrayStructEqual::operator =( + ArrayStructEqual&& x) noexcept +{ + m_my_array_equal = std::move(x.m_my_array_equal); + + return *this; +} + +bool ArrayStructEqual::operator ==( + const ArrayStructEqual& x) const +{ + return (m_my_array_equal == x.m_my_array_equal); +} + +bool ArrayStructEqual::operator !=( + const ArrayStructEqual& x) const +{ + return !(*this == x); +} + +size_t ArrayStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayStructEqual_max_cdr_typesize; +} + +size_t ArrayStructEqual::getCdrSerializedSize( + const ArrayStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array_equal; + + +} + +void ArrayStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array_equal; + + +} + + +bool ArrayStructEqual::isKeyDefined() +{ + return false; +} + +void ArrayStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array_equal + * @param _my_array_equal New value to be copied in member my_array_equal + */ +void ArrayStructEqual::my_array_equal( + const std::array& _my_array_equal) +{ + m_my_array_equal = _my_array_equal; +} + +/*! + * @brief This function moves the value in member my_array_equal + * @param _my_array_equal New value to be moved in member my_array_equal + */ +void ArrayStructEqual::my_array_equal( + std::array&& _my_array_equal) +{ + m_my_array_equal = std::move(_my_array_equal); +} + +/*! + * @brief This function returns a constant reference to member my_array_equal + * @return Constant reference to member my_array_equal + */ +const std::array& ArrayStructEqual::my_array_equal() const +{ + return m_my_array_equal; +} + +/*! + * @brief This function returns a reference to member my_array_equal + * @return Reference to member my_array_equal + */ +std::array& ArrayStructEqual::my_array_equal() +{ + return m_my_array_equal; +} + + + + + +ArrayBadStruct::ArrayBadStruct() +{ + // octet m_my_array + memset(&m_my_array, 0, ((2)) * 1); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayBadStruct::~ArrayBadStruct() +{ +} + +ArrayBadStruct::ArrayBadStruct( + const ArrayBadStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayBadStruct::ArrayBadStruct( + ArrayBadStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayBadStruct& ArrayBadStruct::operator =( + const ArrayBadStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayBadStruct& ArrayBadStruct::operator =( + ArrayBadStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayBadStruct::operator ==( + const ArrayBadStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayBadStruct::operator !=( + const ArrayBadStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayBadStruct_max_cdr_typesize; +} + +size_t ArrayBadStruct::getCdrSerializedSize( + const ArrayBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void ArrayBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArrayBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArrayBadStruct::isKeyDefined() +{ + return false; +} + +void ArrayBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayBadStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayBadStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArrayBadStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArrayBadStruct::my_array() +{ + return m_my_array; +} + + + + + +ArrayDimensionsStruct::ArrayDimensionsStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((2) * (2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayDimensionsStruct::~ArrayDimensionsStruct() +{ +} + +ArrayDimensionsStruct::ArrayDimensionsStruct( + const ArrayDimensionsStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayDimensionsStruct::ArrayDimensionsStruct( + ArrayDimensionsStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( + const ArrayDimensionsStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( + ArrayDimensionsStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayDimensionsStruct::operator ==( + const ArrayDimensionsStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayDimensionsStruct::operator !=( + const ArrayDimensionsStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayDimensionsStruct_max_cdr_typesize; +} + +size_t ArrayDimensionsStruct::getCdrSerializedSize( + const ArrayDimensionsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayDimensionsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + for (uint32_t b = 0; b < m_my_array.size(); ++b) + { + scdr << m_my_array[b]; + + } + + + +} + +void ArrayDimensionsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + for (uint32_t d = 0; d < m_my_array.size(); ++d) + { + dcdr >> m_my_array[d]; + + } + + + +} + + +bool ArrayDimensionsStruct::isKeyDefined() +{ + return false; +} + +void ArrayDimensionsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayDimensionsStruct::my_array( + const std::array, 2>& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayDimensionsStruct::my_array( + std::array, 2>&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array, 2>& ArrayDimensionsStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array, 2>& ArrayDimensionsStruct::my_array() +{ + return m_my_array; +} + + + + + +ArraySizeStruct::ArraySizeStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((5)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArraySizeStruct::~ArraySizeStruct() +{ +} + +ArraySizeStruct::ArraySizeStruct( + const ArraySizeStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArraySizeStruct::ArraySizeStruct( + ArraySizeStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArraySizeStruct& ArraySizeStruct::operator =( + const ArraySizeStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArraySizeStruct& ArraySizeStruct::operator =( + ArraySizeStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArraySizeStruct::operator ==( + const ArraySizeStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArraySizeStruct::operator !=( + const ArraySizeStruct& x) const +{ + return !(*this == x); +} + +size_t ArraySizeStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArraySizeStruct_max_cdr_typesize; +} + +size_t ArraySizeStruct::getCdrSerializedSize( + const ArraySizeStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArraySizeStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArraySizeStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArraySizeStruct::isKeyDefined() +{ + return false; +} + +void ArraySizeStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArraySizeStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArraySizeStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArraySizeStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArraySizeStruct::my_array() +{ + return m_my_array; +} + + + + + + + +SequenceStruct::SequenceStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceStruct::~SequenceStruct() +{ +} + +SequenceStruct::SequenceStruct( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceStruct::SequenceStruct( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceStruct& SequenceStruct::operator =( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceStruct& SequenceStruct::operator =( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceStruct::operator ==( + const SequenceStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceStruct::operator !=( + const SequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; +} + +size_t SequenceStruct::getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + +SequenceStructEqual::SequenceStructEqual() +{ + // sequence m_my_sequence_equal + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceStructEqual::~SequenceStructEqual() +{ +} + +SequenceStructEqual::SequenceStructEqual( + const SequenceStructEqual& x) +{ + m_my_sequence_equal = x.m_my_sequence_equal; + +} + +SequenceStructEqual::SequenceStructEqual( + SequenceStructEqual&& x) noexcept +{ + m_my_sequence_equal = std::move(x.m_my_sequence_equal); + +} + +SequenceStructEqual& SequenceStructEqual::operator =( + const SequenceStructEqual& x) +{ + m_my_sequence_equal = x.m_my_sequence_equal; + + return *this; +} + +SequenceStructEqual& SequenceStructEqual::operator =( + SequenceStructEqual&& x) noexcept +{ + m_my_sequence_equal = std::move(x.m_my_sequence_equal); + + return *this; +} + +bool SequenceStructEqual::operator ==( + const SequenceStructEqual& x) const +{ + return (m_my_sequence_equal == x.m_my_sequence_equal); +} + +bool SequenceStructEqual::operator !=( + const SequenceStructEqual& x) const +{ + return !(*this == x); +} + +size_t SequenceStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceStructEqual_max_cdr_typesize; +} + +size_t SequenceStructEqual::getCdrSerializedSize( + const SequenceStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_equal().size() > 0) + { + current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_equal; + + +} + +void SequenceStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_equal; + + +} + + +bool SequenceStructEqual::isKeyDefined() +{ + return false; +} + +void SequenceStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_equal + * @param _my_sequence_equal New value to be copied in member my_sequence_equal + */ +void SequenceStructEqual::my_sequence_equal( + const std::vector& _my_sequence_equal) +{ + m_my_sequence_equal = _my_sequence_equal; +} + +/*! + * @brief This function moves the value in member my_sequence_equal + * @param _my_sequence_equal New value to be moved in member my_sequence_equal + */ +void SequenceStructEqual::my_sequence_equal( + std::vector&& _my_sequence_equal) +{ + m_my_sequence_equal = std::move(_my_sequence_equal); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_equal + * @return Constant reference to member my_sequence_equal + */ +const std::vector& SequenceStructEqual::my_sequence_equal() const +{ + return m_my_sequence_equal; +} + +/*! + * @brief This function returns a reference to member my_sequence_equal + * @return Reference to member my_sequence_equal + */ +std::vector& SequenceStructEqual::my_sequence_equal() +{ + return m_my_sequence_equal; +} + + + + + + + +SequenceBadStruct::SequenceBadStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceBadStruct::~SequenceBadStruct() +{ +} + +SequenceBadStruct::SequenceBadStruct( + const SequenceBadStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceBadStruct::SequenceBadStruct( + SequenceBadStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceBadStruct& SequenceBadStruct::operator =( + const SequenceBadStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceBadStruct& SequenceBadStruct::operator =( + SequenceBadStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceBadStruct::operator ==( + const SequenceBadStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceBadStruct::operator !=( + const SequenceBadStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceBadStruct_max_cdr_typesize; +} + +size_t SequenceBadStruct::getCdrSerializedSize( + const SequenceBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceBadStruct::isKeyDefined() +{ + return false; +} + +void SequenceBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceBadStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceBadStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceBadStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceBadStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + +SequenceBoundsStruct::SequenceBoundsStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceBoundsStruct::~SequenceBoundsStruct() +{ +} + +SequenceBoundsStruct::SequenceBoundsStruct( + const SequenceBoundsStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceBoundsStruct::SequenceBoundsStruct( + SequenceBoundsStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceBoundsStruct& SequenceBoundsStruct::operator =( + const SequenceBoundsStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceBoundsStruct& SequenceBoundsStruct::operator =( + SequenceBoundsStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceBoundsStruct::operator ==( + const SequenceBoundsStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceBoundsStruct::operator !=( + const SequenceBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceBoundsStruct_max_cdr_typesize; +} + +size_t SequenceBoundsStruct::getCdrSerializedSize( + const SequenceBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceBoundsStruct::isKeyDefined() +{ + return false; +} + +void SequenceBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceBoundsStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceBoundsStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceBoundsStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceBoundsStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + + + +SequenceSequenceStruct::SequenceSequenceStruct() +{ + // sequence, 3> m_my_sequence_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceSequenceStruct::~SequenceSequenceStruct() +{ +} + +SequenceSequenceStruct::SequenceSequenceStruct( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + +} + +SequenceSequenceStruct::SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + + return *this; +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + + return *this; +} + +bool SequenceSequenceStruct::operator ==( + const SequenceSequenceStruct& x) const +{ + return (m_my_sequence_sequence == x.m_my_sequence_sequence); +} + +bool SequenceSequenceStruct::operator !=( + const SequenceSequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceSequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; +} + +size_t SequenceSequenceStruct::getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_sequence().at(a).size() > 0) + { + current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + } + + + + return current_alignment - initial_alignment; +} + + +void SequenceSequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_sequence; + + +} + +void SequenceSequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_sequence; + + +} + + +bool SequenceSequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceSequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + const std::vector>& _my_sequence_sequence) +{ + m_my_sequence_sequence = _my_sequence_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + std::vector>&& _my_sequence_sequence) +{ + m_my_sequence_sequence = std::move(_my_sequence_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ +const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const +{ + return m_my_sequence_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ +std::vector>& SequenceSequenceStruct::my_sequence_sequence() +{ + return m_my_sequence_sequence; +} + + + + + + + + + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() +{ + // sequence, 5> m_my_sequence_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() +{ +} + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( + const SequenceSequenceBoundsStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + +} + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( + SequenceSequenceBoundsStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + +} + +SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( + const SequenceSequenceBoundsStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + + return *this; +} + +SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( + SequenceSequenceBoundsStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + + return *this; +} + +bool SequenceSequenceBoundsStruct::operator ==( + const SequenceSequenceBoundsStruct& x) const +{ + return (m_my_sequence_sequence == x.m_my_sequence_sequence); +} + +bool SequenceSequenceBoundsStruct::operator !=( + const SequenceSequenceBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_cdr_typesize; +} + +size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( + const SequenceSequenceBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_sequence().at(a).size() > 0) + { + current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + } + + + + return current_alignment - initial_alignment; +} + + +void SequenceSequenceBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_sequence; + + +} + +void SequenceSequenceBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_sequence; + + +} + + +bool SequenceSequenceBoundsStruct::isKeyDefined() +{ + return false; +} + +void SequenceSequenceBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ +void SequenceSequenceBoundsStruct::my_sequence_sequence( + const std::vector>& _my_sequence_sequence) +{ + m_my_sequence_sequence = _my_sequence_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ +void SequenceSequenceBoundsStruct::my_sequence_sequence( + std::vector>&& _my_sequence_sequence) +{ + m_my_sequence_sequence = std::move(_my_sequence_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ +const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const +{ + return m_my_sequence_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ +std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() +{ + return m_my_sequence_sequence; +} + + + + + + + +MapStruct::MapStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapStruct::~MapStruct() +{ +} + +MapStruct::MapStruct( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapStruct::MapStruct( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapStruct& MapStruct::operator =( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapStruct& MapStruct::operator =( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapStruct::operator ==( + const MapStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapStruct::operator !=( + const MapStruct& x) const +{ + return !(*this == x); +} + +size_t MapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; +} + +size_t MapStruct::getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapStruct::isKeyDefined() +{ + return false; +} + +void MapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapStructEqual::MapStructEqual() +{ + // map m_my_map_equal + + + // Just to register all known types + registerTypesTypes(); +} + +MapStructEqual::~MapStructEqual() +{ +} + +MapStructEqual::MapStructEqual( + const MapStructEqual& x) +{ + m_my_map_equal = x.m_my_map_equal; + +} + +MapStructEqual::MapStructEqual( + MapStructEqual&& x) noexcept +{ + m_my_map_equal = std::move(x.m_my_map_equal); + +} + +MapStructEqual& MapStructEqual::operator =( + const MapStructEqual& x) +{ + m_my_map_equal = x.m_my_map_equal; + + return *this; +} + +MapStructEqual& MapStructEqual::operator =( + MapStructEqual&& x) noexcept +{ + m_my_map_equal = std::move(x.m_my_map_equal); + + return *this; +} + +bool MapStructEqual::operator ==( + const MapStructEqual& x) const +{ + return (m_my_map_equal == x.m_my_map_equal); +} + +bool MapStructEqual::operator !=( + const MapStructEqual& x) const +{ + return !(*this == x); +} + +size_t MapStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapStructEqual_max_cdr_typesize; +} + +size_t MapStructEqual::getCdrSerializedSize( + const MapStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_equal()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_equal.size()); + for (const auto& pair : m_my_map_equal) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_equal; + + +} + + +bool MapStructEqual::isKeyDefined() +{ + return false; +} + +void MapStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_equal + * @param _my_map_equal New value to be copied in member my_map_equal + */ +void MapStructEqual::my_map_equal( + const std::map& _my_map_equal) +{ + m_my_map_equal = _my_map_equal; +} + +/*! + * @brief This function moves the value in member my_map_equal + * @param _my_map_equal New value to be moved in member my_map_equal + */ +void MapStructEqual::my_map_equal( + std::map&& _my_map_equal) +{ + m_my_map_equal = std::move(_my_map_equal); +} + +/*! + * @brief This function returns a constant reference to member my_map_equal + * @return Constant reference to member my_map_equal + */ +const std::map& MapStructEqual::my_map_equal() const +{ + return m_my_map_equal; +} + +/*! + * @brief This function returns a reference to member my_map_equal + * @return Reference to member my_map_equal + */ +std::map& MapStructEqual::my_map_equal() +{ + return m_my_map_equal; +} + + + + + + + +MapBadKeyStruct::MapBadKeyStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBadKeyStruct::~MapBadKeyStruct() +{ +} + +MapBadKeyStruct::MapBadKeyStruct( + const MapBadKeyStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBadKeyStruct::MapBadKeyStruct( + MapBadKeyStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBadKeyStruct& MapBadKeyStruct::operator =( + const MapBadKeyStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBadKeyStruct& MapBadKeyStruct::operator =( + MapBadKeyStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBadKeyStruct::operator ==( + const MapBadKeyStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBadKeyStruct::operator !=( + const MapBadKeyStruct& x) const +{ + return !(*this == x); +} + +size_t MapBadKeyStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadKeyStruct_max_cdr_typesize; +} + +size_t MapBadKeyStruct::getCdrSerializedSize( + const MapBadKeyStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBadKeyStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBadKeyStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBadKeyStruct::isKeyDefined() +{ + return false; +} + +void MapBadKeyStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBadKeyStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBadKeyStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBadKeyStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBadKeyStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapBadElemStruct::MapBadElemStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBadElemStruct::~MapBadElemStruct() +{ +} + +MapBadElemStruct::MapBadElemStruct( + const MapBadElemStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBadElemStruct::MapBadElemStruct( + MapBadElemStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBadElemStruct& MapBadElemStruct::operator =( + const MapBadElemStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBadElemStruct& MapBadElemStruct::operator =( + MapBadElemStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBadElemStruct::operator ==( + const MapBadElemStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBadElemStruct::operator !=( + const MapBadElemStruct& x) const +{ + return !(*this == x); +} + +size_t MapBadElemStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadElemStruct_max_cdr_typesize; +} + +size_t MapBadElemStruct::getCdrSerializedSize( + const MapBadElemStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBadElemStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBadElemStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBadElemStruct::isKeyDefined() +{ + return false; +} + +void MapBadElemStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBadElemStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBadElemStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBadElemStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBadElemStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapBoundsStruct::MapBoundsStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBoundsStruct::~MapBoundsStruct() +{ +} + +MapBoundsStruct::MapBoundsStruct( + const MapBoundsStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBoundsStruct::MapBoundsStruct( + MapBoundsStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBoundsStruct& MapBoundsStruct::operator =( + const MapBoundsStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBoundsStruct& MapBoundsStruct::operator =( + MapBoundsStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBoundsStruct::operator ==( + const MapBoundsStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBoundsStruct::operator !=( + const MapBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t MapBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBoundsStruct_max_cdr_typesize; +} + +size_t MapBoundsStruct::getCdrSerializedSize( + const MapBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBoundsStruct::isKeyDefined() +{ + return false; +} + +void MapBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBoundsStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBoundsStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBoundsStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBoundsStruct::my_map() +{ + return m_my_map; +} + + + + + + + + + +MapMapStruct::MapMapStruct() +{ + // map> m_my_map_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapMapStruct::~MapMapStruct() +{ +} + +MapMapStruct::MapMapStruct( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + +} + +MapMapStruct::MapMapStruct( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + +} + +MapMapStruct& MapMapStruct::operator =( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + + return *this; +} + +MapMapStruct& MapMapStruct::operator =( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + + return *this; +} + +bool MapMapStruct::operator ==( + const MapMapStruct& x) const +{ + return (m_my_map_map == x.m_my_map_map); +} + +bool MapMapStruct::operator !=( + const MapMapStruct& x) const +{ + return !(*this == x); +} + +size_t MapMapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; +} + +size_t MapMapStruct::getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + } + + + return current_alignment - initial_alignment; +} + + +void MapMapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_map.size()); + for (const auto& pair : m_my_map_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapMapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_map; + + +} + + +bool MapMapStruct::isKeyDefined() +{ + return false; +} + +void MapMapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ +void MapMapStruct::my_map_map( + const std::map>& _my_map_map) +{ + m_my_map_map = _my_map_map; +} + +/*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ +void MapMapStruct::my_map_map( + std::map>&& _my_map_map) +{ + m_my_map_map = std::move(_my_map_map); +} + +/*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ +const std::map>& MapMapStruct::my_map_map() const +{ + return m_my_map_map; +} + +/*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ +std::map>& MapMapStruct::my_map_map() +{ + return m_my_map_map; +} + + + + + + + + + +MapMapBoundsStruct::MapMapBoundsStruct() +{ + // map> m_my_map_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapMapBoundsStruct::~MapMapBoundsStruct() +{ +} + +MapMapBoundsStruct::MapMapBoundsStruct( + const MapMapBoundsStruct& x) +{ + m_my_map_map = x.m_my_map_map; + +} + +MapMapBoundsStruct::MapMapBoundsStruct( + MapMapBoundsStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + +} + +MapMapBoundsStruct& MapMapBoundsStruct::operator =( + const MapMapBoundsStruct& x) +{ + m_my_map_map = x.m_my_map_map; + + return *this; +} + +MapMapBoundsStruct& MapMapBoundsStruct::operator =( + MapMapBoundsStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + + return *this; +} + +bool MapMapBoundsStruct::operator ==( + const MapMapBoundsStruct& x) const +{ + return (m_my_map_map == x.m_my_map_map); +} + +bool MapMapBoundsStruct::operator !=( + const MapMapBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t MapMapBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapMapBoundsStruct_max_cdr_typesize; +} + +size_t MapMapBoundsStruct::getCdrSerializedSize( + const MapMapBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + } + + + return current_alignment - initial_alignment; +} + + +void MapMapBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_map.size()); + for (const auto& pair : m_my_map_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapMapBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_map; + + +} + + +bool MapMapBoundsStruct::isKeyDefined() +{ + return false; +} + +void MapMapBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ +void MapMapBoundsStruct::my_map_map( + const std::map>& _my_map_map) +{ + m_my_map_map = _my_map_map; +} + +/*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ +void MapMapBoundsStruct::my_map_map( + std::map>&& _my_map_map) +{ + m_my_map_map = std::move(_my_map_map); +} + +/*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ +const std::map>& MapMapBoundsStruct::my_map_map() const +{ + return m_my_map_map; +} + +/*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ +std::map>& MapMapBoundsStruct::my_map_map() +{ + return m_my_map_map; +} + + + + + +SimpleUnion::SimpleUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleUnion::~SimpleUnion() +{ +} + +SimpleUnion::SimpleUnion( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion::SimpleUnion( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion& SimpleUnion::operator =( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleUnion& SimpleUnion::operator =( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleUnion::operator ==( + const SimpleUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleUnion::operator !=( + const SimpleUnion& x) const +{ + return !(*this == x); +} + +void SimpleUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleUnion::_d() +{ + return m__d; +} + +void SimpleUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleUnion::getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleUnionNames::SimpleUnionNames() +{ + m__d = A; + // long m_first_case + m_first_case = 0; + // long long m_second_case + m_second_case = 0; +} + +SimpleUnionNames::~SimpleUnionNames() +{ +} + +SimpleUnionNames::SimpleUnionNames( + const SimpleUnionNames& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } +} + +SimpleUnionNames::SimpleUnionNames( + SimpleUnionNames&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } +} + +SimpleUnionNames& SimpleUnionNames::operator =( + const SimpleUnionNames& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } + + return *this; +} + +SimpleUnionNames& SimpleUnionNames::operator =( + SimpleUnionNames&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } + + return *this; +} + +bool SimpleUnionNames::operator ==( + const SimpleUnionNames& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first_case == x.m_first_case); + break; + + + case B: + return (m_second_case == x.m_second_case); + break; + + default: + break; + } + return false; +} + +bool SimpleUnionNames::operator !=( + const SimpleUnionNames& x) const +{ + return !(*this == x); +} + +void SimpleUnionNames::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleUnionNames::_d() const +{ + return m__d; +} + +int32_t& SimpleUnionNames::_d() +{ + return m__d; +} + +void SimpleUnionNames::first_case( + int32_t _first_case) +{ + m_first_case = _first_case; + m__d = A; + +} + +int32_t SimpleUnionNames::first_case() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first_case; +} + +int32_t& SimpleUnionNames::first_case() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first_case; +} + + +void SimpleUnionNames::second_case( + int64_t _second_case) +{ + m_second_case = _second_case; + m__d = B; + +} + +int64_t SimpleUnionNames::second_case() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second_case; +} + +int64_t& SimpleUnionNames::second_case() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second_case; +} + + +// TODO(Ricardo) Review +size_t SimpleUnionNames::getCdrSerializedSize( + const SimpleUnionNames& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleUnionNames::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first_case; + + break; + + + case B: + scdr << m_second_case; + + break; + + default: + break; + } +} + +void SimpleUnionNames::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first_case; + + + break; + + + case B: + dcdr >> m_second_case; + + + break; + + default: + break; + } +} + + + + + +SimpleTypeUnion::SimpleTypeUnion() +{ + m__d = A; + // octet m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleTypeUnion::~SimpleTypeUnion() +{ +} + +SimpleTypeUnion::SimpleTypeUnion( + const SimpleTypeUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleTypeUnion::SimpleTypeUnion( + SimpleTypeUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleTypeUnion& SimpleTypeUnion::operator =( + const SimpleTypeUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleTypeUnion& SimpleTypeUnion::operator =( + SimpleTypeUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleTypeUnion::operator ==( + const SimpleTypeUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleTypeUnion::operator !=( + const SimpleTypeUnion& x) const +{ + return !(*this == x); +} + +void SimpleTypeUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleTypeUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleTypeUnion::_d() +{ + return m__d; +} + +void SimpleTypeUnion::first( + uint8_t _first) +{ + m_first = _first; + m__d = A; + +} + +uint8_t SimpleTypeUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +uint8_t& SimpleTypeUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleTypeUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleTypeUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleTypeUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleTypeUnion::getCdrSerializedSize( + const SimpleTypeUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleTypeUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleTypeUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleBadUnion::SimpleBadUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleBadUnion::~SimpleBadUnion() +{ +} + +SimpleBadUnion::SimpleBadUnion( + const SimpleBadUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadUnion::SimpleBadUnion( + SimpleBadUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadUnion& SimpleBadUnion::operator =( + const SimpleBadUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleBadUnion& SimpleBadUnion::operator =( + SimpleBadUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleBadUnion::operator ==( + const SimpleBadUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case C: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleBadUnion::operator !=( + const SimpleBadUnion& x) const +{ + return !(*this == x); +} + +void SimpleBadUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case C: + switch(__d) + { + case C: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleBadUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleBadUnion::_d() +{ + return m__d; +} + +void SimpleBadUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleBadUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleBadUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleBadUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = C; + +} + +int64_t SimpleBadUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleBadUnion::second() +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleBadUnion::getCdrSerializedSize( + const SimpleBadUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case C: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleBadUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case C: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleBadUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case C: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleBadDiscUnion::SimpleBadDiscUnion() +{ + m__d = 0; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleBadDiscUnion::~SimpleBadDiscUnion() +{ +} + +SimpleBadDiscUnion::SimpleBadDiscUnion( + const SimpleBadDiscUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadDiscUnion::SimpleBadDiscUnion( + SimpleBadDiscUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( + const SimpleBadDiscUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( + SimpleBadDiscUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleBadDiscUnion::operator ==( + const SimpleBadDiscUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case 0: + return (m_first == x.m_first); + break; + + + case 1: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleBadDiscUnion::operator !=( + const SimpleBadDiscUnion& x) const +{ + return !(*this == x); +} + +void SimpleBadDiscUnion::_d( + uint8_t __d) +{ + bool b = false; + + switch(m__d) + { + case 0: + switch(__d) + { + case 0: + b = true; + break; + default: + break; + } + break; + + + case 1: + switch(__d) + { + case 1: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +uint8_t SimpleBadDiscUnion::_d() const +{ + return m__d; +} + +uint8_t& SimpleBadDiscUnion::_d() +{ + return m__d; +} + +void SimpleBadDiscUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = 0; + +} + +int32_t SimpleBadDiscUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case 0: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleBadDiscUnion::first() +{ + bool b = false; + + switch(m__d) + { + case 0: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleBadDiscUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = 1; + +} + +int64_t SimpleBadDiscUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case 1: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleBadDiscUnion::second() +{ + bool b = false; + + switch(m__d) + { + case 1: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleBadDiscUnion::getCdrSerializedSize( + const SimpleBadDiscUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + switch(data.m__d) + { + case 0: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case 1: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleBadDiscUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case 0: + scdr << m_first; + + break; + + + case 1: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleBadDiscUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case 0: + dcdr >> m_first; + + + break; + + + case 1: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleUnionStruct::SimpleUnionStruct() +{ + // SimpleUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionStruct::~SimpleUnionStruct() +{ +} + +SimpleUnionStruct::SimpleUnionStruct( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleUnionStruct::SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleUnionStruct::operator ==( + const SimpleUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleUnionStruct::operator !=( + const SimpleUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; +} + +size_t SimpleUnionStruct::getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleUnionStruct::my_union( + const SimpleUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleUnionStruct::my_union( + SimpleUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleUnion& SimpleUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleUnion& SimpleUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleUnionStructEqual::SimpleUnionStructEqual() +{ + // SimpleUnion m_my_union_equal + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionStructEqual::~SimpleUnionStructEqual() +{ +} + +SimpleUnionStructEqual::SimpleUnionStructEqual( + const SimpleUnionStructEqual& x) +{ + m_my_union_equal = x.m_my_union_equal; + +} + +SimpleUnionStructEqual::SimpleUnionStructEqual( + SimpleUnionStructEqual&& x) noexcept +{ + m_my_union_equal = std::move(x.m_my_union_equal); + +} + +SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( + const SimpleUnionStructEqual& x) +{ + m_my_union_equal = x.m_my_union_equal; + + return *this; +} + +SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( + SimpleUnionStructEqual&& x) noexcept +{ + m_my_union_equal = std::move(x.m_my_union_equal); + + return *this; +} + +bool SimpleUnionStructEqual::operator ==( + const SimpleUnionStructEqual& x) const +{ + return (m_my_union_equal == x.m_my_union_equal); +} + +bool SimpleUnionStructEqual::operator !=( + const SimpleUnionStructEqual& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionStructEqual_max_cdr_typesize; +} + +size_t SimpleUnionStructEqual::getCdrSerializedSize( + const SimpleUnionStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union_equal; + +} + +void SimpleUnionStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union_equal; + + +} + + +bool SimpleUnionStructEqual::isKeyDefined() +{ + return false; +} + +void SimpleUnionStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union_equal + * @param _my_union_equal New value to be copied in member my_union_equal + */ +void SimpleUnionStructEqual::my_union_equal( + const SimpleUnion& _my_union_equal) +{ + m_my_union_equal = _my_union_equal; +} + +/*! + * @brief This function moves the value in member my_union_equal + * @param _my_union_equal New value to be moved in member my_union_equal + */ +void SimpleUnionStructEqual::my_union_equal( + SimpleUnion&& _my_union_equal) +{ + m_my_union_equal = std::move(_my_union_equal); +} + +/*! + * @brief This function returns a constant reference to member my_union_equal + * @return Constant reference to member my_union_equal + */ +const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const +{ + return m_my_union_equal; +} + +/*! + * @brief This function returns a reference to member my_union_equal + * @return Reference to member my_union_equal + */ +SimpleUnion& SimpleUnionStructEqual::my_union_equal() +{ + return m_my_union_equal; +} + + + + + +SimpleUnionNamesStruct::SimpleUnionNamesStruct() +{ + // SimpleUnionNames m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionNamesStruct::~SimpleUnionNamesStruct() +{ +} + +SimpleUnionNamesStruct::SimpleUnionNamesStruct( + const SimpleUnionNamesStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleUnionNamesStruct::SimpleUnionNamesStruct( + SimpleUnionNamesStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( + const SimpleUnionNamesStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( + SimpleUnionNamesStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleUnionNamesStruct::operator ==( + const SimpleUnionNamesStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleUnionNamesStruct::operator !=( + const SimpleUnionNamesStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_cdr_typesize; +} + +size_t SimpleUnionNamesStruct::getCdrSerializedSize( + const SimpleUnionNamesStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionNamesStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleUnionNamesStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleUnionNamesStruct::isKeyDefined() +{ + return false; +} + +void SimpleUnionNamesStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleUnionNamesStruct::my_union( + const SimpleUnionNames& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleUnionNamesStruct::my_union( + SimpleUnionNames&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleUnionNames& SimpleUnionNamesStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleTypeUnionStruct::SimpleTypeUnionStruct() +{ + // SimpleTypeUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleTypeUnionStruct::~SimpleTypeUnionStruct() +{ +} + +SimpleTypeUnionStruct::SimpleTypeUnionStruct( + const SimpleTypeUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleTypeUnionStruct::SimpleTypeUnionStruct( + SimpleTypeUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( + const SimpleTypeUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( + SimpleTypeUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleTypeUnionStruct::operator ==( + const SimpleTypeUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleTypeUnionStruct::operator !=( + const SimpleTypeUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_cdr_typesize; +} + +size_t SimpleTypeUnionStruct::getCdrSerializedSize( + const SimpleTypeUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleTypeUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleTypeUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleTypeUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleTypeUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleTypeUnionStruct::my_union( + const SimpleTypeUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleTypeUnionStruct::my_union( + SimpleTypeUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleTypeUnion& SimpleTypeUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleBadUnionStruct::SimpleBadUnionStruct() +{ + // SimpleBadUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleBadUnionStruct::~SimpleBadUnionStruct() +{ +} + +SimpleBadUnionStruct::SimpleBadUnionStruct( + const SimpleBadUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleBadUnionStruct::SimpleBadUnionStruct( + SimpleBadUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( + const SimpleBadUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( + SimpleBadUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleBadUnionStruct::operator ==( + const SimpleBadUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleBadUnionStruct::operator !=( + const SimpleBadUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleBadUnionStruct_max_cdr_typesize; +} + +size_t SimpleBadUnionStruct::getCdrSerializedSize( + const SimpleBadUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleBadUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleBadUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleBadUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleBadUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleBadUnionStruct::my_union( + const SimpleBadUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleBadUnionStruct::my_union( + SimpleBadUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleBadUnion& SimpleBadUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleBadUnion& SimpleBadUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() +{ + // SimpleBadDiscUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() +{ +} + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( + const SimplBadDiscUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( + SimplBadDiscUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( + const SimplBadDiscUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( + SimplBadDiscUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimplBadDiscUnionStruct::operator ==( + const SimplBadDiscUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimplBadDiscUnionStruct::operator !=( + const SimplBadDiscUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_cdr_typesize; +} + +size_t SimplBadDiscUnionStruct::getCdrSerializedSize( + const SimplBadDiscUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimplBadDiscUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimplBadDiscUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimplBadDiscUnionStruct::isKeyDefined() +{ + return false; +} + +void SimplBadDiscUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimplBadDiscUnionStruct::my_union( + const SimpleBadDiscUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimplBadDiscUnionStruct::my_union( + SimpleBadDiscUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() +{ + return m_my_union; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/Typesv1.h b/test/unittest/xtypes/idl/Typesv1.h new file mode 100644 index 00000000000..9cf664ae223 --- /dev/null +++ b/test/unittest/xtypes/idl/Typesv1.h @@ -0,0 +1,6495 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TYPES_H_ +#define _FAST_DDS_GENERATED_TYPES_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. + * @ingroup Types + */ +enum MyEnum : uint32_t +{ + A, + B, + C +}; +/*! + * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. + * @ingroup Types + */ +enum MyBadEnum : uint32_t +{ + A1, + B1, + C1 +}; + + +/*! + * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct( + const MyEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct( + MyEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct& operator =( + const MyEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct& operator =( + MyEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyEnum m_my_enum; + +}; + + + +/*! + * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyBadEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyBadEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyBadEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct( + const MyBadEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct( + MyBadEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct& operator =( + const MyBadEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct& operator =( + MyBadEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyBadEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyBadEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyBadEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyBadEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyBadEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyBadEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyBadEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyBadEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyBadEnum m_my_enum; + +}; + +typedef MyEnum MyAliasEnum; + + + +/*! + * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyAliasEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyAliasEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyAliasEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct( + const MyAliasEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct( + MyAliasEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct& operator =( + const MyAliasEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct& operator =( + MyAliasEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyAliasEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyAliasEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyAliasEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyAliasEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyAliasEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyAliasEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyAliasEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyAliasEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyAliasEnum m_my_enum; + +}; + + + +/*! + * @brief This class represents the structure BasicStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + const BasicStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + BasicStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + const BasicStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + BasicStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicNamesStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicNamesStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicNamesStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct( + const BasicNamesStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct( + BasicNamesStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct& operator =( + const BasicNamesStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct& operator =( + BasicNamesStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicNamesStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicNamesStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool_name + * @param _my_bool_name New value for member my_bool_name + */ + eProsima_user_DllExport void my_bool_name( + bool _my_bool_name); + + /*! + * @brief This function returns the value of member my_bool_name + * @return Value of member my_bool_name + */ + eProsima_user_DllExport bool my_bool_name() const; + + /*! + * @brief This function returns a reference to member my_bool_name + * @return Reference to member my_bool_name + */ + eProsima_user_DllExport bool& my_bool_name(); + + + /*! + * @brief This function sets a value in member my_int32_name + * @param _my_int32_name New value for member my_int32_name + */ + eProsima_user_DllExport void my_int32_name( + int32_t _my_int32_name); + + /*! + * @brief This function returns the value of member my_int32_name + * @return Value of member my_int32_name + */ + eProsima_user_DllExport int32_t my_int32_name() const; + + /*! + * @brief This function returns a reference to member my_int32_name + * @return Reference to member my_int32_name + */ + eProsima_user_DllExport int32_t& my_int32_name(); + + + /*! + * @brief This function copies the value in member my_string_name + * @param _my_string_name New value to be copied in member my_string_name + */ + eProsima_user_DllExport void my_string_name( + const std::string& _my_string_name); + + /*! + * @brief This function moves the value in member my_string_name + * @param _my_string_name New value to be moved in member my_string_name + */ + eProsima_user_DllExport void my_string_name( + std::string&& _my_string_name); + + /*! + * @brief This function returns a constant reference to member my_string_name + * @return Constant reference to member my_string_name + */ + eProsima_user_DllExport const std::string& my_string_name() const; + + /*! + * @brief This function returns a reference to member my_string_name + * @return Reference to member my_string_name + */ + eProsima_user_DllExport std::string& my_string_name(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicNamesStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool_name; + int32_t m_my_int32_name; + std::string m_my_string_name; + +}; + + + +/*! + * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct( + const BasicBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct( + BasicBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct& operator =( + const BasicBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct& operator =( + BasicBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicBadStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + uint8_t _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport uint8_t my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport uint8_t& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicWideStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicWideStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicWideStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct( + const BasicWideStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct( + BasicWideStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct& operator =( + const BasicWideStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct& operator =( + BasicWideStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicWideStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicWideStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ + eProsima_user_DllExport void new_int32( + int32_t _new_int32); + + /*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ + eProsima_user_DllExport int32_t new_int32() const; + + /*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ + eProsima_user_DllExport int32_t& new_int32(); + + + /*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ + eProsima_user_DllExport void new_string( + const std::string& _new_string); + + /*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ + eProsima_user_DllExport void new_string( + std::string&& _new_string); + + /*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ + eProsima_user_DllExport const std::string& new_string() const; + + /*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ + eProsima_user_DllExport std::string& new_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicWideStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + int32_t m_new_int32; + std::string m_new_string; + +}; + + + +/*! + * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BadBasicWideStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BadBasicWideStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BadBasicWideStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct( + const BadBasicWideStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct( + BadBasicWideStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct& operator =( + const BadBasicWideStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct& operator =( + BadBasicWideStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BadBasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BadBasicWideStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BadBasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BadBasicWideStruct& x) const; + + /*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ + eProsima_user_DllExport void new_int32( + int32_t _new_int32); + + /*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ + eProsima_user_DllExport int32_t new_int32() const; + + /*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ + eProsima_user_DllExport int32_t& new_int32(); + + + /*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ + eProsima_user_DllExport void new_string( + const std::string& _new_string); + + /*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ + eProsima_user_DllExport void new_string( + std::string&& _new_string); + + /*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ + eProsima_user_DllExport const std::string& new_string() const; + + /*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ + eProsima_user_DllExport std::string& new_string(); + + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BadBasicWideStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int32_t m_new_int32; + std::string m_new_string; + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure StringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class StringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + const StringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + StringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + const StringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + StringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringStruct& x) const; + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class LargeStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + const LargeStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + const LargeStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string); + + /*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string); + + /*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; + + /*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + eprosima::fastrtps::fixed_string<41925> m_my_large_string; + +}; + + + +/*! + * @brief This class represents the structure WStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class WStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + const WStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + WStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + const WStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + WStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + const std::wstring& _my_wstring); + + /*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + std::wstring&& _my_wstring); + + /*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ + eProsima_user_DllExport const std::wstring& my_wstring() const; + + /*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ + eProsima_user_DllExport std::wstring& my_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_wstring; + +}; + + + +/*! + * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class LargeWStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeWStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeWStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + const LargeWStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + const LargeWStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeWStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeWStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + const std::wstring& _my_large_wstring); + + /*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + std::wstring&& _my_large_wstring); + + /*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ + eProsima_user_DllExport const std::wstring& my_large_wstring() const; + + /*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ + eProsima_user_DllExport std::wstring& my_large_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_large_wstring; + +}; + + + +/*! + * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct( + const ArrayStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct( + ArrayStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct& operator =( + const ArrayStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct& operator =( + ArrayStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual( + const ArrayStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual( + ArrayStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual& operator =( + const ArrayStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual& operator =( + ArrayStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_array_equal + * @param _my_array_equal New value to be copied in member my_array_equal + */ + eProsima_user_DllExport void my_array_equal( + const std::array& _my_array_equal); + + /*! + * @brief This function moves the value in member my_array_equal + * @param _my_array_equal New value to be moved in member my_array_equal + */ + eProsima_user_DllExport void my_array_equal( + std::array&& _my_array_equal); + + /*! + * @brief This function returns a constant reference to member my_array_equal + * @return Constant reference to member my_array_equal + */ + eProsima_user_DllExport const std::array& my_array_equal() const; + + /*! + * @brief This function returns a reference to member my_array_equal + * @return Reference to member my_array_equal + */ + eProsima_user_DllExport std::array& my_array_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array_equal; + +}; + + + +/*! + * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct( + const ArrayBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct( + ArrayBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct& operator =( + const ArrayBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct& operator =( + ArrayBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayBadStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayDimensionsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayDimensionsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayDimensionsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct( + const ArrayDimensionsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct( + ArrayDimensionsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct& operator =( + const ArrayDimensionsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct& operator =( + ArrayDimensionsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayDimensionsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayDimensionsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayDimensionsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayDimensionsStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array, 2>& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array, 2>&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array, 2>& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array, 2>& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayDimensionsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array, 2> m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArraySizeStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArraySizeStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArraySizeStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct( + const ArraySizeStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct( + ArraySizeStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct& operator =( + const ArraySizeStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct& operator =( + ArraySizeStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArraySizeStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArraySizeStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArraySizeStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArraySizeStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArraySizeStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + const SequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + SequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + const SequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + SequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual( + const SequenceStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual( + SequenceStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual& operator =( + const SequenceStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual& operator =( + SequenceStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_sequence_equal + * @param _my_sequence_equal New value to be copied in member my_sequence_equal + */ + eProsima_user_DllExport void my_sequence_equal( + const std::vector& _my_sequence_equal); + + /*! + * @brief This function moves the value in member my_sequence_equal + * @param _my_sequence_equal New value to be moved in member my_sequence_equal + */ + eProsima_user_DllExport void my_sequence_equal( + std::vector&& _my_sequence_equal); + + /*! + * @brief This function returns a constant reference to member my_sequence_equal + * @return Constant reference to member my_sequence_equal + */ + eProsima_user_DllExport const std::vector& my_sequence_equal() const; + + /*! + * @brief This function returns a reference to member my_sequence_equal + * @return Reference to member my_sequence_equal + */ + eProsima_user_DllExport std::vector& my_sequence_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence_equal; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct( + const SequenceBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct( + SequenceBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct& operator =( + const SequenceBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct& operator =( + SequenceBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceBadStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct( + const SequenceBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct( + SequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct& operator =( + const SequenceBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct& operator =( + SequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + + + +/*! + * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceSequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceSequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceSequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + const SequenceSequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + const SequenceSequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceSequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceSequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + const std::vector>& _my_sequence_sequence); + + /*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + std::vector>&& _my_sequence_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ + eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ + eProsima_user_DllExport std::vector>& my_sequence_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector> m_my_sequence_sequence; + +}; + + + + + + + +/*! + * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceSequenceBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct( + const SequenceSequenceBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct( + SequenceSequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( + const SequenceSequenceBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( + SequenceSequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceSequenceBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceSequenceBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + const std::vector>& _my_sequence_sequence); + + /*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + std::vector>&& _my_sequence_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ + eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ + eProsima_user_DllExport std::vector>& my_sequence_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceSequenceBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector> m_my_sequence_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure MapStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + const MapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + MapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + const MapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + MapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class MapStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual( + const MapStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual( + MapStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual& operator =( + const MapStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual& operator =( + MapStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x MapStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_map_equal + * @param _my_map_equal New value to be copied in member my_map_equal + */ + eProsima_user_DllExport void my_map_equal( + const std::map& _my_map_equal); + + /*! + * @brief This function moves the value in member my_map_equal + * @param _my_map_equal New value to be moved in member my_map_equal + */ + eProsima_user_DllExport void my_map_equal( + std::map&& _my_map_equal); + + /*! + * @brief This function returns a constant reference to member my_map_equal + * @return Constant reference to member my_map_equal + */ + eProsima_user_DllExport const std::map& my_map_equal() const; + + /*! + * @brief This function returns a reference to member my_map_equal + * @return Reference to member my_map_equal + */ + eProsima_user_DllExport std::map& my_map_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map_equal; + +}; + + + + + +/*! + * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBadKeyStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBadKeyStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBadKeyStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct( + const MapBadKeyStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct( + MapBadKeyStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct& operator =( + const MapBadKeyStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct& operator =( + MapBadKeyStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBadKeyStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBadKeyStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBadKeyStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBadKeyStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBadKeyStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBadElemStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBadElemStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBadElemStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct( + const MapBadElemStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct( + MapBadElemStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct& operator =( + const MapBadElemStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct& operator =( + MapBadElemStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBadElemStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBadElemStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBadElemStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBadElemStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBadElemStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct( + const MapBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct( + MapBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct& operator =( + const MapBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct& operator =( + MapBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + + + +/*! + * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapMapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapMapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapMapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + const MapMapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + MapMapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + const MapMapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + MapMapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapMapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapMapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + const std::map>& _my_map_map); + + /*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + std::map>&& _my_map_map); + + /*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ + eProsima_user_DllExport const std::map>& my_map_map() const; + + /*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ + eProsima_user_DllExport std::map>& my_map_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map> m_my_map_map; + +}; + + + + + + + +/*! + * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapMapBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapMapBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapMapBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct( + const MapMapBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct( + MapMapBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct& operator =( + const MapMapBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct& operator =( + MapMapBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapMapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapMapBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapMapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapMapBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + const std::map>& _my_map_map); + + /*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + std::map>&& _my_map_map); + + /*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ + eProsima_user_DllExport const std::map>& my_map_map() const; + + /*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ + eProsima_user_DllExport std::map>& my_map_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapMapBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map> m_my_map_map; + +}; + + + +/*! + * @brief This class represents the union SimpleUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + const SimpleUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + SimpleUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + const SimpleUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + SimpleUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionNames +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionNames(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionNames(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames( + const SimpleUnionNames& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames( + SimpleUnionNames&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames& operator =( + const SimpleUnionNames& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames& operator =( + SimpleUnionNames&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNames object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionNames& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNames object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionNames& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first_case + * @param _first_case New value for member first_case + */ + eProsima_user_DllExport void first_case( + int32_t _first_case); + + /*! + * @brief This function returns the value of member first_case + * @return Value of member first_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first_case() const; + + /*! + * @brief This function returns a reference to member first_case + * @return Reference to member first_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first_case(); + + + /*! + * @brief This function sets a value in member second_case + * @param _second_case New value for member second_case + */ + eProsima_user_DllExport void second_case( + int64_t _second_case); + + /*! + * @brief This function returns the value of member second_case + * @return Value of member second_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second_case() const; + + /*! + * @brief This function returns a reference to member second_case + * @return Reference to member second_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second_case(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionNames& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first_case; + int64_t m_second_case; +}; + + + +/*! + * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleTypeUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleTypeUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleTypeUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion( + const SimpleTypeUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion( + SimpleTypeUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion& operator =( + const SimpleTypeUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion& operator =( + SimpleTypeUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleTypeUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleTypeUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + uint8_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleTypeUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + uint8_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion( + const SimpleBadUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion( + SimpleBadUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion& operator =( + const SimpleBadUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion& operator =( + SimpleBadUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadDiscUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadDiscUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadDiscUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion( + const SimpleBadDiscUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion( + SimpleBadDiscUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion& operator =( + const SimpleBadDiscUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion& operator =( + SimpleBadDiscUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadDiscUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadDiscUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadDiscUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadDiscUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport uint8_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadDiscUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + uint8_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + const SimpleUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + const SimpleUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual( + const SimpleUnionStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual( + SimpleUnionStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual& operator =( + const SimpleUnionStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual& operator =( + SimpleUnionStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_union_equal + * @param _my_union_equal New value to be copied in member my_union_equal + */ + eProsima_user_DllExport void my_union_equal( + const SimpleUnion& _my_union_equal); + + /*! + * @brief This function moves the value in member my_union_equal + * @param _my_union_equal New value to be moved in member my_union_equal + */ + eProsima_user_DllExport void my_union_equal( + SimpleUnion&& _my_union_equal); + + /*! + * @brief This function returns a constant reference to member my_union_equal + * @return Constant reference to member my_union_equal + */ + eProsima_user_DllExport const SimpleUnion& my_union_equal() const; + + /*! + * @brief This function returns a reference to member my_union_equal + * @return Reference to member my_union_equal + */ + eProsima_user_DllExport SimpleUnion& my_union_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnion m_my_union_equal; + +}; + + + +/*! + * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionNamesStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionNamesStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionNamesStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct( + const SimpleUnionNamesStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct( + SimpleUnionNamesStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct& operator =( + const SimpleUnionNamesStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct& operator =( + SimpleUnionNamesStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionNamesStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionNamesStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleUnionNames& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleUnionNames&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleUnionNames& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleUnionNames& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionNamesStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnionNames m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleTypeUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleTypeUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleTypeUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct( + const SimpleTypeUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct( + SimpleTypeUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct& operator =( + const SimpleTypeUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct& operator =( + SimpleTypeUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleTypeUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleTypeUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleTypeUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleTypeUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleTypeUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleTypeUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleTypeUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleTypeUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct( + const SimpleBadUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct( + SimpleBadUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct& operator =( + const SimpleBadUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct& operator =( + SimpleBadUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleBadUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleBadUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleBadUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleBadUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleBadUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimplBadDiscUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimplBadDiscUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct( + const SimplBadDiscUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct( + SimplBadDiscUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( + const SimplBadDiscUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( + SimplBadDiscUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimplBadDiscUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimplBadDiscUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimplBadDiscUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimplBadDiscUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleBadDiscUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleBadDiscUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleBadDiscUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimplBadDiscUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleBadDiscUnion m_my_union; + +}; + + +#endif // _FAST_DDS_GENERATED_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnum.cxx b/test/unittest/xtypes/idl/WideEnum.cxx index 8554f622523..504b70b0b4a 100644 --- a/test/unittest/xtypes/idl/WideEnum.cxx +++ b/test/unittest/xtypes/idl/WideEnum.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "WideEnum.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "WideEnumTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + MyEnumWideStruct::MyEnumWideStruct() { - // Just to register all known types registerWideEnumTypes(); } @@ -66,7 +70,6 @@ MyEnumWideStruct& MyEnumWideStruct::operator =( { m_my_enum_wide = x.m_my_enum_wide; - return *this; } @@ -75,7 +78,6 @@ MyEnumWideStruct& MyEnumWideStruct::operator =( { m_my_enum_wide = x.m_my_enum_wide; - return *this; } @@ -120,6 +122,8 @@ MyEnumWide& MyEnumWideStruct::my_enum_wide() } + + SimpleWideUnion::SimpleWideUnion() { m__d = A; @@ -315,6 +319,8 @@ void SimpleWideUnion::_d( } break; + default: + break; } if (!b) @@ -488,9 +494,10 @@ uint8_t& SimpleWideUnion::third() } + + SimpleWideUnionStruct::SimpleWideUnionStruct() { - // Just to register all known types registerWideEnumTypes(); } @@ -516,7 +523,6 @@ SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -525,7 +531,6 @@ SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -582,3 +587,5 @@ SimpleWideUnion& SimpleWideUnionStruct::my_union() // Include auxiliary functions like for serializing/deserializing. #include "WideEnumCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnum.h b/test/unittest/xtypes/idl/WideEnum.h index c532f6eb90f..3a731aeb935 100644 --- a/test/unittest/xtypes/idl/WideEnum.h +++ b/test/unittest/xtypes/idl/WideEnum.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "WideEnumv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ #define _FAST_DDS_GENERATED_WIDEENUM_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -78,6 +84,8 @@ enum MyEnumWide : uint32_t C, D }; + + /*! * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. * @ingroup WideEnum @@ -162,6 +170,8 @@ class MyEnumWideStruct MyEnumWide m_my_enum_wide{::A}; }; + + /*! * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. * @ingroup WideEnum @@ -315,6 +325,8 @@ class SimpleWideUnion int64_t m_second{0}; uint8_t m_third{0}; }; + + /*! * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. * @ingroup WideEnum @@ -409,3 +421,6 @@ class SimpleWideUnionStruct #endif // _FAST_DDS_GENERATED_WIDEENUM_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp b/test/unittest/xtypes/idl/WideEnumCdrAux.hpp index 5f3af0066f8..34c5600fbef 100644 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp +++ b/test/unittest/xtypes/idl/WideEnumCdrAux.hpp @@ -39,11 +39,18 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyEnumWideStruct& data); + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleWideUnionStruct& data); @@ -52,4 +59,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ + diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp b/test/unittest/xtypes/idl/WideEnumCdrAux.ipp index e709fba95cf..4cf12cc8050 100644 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp +++ b/test/unittest/xtypes/idl/WideEnumCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum_wide() ; - scdr.end_serialize_type(current_state); } @@ -111,6 +112,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -146,6 +149,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.third(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -181,6 +186,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(2) << data.third(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -217,6 +224,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.third(); break; + default: + break; } ret_value = false; break; @@ -225,6 +234,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -264,7 +275,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -306,4 +316,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ + diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx b/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx index 0f1dc4fe695..3e60c0cd922 100644 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx +++ b/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "WideEnumPubSubTypes.h" #include "WideEnumCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + MyEnumWideStructPubSubType::MyEnumWideStructPubSubType() { setName("MyEnumWideStruct"); - uint32_t type_size = MyEnumWideStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyEnumWideStruct::getMaxCdrSerializedSize()); +#else + MyEnumWideStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool MyEnumWideStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool MyEnumWideStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool MyEnumWideStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function MyEnumWideStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool MyEnumWideStructPubSubType::getKey( MyEnumWideStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyEnumWideStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -184,10 +220,20 @@ bool MyEnumWideStructPubSubType::getKey( } + + + + + SimpleWideUnionStructPubSubType::SimpleWideUnionStructPubSubType() { setName("SimpleWideUnionStruct"); - uint32_t type_size = SimpleWideUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleWideUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleWideUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -218,10 +264,12 @@ bool SimpleWideUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -236,7 +284,11 @@ bool SimpleWideUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -253,7 +305,11 @@ bool SimpleWideUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -276,13 +332,26 @@ std::function SimpleWideUnionStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -314,12 +383,20 @@ bool SimpleWideUnionStructPubSubType::getKey( SimpleWideUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleWideUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h b/test/unittest/xtypes/idl/WideEnumPubSubTypes.h index 3a935855a7d..8119ba12ac2 100644 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h +++ b/test/unittest/xtypes/idl/WideEnumPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type MyEnumWideStruct defined by the user in the IDL file. * @ingroup WideEnum @@ -127,6 +129,11 @@ class MyEnumWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + /*! * @brief This class represents the TopicDataType of the type SimpleWideUnionStruct defined by the user in the IDL file. * @ingroup WideEnum diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx b/test/unittest/xtypes/idl/WideEnumTypeObject.cxx index e53965ad0e7..0ae2ba7138b 100644 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx +++ b/test/unittest/xtypes/idl/WideEnumTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -201,7 +199,11 @@ const TypeObject* GetMinimalMyEnumWideObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -306,7 +308,11 @@ const TypeObject* GetCompleteMyEnumWideObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -320,6 +326,8 @@ const TypeObject* GetCompleteMyEnumWideObject() return TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", true); } + + const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWideStruct", complete); @@ -389,7 +397,6 @@ const TypeObject* GetMinimalMyEnumWideStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -405,7 +412,11 @@ const TypeObject* GetMinimalMyEnumWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -457,7 +468,6 @@ const TypeObject* GetCompleteMyEnumWideStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyEnumWideStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -473,7 +483,11 @@ const TypeObject* GetCompleteMyEnumWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -487,6 +501,8 @@ const TypeObject* GetCompleteMyEnumWideStructObject() return TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", true); } + + const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnion", complete); @@ -625,7 +641,11 @@ const TypeObject* GetMinimalSimpleWideUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -742,7 +762,11 @@ const TypeObject* GetCompleteSimpleWideUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -757,6 +781,8 @@ const TypeObject* GetCompleteSimpleWideUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", true); } + + const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnionStruct", complete); @@ -826,7 +852,6 @@ const TypeObject* GetMinimalSimpleWideUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -842,7 +867,11 @@ const TypeObject* GetMinimalSimpleWideUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -894,7 +923,6 @@ const TypeObject* GetCompleteSimpleWideUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleWideUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -910,7 +938,11 @@ const TypeObject* GetCompleteSimpleWideUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.h b/test/unittest/xtypes/idl/WideEnumTypeObject.h index bb42fcc5191..34ea60df451 100644 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.h +++ b/test/unittest/xtypes/idl/WideEnumTypeObject.h @@ -59,16 +59,22 @@ eProsima_user_DllExport const TypeObject* GetMyEnumWideObject(bool complete = fa eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyEnumWideStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleWideUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleWideUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleWideUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionStructObject(); diff --git a/test/unittest/xtypes/idl/WideEnumv1.cxx b/test/unittest/xtypes/idl/WideEnumv1.cxx new file mode 100644 index 00000000000..a49be8dfc84 --- /dev/null +++ b/test/unittest/xtypes/idl/WideEnumv1.cxx @@ -0,0 +1,858 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file WideEnum.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "WideEnum.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "WideEnumTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define MyEnumWideStruct_max_cdr_typesize 8ULL; + +#define SimpleWideUnionStruct_max_cdr_typesize 24ULL; + + + + + +MyEnumWideStruct::MyEnumWideStruct() +{ + // MyEnumWide m_my_enum_wide + m_my_enum_wide = ::A; + + // Just to register all known types + registerWideEnumTypes(); +} + +MyEnumWideStruct::~MyEnumWideStruct() +{ +} + +MyEnumWideStruct::MyEnumWideStruct( + const MyEnumWideStruct& x) +{ + m_my_enum_wide = x.m_my_enum_wide; + +} + +MyEnumWideStruct::MyEnumWideStruct( + MyEnumWideStruct&& x) noexcept +{ + m_my_enum_wide = x.m_my_enum_wide; + +} + +MyEnumWideStruct& MyEnumWideStruct::operator =( + const MyEnumWideStruct& x) +{ + m_my_enum_wide = x.m_my_enum_wide; + + return *this; +} + +MyEnumWideStruct& MyEnumWideStruct::operator =( + MyEnumWideStruct&& x) noexcept +{ + m_my_enum_wide = x.m_my_enum_wide; + + return *this; +} + +bool MyEnumWideStruct::operator ==( + const MyEnumWideStruct& x) const +{ + return (m_my_enum_wide == x.m_my_enum_wide); +} + +bool MyEnumWideStruct::operator !=( + const MyEnumWideStruct& x) const +{ + return !(*this == x); +} + +size_t MyEnumWideStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyEnumWideStruct_max_cdr_typesize; +} + +size_t MyEnumWideStruct::getCdrSerializedSize( + const MyEnumWideStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyEnumWideStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum_wide; + +} + +void MyEnumWideStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum_wide = (MyEnumWide)enum_value; + } + + +} + + +bool MyEnumWideStruct::isKeyDefined() +{ + return false; +} + +void MyEnumWideStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum_wide + * @param _my_enum_wide New value for member my_enum_wide + */ +void MyEnumWideStruct::my_enum_wide( + MyEnumWide _my_enum_wide) +{ + m_my_enum_wide = _my_enum_wide; +} + +/*! + * @brief This function returns the value of member my_enum_wide + * @return Value of member my_enum_wide + */ +MyEnumWide MyEnumWideStruct::my_enum_wide() const +{ + return m_my_enum_wide; +} + +/*! + * @brief This function returns a reference to member my_enum_wide + * @return Reference to member my_enum_wide + */ +MyEnumWide& MyEnumWideStruct::my_enum_wide() +{ + return m_my_enum_wide; +} + + + + + +SimpleWideUnion::SimpleWideUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; + // octet m_third + m_third = 0; +} + +SimpleWideUnion::~SimpleWideUnion() +{ +} + +SimpleWideUnion::SimpleWideUnion( + const SimpleWideUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + + case D: + m_third = x.m_third; + break; + + default: + break; + } +} + +SimpleWideUnion::SimpleWideUnion( + SimpleWideUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + + case D: + m_third = x.m_third; + break; + + default: + break; + } +} + +SimpleWideUnion& SimpleWideUnion::operator =( + const SimpleWideUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + + case D: + m_third = x.m_third; + break; + + default: + break; + } + + return *this; +} + +SimpleWideUnion& SimpleWideUnion::operator =( + SimpleWideUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + + case D: + m_third = x.m_third; + break; + + default: + break; + } + + return *this; +} + +bool SimpleWideUnion::operator ==( + const SimpleWideUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + + case D: + return (m_third == x.m_third); + break; + + default: + break; + } + return false; +} + +bool SimpleWideUnion::operator !=( + const SimpleWideUnion& x) const +{ + return !(*this == x); +} + +void SimpleWideUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + + case D: + switch(__d) + { + case D: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleWideUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleWideUnion::_d() +{ + return m__d; +} + +void SimpleWideUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleWideUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleWideUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleWideUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleWideUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleWideUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +void SimpleWideUnion::third( + uint8_t _third) +{ + m_third = _third; + m__d = D; + +} + +uint8_t SimpleWideUnion::third() const +{ + bool b = false; + + switch(m__d) + { + case D: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_third; +} + +uint8_t& SimpleWideUnion::third() +{ + bool b = false; + + switch(m__d) + { + case D: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_third; +} + + +// TODO(Ricardo) Review +size_t SimpleWideUnion::getCdrSerializedSize( + const SimpleWideUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + + case D: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleWideUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + + case D: + scdr << m_third; + + break; + + default: + break; + } +} + +void SimpleWideUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + + case D: + dcdr >> m_third; + + + break; + + default: + break; + } +} + + + + + +SimpleWideUnionStruct::SimpleWideUnionStruct() +{ + // SimpleWideUnion m_my_union + + + // Just to register all known types + registerWideEnumTypes(); +} + +SimpleWideUnionStruct::~SimpleWideUnionStruct() +{ +} + +SimpleWideUnionStruct::SimpleWideUnionStruct( + const SimpleWideUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleWideUnionStruct::SimpleWideUnionStruct( + SimpleWideUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( + const SimpleWideUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( + SimpleWideUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleWideUnionStruct::operator ==( + const SimpleWideUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleWideUnionStruct::operator !=( + const SimpleWideUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleWideUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleWideUnionStruct_max_cdr_typesize; +} + +size_t SimpleWideUnionStruct::getCdrSerializedSize( + const SimpleWideUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleWideUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleWideUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleWideUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleWideUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleWideUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleWideUnionStruct::my_union( + const SimpleWideUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleWideUnionStruct::my_union( + SimpleWideUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleWideUnion& SimpleWideUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleWideUnion& SimpleWideUnionStruct::my_union() +{ + return m_my_union; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnumv1.h b/test/unittest/xtypes/idl/WideEnumv1.h new file mode 100644 index 00000000000..99c17bd53b0 --- /dev/null +++ b/test/unittest/xtypes/idl/WideEnumv1.h @@ -0,0 +1,559 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file WideEnum.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ +#define _FAST_DDS_GENERATED_WIDEENUM_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(WIDEENUM_SOURCE) +#define WIDEENUM_DllAPI __declspec( dllexport ) +#else +#define WIDEENUM_DllAPI __declspec( dllimport ) +#endif // WIDEENUM_SOURCE +#else +#define WIDEENUM_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define WIDEENUM_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. + * @ingroup WideEnum + */ +enum MyEnumWide : uint32_t +{ + A, + B, + C, + D +}; + + +/*! + * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. + * @ingroup WideEnum + */ +class MyEnumWideStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyEnumWideStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyEnumWideStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyEnumWideStruct that will be copied. + */ + eProsima_user_DllExport MyEnumWideStruct( + const MyEnumWideStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyEnumWideStruct that will be copied. + */ + eProsima_user_DllExport MyEnumWideStruct( + MyEnumWideStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyEnumWideStruct that will be copied. + */ + eProsima_user_DllExport MyEnumWideStruct& operator =( + const MyEnumWideStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyEnumWideStruct that will be copied. + */ + eProsima_user_DllExport MyEnumWideStruct& operator =( + MyEnumWideStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyEnumWideStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyEnumWideStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyEnumWideStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyEnumWideStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum_wide + * @param _my_enum_wide New value for member my_enum_wide + */ + eProsima_user_DllExport void my_enum_wide( + MyEnumWide _my_enum_wide); + + /*! + * @brief This function returns the value of member my_enum_wide + * @return Value of member my_enum_wide + */ + eProsima_user_DllExport MyEnumWide my_enum_wide() const; + + /*! + * @brief This function returns a reference to member my_enum_wide + * @return Reference to member my_enum_wide + */ + eProsima_user_DllExport MyEnumWide& my_enum_wide(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyEnumWideStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyEnumWide m_my_enum_wide; + +}; + + + +/*! + * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. + * @ingroup WideEnum + */ +class SimpleWideUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleWideUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleWideUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleWideUnion that will be copied. + */ + eProsima_user_DllExport SimpleWideUnion( + const SimpleWideUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleWideUnion that will be copied. + */ + eProsima_user_DllExport SimpleWideUnion( + SimpleWideUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleWideUnion that will be copied. + */ + eProsima_user_DllExport SimpleWideUnion& operator =( + const SimpleWideUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleWideUnion that will be copied. + */ + eProsima_user_DllExport SimpleWideUnion& operator =( + SimpleWideUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleWideUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleWideUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleWideUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleWideUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function sets a value in member third + * @param _third New value for member third + */ + eProsima_user_DllExport void third( + uint8_t _third); + + /*! + * @brief This function returns the value of member third + * @return Value of member third + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t third() const; + + /*! + * @brief This function returns a reference to member third + * @return Reference to member third + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& third(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleWideUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; + uint8_t m_third; +}; + + + +/*! + * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. + * @ingroup WideEnum + */ +class SimpleWideUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleWideUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleWideUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleWideUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleWideUnionStruct( + const SimpleWideUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleWideUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleWideUnionStruct( + SimpleWideUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleWideUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleWideUnionStruct& operator =( + const SimpleWideUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleWideUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleWideUnionStruct& operator =( + SimpleWideUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleWideUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleWideUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleWideUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleWideUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleWideUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleWideUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleWideUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleWideUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleWideUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleWideUnion m_my_union; + +}; + + +#endif // _FAST_DDS_GENERATED_WIDEENUM_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/xtypes/CMakeLists.txt b/test/xtypes/CMakeLists.txt index a9d523dbaa8..620a14d5f3d 100644 --- a/test/xtypes/CMakeLists.txt +++ b/test/xtypes/CMakeLists.txt @@ -87,6 +87,7 @@ endif() ############################################################################### set(XTYPES_TESTS_SOURCE XTypesTests.cpp idl/Types.cxx + idl/Typesv1.cxx idl/TypesPubSubTypes.cxx idl/TypesTypeObject.cxx TestPublisher.cpp diff --git a/test/xtypes/idl/Types.cxx b/test/xtypes/idl/Types.cxx index de7075654cf..d0ee9153b8d 100644 --- a/test/xtypes/idl/Types.cxx +++ b/test/xtypes/idl/Types.cxx @@ -27,6 +27,9 @@ char dummy; #endif // _WIN32 #include "Types.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #include "TypesTypeObject.h" #include @@ -38,9 +41,10 @@ using namespace eprosima::fastcdr::exception; #include + + MyEnumStruct::MyEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -66,7 +70,6 @@ MyEnumStruct& MyEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -75,7 +78,6 @@ MyEnumStruct& MyEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -120,9 +122,10 @@ MyEnum& MyEnumStruct::my_enum() } + + MyBadEnumStruct::MyBadEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -148,7 +151,6 @@ MyBadEnumStruct& MyBadEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -157,7 +159,6 @@ MyBadEnumStruct& MyBadEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -203,9 +204,10 @@ MyBadEnum& MyBadEnumStruct::my_enum() + + MyAliasEnumStruct::MyAliasEnumStruct() { - // Just to register all known types registerTypesTypes(); } @@ -231,7 +233,6 @@ MyAliasEnumStruct& MyAliasEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -240,7 +241,6 @@ MyAliasEnumStruct& MyAliasEnumStruct::operator =( { m_my_enum = x.m_my_enum; - return *this; } @@ -285,9 +285,10 @@ MyAliasEnum& MyAliasEnumStruct::my_enum() } + + BasicStruct::BasicStruct() { - // Just to register all known types registerTypesTypes(); } @@ -319,7 +320,6 @@ BasicStruct& BasicStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -330,7 +330,6 @@ BasicStruct& BasicStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -445,9 +444,10 @@ std::string& BasicStruct::my_string() } + + BasicNamesStruct::BasicNamesStruct() { - // Just to register all known types registerTypesTypes(); } @@ -479,7 +479,6 @@ BasicNamesStruct& BasicNamesStruct::operator =( m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; m_my_string_name = x.m_my_string_name; - return *this; } @@ -490,7 +489,6 @@ BasicNamesStruct& BasicNamesStruct::operator =( m_my_bool_name = x.m_my_bool_name; m_my_int32_name = x.m_my_int32_name; m_my_string_name = std::move(x.m_my_string_name); - return *this; } @@ -605,9 +603,10 @@ std::string& BasicNamesStruct::my_string_name() } + + BasicBadStruct::BasicBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -639,7 +638,6 @@ BasicBadStruct& BasicBadStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -650,7 +648,6 @@ BasicBadStruct& BasicBadStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -765,9 +762,10 @@ std::string& BasicBadStruct::my_string() } + + BasicWideStruct::BasicWideStruct() { - // Just to register all known types registerTypesTypes(); } @@ -805,7 +803,6 @@ BasicWideStruct& BasicWideStruct::operator =( m_my_string = x.m_my_string; m_new_int32 = x.m_new_int32; m_new_string = x.m_new_string; - return *this; } @@ -818,7 +815,6 @@ BasicWideStruct& BasicWideStruct::operator =( m_my_string = std::move(x.m_my_string); m_new_int32 = x.m_new_int32; m_new_string = std::move(x.m_new_string); - return *this; } @@ -1003,9 +999,10 @@ std::string& BasicWideStruct::new_string() } + + BadBasicWideStruct::BadBasicWideStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1043,7 +1040,6 @@ BadBasicWideStruct& BadBasicWideStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = x.m_my_string; - return *this; } @@ -1056,7 +1052,6 @@ BadBasicWideStruct& BadBasicWideStruct::operator =( m_my_bool = x.m_my_bool; m_my_int32 = x.m_my_int32; m_my_string = std::move(x.m_my_string); - return *this; } @@ -1241,9 +1236,10 @@ std::string& BadBasicWideStruct::my_string() } + + StringStruct::StringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1269,7 +1265,6 @@ StringStruct& StringStruct::operator =( { m_my_string = x.m_my_string; - return *this; } @@ -1278,7 +1273,6 @@ StringStruct& StringStruct::operator =( { m_my_string = std::move(x.m_my_string); - return *this; } @@ -1333,9 +1327,10 @@ std::string& StringStruct::my_string() } + + LargeStringStruct::LargeStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1361,7 +1356,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = x.m_my_large_string; - return *this; } @@ -1370,7 +1364,6 @@ LargeStringStruct& LargeStringStruct::operator =( { m_my_large_string = std::move(x.m_my_large_string); - return *this; } @@ -1425,9 +1418,10 @@ eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() } + + WStringStruct::WStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1453,7 +1447,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = x.m_my_wstring; - return *this; } @@ -1462,7 +1455,6 @@ WStringStruct& WStringStruct::operator =( { m_my_wstring = std::move(x.m_my_wstring); - return *this; } @@ -1517,9 +1509,10 @@ std::wstring& WStringStruct::my_wstring() } + + LargeWStringStruct::LargeWStringStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1545,7 +1538,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = x.m_my_large_wstring; - return *this; } @@ -1554,7 +1546,6 @@ LargeWStringStruct& LargeWStringStruct::operator =( { m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; } @@ -1609,9 +1600,10 @@ std::wstring& LargeWStringStruct::my_large_wstring() } + + ArrayStruct::ArrayStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1637,7 +1629,6 @@ ArrayStruct& ArrayStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1646,7 +1637,6 @@ ArrayStruct& ArrayStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1701,9 +1691,10 @@ std::array& ArrayStruct::my_array() } + + ArrayStructEqual::ArrayStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -1729,7 +1720,6 @@ ArrayStructEqual& ArrayStructEqual::operator =( { m_my_array_equal = x.m_my_array_equal; - return *this; } @@ -1738,7 +1728,6 @@ ArrayStructEqual& ArrayStructEqual::operator =( { m_my_array_equal = std::move(x.m_my_array_equal); - return *this; } @@ -1793,9 +1782,10 @@ std::array& ArrayStructEqual::my_array_equal() } + + ArrayBadStruct::ArrayBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1821,7 +1811,6 @@ ArrayBadStruct& ArrayBadStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1830,7 +1819,6 @@ ArrayBadStruct& ArrayBadStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1885,9 +1873,10 @@ std::array& ArrayBadStruct::my_array() } + + ArrayDimensionsStruct::ArrayDimensionsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -1913,7 +1902,6 @@ ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -1922,7 +1910,6 @@ ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -1977,9 +1964,10 @@ std::array, 2>& ArrayDimensionsStruct::my_array() } + + ArraySizeStruct::ArraySizeStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2005,7 +1993,6 @@ ArraySizeStruct& ArraySizeStruct::operator =( { m_my_array = x.m_my_array; - return *this; } @@ -2014,7 +2001,6 @@ ArraySizeStruct& ArraySizeStruct::operator =( { m_my_array = std::move(x.m_my_array); - return *this; } @@ -2069,9 +2055,12 @@ std::array& ArraySizeStruct::my_array() } + + + + SequenceStruct::SequenceStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2097,7 +2086,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2106,7 +2094,6 @@ SequenceStruct& SequenceStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2161,9 +2148,12 @@ std::vector& SequenceStruct::my_sequence() } + + + + SequenceStructEqual::SequenceStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -2189,7 +2179,6 @@ SequenceStructEqual& SequenceStructEqual::operator =( { m_my_sequence_equal = x.m_my_sequence_equal; - return *this; } @@ -2198,7 +2187,6 @@ SequenceStructEqual& SequenceStructEqual::operator =( { m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; } @@ -2253,9 +2241,12 @@ std::vector& SequenceStructEqual::my_sequence_equal() } + + + + SequenceBadStruct::SequenceBadStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2281,7 +2272,6 @@ SequenceBadStruct& SequenceBadStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2290,7 +2280,6 @@ SequenceBadStruct& SequenceBadStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2345,9 +2334,12 @@ std::vector& SequenceBadStruct::my_sequence() } + + + + SequenceBoundsStruct::SequenceBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2373,7 +2365,6 @@ SequenceBoundsStruct& SequenceBoundsStruct::operator =( { m_my_sequence = x.m_my_sequence; - return *this; } @@ -2382,7 +2373,6 @@ SequenceBoundsStruct& SequenceBoundsStruct::operator =( { m_my_sequence = std::move(x.m_my_sequence); - return *this; } @@ -2437,9 +2427,14 @@ std::vector& SequenceBoundsStruct::my_sequence() } + + + + + + SequenceSequenceStruct::SequenceSequenceStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2465,7 +2460,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; } @@ -2474,7 +2468,6 @@ SequenceSequenceStruct& SequenceSequenceStruct::operator =( { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; } @@ -2529,9 +2522,14 @@ std::vector>& SequenceSequenceStruct::my_sequence_sequence( } + + + + + + SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2557,7 +2555,6 @@ SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( { m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; } @@ -2566,7 +2563,6 @@ SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( { m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; } @@ -2621,9 +2617,12 @@ std::vector>& SequenceSequenceBoundsStruct::my_sequence_seq } + + + + MapStruct::MapStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2649,7 +2648,6 @@ MapStruct& MapStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2658,7 +2656,6 @@ MapStruct& MapStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2713,9 +2710,12 @@ std::map& MapStruct::my_map() } + + + + MapStructEqual::MapStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -2741,7 +2741,6 @@ MapStructEqual& MapStructEqual::operator =( { m_my_map_equal = x.m_my_map_equal; - return *this; } @@ -2750,7 +2749,6 @@ MapStructEqual& MapStructEqual::operator =( { m_my_map_equal = std::move(x.m_my_map_equal); - return *this; } @@ -2805,9 +2803,12 @@ std::map& MapStructEqual::my_map_equal() } + + + + MapBadKeyStruct::MapBadKeyStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2833,7 +2834,6 @@ MapBadKeyStruct& MapBadKeyStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2842,7 +2842,6 @@ MapBadKeyStruct& MapBadKeyStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2897,9 +2896,12 @@ std::map& MapBadKeyStruct::my_map() } + + + + MapBadElemStruct::MapBadElemStruct() { - // Just to register all known types registerTypesTypes(); } @@ -2925,7 +2927,6 @@ MapBadElemStruct& MapBadElemStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -2934,7 +2935,6 @@ MapBadElemStruct& MapBadElemStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -2989,9 +2989,12 @@ std::map& MapBadElemStruct::my_map() } + + + + MapBoundsStruct::MapBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3017,7 +3020,6 @@ MapBoundsStruct& MapBoundsStruct::operator =( { m_my_map = x.m_my_map; - return *this; } @@ -3026,7 +3028,6 @@ MapBoundsStruct& MapBoundsStruct::operator =( { m_my_map = std::move(x.m_my_map); - return *this; } @@ -3081,9 +3082,14 @@ std::map& MapBoundsStruct::my_map() } + + + + + + MapMapStruct::MapMapStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3109,7 +3115,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = x.m_my_map_map; - return *this; } @@ -3118,7 +3123,6 @@ MapMapStruct& MapMapStruct::operator =( { m_my_map_map = std::move(x.m_my_map_map); - return *this; } @@ -3173,9 +3177,14 @@ std::map>& MapMapStruct::my_map_map() } + + + + + + MapMapBoundsStruct::MapMapBoundsStruct() { - // Just to register all known types registerTypesTypes(); } @@ -3201,7 +3210,6 @@ MapMapBoundsStruct& MapMapBoundsStruct::operator =( { m_my_map_map = x.m_my_map_map; - return *this; } @@ -3210,7 +3218,6 @@ MapMapBoundsStruct& MapMapBoundsStruct::operator =( { m_my_map_map = std::move(x.m_my_map_map); - return *this; } @@ -3265,6 +3272,8 @@ std::map>& MapMapBoundsStruct::my_map_map() } + + SimpleUnion::SimpleUnion() { m__d = A; @@ -3423,6 +3432,8 @@ void SimpleUnion::_d( } break; + default: + break; } if (!b) @@ -3545,6 +3556,8 @@ int64_t& SimpleUnion::second() } + + SimpleUnionNames::SimpleUnionNames() { m__d = A; @@ -3703,6 +3716,8 @@ void SimpleUnionNames::_d( } break; + default: + break; } if (!b) @@ -3825,6 +3840,8 @@ int64_t& SimpleUnionNames::second_case() } + + SimpleTypeUnion::SimpleTypeUnion() { m__d = A; @@ -3983,6 +4000,8 @@ void SimpleTypeUnion::_d( } break; + default: + break; } if (!b) @@ -4105,6 +4124,8 @@ int64_t& SimpleTypeUnion::second() } + + SimpleBadUnion::SimpleBadUnion() { m__d = A; @@ -4263,6 +4284,8 @@ void SimpleBadUnion::_d( } break; + default: + break; } if (!b) @@ -4385,6 +4408,8 @@ int64_t& SimpleBadUnion::second() } + + SimpleBadDiscUnion::SimpleBadDiscUnion() { m__d = 0; @@ -4543,6 +4568,8 @@ void SimpleBadDiscUnion::_d( } break; + default: + break; } if (!b) @@ -4665,9 +4692,10 @@ int64_t& SimpleBadDiscUnion::second() } + + SimpleUnionStruct::SimpleUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4693,7 +4721,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4702,7 +4729,6 @@ SimpleUnionStruct& SimpleUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -4757,9 +4783,10 @@ SimpleUnion& SimpleUnionStruct::my_union() } + + SimpleUnionStructEqual::SimpleUnionStructEqual() { - // Just to register all known types registerTypesTypes(); } @@ -4785,7 +4812,6 @@ SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( { m_my_union_equal = x.m_my_union_equal; - return *this; } @@ -4794,7 +4820,6 @@ SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( { m_my_union_equal = std::move(x.m_my_union_equal); - return *this; } @@ -4849,9 +4874,10 @@ SimpleUnion& SimpleUnionStructEqual::my_union_equal() } + + SimpleUnionNamesStruct::SimpleUnionNamesStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4877,7 +4903,6 @@ SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4886,7 +4911,6 @@ SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -4941,9 +4965,10 @@ SimpleUnionNames& SimpleUnionNamesStruct::my_union() } + + SimpleTypeUnionStruct::SimpleTypeUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -4969,7 +4994,6 @@ SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -4978,7 +5002,6 @@ SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5033,9 +5056,10 @@ SimpleTypeUnion& SimpleTypeUnionStruct::my_union() } + + SimpleBadUnionStruct::SimpleBadUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -5061,7 +5085,6 @@ SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -5070,7 +5093,6 @@ SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5125,9 +5147,10 @@ SimpleBadUnion& SimpleBadUnionStruct::my_union() } + + SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() { - // Just to register all known types registerTypesTypes(); } @@ -5153,7 +5176,6 @@ SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( { m_my_union = x.m_my_union; - return *this; } @@ -5162,7 +5184,6 @@ SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( { m_my_union = std::move(x.m_my_union); - return *this; } @@ -5219,3 +5240,5 @@ SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() // Include auxiliary functions like for serializing/deserializing. #include "TypesCdrAux.ipp" + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/Types.h b/test/xtypes/idl/Types.h index 73e00b2ec7c..e482676e515 100644 --- a/test/xtypes/idl/Types.h +++ b/test/xtypes/idl/Types.h @@ -19,6 +19,11 @@ * This file was generated by the tool fastddsgen. */ +#include +#include "Typesv1.h" + +#if FASTCDR_VERSION_MAJOR > 1 + #ifndef _FAST_DDS_GENERATED_TYPES_H_ #define _FAST_DDS_GENERATED_TYPES_H_ @@ -30,6 +35,7 @@ #include #include +#include #include @@ -87,6 +93,8 @@ enum MyBadEnum : uint32_t B1, C1 }; + + /*! * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -171,6 +179,8 @@ class MyEnumStruct MyEnum m_my_enum{::A}; }; + + /*! * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -257,6 +267,8 @@ class MyBadEnumStruct }; typedef MyEnum MyAliasEnum; + + /*! * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -341,6 +353,8 @@ class MyAliasEnumStruct MyAliasEnum m_my_enum{::A}; }; + + /*! * @brief This class represents the structure BasicStruct defined by the user in the IDL file. * @ingroup Types @@ -474,6 +488,8 @@ class BasicStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -607,6 +623,8 @@ class BasicNamesStruct std::string m_my_string_name; }; + + /*! * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. * @ingroup Types @@ -740,6 +758,8 @@ class BasicBadStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -922,6 +942,8 @@ class BasicWideStruct std::string m_new_string; }; + + /*! * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -1104,6 +1126,8 @@ class BadBasicWideStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure StringStruct defined by the user in the IDL file. * @ingroup Types @@ -1195,6 +1219,8 @@ class StringStruct std::string m_my_string; }; + + /*! * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1286,6 +1312,8 @@ class LargeStringStruct eprosima::fastcdr::fixed_string<41925> m_my_large_string; }; + + /*! * @brief This class represents the structure WStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1377,6 +1405,8 @@ class WStringStruct std::wstring m_my_wstring; }; + + /*! * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1468,6 +1498,8 @@ class LargeWStringStruct std::wstring m_my_large_wstring; }; + + /*! * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. * @ingroup Types @@ -1559,6 +1591,8 @@ class ArrayStruct std::array m_my_array{0}; }; + + /*! * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1650,6 +1684,8 @@ class ArrayStructEqual std::array m_my_array_equal{0}; }; + + /*! * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1741,6 +1777,8 @@ class ArrayBadStruct std::array m_my_array{0}; }; + + /*! * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. * @ingroup Types @@ -1829,9 +1867,11 @@ class ArrayDimensionsStruct private: - std::array, 2> m_my_array { {{0}} }; + std::array, 2> m_my_array{ {{0}} }; }; + + /*! * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. * @ingroup Types @@ -1923,6 +1963,10 @@ class ArraySizeStruct std::array m_my_array{0}; }; + + + + /*! * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -2014,6 +2058,10 @@ class SequenceStruct std::vector m_my_sequence; }; + + + + /*! * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2105,6 +2153,10 @@ class SequenceStructEqual std::vector m_my_sequence_equal; }; + + + + /*! * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. * @ingroup Types @@ -2196,6 +2248,10 @@ class SequenceBadStruct std::vector m_my_sequence; }; + + + + /*! * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2287,6 +2343,12 @@ class SequenceBoundsStruct std::vector m_my_sequence; }; + + + + + + /*! * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -2378,6 +2440,12 @@ class SequenceSequenceStruct std::vector> m_my_sequence_sequence; }; + + + + + + /*! * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2469,6 +2537,10 @@ class SequenceSequenceBoundsStruct std::vector> m_my_sequence_sequence; }; + + + + /*! * @brief This class represents the structure MapStruct defined by the user in the IDL file. * @ingroup Types @@ -2560,6 +2632,10 @@ class MapStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2651,6 +2727,10 @@ class MapStructEqual std::map m_my_map_equal; }; + + + + /*! * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. * @ingroup Types @@ -2742,6 +2822,10 @@ class MapBadKeyStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. * @ingroup Types @@ -2833,6 +2917,10 @@ class MapBadElemStruct std::map m_my_map; }; + + + + /*! * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2924,6 +3012,12 @@ class MapBoundsStruct std::map m_my_map; }; + + + + + + /*! * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. * @ingroup Types @@ -3015,6 +3109,12 @@ class MapMapStruct std::map> m_my_map_map; }; + + + + + + /*! * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -3106,6 +3206,8 @@ class MapMapBoundsStruct std::map> m_my_map_map; }; + + /*! * @brief This class represents the union SimpleUnion defined by the user in the IDL file. * @ingroup Types @@ -3236,6 +3338,8 @@ class SimpleUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. * @ingroup Types @@ -3366,6 +3470,8 @@ class SimpleUnionNames int32_t m_first_case{0}; int64_t m_second_case{0}; }; + + /*! * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. * @ingroup Types @@ -3496,6 +3602,8 @@ class SimpleTypeUnion uint8_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. * @ingroup Types @@ -3626,6 +3734,8 @@ class SimpleBadUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. * @ingroup Types @@ -3756,6 +3866,8 @@ class SimpleBadDiscUnion int32_t m_first{0}; int64_t m_second{0}; }; + + /*! * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3847,6 +3959,8 @@ class SimpleUnionStruct SimpleUnion m_my_union; }; + + /*! * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. * @ingroup Types @@ -3938,6 +4052,8 @@ class SimpleUnionStructEqual SimpleUnion m_my_union_equal; }; + + /*! * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -4029,6 +4145,8 @@ class SimpleUnionNamesStruct SimpleUnionNames m_my_union; }; + + /*! * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4120,6 +4238,8 @@ class SimpleTypeUnionStruct SimpleTypeUnion m_my_union; }; + + /*! * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4211,6 +4331,8 @@ class SimpleBadUnionStruct SimpleBadUnion m_my_union; }; + + /*! * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -4305,3 +4427,6 @@ class SimplBadDiscUnionStruct #endif // _FAST_DDS_GENERATED_TYPES_H_ + + +#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/TypesCdrAux.hpp b/test/xtypes/idl/TypesCdrAux.hpp index f48f11b2bf8..14992724933 100644 --- a/test/xtypes/idl/TypesCdrAux.hpp +++ b/test/xtypes/idl/TypesCdrAux.hpp @@ -147,129 +147,241 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyEnumStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyBadEnumStruct& data); + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MyAliasEnumStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicNamesStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicBadStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BasicWideStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const BadBasicWideStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const StringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const WStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LargeWStringStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayStructEqual& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayBadStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArrayDimensionsStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ArraySizeStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceStructEqual& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceBadStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceBoundsStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceSequenceStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SequenceSequenceBoundsStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapStructEqual& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBadKeyStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBadElemStruct& data); + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapBoundsStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapMapStruct& data); + + + + + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const MapMapBoundsStruct& data); + + + + + + + + + + + + + + + + + @@ -277,22 +389,32 @@ eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionStructEqual& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleUnionNamesStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleTypeUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimpleBadUnionStruct& data); + + eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const SimplBadDiscUnionStruct& data); @@ -301,4 +423,5 @@ eProsima_user_DllExport void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ + diff --git a/test/xtypes/idl/TypesCdrAux.ipp b/test/xtypes/idl/TypesCdrAux.ipp index 9af89efac1a..837c42573bb 100644 --- a/test/xtypes/idl/TypesCdrAux.ipp +++ b/test/xtypes/idl/TypesCdrAux.ipp @@ -34,6 +34,8 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -73,7 +75,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -111,6 +112,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -150,7 +153,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -189,6 +191,9 @@ void serialize_key( + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -228,7 +233,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_enum() ; - scdr.end_serialize_type(current_state); } @@ -266,6 +270,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -313,7 +319,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32() << eprosima::fastcdr::MemberId(2) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -359,6 +364,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -406,7 +413,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32_name() << eprosima::fastcdr::MemberId(2) << data.my_string_name() ; - scdr.end_serialize_type(current_state); } @@ -452,6 +458,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -499,7 +507,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(1) << data.my_int32() << eprosima::fastcdr::MemberId(2) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -545,6 +552,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -600,7 +609,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.new_int32() << eprosima::fastcdr::MemberId(4) << data.new_string() ; - scdr.end_serialize_type(current_state); } @@ -654,6 +662,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -709,7 +719,6 @@ eProsima_user_DllExport void serialize( << eprosima::fastcdr::MemberId(3) << data.my_int32() << eprosima::fastcdr::MemberId(4) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -763,6 +772,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -802,7 +813,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_string() ; - scdr.end_serialize_type(current_state); } @@ -840,6 +850,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -879,7 +891,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_string() ; - scdr.end_serialize_type(current_state); } @@ -917,6 +928,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -956,7 +969,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_wstring() ; - scdr.end_serialize_type(current_state); } @@ -994,6 +1006,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1033,7 +1047,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_large_wstring() ; - scdr.end_serialize_type(current_state); } @@ -1071,6 +1084,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1110,7 +1125,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1148,6 +1162,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1187,7 +1203,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array_equal() ; - scdr.end_serialize_type(current_state); } @@ -1225,6 +1240,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1264,7 +1281,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1302,6 +1318,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1341,7 +1359,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1379,6 +1396,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1418,7 +1437,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_array() ; - scdr.end_serialize_type(current_state); } @@ -1456,6 +1474,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1495,7 +1517,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1533,6 +1554,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1572,7 +1597,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_equal() ; - scdr.end_serialize_type(current_state); } @@ -1610,6 +1634,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1649,7 +1677,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1687,6 +1714,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1726,7 +1757,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1764,6 +1794,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1803,7 +1839,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1841,6 +1876,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1880,7 +1921,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_sequence_sequence() ; - scdr.end_serialize_type(current_state); } @@ -1918,6 +1958,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -1957,7 +2001,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -1995,6 +2038,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2034,7 +2081,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_equal() ; - scdr.end_serialize_type(current_state); } @@ -2072,6 +2118,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2111,7 +2161,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2149,6 +2198,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2188,7 +2241,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2226,6 +2278,10 @@ void serialize_key( } + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2265,7 +2321,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map() ; - scdr.end_serialize_type(current_state); } @@ -2303,6 +2358,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2342,7 +2403,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_map() ; - scdr.end_serialize_type(current_state); } @@ -2380,6 +2440,12 @@ void serialize_key( } + + + + + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2419,7 +2485,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_map_map() ; - scdr.end_serialize_type(current_state); } @@ -2457,6 +2522,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2487,6 +2554,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2518,6 +2587,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2550,6 +2621,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2558,6 +2631,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2588,6 +2663,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second_case(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2619,6 +2696,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second_case(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2651,6 +2730,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second_case(); break; + default: + break; } ret_value = false; break; @@ -2659,6 +2740,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2689,6 +2772,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2720,6 +2805,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2752,6 +2839,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2760,6 +2849,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2790,6 +2881,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2821,6 +2914,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2853,6 +2948,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2861,6 +2958,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -2891,6 +2990,8 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.second(), current_alignment); break; + default: + break; } calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -2922,6 +3023,8 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(1) << data.second(); break; + default: + break; } scdr.end_serialize_type(current_state); @@ -2954,6 +3057,8 @@ eProsima_user_DllExport void deserialize( dcdr >> data.second(); break; + default: + break; } ret_value = false; break; @@ -2962,6 +3067,8 @@ eProsima_user_DllExport void deserialize( }); } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3001,7 +3108,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3039,6 +3145,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3078,7 +3186,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union_equal() ; - scdr.end_serialize_type(current_state); } @@ -3116,6 +3223,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3155,7 +3264,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3193,6 +3301,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3232,7 +3342,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3270,6 +3379,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3309,7 +3420,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3347,6 +3457,8 @@ void serialize_key( } + + template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -3386,7 +3498,6 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.my_union() ; - scdr.end_serialize_type(current_state); } @@ -3428,4 +3539,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ + diff --git a/test/xtypes/idl/TypesPubSubTypes.cxx b/test/xtypes/idl/TypesPubSubTypes.cxx index 3a0c01bd2b4..0c0a8f0363e 100644 --- a/test/xtypes/idl/TypesPubSubTypes.cxx +++ b/test/xtypes/idl/TypesPubSubTypes.cxx @@ -20,9 +20,7 @@ */ -#include -#include -#include +#include #include "TypesPubSubTypes.h" #include "TypesCdrAux.hpp" @@ -31,10 +29,17 @@ using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; + + MyEnumStructPubSubType::MyEnumStructPubSubType() { setName("MyEnumStruct"); - uint32_t type_size = MyEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyEnumStruct::getMaxCdrSerializedSize()); +#else + MyEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -65,10 +70,12 @@ bool MyEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -83,7 +90,11 @@ bool MyEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -100,7 +111,11 @@ bool MyEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -123,13 +138,26 @@ std::function MyEnumStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -161,12 +189,20 @@ bool MyEnumStructPubSubType::getKey( MyEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -183,10 +219,17 @@ bool MyEnumStructPubSubType::getKey( return true; } + + MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() { setName("MyBadEnumStruct"); - uint32_t type_size = MyBadEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); +#else + MyBadEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -217,10 +260,12 @@ bool MyBadEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -235,7 +280,11 @@ bool MyBadEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -252,7 +301,11 @@ bool MyBadEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -275,13 +328,26 @@ std::function MyBadEnumStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -313,12 +379,20 @@ bool MyBadEnumStructPubSubType::getKey( MyBadEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyBadEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -336,10 +410,18 @@ bool MyBadEnumStructPubSubType::getKey( } + + + MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() { setName("MyAliasEnumStruct"); - uint32_t type_size = MyAliasEnumStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); +#else + MyAliasEnumStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -370,10 +452,12 @@ bool MyAliasEnumStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -388,7 +472,11 @@ bool MyAliasEnumStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -405,7 +493,11 @@ bool MyAliasEnumStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -428,13 +520,26 @@ std::function MyAliasEnumStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -466,12 +571,20 @@ bool MyAliasEnumStructPubSubType::getKey( MyAliasEnumStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MyAliasEnumStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -488,10 +601,17 @@ bool MyAliasEnumStructPubSubType::getKey( return true; } + + BasicStructPubSubType::BasicStructPubSubType() { setName("BasicStruct"); - uint32_t type_size = BasicStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicStruct::getMaxCdrSerializedSize()); +#else + BasicStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -522,10 +642,12 @@ bool BasicStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -540,7 +662,11 @@ bool BasicStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -557,7 +683,11 @@ bool BasicStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -580,13 +710,26 @@ std::function BasicStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -618,12 +761,20 @@ bool BasicStructPubSubType::getKey( BasicStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -640,10 +791,17 @@ bool BasicStructPubSubType::getKey( return true; } + + BasicNamesStructPubSubType::BasicNamesStructPubSubType() { setName("BasicNamesStruct"); - uint32_t type_size = BasicNamesStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); +#else + BasicNamesStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -674,10 +832,12 @@ bool BasicNamesStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -692,7 +852,11 @@ bool BasicNamesStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -709,7 +873,11 @@ bool BasicNamesStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -732,13 +900,26 @@ std::function BasicNamesStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -770,12 +951,20 @@ bool BasicNamesStructPubSubType::getKey( BasicNamesStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicNamesStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -792,10 +981,17 @@ bool BasicNamesStructPubSubType::getKey( return true; } + + BasicBadStructPubSubType::BasicBadStructPubSubType() { setName("BasicBadStruct"); - uint32_t type_size = BasicBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicBadStruct::getMaxCdrSerializedSize()); +#else + BasicBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -826,10 +1022,12 @@ bool BasicBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -844,7 +1042,11 @@ bool BasicBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -861,7 +1063,11 @@ bool BasicBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -884,13 +1090,26 @@ std::function BasicBadStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -922,12 +1141,20 @@ bool BasicBadStructPubSubType::getKey( BasicBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -944,10 +1171,17 @@ bool BasicBadStructPubSubType::getKey( return true; } + + BasicWideStructPubSubType::BasicWideStructPubSubType() { setName("BasicWideStruct"); - uint32_t type_size = BasicWideStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BasicWideStruct::getMaxCdrSerializedSize()); +#else + BasicWideStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -978,10 +1212,12 @@ bool BasicWideStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -996,7 +1232,11 @@ bool BasicWideStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1013,7 +1253,11 @@ bool BasicWideStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1036,13 +1280,26 @@ std::function BasicWideStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1074,12 +1331,20 @@ bool BasicWideStructPubSubType::getKey( BasicWideStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BasicWideStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1096,10 +1361,17 @@ bool BasicWideStructPubSubType::getKey( return true; } + + BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() { setName("BadBasicWideStruct"); - uint32_t type_size = BadBasicWideStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); +#else + BadBasicWideStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1130,10 +1402,12 @@ bool BadBasicWideStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1148,7 +1422,11 @@ bool BadBasicWideStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1165,7 +1443,11 @@ bool BadBasicWideStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1188,13 +1470,26 @@ std::function BadBasicWideStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1226,12 +1521,20 @@ bool BadBasicWideStructPubSubType::getKey( BadBasicWideStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || BadBasicWideStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1248,10 +1551,17 @@ bool BadBasicWideStructPubSubType::getKey( return true; } + + StringStructPubSubType::StringStructPubSubType() { setName("StringStruct"); - uint32_t type_size = StringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(StringStruct::getMaxCdrSerializedSize()); +#else + StringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1282,10 +1592,12 @@ bool StringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1300,7 +1612,11 @@ bool StringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1317,7 +1633,11 @@ bool StringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1340,13 +1660,26 @@ std::function StringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1378,12 +1711,20 @@ bool StringStructPubSubType::getKey( StringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || StringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1400,10 +1741,17 @@ bool StringStructPubSubType::getKey( return true; } + + LargeStringStructPubSubType::LargeStringStructPubSubType() { setName("LargeStringStruct"); - uint32_t type_size = LargeStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeStringStruct::getMaxCdrSerializedSize()); +#else + LargeStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1434,10 +1782,12 @@ bool LargeStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1452,7 +1802,11 @@ bool LargeStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1469,7 +1823,11 @@ bool LargeStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1492,13 +1850,26 @@ std::function LargeStringStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1530,12 +1901,20 @@ bool LargeStringStructPubSubType::getKey( LargeStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1552,10 +1931,17 @@ bool LargeStringStructPubSubType::getKey( return true; } + + WStringStructPubSubType::WStringStructPubSubType() { setName("WStringStruct"); - uint32_t type_size = WStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(WStringStruct::getMaxCdrSerializedSize()); +#else + WStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1586,10 +1972,12 @@ bool WStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1604,7 +1992,11 @@ bool WStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1621,7 +2013,11 @@ bool WStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1644,13 +2040,26 @@ std::function WStringStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1682,12 +2091,20 @@ bool WStringStructPubSubType::getKey( WStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || WStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1704,10 +2121,17 @@ bool WStringStructPubSubType::getKey( return true; } + + LargeWStringStructPubSubType::LargeWStringStructPubSubType() { setName("LargeWStringStruct"); - uint32_t type_size = LargeWStringStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); +#else + LargeWStringStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1738,10 +2162,12 @@ bool LargeWStringStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1756,7 +2182,11 @@ bool LargeWStringStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1773,7 +2203,11 @@ bool LargeWStringStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1796,13 +2230,26 @@ std::function LargeWStringStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1834,12 +2281,20 @@ bool LargeWStringStructPubSubType::getKey( LargeWStringStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || LargeWStringStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -1856,10 +2311,17 @@ bool LargeWStringStructPubSubType::getKey( return true; } + + ArrayStructPubSubType::ArrayStructPubSubType() { setName("ArrayStruct"); - uint32_t type_size = ArrayStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayStruct::getMaxCdrSerializedSize()); +#else + ArrayStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -1890,10 +2352,12 @@ bool ArrayStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -1908,7 +2372,11 @@ bool ArrayStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -1925,7 +2393,11 @@ bool ArrayStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -1948,13 +2420,26 @@ std::function ArrayStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -1986,12 +2471,20 @@ bool ArrayStructPubSubType::getKey( ArrayStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2008,10 +2501,17 @@ bool ArrayStructPubSubType::getKey( return true; } + + ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() { setName("ArrayStructEqual"); - uint32_t type_size = ArrayStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); +#else + ArrayStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2042,10 +2542,12 @@ bool ArrayStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2060,7 +2562,11 @@ bool ArrayStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2077,7 +2583,11 @@ bool ArrayStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2100,13 +2610,26 @@ std::function ArrayStructEqualPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2138,12 +2661,20 @@ bool ArrayStructEqualPubSubType::getKey( ArrayStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2160,10 +2691,17 @@ bool ArrayStructEqualPubSubType::getKey( return true; } + + ArrayBadStructPubSubType::ArrayBadStructPubSubType() { setName("ArrayBadStruct"); - uint32_t type_size = ArrayBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); +#else + ArrayBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2194,10 +2732,12 @@ bool ArrayBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2212,7 +2752,11 @@ bool ArrayBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2229,7 +2773,11 @@ bool ArrayBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2252,13 +2800,26 @@ std::function ArrayBadStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2290,12 +2851,20 @@ bool ArrayBadStructPubSubType::getKey( ArrayBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2312,10 +2881,17 @@ bool ArrayBadStructPubSubType::getKey( return true; } + + ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() { setName("ArrayDimensionsStruct"); - uint32_t type_size = ArrayDimensionsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); +#else + ArrayDimensionsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2346,10 +2922,12 @@ bool ArrayDimensionsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2364,7 +2942,11 @@ bool ArrayDimensionsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2381,7 +2963,11 @@ bool ArrayDimensionsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2404,13 +2990,26 @@ std::function ArrayDimensionsStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2442,12 +3041,20 @@ bool ArrayDimensionsStructPubSubType::getKey( ArrayDimensionsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArrayDimensionsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2464,10 +3071,17 @@ bool ArrayDimensionsStructPubSubType::getKey( return true; } + + ArraySizeStructPubSubType::ArraySizeStructPubSubType() { setName("ArraySizeStruct"); - uint32_t type_size = ArraySizeStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); +#else + ArraySizeStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2498,10 +3112,12 @@ bool ArraySizeStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2516,7 +3132,11 @@ bool ArraySizeStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2533,7 +3153,11 @@ bool ArraySizeStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2556,13 +3180,26 @@ std::function ArraySizeStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2594,12 +3231,20 @@ bool ArraySizeStructPubSubType::getKey( ArraySizeStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || ArraySizeStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2616,10 +3261,19 @@ bool ArraySizeStructPubSubType::getKey( return true; } + + + + SequenceStructPubSubType::SequenceStructPubSubType() { setName("SequenceStruct"); - uint32_t type_size = SequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2650,10 +3304,12 @@ bool SequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2668,7 +3324,11 @@ bool SequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2685,7 +3345,11 @@ bool SequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2708,13 +3372,26 @@ std::function SequenceStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2746,12 +3423,20 @@ bool SequenceStructPubSubType::getKey( SequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2768,10 +3453,19 @@ bool SequenceStructPubSubType::getKey( return true; } + + + + SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() { setName("SequenceStructEqual"); - uint32_t type_size = SequenceStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); +#else + SequenceStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2802,10 +3496,12 @@ bool SequenceStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2820,7 +3516,11 @@ bool SequenceStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2837,7 +3537,11 @@ bool SequenceStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -2860,13 +3564,26 @@ std::function SequenceStructEqualPubSubType::getSerializedSizeProvid { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -2898,12 +3615,20 @@ bool SequenceStructEqualPubSubType::getKey( SequenceStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -2920,10 +3645,19 @@ bool SequenceStructEqualPubSubType::getKey( return true; } + + + + SequenceBadStructPubSubType::SequenceBadStructPubSubType() { setName("SequenceBadStruct"); - uint32_t type_size = SequenceBadStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); +#else + SequenceBadStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -2954,10 +3688,12 @@ bool SequenceBadStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -2972,7 +3708,11 @@ bool SequenceBadStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -2989,7 +3729,11 @@ bool SequenceBadStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3012,13 +3756,26 @@ std::function SequenceBadStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3050,12 +3807,20 @@ bool SequenceBadStructPubSubType::getKey( SequenceBadStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceBadStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3072,10 +3837,19 @@ bool SequenceBadStructPubSubType::getKey( return true; } + + + + SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() { setName("SequenceBoundsStruct"); - uint32_t type_size = SequenceBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); +#else + SequenceBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3106,10 +3880,12 @@ bool SequenceBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3124,7 +3900,11 @@ bool SequenceBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3141,7 +3921,11 @@ bool SequenceBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3164,13 +3948,26 @@ std::function SequenceBoundsStructPubSubType::getSerializedSizeProvi { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3202,12 +3999,20 @@ bool SequenceBoundsStructPubSubType::getKey( SequenceBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3224,10 +4029,21 @@ bool SequenceBoundsStructPubSubType::getKey( return true; } + + + + + + SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() { setName("SequenceSequenceStruct"); - uint32_t type_size = SequenceSequenceStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); +#else + SequenceSequenceStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3258,10 +4074,12 @@ bool SequenceSequenceStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3276,7 +4094,11 @@ bool SequenceSequenceStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3293,7 +4115,11 @@ bool SequenceSequenceStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3316,13 +4142,26 @@ std::function SequenceSequenceStructPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3354,12 +4193,20 @@ bool SequenceSequenceStructPubSubType::getKey( SequenceSequenceStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceSequenceStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3376,10 +4223,21 @@ bool SequenceSequenceStructPubSubType::getKey( return true; } + + + + + + SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() { setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = SequenceSequenceBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); +#else + SequenceSequenceBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3410,10 +4268,12 @@ bool SequenceSequenceBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3428,7 +4288,11 @@ bool SequenceSequenceBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3445,7 +4309,11 @@ bool SequenceSequenceBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3468,13 +4336,26 @@ std::function SequenceSequenceBoundsStructPubSubType::getSerializedS { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3506,12 +4387,20 @@ bool SequenceSequenceBoundsStructPubSubType::getKey( SequenceSequenceBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3528,10 +4417,19 @@ bool SequenceSequenceBoundsStructPubSubType::getKey( return true; } + + + + MapStructPubSubType::MapStructPubSubType() { setName("MapStruct"); - uint32_t type_size = MapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapStruct::getMaxCdrSerializedSize()); +#else + MapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3562,10 +4460,12 @@ bool MapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3580,7 +4480,11 @@ bool MapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3597,7 +4501,11 @@ bool MapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3620,13 +4528,26 @@ std::function MapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3658,12 +4579,20 @@ bool MapStructPubSubType::getKey( MapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3680,10 +4609,19 @@ bool MapStructPubSubType::getKey( return true; } + + + + MapStructEqualPubSubType::MapStructEqualPubSubType() { setName("MapStructEqual"); - uint32_t type_size = MapStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapStructEqual::getMaxCdrSerializedSize()); +#else + MapStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3714,10 +4652,12 @@ bool MapStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3732,7 +4672,11 @@ bool MapStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3749,7 +4693,11 @@ bool MapStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3772,13 +4720,26 @@ std::function MapStructEqualPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3810,12 +4771,20 @@ bool MapStructEqualPubSubType::getKey( MapStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3832,10 +4801,19 @@ bool MapStructEqualPubSubType::getKey( return true; } + + + + MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() { setName("MapBadKeyStruct"); - uint32_t type_size = MapBadKeyStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); +#else + MapBadKeyStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -3866,10 +4844,12 @@ bool MapBadKeyStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -3884,7 +4864,11 @@ bool MapBadKeyStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -3901,7 +4885,11 @@ bool MapBadKeyStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -3924,13 +4912,26 @@ std::function MapBadKeyStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -3962,12 +4963,20 @@ bool MapBadKeyStructPubSubType::getKey( MapBadKeyStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBadKeyStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -3984,10 +4993,19 @@ bool MapBadKeyStructPubSubType::getKey( return true; } + + + + MapBadElemStructPubSubType::MapBadElemStructPubSubType() { setName("MapBadElemStruct"); - uint32_t type_size = MapBadElemStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); +#else + MapBadElemStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4018,10 +5036,12 @@ bool MapBadElemStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4036,7 +5056,11 @@ bool MapBadElemStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4053,7 +5077,11 @@ bool MapBadElemStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4076,13 +5104,26 @@ std::function MapBadElemStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4114,12 +5155,20 @@ bool MapBadElemStructPubSubType::getKey( MapBadElemStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBadElemStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4136,10 +5185,19 @@ bool MapBadElemStructPubSubType::getKey( return true; } + + + + MapBoundsStructPubSubType::MapBoundsStructPubSubType() { setName("MapBoundsStruct"); - uint32_t type_size = MapBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); +#else + MapBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4170,10 +5228,12 @@ bool MapBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4188,7 +5248,11 @@ bool MapBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4205,7 +5269,11 @@ bool MapBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4228,13 +5296,26 @@ std::function MapBoundsStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4266,12 +5347,20 @@ bool MapBoundsStructPubSubType::getKey( MapBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4288,10 +5377,21 @@ bool MapBoundsStructPubSubType::getKey( return true; } + + + + + + MapMapStructPubSubType::MapMapStructPubSubType() { setName("MapMapStruct"); - uint32_t type_size = MapMapStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapMapStruct::getMaxCdrSerializedSize()); +#else + MapMapStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4322,10 +5422,12 @@ bool MapMapStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4340,7 +5442,11 @@ bool MapMapStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4357,7 +5463,11 @@ bool MapMapStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4380,13 +5490,26 @@ std::function MapMapStructPubSubType::getSerializedSizeProvider( { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4418,12 +5541,20 @@ bool MapMapStructPubSubType::getKey( MapMapStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapMapStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4440,10 +5571,21 @@ bool MapMapStructPubSubType::getKey( return true; } + + + + + + MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() { setName("MapMapBoundsStruct"); - uint32_t type_size = MapMapBoundsStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); +#else + MapMapBoundsStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4474,10 +5616,12 @@ bool MapMapBoundsStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4492,7 +5636,11 @@ bool MapMapBoundsStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4509,7 +5657,11 @@ bool MapMapBoundsStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4532,13 +5684,26 @@ std::function MapMapBoundsStructPubSubType::getSerializedSizeProvide { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4570,12 +5735,20 @@ bool MapMapBoundsStructPubSubType::getKey( MapMapBoundsStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || MapMapBoundsStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4594,13 +5767,35 @@ bool MapMapBoundsStructPubSubType::getKey( + + + + + + + + + + + + + + + + + SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() { setName("SimpleUnionStruct"); - uint32_t type_size = SimpleUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4631,10 +5826,12 @@ bool SimpleUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4649,7 +5846,11 @@ bool SimpleUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4666,7 +5867,11 @@ bool SimpleUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4689,13 +5894,26 @@ std::function SimpleUnionStructPubSubType::getSerializedSizeProvider { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4727,12 +5945,20 @@ bool SimpleUnionStructPubSubType::getKey( SimpleUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4749,10 +5975,17 @@ bool SimpleUnionStructPubSubType::getKey( return true; } + + SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() { setName("SimpleUnionStructEqual"); - uint32_t type_size = SimpleUnionStructEqual_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); +#else + SimpleUnionStructEqual_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4783,10 +6016,12 @@ bool SimpleUnionStructEqualPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4801,7 +6036,11 @@ bool SimpleUnionStructEqualPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4818,7 +6057,11 @@ bool SimpleUnionStructEqualPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4841,13 +6084,26 @@ std::function SimpleUnionStructEqualPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -4879,12 +6135,20 @@ bool SimpleUnionStructEqualPubSubType::getKey( SimpleUnionStructEqual_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionStructEqual_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -4901,10 +6165,17 @@ bool SimpleUnionStructEqualPubSubType::getKey( return true; } + + SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() { setName("SimpleUnionNamesStruct"); - uint32_t type_size = SimpleUnionNamesStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); +#else + SimpleUnionNamesStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -4935,10 +6206,12 @@ bool SimpleUnionNamesStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -4953,7 +6226,11 @@ bool SimpleUnionNamesStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -4970,7 +6247,11 @@ bool SimpleUnionNamesStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -4993,13 +6274,26 @@ std::function SimpleUnionNamesStructPubSubType::getSerializedSizePro { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5031,12 +6325,20 @@ bool SimpleUnionNamesStructPubSubType::getKey( SimpleUnionNamesStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleUnionNamesStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5053,10 +6355,17 @@ bool SimpleUnionNamesStructPubSubType::getKey( return true; } + + SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() { setName("SimpleTypeUnionStruct"); - uint32_t type_size = SimpleTypeUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleTypeUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5087,10 +6396,12 @@ bool SimpleTypeUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5105,7 +6416,11 @@ bool SimpleTypeUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5122,7 +6437,11 @@ bool SimpleTypeUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5145,13 +6464,26 @@ std::function SimpleTypeUnionStructPubSubType::getSerializedSizeProv { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5183,12 +6515,20 @@ bool SimpleTypeUnionStructPubSubType::getKey( SimpleTypeUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleTypeUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5205,10 +6545,17 @@ bool SimpleTypeUnionStructPubSubType::getKey( return true; } + + SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() { setName("SimpleBadUnionStruct"); - uint32_t type_size = SimpleBadUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); +#else + SimpleBadUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5239,10 +6586,12 @@ bool SimpleBadUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5257,7 +6606,11 @@ bool SimpleBadUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5274,7 +6627,11 @@ bool SimpleBadUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5297,13 +6654,26 @@ std::function SimpleBadUnionStructPubSubType::getSerializedSizeProvi { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5335,12 +6705,20 @@ bool SimpleBadUnionStructPubSubType::getKey( SimpleBadUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimpleBadUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { @@ -5357,10 +6735,17 @@ bool SimpleBadUnionStructPubSubType::getKey( return true; } + + SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() { setName("SimplBadDiscUnionStruct"); - uint32_t type_size = SimplBadDiscUnionStruct_max_cdr_typesize; + uint32_t type_size = +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); +#else + SimplBadDiscUnionStruct_max_cdr_typesize; +#endif type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ m_typeSize = type_size + 4; /*encapsulation*/ m_isGetKeyDefined = false; @@ -5391,10 +6776,12 @@ bool SimplBadDiscUnionStructPubSubType::serialize( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; +#if FASTCDR_VERSION_MAJOR > 1 ser.set_encoding_flag( data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); +#endif // FASTCDR_VERSION_MAJOR > 1 try { @@ -5409,7 +6796,11 @@ bool SimplBadDiscUnionStructPubSubType::serialize( } // Get the serialized length +#if FASTCDR_VERSION_MAJOR == 1 + payload->length = static_cast(ser.getSerializedDataLength()); +#else payload->length = static_cast(ser.get_serialized_data_length()); +#endif // FASTCDR_VERSION_MAJOR == 1 return true; } @@ -5426,7 +6817,11 @@ bool SimplBadDiscUnionStructPubSubType::deserialize( eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN +#if FASTCDR_VERSION_MAJOR == 1 + , eprosima::fastcdr::Cdr::CdrType::DDS_CDR +#endif // FASTCDR_VERSION_MAJOR == 1 + ); // Deserialize encapsulation. deser.read_encapsulation(); @@ -5449,13 +6844,26 @@ std::function SimplBadDiscUnionStructPubSubType::getSerializedSizePr { return [data, data_representation]() -> uint32_t { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; +#if FASTCDR_VERSION_MAJOR == 1 + static_cast(data_representation); + return static_cast(type::getCdrSerializedSize(*static_cast(data))) + + 4u /*encapsulation*/; +#else + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } +#endif // FASTCDR_VERSION_MAJOR == 1 }; } @@ -5487,12 +6895,20 @@ bool SimplBadDiscUnionStructPubSubType::getKey( SimplBadDiscUnionStruct_max_key_cdr_typesize); // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS); + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); +#if FASTCDR_VERSION_MAJOR == 1 + p_type->serializeKey(ser); +#else eprosima::fastcdr::serialize_key(ser, *p_type); +#endif // FASTCDR_VERSION_MAJOR == 1 if (force_md5 || SimplBadDiscUnionStruct_max_key_cdr_typesize > 16) { m_md5.init(); +#if FASTCDR_VERSION_MAJOR == 1 + m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); +#else m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); +#endif // FASTCDR_VERSION_MAJOR == 1 m_md5.finalize(); for (uint8_t i = 0; i < 16; ++i) { diff --git a/test/xtypes/idl/TypesPubSubTypes.h b/test/xtypes/idl/TypesPubSubTypes.h index 56b444310e3..6a934f82843 100644 --- a/test/xtypes/idl/TypesPubSubTypes.h +++ b/test/xtypes/idl/TypesPubSubTypes.h @@ -38,6 +38,8 @@ #endif // GEN_API_VER + + /*! * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -126,6 +128,8 @@ class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -215,6 +219,8 @@ class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; typedef MyEnum MyAliasEnum; + + /*! * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. * @ingroup Types @@ -303,6 +309,8 @@ class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. * @ingroup Types @@ -391,6 +399,8 @@ class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -479,6 +489,8 @@ class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. * @ingroup Types @@ -567,6 +579,8 @@ class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -655,6 +669,8 @@ class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. * @ingroup Types @@ -743,6 +759,8 @@ class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp }; + + /*! * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. * @ingroup Types @@ -831,6 +849,8 @@ class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. * @ingroup Types @@ -919,6 +939,8 @@ class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1007,6 +1029,8 @@ class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. * @ingroup Types @@ -1095,6 +1119,8 @@ class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp }; + + /*! * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. * @ingroup Types @@ -1183,6 +1209,8 @@ class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1271,6 +1299,8 @@ class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1359,6 +1389,8 @@ class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. * @ingroup Types @@ -1447,6 +1479,8 @@ class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicData }; + + /*! * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. * @ingroup Types @@ -1535,6 +1569,10 @@ class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -1623,6 +1661,10 @@ class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. * @ingroup Types @@ -1711,6 +1753,10 @@ class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataTy }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. * @ingroup Types @@ -1799,6 +1845,10 @@ class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -1887,6 +1937,12 @@ class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataT }; + + + + + + /*! * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. * @ingroup Types @@ -1975,6 +2031,12 @@ class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDat }; + + + + + + /*! * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2063,6 +2125,10 @@ class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::To }; + + + + /*! * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. * @ingroup Types @@ -2151,6 +2217,10 @@ class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2239,6 +2309,10 @@ class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. * @ingroup Types @@ -2327,6 +2401,10 @@ class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. * @ingroup Types @@ -2415,6 +2493,10 @@ class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + /*! * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2503,6 +2585,12 @@ class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. * @ingroup Types @@ -2591,6 +2679,12 @@ class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + + + + + /*! * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. * @ingroup Types @@ -2681,6 +2775,23 @@ class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataTyp + + + + + + + + + + + + + + + + + @@ -2772,6 +2883,8 @@ class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType }; + + /*! * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. * @ingroup Types @@ -2860,6 +2973,8 @@ class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDat }; + + /*! * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. * @ingroup Types @@ -2948,6 +3063,8 @@ class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDat }; + + /*! * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3036,6 +3153,8 @@ class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicData }; + + /*! * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. * @ingroup Types @@ -3124,6 +3243,8 @@ class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataT }; + + /*! * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. * @ingroup Types diff --git a/test/xtypes/idl/TypesTypeObject.cxx b/test/xtypes/idl/TypesTypeObject.cxx index 38779b7bcab..bcefed47249 100644 --- a/test/xtypes/idl/TypesTypeObject.cxx +++ b/test/xtypes/idl/TypesTypeObject.cxx @@ -29,14 +29,12 @@ namespace { char dummy; } #include #include #include +#include #include #include #include #include #include -#include -#include -#include using namespace eprosima::fastrtps::rtps; @@ -425,7 +423,11 @@ const TypeObject* GetMinimalMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -517,7 +519,11 @@ const TypeObject* GetCompleteMyEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -644,7 +650,11 @@ const TypeObject* GetMinimalMyBadEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -736,7 +746,11 @@ const TypeObject* GetCompleteMyBadEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -750,6 +764,8 @@ const TypeObject* GetCompleteMyBadEnumObject() return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); } + + const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); @@ -819,7 +835,6 @@ const TypeObject* GetMinimalMyEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -835,7 +850,11 @@ const TypeObject* GetMinimalMyEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -887,7 +906,6 @@ const TypeObject* GetCompleteMyEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -903,7 +921,11 @@ const TypeObject* GetCompleteMyEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -917,6 +939,8 @@ const TypeObject* GetCompleteMyEnumStructObject() return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); } + + const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); @@ -986,7 +1010,6 @@ const TypeObject* GetMinimalMyBadEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1002,7 +1025,11 @@ const TypeObject* GetMinimalMyBadEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1054,7 +1081,6 @@ const TypeObject* GetCompleteMyBadEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1070,7 +1096,11 @@ const TypeObject* GetCompleteMyBadEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1173,7 +1203,11 @@ const TypeObject* GetMinimalMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1257,7 +1291,11 @@ const TypeObject* GetCompleteMyAliasEnumObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1274,6 +1312,8 @@ const TypeObject* GetCompleteMyAliasEnumObject() return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); } + + const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); @@ -1343,7 +1383,6 @@ const TypeObject* GetMinimalMyAliasEnumStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1359,7 +1398,11 @@ const TypeObject* GetMinimalMyAliasEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1411,7 +1454,6 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1427,7 +1469,11 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1441,6 +1487,8 @@ const TypeObject* GetCompleteMyAliasEnumStructObject() return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); } + + const TypeIdentifier* GetBasicStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); @@ -1548,7 +1596,6 @@ const TypeObject* GetMinimalBasicStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1564,7 +1611,11 @@ const TypeObject* GetMinimalBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1648,7 +1699,6 @@ const TypeObject* GetCompleteBasicStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1664,7 +1714,11 @@ const TypeObject* GetCompleteBasicStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1678,6 +1732,8 @@ const TypeObject* GetCompleteBasicStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); } + + const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); @@ -1785,7 +1841,6 @@ const TypeObject* GetMinimalBasicNamesStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -1801,7 +1856,11 @@ const TypeObject* GetMinimalBasicNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1885,7 +1944,6 @@ const TypeObject* GetCompleteBasicNamesStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -1901,7 +1959,11 @@ const TypeObject* GetCompleteBasicNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -1915,6 +1977,8 @@ const TypeObject* GetCompleteBasicNamesStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); } + + const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); @@ -2022,7 +2086,6 @@ const TypeObject* GetMinimalBasicBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2038,7 +2101,11 @@ const TypeObject* GetMinimalBasicBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2122,7 +2189,6 @@ const TypeObject* GetCompleteBasicBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2138,7 +2204,11 @@ const TypeObject* GetCompleteBasicBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2152,6 +2222,8 @@ const TypeObject* GetCompleteBasicBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); } + + const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); @@ -2296,7 +2368,6 @@ const TypeObject* GetMinimalBasicWideStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2312,7 +2383,11 @@ const TypeObject* GetMinimalBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2427,7 +2502,6 @@ const TypeObject* GetCompleteBasicWideStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2443,7 +2517,11 @@ const TypeObject* GetCompleteBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2457,6 +2535,8 @@ const TypeObject* GetCompleteBasicWideStructObject() return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); } + + const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); @@ -2601,7 +2681,6 @@ const TypeObject* GetMinimalBadBasicWideStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2617,7 +2696,11 @@ const TypeObject* GetMinimalBadBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2732,7 +2815,6 @@ const TypeObject* GetCompleteBadBasicWideStructObject() // Header type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2748,7 +2830,11 @@ const TypeObject* GetCompleteBadBasicWideStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2762,6 +2848,8 @@ const TypeObject* GetCompleteBadBasicWideStructObject() return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); } + + const TypeIdentifier* GetStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); @@ -2831,7 +2919,6 @@ const TypeObject* GetMinimalStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -2847,7 +2934,11 @@ const TypeObject* GetMinimalStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2899,7 +2990,6 @@ const TypeObject* GetCompleteStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("StringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -2915,7 +3005,11 @@ const TypeObject* GetCompleteStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -2929,6 +3023,8 @@ const TypeObject* GetCompleteStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); } + + const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); @@ -2998,7 +3094,6 @@ const TypeObject* GetMinimalLargeStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3014,7 +3109,11 @@ const TypeObject* GetMinimalLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3066,7 +3165,6 @@ const TypeObject* GetCompleteLargeStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3082,7 +3180,11 @@ const TypeObject* GetCompleteLargeStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3096,6 +3198,8 @@ const TypeObject* GetCompleteLargeStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); } + + const TypeIdentifier* GetWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); @@ -3165,7 +3269,6 @@ const TypeObject* GetMinimalWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3181,7 +3284,11 @@ const TypeObject* GetMinimalWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3233,7 +3340,6 @@ const TypeObject* GetCompleteWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("WStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3249,7 +3355,11 @@ const TypeObject* GetCompleteWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3263,6 +3373,8 @@ const TypeObject* GetCompleteWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); } + + const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); @@ -3332,7 +3444,6 @@ const TypeObject* GetMinimalLargeWStringStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3348,7 +3459,11 @@ const TypeObject* GetMinimalLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3400,7 +3515,6 @@ const TypeObject* GetCompleteLargeWStringStructObject() // Header type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3416,7 +3530,11 @@ const TypeObject* GetCompleteLargeWStringStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3430,6 +3548,8 @@ const TypeObject* GetCompleteLargeWStringStructObject() return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); } + + const TypeIdentifier* GetArrayStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); @@ -3499,7 +3619,6 @@ const TypeObject* GetMinimalArrayStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3515,7 +3634,11 @@ const TypeObject* GetMinimalArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3567,7 +3690,6 @@ const TypeObject* GetCompleteArrayStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3583,7 +3705,11 @@ const TypeObject* GetCompleteArrayStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3597,6 +3723,8 @@ const TypeObject* GetCompleteArrayStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); } + + const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); @@ -3666,7 +3794,6 @@ const TypeObject* GetMinimalArrayStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3682,7 +3809,11 @@ const TypeObject* GetMinimalArrayStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3734,7 +3865,6 @@ const TypeObject* GetCompleteArrayStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3750,7 +3880,11 @@ const TypeObject* GetCompleteArrayStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3764,6 +3898,8 @@ const TypeObject* GetCompleteArrayStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); } + + const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); @@ -3833,7 +3969,6 @@ const TypeObject* GetMinimalArrayBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -3849,7 +3984,11 @@ const TypeObject* GetMinimalArrayBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3901,7 +4040,6 @@ const TypeObject* GetCompleteArrayBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -3917,7 +4055,11 @@ const TypeObject* GetCompleteArrayBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -3931,6 +4073,8 @@ const TypeObject* GetCompleteArrayBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); } + + const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); @@ -4000,7 +4144,6 @@ const TypeObject* GetMinimalArrayDimensionsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4016,7 +4159,11 @@ const TypeObject* GetMinimalArrayDimensionsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4068,7 +4215,6 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4084,7 +4230,11 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4098,6 +4248,8 @@ const TypeObject* GetCompleteArrayDimensionsStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); } + + const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); @@ -4167,7 +4319,6 @@ const TypeObject* GetMinimalArraySizeStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4183,7 +4334,11 @@ const TypeObject* GetMinimalArraySizeStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4235,7 +4390,6 @@ const TypeObject* GetCompleteArraySizeStructObject() // Header type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4251,7 +4405,11 @@ const TypeObject* GetCompleteArraySizeStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4265,6 +4423,10 @@ const TypeObject* GetCompleteArraySizeStructObject() return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); } + + + + const TypeIdentifier* GetSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); @@ -4334,7 +4496,6 @@ const TypeObject* GetMinimalSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4350,7 +4511,11 @@ const TypeObject* GetMinimalSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4402,7 +4567,6 @@ const TypeObject* GetCompleteSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4418,7 +4582,11 @@ const TypeObject* GetCompleteSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4432,6 +4600,10 @@ const TypeObject* GetCompleteSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); } + + + + const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); @@ -4501,7 +4673,6 @@ const TypeObject* GetMinimalSequenceStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4517,7 +4688,11 @@ const TypeObject* GetMinimalSequenceStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4569,7 +4744,6 @@ const TypeObject* GetCompleteSequenceStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4585,7 +4759,11 @@ const TypeObject* GetCompleteSequenceStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4599,6 +4777,10 @@ const TypeObject* GetCompleteSequenceStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); } + + + + const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); @@ -4668,7 +4850,6 @@ const TypeObject* GetMinimalSequenceBadStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4684,7 +4865,11 @@ const TypeObject* GetMinimalSequenceBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4736,7 +4921,6 @@ const TypeObject* GetCompleteSequenceBadStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4752,7 +4936,11 @@ const TypeObject* GetCompleteSequenceBadStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4766,6 +4954,10 @@ const TypeObject* GetCompleteSequenceBadStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); } + + + + const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); @@ -4835,7 +5027,6 @@ const TypeObject* GetMinimalSequenceBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -4851,7 +5042,11 @@ const TypeObject* GetMinimalSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4903,7 +5098,6 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -4919,7 +5113,11 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -4933,6 +5131,12 @@ const TypeObject* GetCompleteSequenceBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); } + + + + + + const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); @@ -5002,7 +5206,6 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5018,7 +5221,11 @@ const TypeObject* GetMinimalSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5070,7 +5277,6 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5086,7 +5292,11 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5100,6 +5310,12 @@ const TypeObject* GetCompleteSequenceSequenceStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); } + + + + + + const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); @@ -5169,7 +5385,6 @@ const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5185,7 +5400,11 @@ const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5237,7 +5456,6 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5253,7 +5471,11 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5267,6 +5489,10 @@ const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); } + + + + const TypeIdentifier* GetMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); @@ -5336,7 +5562,6 @@ const TypeObject* GetMinimalMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5352,7 +5577,11 @@ const TypeObject* GetMinimalMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5404,7 +5633,6 @@ const TypeObject* GetCompleteMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5420,7 +5648,11 @@ const TypeObject* GetCompleteMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5434,6 +5666,10 @@ const TypeObject* GetCompleteMapStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); } + + + + const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); @@ -5503,7 +5739,6 @@ const TypeObject* GetMinimalMapStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5519,7 +5754,11 @@ const TypeObject* GetMinimalMapStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5571,7 +5810,6 @@ const TypeObject* GetCompleteMapStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5587,7 +5825,11 @@ const TypeObject* GetCompleteMapStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5601,6 +5843,10 @@ const TypeObject* GetCompleteMapStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); } + + + + const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); @@ -5670,7 +5916,6 @@ const TypeObject* GetMinimalMapBadKeyStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5686,7 +5931,11 @@ const TypeObject* GetMinimalMapBadKeyStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5738,7 +5987,6 @@ const TypeObject* GetCompleteMapBadKeyStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5754,7 +6002,11 @@ const TypeObject* GetCompleteMapBadKeyStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5768,6 +6020,10 @@ const TypeObject* GetCompleteMapBadKeyStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); } + + + + const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); @@ -5837,7 +6093,6 @@ const TypeObject* GetMinimalMapBadElemStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -5853,7 +6108,11 @@ const TypeObject* GetMinimalMapBadElemStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5905,7 +6164,6 @@ const TypeObject* GetCompleteMapBadElemStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -5921,7 +6179,11 @@ const TypeObject* GetCompleteMapBadElemStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -5935,6 +6197,10 @@ const TypeObject* GetCompleteMapBadElemStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); } + + + + const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); @@ -6004,7 +6270,6 @@ const TypeObject* GetMinimalMapBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6020,7 +6285,11 @@ const TypeObject* GetMinimalMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6072,7 +6341,6 @@ const TypeObject* GetCompleteMapBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6088,7 +6356,11 @@ const TypeObject* GetCompleteMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6102,6 +6374,12 @@ const TypeObject* GetCompleteMapBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); } + + + + + + const TypeIdentifier* GetMapMapStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); @@ -6171,7 +6449,6 @@ const TypeObject* GetMinimalMapMapStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6187,7 +6464,11 @@ const TypeObject* GetMinimalMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6239,7 +6520,6 @@ const TypeObject* GetCompleteMapMapStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6255,7 +6535,11 @@ const TypeObject* GetCompleteMapMapStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6269,6 +6553,12 @@ const TypeObject* GetCompleteMapMapStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); } + + + + + + const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); @@ -6338,7 +6628,6 @@ const TypeObject* GetMinimalMapMapBoundsStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -6354,7 +6643,11 @@ const TypeObject* GetMinimalMapMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6406,7 +6699,6 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() // Header type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -6422,7 +6714,11 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6436,6 +6732,8 @@ const TypeObject* GetCompleteMapMapBoundsStructObject() return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); } + + const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); @@ -6553,7 +6851,11 @@ const TypeObject* GetMinimalSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6652,7 +6954,11 @@ const TypeObject* GetCompleteSimpleUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6667,6 +6973,8 @@ const TypeObject* GetCompleteSimpleUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); } + + const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); @@ -6784,7 +7092,11 @@ const TypeObject* GetMinimalSimpleUnionNamesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6883,7 +7195,11 @@ const TypeObject* GetCompleteSimpleUnionNamesObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -6898,6 +7214,8 @@ const TypeObject* GetCompleteSimpleUnionNamesObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); } + + const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); @@ -7015,7 +7333,11 @@ const TypeObject* GetMinimalSimpleTypeUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7114,7 +7436,11 @@ const TypeObject* GetCompleteSimpleTypeUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7129,6 +7455,8 @@ const TypeObject* GetCompleteSimpleTypeUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); } + + const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); @@ -7246,7 +7574,11 @@ const TypeObject* GetMinimalSimpleBadUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7345,7 +7677,11 @@ const TypeObject* GetCompleteSimpleBadUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7360,6 +7696,8 @@ const TypeObject* GetCompleteSimpleBadUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); } + + const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); @@ -7477,7 +7815,11 @@ const TypeObject* GetMinimalSimpleBadDiscUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7576,7 +7918,11 @@ const TypeObject* GetCompleteSimpleBadDiscUnionObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7591,6 +7937,8 @@ const TypeObject* GetCompleteSimpleBadDiscUnionObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); } + + const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); @@ -7660,7 +8008,6 @@ const TypeObject* GetMinimalSimpleUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7676,7 +8023,11 @@ const TypeObject* GetMinimalSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7728,7 +8079,6 @@ const TypeObject* GetCompleteSimpleUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7744,7 +8094,11 @@ const TypeObject* GetCompleteSimpleUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7758,6 +8112,8 @@ const TypeObject* GetCompleteSimpleUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); } + + const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); @@ -7827,7 +8183,6 @@ const TypeObject* GetMinimalSimpleUnionStructEqualObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -7843,7 +8198,11 @@ const TypeObject* GetMinimalSimpleUnionStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7895,7 +8254,6 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -7911,7 +8269,11 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -7925,6 +8287,8 @@ const TypeObject* GetCompleteSimpleUnionStructEqualObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); } + + const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); @@ -7994,7 +8358,6 @@ const TypeObject* GetMinimalSimpleUnionNamesStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8010,7 +8373,11 @@ const TypeObject* GetMinimalSimpleUnionNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8062,7 +8429,6 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8078,7 +8444,11 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8092,6 +8462,8 @@ const TypeObject* GetCompleteSimpleUnionNamesStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); } + + const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); @@ -8161,7 +8533,6 @@ const TypeObject* GetMinimalSimpleTypeUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8177,7 +8548,11 @@ const TypeObject* GetMinimalSimpleTypeUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8229,7 +8604,6 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8245,7 +8619,11 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8259,6 +8637,8 @@ const TypeObject* GetCompleteSimpleTypeUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); } + + const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); @@ -8328,7 +8708,6 @@ const TypeObject* GetMinimalSimpleBadUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8344,7 +8723,11 @@ const TypeObject* GetMinimalSimpleBadUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8396,7 +8779,6 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8412,7 +8794,11 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8426,6 +8812,8 @@ const TypeObject* GetCompleteSimpleBadUnionStructObject() return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); } + + const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) { const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); @@ -8495,7 +8883,6 @@ const TypeObject* GetMinimalSimplBadDiscUnionStructObject() // TODO Inheritance //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; identifier._d(EK_MINIMAL); @@ -8511,7 +8898,11 @@ const TypeObject* GetMinimalSimplBadDiscUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); @@ -8563,7 +8954,6 @@ const TypeObject* GetCompleteSimplBadDiscUnionStructObject() // Header type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); // TODO inheritance - TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -8579,7 +8969,11 @@ const TypeObject* GetCompleteSimplBadDiscUnionStructObject() payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; ser << *type_object; +#if FASTCDR_VERSION_MAJOR == 1 + payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length +#else payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length +#endif // FASTCDR_VERSION_MAJOR == 1 MD5 objectHash; objectHash.update((char*)payload.data, payload.length); objectHash.finalize(); diff --git a/test/xtypes/idl/TypesTypeObject.h b/test/xtypes/idl/TypesTypeObject.h index 79af54dad4f..2f615b62792 100644 --- a/test/xtypes/idl/TypesTypeObject.h +++ b/test/xtypes/idl/TypesTypeObject.h @@ -64,11 +64,15 @@ eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = fal eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); @@ -79,196 +83,308 @@ eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = f eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); + + eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); + + + + eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); + + + + + + eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); + + eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); diff --git a/test/xtypes/idl/Typesv1.cxx b/test/xtypes/idl/Typesv1.cxx new file mode 100644 index 00000000000..54b0d494ecc --- /dev/null +++ b/test/xtypes/idl/Typesv1.cxx @@ -0,0 +1,8202 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Types.cpp + * This source file contains the implementation of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifdef _WIN32 +// Remove linker warning LNK4221 on Visual Studio +namespace { +char dummy; +} // namespace +#endif // _WIN32 + +#include "Types.h" + +#if FASTCDR_VERSION_MAJOR == 1 + +#include "TypesTypeObject.h" + +#include + + +#include +using namespace eprosima::fastcdr::exception; + +#include + +namespace helper { namespace internal { + +enum class Size { + UInt8, + UInt16, + UInt32, + UInt64, +}; + +constexpr Size get_size(int s) { + return (s <= 8 ) ? Size::UInt8: + (s <= 16) ? Size::UInt16: + (s <= 32) ? Size::UInt32: Size::UInt64; +} + +template +struct FindTypeH; + +template<> +struct FindTypeH { + using type = std::uint8_t; +}; + +template<> +struct FindTypeH { + using type = std::uint16_t; +}; + +template<> +struct FindTypeH { + using type = std::uint32_t; +}; + +template<> +struct FindTypeH { + using type = std::uint64_t; +}; +} + +template +struct FindType { + using type = typename internal::FindTypeH::type; +}; +} + +#define SimpleUnionStruct_max_cdr_typesize 24ULL; +#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; + +#define MyAliasEnumStruct_max_cdr_typesize 8ULL; +#define ArrayBadStruct_max_cdr_typesize 6ULL; +#define MapBadKeyStruct_max_cdr_typesize 24ULL; +#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; +#define MyEnumStruct_max_cdr_typesize 8ULL; + +#define ArrayStructEqual_max_cdr_typesize 12ULL; +#define LargeWStringStruct_max_cdr_typesize 167708ULL; + +#define WStringStruct_max_cdr_typesize 1028ULL; +#define SequenceStruct_max_cdr_typesize 16ULL; +#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; + +#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; +#define SequenceSequenceStruct_max_cdr_typesize 48ULL; +#define MapBoundsStruct_max_cdr_typesize 40ULL; +#define SequenceStructEqual_max_cdr_typesize 16ULL; +#define MapStructEqual_max_cdr_typesize 24ULL; +#define BasicStruct_max_cdr_typesize 272ULL; +#define SequenceBoundsStruct_max_cdr_typesize 24ULL; +#define MapMapStruct_max_cdr_typesize 60ULL; +#define BasicWideStruct_max_cdr_typesize 536ULL; + +#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; +#define MapStruct_max_cdr_typesize 24ULL; + +#define MyBadEnumStruct_max_cdr_typesize 8ULL; +#define SequenceBadStruct_max_cdr_typesize 10ULL; +#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; +#define LargeStringStruct_max_cdr_typesize 41934ULL; +#define ArrayStruct_max_cdr_typesize 12ULL; +#define BadBasicWideStruct_max_cdr_typesize 536ULL; +#define ArraySizeStruct_max_cdr_typesize 24ULL; + +#define MapBadElemStruct_max_cdr_typesize 40ULL; +#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; +#define BasicBadStruct_max_cdr_typesize 272ULL; +#define BasicNamesStruct_max_cdr_typesize 272ULL; +#define StringStruct_max_cdr_typesize 264ULL; + +#define MapMapBoundsStruct_max_cdr_typesize 108ULL; + + + + +MyEnumStruct::MyEnumStruct() +{ + // MyEnum m_my_enum + m_my_enum = ::A; + + // Just to register all known types + registerTypesTypes(); +} + +MyEnumStruct::~MyEnumStruct() +{ +} + +MyEnumStruct::MyEnumStruct( + const MyEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyEnumStruct::MyEnumStruct( + MyEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyEnumStruct& MyEnumStruct::operator =( + const MyEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyEnumStruct& MyEnumStruct::operator =( + MyEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyEnumStruct::operator ==( + const MyEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyEnumStruct::operator !=( + const MyEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyEnumStruct_max_cdr_typesize; +} + +size_t MyEnumStruct::getCdrSerializedSize( + const MyEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyEnum)enum_value; + } + + +} + + +bool MyEnumStruct::isKeyDefined() +{ + return false; +} + +void MyEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyEnumStruct::my_enum( + MyEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyEnum MyEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyEnum& MyEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + +MyBadEnumStruct::MyBadEnumStruct() +{ + // MyBadEnum m_my_enum + m_my_enum = ::A1; + + // Just to register all known types + registerTypesTypes(); +} + +MyBadEnumStruct::~MyBadEnumStruct() +{ +} + +MyBadEnumStruct::MyBadEnumStruct( + const MyBadEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyBadEnumStruct::MyBadEnumStruct( + MyBadEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyBadEnumStruct& MyBadEnumStruct::operator =( + const MyBadEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyBadEnumStruct& MyBadEnumStruct::operator =( + MyBadEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyBadEnumStruct::operator ==( + const MyBadEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyBadEnumStruct::operator !=( + const MyBadEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyBadEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyBadEnumStruct_max_cdr_typesize; +} + +size_t MyBadEnumStruct::getCdrSerializedSize( + const MyBadEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyBadEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyBadEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyBadEnum)enum_value; + } + + +} + + +bool MyBadEnumStruct::isKeyDefined() +{ + return false; +} + +void MyBadEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyBadEnumStruct::my_enum( + MyBadEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyBadEnum MyBadEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyBadEnum& MyBadEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + + +MyAliasEnumStruct::MyAliasEnumStruct() +{ + // MyAliasEnum m_my_enum + m_my_enum = ::A; + + // Just to register all known types + registerTypesTypes(); +} + +MyAliasEnumStruct::~MyAliasEnumStruct() +{ +} + +MyAliasEnumStruct::MyAliasEnumStruct( + const MyAliasEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + +} + +MyAliasEnumStruct::MyAliasEnumStruct( + MyAliasEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + +} + +MyAliasEnumStruct& MyAliasEnumStruct::operator =( + const MyAliasEnumStruct& x) +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +MyAliasEnumStruct& MyAliasEnumStruct::operator =( + MyAliasEnumStruct&& x) noexcept +{ + m_my_enum = x.m_my_enum; + + return *this; +} + +bool MyAliasEnumStruct::operator ==( + const MyAliasEnumStruct& x) const +{ + return (m_my_enum == x.m_my_enum); +} + +bool MyAliasEnumStruct::operator !=( + const MyAliasEnumStruct& x) const +{ + return !(*this == x); +} + +size_t MyAliasEnumStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MyAliasEnumStruct_max_cdr_typesize; +} + +size_t MyAliasEnumStruct::getCdrSerializedSize( + const MyAliasEnumStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + return current_alignment - initial_alignment; +} + + +void MyAliasEnumStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << (uint32_t)m_my_enum; + +} + +void MyAliasEnumStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + uint32_t enum_value = 0; + dcdr >> enum_value; + m_my_enum = (MyAliasEnum)enum_value; + } + + +} + + +bool MyAliasEnumStruct::isKeyDefined() +{ + return false; +} + +void MyAliasEnumStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ +void MyAliasEnumStruct::my_enum( + MyAliasEnum _my_enum) +{ + m_my_enum = _my_enum; +} + +/*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ +MyAliasEnum MyAliasEnumStruct::my_enum() const +{ + return m_my_enum; +} + +/*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ +MyAliasEnum& MyAliasEnumStruct::my_enum() +{ + return m_my_enum; +} + + + + + +BasicStruct::BasicStruct() +{ + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicStruct::~BasicStruct() +{ +} + +BasicStruct::BasicStruct( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BasicStruct::BasicStruct( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BasicStruct& BasicStruct::operator =( + const BasicStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BasicStruct& BasicStruct::operator =( + BasicStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BasicStruct::operator ==( + const BasicStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BasicStruct::operator !=( + const BasicStruct& x) const +{ + return !(*this == x); +} + +size_t BasicStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicStruct_max_cdr_typesize; +} + +size_t BasicStruct::getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BasicStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BasicStruct::isKeyDefined() +{ + return false; +} + +void BasicStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BasicStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BasicStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicStruct::my_string() +{ + return m_my_string; +} + + + + + +BasicNamesStruct::BasicNamesStruct() +{ + // boolean m_my_bool_name + m_my_bool_name = false; + // long m_my_int32_name + m_my_int32_name = 0; + // /type_d() m_my_string_name + + + // Just to register all known types + registerTypesTypes(); +} + +BasicNamesStruct::~BasicNamesStruct() +{ +} + +BasicNamesStruct::BasicNamesStruct( + const BasicNamesStruct& x) +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = x.m_my_string_name; + +} + +BasicNamesStruct::BasicNamesStruct( + BasicNamesStruct&& x) noexcept +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = std::move(x.m_my_string_name); + +} + +BasicNamesStruct& BasicNamesStruct::operator =( + const BasicNamesStruct& x) +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = x.m_my_string_name; + + return *this; +} + +BasicNamesStruct& BasicNamesStruct::operator =( + BasicNamesStruct&& x) noexcept +{ + m_my_bool_name = x.m_my_bool_name; + + + m_my_int32_name = x.m_my_int32_name; + + + m_my_string_name = std::move(x.m_my_string_name); + + return *this; +} + +bool BasicNamesStruct::operator ==( + const BasicNamesStruct& x) const +{ + return (m_my_bool_name == x.m_my_bool_name && + m_my_int32_name == x.m_my_int32_name && + m_my_string_name == x.m_my_string_name); +} + +bool BasicNamesStruct::operator !=( + const BasicNamesStruct& x) const +{ + return !(*this == x); +} + +size_t BasicNamesStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicNamesStruct_max_cdr_typesize; +} + +size_t BasicNamesStruct::getCdrSerializedSize( + const BasicNamesStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicNamesStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool_name; + + scdr << m_my_int32_name; + + scdr << m_my_string_name.c_str(); + +} + +void BasicNamesStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool_name; + + + + dcdr >> m_my_int32_name; + + + + dcdr >> m_my_string_name; + + +} + + +bool BasicNamesStruct::isKeyDefined() +{ + return false; +} + +void BasicNamesStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool_name + * @param _my_bool_name New value for member my_bool_name + */ +void BasicNamesStruct::my_bool_name( + bool _my_bool_name) +{ + m_my_bool_name = _my_bool_name; +} + +/*! + * @brief This function returns the value of member my_bool_name + * @return Value of member my_bool_name + */ +bool BasicNamesStruct::my_bool_name() const +{ + return m_my_bool_name; +} + +/*! + * @brief This function returns a reference to member my_bool_name + * @return Reference to member my_bool_name + */ +bool& BasicNamesStruct::my_bool_name() +{ + return m_my_bool_name; +} + + +/*! + * @brief This function sets a value in member my_int32_name + * @param _my_int32_name New value for member my_int32_name + */ +void BasicNamesStruct::my_int32_name( + int32_t _my_int32_name) +{ + m_my_int32_name = _my_int32_name; +} + +/*! + * @brief This function returns the value of member my_int32_name + * @return Value of member my_int32_name + */ +int32_t BasicNamesStruct::my_int32_name() const +{ + return m_my_int32_name; +} + +/*! + * @brief This function returns a reference to member my_int32_name + * @return Reference to member my_int32_name + */ +int32_t& BasicNamesStruct::my_int32_name() +{ + return m_my_int32_name; +} + + +/*! + * @brief This function copies the value in member my_string_name + * @param _my_string_name New value to be copied in member my_string_name + */ +void BasicNamesStruct::my_string_name( + const std::string& _my_string_name) +{ + m_my_string_name = _my_string_name; +} + +/*! + * @brief This function moves the value in member my_string_name + * @param _my_string_name New value to be moved in member my_string_name + */ +void BasicNamesStruct::my_string_name( + std::string&& _my_string_name) +{ + m_my_string_name = std::move(_my_string_name); +} + +/*! + * @brief This function returns a constant reference to member my_string_name + * @return Constant reference to member my_string_name + */ +const std::string& BasicNamesStruct::my_string_name() const +{ + return m_my_string_name; +} + +/*! + * @brief This function returns a reference to member my_string_name + * @return Reference to member my_string_name + */ +std::string& BasicNamesStruct::my_string_name() +{ + return m_my_string_name; +} + + + + + +BasicBadStruct::BasicBadStruct() +{ + // octet m_my_bool + m_my_bool = 0; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicBadStruct::~BasicBadStruct() +{ +} + +BasicBadStruct::BasicBadStruct( + const BasicBadStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BasicBadStruct::BasicBadStruct( + BasicBadStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BasicBadStruct& BasicBadStruct::operator =( + const BasicBadStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BasicBadStruct& BasicBadStruct::operator =( + BasicBadStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BasicBadStruct::operator ==( + const BasicBadStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BasicBadStruct::operator !=( + const BasicBadStruct& x) const +{ + return !(*this == x); +} + +size_t BasicBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicBadStruct_max_cdr_typesize; +} + +size_t BasicBadStruct::getCdrSerializedSize( + const BasicBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BasicBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BasicBadStruct::isKeyDefined() +{ + return false; +} + +void BasicBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicBadStruct::my_bool( + uint8_t _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +uint8_t BasicBadStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +uint8_t& BasicBadStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicBadStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicBadStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicBadStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicBadStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicBadStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicBadStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicBadStruct::my_string() +{ + return m_my_string; +} + + + + + +BasicWideStruct::BasicWideStruct() +{ + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + // long m_new_int32 + m_new_int32 = 0; + // /type_d() m_new_string + + + // Just to register all known types + registerTypesTypes(); +} + +BasicWideStruct::~BasicWideStruct() +{ +} + +BasicWideStruct::BasicWideStruct( + const BasicWideStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + +} + +BasicWideStruct::BasicWideStruct( + BasicWideStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + +} + +BasicWideStruct& BasicWideStruct::operator =( + const BasicWideStruct& x) +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + return *this; +} + +BasicWideStruct& BasicWideStruct::operator =( + BasicWideStruct&& x) noexcept +{ + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + return *this; +} + +bool BasicWideStruct::operator ==( + const BasicWideStruct& x) const +{ + return (m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string && + m_new_int32 == x.m_new_int32 && + m_new_string == x.m_new_string); +} + +bool BasicWideStruct::operator !=( + const BasicWideStruct& x) const +{ + return !(*this == x); +} + +size_t BasicWideStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BasicWideStruct_max_cdr_typesize; +} + +size_t BasicWideStruct::getCdrSerializedSize( + const BasicWideStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BasicWideStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + + scdr << m_new_int32; + + scdr << m_new_string.c_str(); + +} + +void BasicWideStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + + + dcdr >> m_new_int32; + + + + dcdr >> m_new_string; + + +} + + +bool BasicWideStruct::isKeyDefined() +{ + return false; +} + +void BasicWideStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BasicWideStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BasicWideStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BasicWideStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BasicWideStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BasicWideStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BasicWideStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BasicWideStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BasicWideStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BasicWideStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BasicWideStruct::my_string() +{ + return m_my_string; +} + + +/*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ +void BasicWideStruct::new_int32( + int32_t _new_int32) +{ + m_new_int32 = _new_int32; +} + +/*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ +int32_t BasicWideStruct::new_int32() const +{ + return m_new_int32; +} + +/*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ +int32_t& BasicWideStruct::new_int32() +{ + return m_new_int32; +} + + +/*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ +void BasicWideStruct::new_string( + const std::string& _new_string) +{ + m_new_string = _new_string; +} + +/*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ +void BasicWideStruct::new_string( + std::string&& _new_string) +{ + m_new_string = std::move(_new_string); +} + +/*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ +const std::string& BasicWideStruct::new_string() const +{ + return m_new_string; +} + +/*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ +std::string& BasicWideStruct::new_string() +{ + return m_new_string; +} + + + + + +BadBasicWideStruct::BadBasicWideStruct() +{ + // long m_new_int32 + m_new_int32 = 0; + // /type_d() m_new_string + + // boolean m_my_bool + m_my_bool = false; + // long m_my_int32 + m_my_int32 = 0; + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +BadBasicWideStruct::~BadBasicWideStruct() +{ +} + +BadBasicWideStruct::BadBasicWideStruct( + const BadBasicWideStruct& x) +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + +} + +BadBasicWideStruct::BadBasicWideStruct( + BadBasicWideStruct&& x) noexcept +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + +} + +BadBasicWideStruct& BadBasicWideStruct::operator =( + const BadBasicWideStruct& x) +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = x.m_new_string; + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = x.m_my_string; + + return *this; +} + +BadBasicWideStruct& BadBasicWideStruct::operator =( + BadBasicWideStruct&& x) noexcept +{ + m_new_int32 = x.m_new_int32; + + + m_new_string = std::move(x.m_new_string); + + + m_my_bool = x.m_my_bool; + + + m_my_int32 = x.m_my_int32; + + + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool BadBasicWideStruct::operator ==( + const BadBasicWideStruct& x) const +{ + return (m_new_int32 == x.m_new_int32 && + m_new_string == x.m_new_string && + m_my_bool == x.m_my_bool && + m_my_int32 == x.m_my_int32 && + m_my_string == x.m_my_string); +} + +bool BadBasicWideStruct::operator !=( + const BadBasicWideStruct& x) const +{ + return !(*this == x); +} + +size_t BadBasicWideStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return BadBasicWideStruct_max_cdr_typesize; +} + +size_t BadBasicWideStruct::getCdrSerializedSize( + const BadBasicWideStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; + + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void BadBasicWideStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_new_int32; + + scdr << m_new_string.c_str(); + + scdr << m_my_bool; + + scdr << m_my_int32; + + scdr << m_my_string.c_str(); + +} + +void BadBasicWideStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_new_int32; + + + + dcdr >> m_new_string; + + + + dcdr >> m_my_bool; + + + + dcdr >> m_my_int32; + + + + dcdr >> m_my_string; + + +} + + +bool BadBasicWideStruct::isKeyDefined() +{ + return false; +} + +void BadBasicWideStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ +void BadBasicWideStruct::new_int32( + int32_t _new_int32) +{ + m_new_int32 = _new_int32; +} + +/*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ +int32_t BadBasicWideStruct::new_int32() const +{ + return m_new_int32; +} + +/*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ +int32_t& BadBasicWideStruct::new_int32() +{ + return m_new_int32; +} + + +/*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ +void BadBasicWideStruct::new_string( + const std::string& _new_string) +{ + m_new_string = _new_string; +} + +/*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ +void BadBasicWideStruct::new_string( + std::string&& _new_string) +{ + m_new_string = std::move(_new_string); +} + +/*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ +const std::string& BadBasicWideStruct::new_string() const +{ + return m_new_string; +} + +/*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ +std::string& BadBasicWideStruct::new_string() +{ + return m_new_string; +} + + +/*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ +void BadBasicWideStruct::my_bool( + bool _my_bool) +{ + m_my_bool = _my_bool; +} + +/*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ +bool BadBasicWideStruct::my_bool() const +{ + return m_my_bool; +} + +/*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ +bool& BadBasicWideStruct::my_bool() +{ + return m_my_bool; +} + + +/*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ +void BadBasicWideStruct::my_int32( + int32_t _my_int32) +{ + m_my_int32 = _my_int32; +} + +/*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ +int32_t BadBasicWideStruct::my_int32() const +{ + return m_my_int32; +} + +/*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ +int32_t& BadBasicWideStruct::my_int32() +{ + return m_my_int32; +} + + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void BadBasicWideStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void BadBasicWideStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& BadBasicWideStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& BadBasicWideStruct::my_string() +{ + return m_my_string; +} + + + + + +StringStruct::StringStruct() +{ + // /type_d() m_my_string + + + // Just to register all known types + registerTypesTypes(); +} + +StringStruct::~StringStruct() +{ +} + +StringStruct::StringStruct( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + +} + +StringStruct::StringStruct( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + +} + +StringStruct& StringStruct::operator =( + const StringStruct& x) +{ + m_my_string = x.m_my_string; + + return *this; +} + +StringStruct& StringStruct::operator =( + StringStruct&& x) noexcept +{ + m_my_string = std::move(x.m_my_string); + + return *this; +} + +bool StringStruct::operator ==( + const StringStruct& x) const +{ + return (m_my_string == x.m_my_string); +} + +bool StringStruct::operator !=( + const StringStruct& x) const +{ + return !(*this == x); +} + +size_t StringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return StringStruct_max_cdr_typesize; +} + +size_t StringStruct::getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void StringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_string.c_str(); + +} + +void StringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_string; + + +} + + +bool StringStruct::isKeyDefined() +{ + return false; +} + +void StringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ +void StringStruct::my_string( + const std::string& _my_string) +{ + m_my_string = _my_string; +} + +/*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ +void StringStruct::my_string( + std::string&& _my_string) +{ + m_my_string = std::move(_my_string); +} + +/*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ +const std::string& StringStruct::my_string() const +{ + return m_my_string; +} + +/*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ +std::string& StringStruct::my_string() +{ + return m_my_string; +} + + + + + +LargeStringStruct::LargeStringStruct() +{ + // /type_d() m_my_large_string + + + // Just to register all known types + registerTypesTypes(); +} + +LargeStringStruct::~LargeStringStruct() +{ +} + +LargeStringStruct::LargeStringStruct( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + +} + +LargeStringStruct::LargeStringStruct( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + +} + +LargeStringStruct& LargeStringStruct::operator =( + const LargeStringStruct& x) +{ + m_my_large_string = x.m_my_large_string; + + return *this; +} + +LargeStringStruct& LargeStringStruct::operator =( + LargeStringStruct&& x) noexcept +{ + m_my_large_string = std::move(x.m_my_large_string); + + return *this; +} + +bool LargeStringStruct::operator ==( + const LargeStringStruct& x) const +{ + return (m_my_large_string == x.m_my_large_string); +} + +bool LargeStringStruct::operator !=( + const LargeStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeStringStruct_max_cdr_typesize; +} + +size_t LargeStringStruct::getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; + + + return current_alignment - initial_alignment; +} + + +void LargeStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_string.c_str(); + +} + +void LargeStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + { + std::string aux; + dcdr >> aux; + m_my_large_string = aux.c_str(); + } + + +} + + +bool LargeStringStruct::isKeyDefined() +{ + return false; +} + +void LargeStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ +void LargeStringStruct::my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string) +{ + m_my_large_string = _my_large_string; +} + +/*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ +void LargeStringStruct::my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string) +{ + m_my_large_string = std::move(_my_large_string); +} + +/*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ +const eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() const +{ + return m_my_large_string; +} + +/*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ +eprosima::fastrtps::fixed_string<41925>& LargeStringStruct::my_large_string() +{ + return m_my_large_string; +} + + + + + +WStringStruct::WStringStruct() +{ + // /type_15() m_my_wstring + + + // Just to register all known types + registerTypesTypes(); +} + +WStringStruct::~WStringStruct() +{ +} + +WStringStruct::WStringStruct( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + +} + +WStringStruct::WStringStruct( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + +} + +WStringStruct& WStringStruct::operator =( + const WStringStruct& x) +{ + m_my_wstring = x.m_my_wstring; + + return *this; +} + +WStringStruct& WStringStruct::operator =( + WStringStruct&& x) noexcept +{ + m_my_wstring = std::move(x.m_my_wstring); + + return *this; +} + +bool WStringStruct::operator ==( + const WStringStruct& x) const +{ + return (m_my_wstring == x.m_my_wstring); +} + +bool WStringStruct::operator !=( + const WStringStruct& x) const +{ + return !(*this == x); +} + +size_t WStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return WStringStruct_max_cdr_typesize; +} + +size_t WStringStruct::getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void WStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_wstring; + +} + +void WStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_wstring; + + +} + + +bool WStringStruct::isKeyDefined() +{ + return false; +} + +void WStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ +void WStringStruct::my_wstring( + const std::wstring& _my_wstring) +{ + m_my_wstring = _my_wstring; +} + +/*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ +void WStringStruct::my_wstring( + std::wstring&& _my_wstring) +{ + m_my_wstring = std::move(_my_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ +const std::wstring& WStringStruct::my_wstring() const +{ + return m_my_wstring; +} + +/*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ +std::wstring& WStringStruct::my_wstring() +{ + return m_my_wstring; +} + + + + + +LargeWStringStruct::LargeWStringStruct() +{ + // /type_15() m_my_large_wstring + + + // Just to register all known types + registerTypesTypes(); +} + +LargeWStringStruct::~LargeWStringStruct() +{ +} + +LargeWStringStruct::LargeWStringStruct( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + +} + +LargeWStringStruct::LargeWStringStruct( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + +} + +LargeWStringStruct& LargeWStringStruct::operator =( + const LargeWStringStruct& x) +{ + m_my_large_wstring = x.m_my_large_wstring; + + return *this; +} + +LargeWStringStruct& LargeWStringStruct::operator =( + LargeWStringStruct&& x) noexcept +{ + m_my_large_wstring = std::move(x.m_my_large_wstring); + + return *this; +} + +bool LargeWStringStruct::operator ==( + const LargeWStringStruct& x) const +{ + return (m_my_large_wstring == x.m_my_large_wstring); +} + +bool LargeWStringStruct::operator !=( + const LargeWStringStruct& x) const +{ + return !(*this == x); +} + +size_t LargeWStringStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return LargeWStringStruct_max_cdr_typesize; +} + +size_t LargeWStringStruct::getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits + + + return current_alignment - initial_alignment; +} + + +void LargeWStringStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_large_wstring; + +} + +void LargeWStringStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_large_wstring; + + +} + + +bool LargeWStringStruct::isKeyDefined() +{ + return false; +} + +void LargeWStringStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + const std::wstring& _my_large_wstring) +{ + m_my_large_wstring = _my_large_wstring; +} + +/*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ +void LargeWStringStruct::my_large_wstring( + std::wstring&& _my_large_wstring) +{ + m_my_large_wstring = std::move(_my_large_wstring); +} + +/*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ +const std::wstring& LargeWStringStruct::my_large_wstring() const +{ + return m_my_large_wstring; +} + +/*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ +std::wstring& LargeWStringStruct::my_large_wstring() +{ + return m_my_large_wstring; +} + + + + + +ArrayStruct::ArrayStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayStruct::~ArrayStruct() +{ +} + +ArrayStruct::ArrayStruct( + const ArrayStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayStruct::ArrayStruct( + ArrayStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayStruct& ArrayStruct::operator =( + const ArrayStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayStruct& ArrayStruct::operator =( + ArrayStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayStruct::operator ==( + const ArrayStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayStruct::operator !=( + const ArrayStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayStruct_max_cdr_typesize; +} + +size_t ArrayStruct::getCdrSerializedSize( + const ArrayStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArrayStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArrayStruct::isKeyDefined() +{ + return false; +} + +void ArrayStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArrayStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArrayStruct::my_array() +{ + return m_my_array; +} + + + + + +ArrayStructEqual::ArrayStructEqual() +{ + // long m_my_array_equal + memset(&m_my_array_equal, 0, ((2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayStructEqual::~ArrayStructEqual() +{ +} + +ArrayStructEqual::ArrayStructEqual( + const ArrayStructEqual& x) +{ + m_my_array_equal = x.m_my_array_equal; + +} + +ArrayStructEqual::ArrayStructEqual( + ArrayStructEqual&& x) noexcept +{ + m_my_array_equal = std::move(x.m_my_array_equal); + +} + +ArrayStructEqual& ArrayStructEqual::operator =( + const ArrayStructEqual& x) +{ + m_my_array_equal = x.m_my_array_equal; + + return *this; +} + +ArrayStructEqual& ArrayStructEqual::operator =( + ArrayStructEqual&& x) noexcept +{ + m_my_array_equal = std::move(x.m_my_array_equal); + + return *this; +} + +bool ArrayStructEqual::operator ==( + const ArrayStructEqual& x) const +{ + return (m_my_array_equal == x.m_my_array_equal); +} + +bool ArrayStructEqual::operator !=( + const ArrayStructEqual& x) const +{ + return !(*this == x); +} + +size_t ArrayStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayStructEqual_max_cdr_typesize; +} + +size_t ArrayStructEqual::getCdrSerializedSize( + const ArrayStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array_equal; + + +} + +void ArrayStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array_equal; + + +} + + +bool ArrayStructEqual::isKeyDefined() +{ + return false; +} + +void ArrayStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array_equal + * @param _my_array_equal New value to be copied in member my_array_equal + */ +void ArrayStructEqual::my_array_equal( + const std::array& _my_array_equal) +{ + m_my_array_equal = _my_array_equal; +} + +/*! + * @brief This function moves the value in member my_array_equal + * @param _my_array_equal New value to be moved in member my_array_equal + */ +void ArrayStructEqual::my_array_equal( + std::array&& _my_array_equal) +{ + m_my_array_equal = std::move(_my_array_equal); +} + +/*! + * @brief This function returns a constant reference to member my_array_equal + * @return Constant reference to member my_array_equal + */ +const std::array& ArrayStructEqual::my_array_equal() const +{ + return m_my_array_equal; +} + +/*! + * @brief This function returns a reference to member my_array_equal + * @return Reference to member my_array_equal + */ +std::array& ArrayStructEqual::my_array_equal() +{ + return m_my_array_equal; +} + + + + + +ArrayBadStruct::ArrayBadStruct() +{ + // octet m_my_array + memset(&m_my_array, 0, ((2)) * 1); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayBadStruct::~ArrayBadStruct() +{ +} + +ArrayBadStruct::ArrayBadStruct( + const ArrayBadStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayBadStruct::ArrayBadStruct( + ArrayBadStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayBadStruct& ArrayBadStruct::operator =( + const ArrayBadStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayBadStruct& ArrayBadStruct::operator =( + ArrayBadStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayBadStruct::operator ==( + const ArrayBadStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayBadStruct::operator !=( + const ArrayBadStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayBadStruct_max_cdr_typesize; +} + +size_t ArrayBadStruct::getCdrSerializedSize( + const ArrayBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + return current_alignment - initial_alignment; +} + + +void ArrayBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArrayBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArrayBadStruct::isKeyDefined() +{ + return false; +} + +void ArrayBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayBadStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayBadStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArrayBadStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArrayBadStruct::my_array() +{ + return m_my_array; +} + + + + + +ArrayDimensionsStruct::ArrayDimensionsStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((2) * (2)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArrayDimensionsStruct::~ArrayDimensionsStruct() +{ +} + +ArrayDimensionsStruct::ArrayDimensionsStruct( + const ArrayDimensionsStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArrayDimensionsStruct::ArrayDimensionsStruct( + ArrayDimensionsStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( + const ArrayDimensionsStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( + ArrayDimensionsStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArrayDimensionsStruct::operator ==( + const ArrayDimensionsStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArrayDimensionsStruct::operator !=( + const ArrayDimensionsStruct& x) const +{ + return !(*this == x); +} + +size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArrayDimensionsStruct_max_cdr_typesize; +} + +size_t ArrayDimensionsStruct::getCdrSerializedSize( + const ArrayDimensionsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArrayDimensionsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + for (uint32_t b = 0; b < m_my_array.size(); ++b) + { + scdr << m_my_array[b]; + + } + + + +} + +void ArrayDimensionsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + for (uint32_t d = 0; d < m_my_array.size(); ++d) + { + dcdr >> m_my_array[d]; + + } + + + +} + + +bool ArrayDimensionsStruct::isKeyDefined() +{ + return false; +} + +void ArrayDimensionsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArrayDimensionsStruct::my_array( + const std::array, 2>& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArrayDimensionsStruct::my_array( + std::array, 2>&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array, 2>& ArrayDimensionsStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array, 2>& ArrayDimensionsStruct::my_array() +{ + return m_my_array; +} + + + + + +ArraySizeStruct::ArraySizeStruct() +{ + // long m_my_array + memset(&m_my_array, 0, ((5)) * 4); + + // Just to register all known types + registerTypesTypes(); +} + +ArraySizeStruct::~ArraySizeStruct() +{ +} + +ArraySizeStruct::ArraySizeStruct( + const ArraySizeStruct& x) +{ + m_my_array = x.m_my_array; + +} + +ArraySizeStruct::ArraySizeStruct( + ArraySizeStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + +} + +ArraySizeStruct& ArraySizeStruct::operator =( + const ArraySizeStruct& x) +{ + m_my_array = x.m_my_array; + + return *this; +} + +ArraySizeStruct& ArraySizeStruct::operator =( + ArraySizeStruct&& x) noexcept +{ + m_my_array = std::move(x.m_my_array); + + return *this; +} + +bool ArraySizeStruct::operator ==( + const ArraySizeStruct& x) const +{ + return (m_my_array == x.m_my_array); +} + +bool ArraySizeStruct::operator !=( + const ArraySizeStruct& x) const +{ + return !(*this == x); +} + +size_t ArraySizeStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return ArraySizeStruct_max_cdr_typesize; +} + +size_t ArraySizeStruct::getCdrSerializedSize( + const ArraySizeStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + return current_alignment - initial_alignment; +} + + +void ArraySizeStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_array; + + +} + +void ArraySizeStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_array; + + +} + + +bool ArraySizeStruct::isKeyDefined() +{ + return false; +} + +void ArraySizeStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ +void ArraySizeStruct::my_array( + const std::array& _my_array) +{ + m_my_array = _my_array; +} + +/*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ +void ArraySizeStruct::my_array( + std::array&& _my_array) +{ + m_my_array = std::move(_my_array); +} + +/*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ +const std::array& ArraySizeStruct::my_array() const +{ + return m_my_array; +} + +/*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ +std::array& ArraySizeStruct::my_array() +{ + return m_my_array; +} + + + + + + + +SequenceStruct::SequenceStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceStruct::~SequenceStruct() +{ +} + +SequenceStruct::SequenceStruct( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceStruct::SequenceStruct( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceStruct& SequenceStruct::operator =( + const SequenceStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceStruct& SequenceStruct::operator =( + SequenceStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceStruct::operator ==( + const SequenceStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceStruct::operator !=( + const SequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceStruct_max_cdr_typesize; +} + +size_t SequenceStruct::getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + +SequenceStructEqual::SequenceStructEqual() +{ + // sequence m_my_sequence_equal + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceStructEqual::~SequenceStructEqual() +{ +} + +SequenceStructEqual::SequenceStructEqual( + const SequenceStructEqual& x) +{ + m_my_sequence_equal = x.m_my_sequence_equal; + +} + +SequenceStructEqual::SequenceStructEqual( + SequenceStructEqual&& x) noexcept +{ + m_my_sequence_equal = std::move(x.m_my_sequence_equal); + +} + +SequenceStructEqual& SequenceStructEqual::operator =( + const SequenceStructEqual& x) +{ + m_my_sequence_equal = x.m_my_sequence_equal; + + return *this; +} + +SequenceStructEqual& SequenceStructEqual::operator =( + SequenceStructEqual&& x) noexcept +{ + m_my_sequence_equal = std::move(x.m_my_sequence_equal); + + return *this; +} + +bool SequenceStructEqual::operator ==( + const SequenceStructEqual& x) const +{ + return (m_my_sequence_equal == x.m_my_sequence_equal); +} + +bool SequenceStructEqual::operator !=( + const SequenceStructEqual& x) const +{ + return !(*this == x); +} + +size_t SequenceStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceStructEqual_max_cdr_typesize; +} + +size_t SequenceStructEqual::getCdrSerializedSize( + const SequenceStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_equal().size() > 0) + { + current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_equal; + + +} + +void SequenceStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_equal; + + +} + + +bool SequenceStructEqual::isKeyDefined() +{ + return false; +} + +void SequenceStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_equal + * @param _my_sequence_equal New value to be copied in member my_sequence_equal + */ +void SequenceStructEqual::my_sequence_equal( + const std::vector& _my_sequence_equal) +{ + m_my_sequence_equal = _my_sequence_equal; +} + +/*! + * @brief This function moves the value in member my_sequence_equal + * @param _my_sequence_equal New value to be moved in member my_sequence_equal + */ +void SequenceStructEqual::my_sequence_equal( + std::vector&& _my_sequence_equal) +{ + m_my_sequence_equal = std::move(_my_sequence_equal); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_equal + * @return Constant reference to member my_sequence_equal + */ +const std::vector& SequenceStructEqual::my_sequence_equal() const +{ + return m_my_sequence_equal; +} + +/*! + * @brief This function returns a reference to member my_sequence_equal + * @return Reference to member my_sequence_equal + */ +std::vector& SequenceStructEqual::my_sequence_equal() +{ + return m_my_sequence_equal; +} + + + + + + + +SequenceBadStruct::SequenceBadStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceBadStruct::~SequenceBadStruct() +{ +} + +SequenceBadStruct::SequenceBadStruct( + const SequenceBadStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceBadStruct::SequenceBadStruct( + SequenceBadStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceBadStruct& SequenceBadStruct::operator =( + const SequenceBadStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceBadStruct& SequenceBadStruct::operator =( + SequenceBadStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceBadStruct::operator ==( + const SequenceBadStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceBadStruct::operator !=( + const SequenceBadStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceBadStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceBadStruct_max_cdr_typesize; +} + +size_t SequenceBadStruct::getCdrSerializedSize( + const SequenceBadStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceBadStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceBadStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceBadStruct::isKeyDefined() +{ + return false; +} + +void SequenceBadStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceBadStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceBadStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceBadStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceBadStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + +SequenceBoundsStruct::SequenceBoundsStruct() +{ + // sequence m_my_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceBoundsStruct::~SequenceBoundsStruct() +{ +} + +SequenceBoundsStruct::SequenceBoundsStruct( + const SequenceBoundsStruct& x) +{ + m_my_sequence = x.m_my_sequence; + +} + +SequenceBoundsStruct::SequenceBoundsStruct( + SequenceBoundsStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + +} + +SequenceBoundsStruct& SequenceBoundsStruct::operator =( + const SequenceBoundsStruct& x) +{ + m_my_sequence = x.m_my_sequence; + + return *this; +} + +SequenceBoundsStruct& SequenceBoundsStruct::operator =( + SequenceBoundsStruct&& x) noexcept +{ + m_my_sequence = std::move(x.m_my_sequence); + + return *this; +} + +bool SequenceBoundsStruct::operator ==( + const SequenceBoundsStruct& x) const +{ + return (m_my_sequence == x.m_my_sequence); +} + +bool SequenceBoundsStruct::operator !=( + const SequenceBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceBoundsStruct_max_cdr_typesize; +} + +size_t SequenceBoundsStruct::getCdrSerializedSize( + const SequenceBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence().size() > 0) + { + current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + + + return current_alignment - initial_alignment; +} + + +void SequenceBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence; + + +} + +void SequenceBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence; + + +} + + +bool SequenceBoundsStruct::isKeyDefined() +{ + return false; +} + +void SequenceBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ +void SequenceBoundsStruct::my_sequence( + const std::vector& _my_sequence) +{ + m_my_sequence = _my_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ +void SequenceBoundsStruct::my_sequence( + std::vector&& _my_sequence) +{ + m_my_sequence = std::move(_my_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ +const std::vector& SequenceBoundsStruct::my_sequence() const +{ + return m_my_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ +std::vector& SequenceBoundsStruct::my_sequence() +{ + return m_my_sequence; +} + + + + + + + + + +SequenceSequenceStruct::SequenceSequenceStruct() +{ + // sequence, 3> m_my_sequence_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceSequenceStruct::~SequenceSequenceStruct() +{ +} + +SequenceSequenceStruct::SequenceSequenceStruct( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + +} + +SequenceSequenceStruct::SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + const SequenceSequenceStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + + return *this; +} + +SequenceSequenceStruct& SequenceSequenceStruct::operator =( + SequenceSequenceStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + + return *this; +} + +bool SequenceSequenceStruct::operator ==( + const SequenceSequenceStruct& x) const +{ + return (m_my_sequence_sequence == x.m_my_sequence_sequence); +} + +bool SequenceSequenceStruct::operator !=( + const SequenceSequenceStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceSequenceStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceSequenceStruct_max_cdr_typesize; +} + +size_t SequenceSequenceStruct::getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_sequence().at(a).size() > 0) + { + current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + } + + + + return current_alignment - initial_alignment; +} + + +void SequenceSequenceStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_sequence; + + +} + +void SequenceSequenceStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_sequence; + + +} + + +bool SequenceSequenceStruct::isKeyDefined() +{ + return false; +} + +void SequenceSequenceStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + const std::vector>& _my_sequence_sequence) +{ + m_my_sequence_sequence = _my_sequence_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ +void SequenceSequenceStruct::my_sequence_sequence( + std::vector>&& _my_sequence_sequence) +{ + m_my_sequence_sequence = std::move(_my_sequence_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ +const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const +{ + return m_my_sequence_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ +std::vector>& SequenceSequenceStruct::my_sequence_sequence() +{ + return m_my_sequence_sequence; +} + + + + + + + + + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() +{ + // sequence, 5> m_my_sequence_sequence + + + // Just to register all known types + registerTypesTypes(); +} + +SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() +{ +} + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( + const SequenceSequenceBoundsStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + +} + +SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( + SequenceSequenceBoundsStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + +} + +SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( + const SequenceSequenceBoundsStruct& x) +{ + m_my_sequence_sequence = x.m_my_sequence_sequence; + + return *this; +} + +SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( + SequenceSequenceBoundsStruct&& x) noexcept +{ + m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); + + return *this; +} + +bool SequenceSequenceBoundsStruct::operator ==( + const SequenceSequenceBoundsStruct& x) const +{ + return (m_my_sequence_sequence == x.m_my_sequence_sequence); +} + +bool SequenceSequenceBoundsStruct::operator !=( + const SequenceSequenceBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SequenceSequenceBoundsStruct_max_cdr_typesize; +} + +size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( + const SequenceSequenceBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) + { + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + if (data.my_sequence_sequence().at(a).size() > 0) + { + current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + } + + + } + + + + return current_alignment - initial_alignment; +} + + +void SequenceSequenceBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_sequence_sequence; + + +} + +void SequenceSequenceBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_sequence_sequence; + + +} + + +bool SequenceSequenceBoundsStruct::isKeyDefined() +{ + return false; +} + +void SequenceSequenceBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ +void SequenceSequenceBoundsStruct::my_sequence_sequence( + const std::vector>& _my_sequence_sequence) +{ + m_my_sequence_sequence = _my_sequence_sequence; +} + +/*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ +void SequenceSequenceBoundsStruct::my_sequence_sequence( + std::vector>&& _my_sequence_sequence) +{ + m_my_sequence_sequence = std::move(_my_sequence_sequence); +} + +/*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ +const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const +{ + return m_my_sequence_sequence; +} + +/*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ +std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() +{ + return m_my_sequence_sequence; +} + + + + + + + +MapStruct::MapStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapStruct::~MapStruct() +{ +} + +MapStruct::MapStruct( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapStruct::MapStruct( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapStruct& MapStruct::operator =( + const MapStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapStruct& MapStruct::operator =( + MapStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapStruct::operator ==( + const MapStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapStruct::operator !=( + const MapStruct& x) const +{ + return !(*this == x); +} + +size_t MapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapStruct_max_cdr_typesize; +} + +size_t MapStruct::getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapStruct::isKeyDefined() +{ + return false; +} + +void MapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapStructEqual::MapStructEqual() +{ + // map m_my_map_equal + + + // Just to register all known types + registerTypesTypes(); +} + +MapStructEqual::~MapStructEqual() +{ +} + +MapStructEqual::MapStructEqual( + const MapStructEqual& x) +{ + m_my_map_equal = x.m_my_map_equal; + +} + +MapStructEqual::MapStructEqual( + MapStructEqual&& x) noexcept +{ + m_my_map_equal = std::move(x.m_my_map_equal); + +} + +MapStructEqual& MapStructEqual::operator =( + const MapStructEqual& x) +{ + m_my_map_equal = x.m_my_map_equal; + + return *this; +} + +MapStructEqual& MapStructEqual::operator =( + MapStructEqual&& x) noexcept +{ + m_my_map_equal = std::move(x.m_my_map_equal); + + return *this; +} + +bool MapStructEqual::operator ==( + const MapStructEqual& x) const +{ + return (m_my_map_equal == x.m_my_map_equal); +} + +bool MapStructEqual::operator !=( + const MapStructEqual& x) const +{ + return !(*this == x); +} + +size_t MapStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapStructEqual_max_cdr_typesize; +} + +size_t MapStructEqual::getCdrSerializedSize( + const MapStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_equal()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_equal.size()); + for (const auto& pair : m_my_map_equal) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_equal; + + +} + + +bool MapStructEqual::isKeyDefined() +{ + return false; +} + +void MapStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_equal + * @param _my_map_equal New value to be copied in member my_map_equal + */ +void MapStructEqual::my_map_equal( + const std::map& _my_map_equal) +{ + m_my_map_equal = _my_map_equal; +} + +/*! + * @brief This function moves the value in member my_map_equal + * @param _my_map_equal New value to be moved in member my_map_equal + */ +void MapStructEqual::my_map_equal( + std::map&& _my_map_equal) +{ + m_my_map_equal = std::move(_my_map_equal); +} + +/*! + * @brief This function returns a constant reference to member my_map_equal + * @return Constant reference to member my_map_equal + */ +const std::map& MapStructEqual::my_map_equal() const +{ + return m_my_map_equal; +} + +/*! + * @brief This function returns a reference to member my_map_equal + * @return Reference to member my_map_equal + */ +std::map& MapStructEqual::my_map_equal() +{ + return m_my_map_equal; +} + + + + + + + +MapBadKeyStruct::MapBadKeyStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBadKeyStruct::~MapBadKeyStruct() +{ +} + +MapBadKeyStruct::MapBadKeyStruct( + const MapBadKeyStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBadKeyStruct::MapBadKeyStruct( + MapBadKeyStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBadKeyStruct& MapBadKeyStruct::operator =( + const MapBadKeyStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBadKeyStruct& MapBadKeyStruct::operator =( + MapBadKeyStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBadKeyStruct::operator ==( + const MapBadKeyStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBadKeyStruct::operator !=( + const MapBadKeyStruct& x) const +{ + return !(*this == x); +} + +size_t MapBadKeyStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadKeyStruct_max_cdr_typesize; +} + +size_t MapBadKeyStruct::getCdrSerializedSize( + const MapBadKeyStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBadKeyStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBadKeyStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBadKeyStruct::isKeyDefined() +{ + return false; +} + +void MapBadKeyStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBadKeyStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBadKeyStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBadKeyStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBadKeyStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapBadElemStruct::MapBadElemStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBadElemStruct::~MapBadElemStruct() +{ +} + +MapBadElemStruct::MapBadElemStruct( + const MapBadElemStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBadElemStruct::MapBadElemStruct( + MapBadElemStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBadElemStruct& MapBadElemStruct::operator =( + const MapBadElemStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBadElemStruct& MapBadElemStruct::operator =( + MapBadElemStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBadElemStruct::operator ==( + const MapBadElemStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBadElemStruct::operator !=( + const MapBadElemStruct& x) const +{ + return !(*this == x); +} + +size_t MapBadElemStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBadElemStruct_max_cdr_typesize; +} + +size_t MapBadElemStruct::getCdrSerializedSize( + const MapBadElemStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBadElemStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBadElemStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBadElemStruct::isKeyDefined() +{ + return false; +} + +void MapBadElemStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBadElemStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBadElemStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBadElemStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBadElemStruct::my_map() +{ + return m_my_map; +} + + + + + + + +MapBoundsStruct::MapBoundsStruct() +{ + // map m_my_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapBoundsStruct::~MapBoundsStruct() +{ +} + +MapBoundsStruct::MapBoundsStruct( + const MapBoundsStruct& x) +{ + m_my_map = x.m_my_map; + +} + +MapBoundsStruct::MapBoundsStruct( + MapBoundsStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + +} + +MapBoundsStruct& MapBoundsStruct::operator =( + const MapBoundsStruct& x) +{ + m_my_map = x.m_my_map; + + return *this; +} + +MapBoundsStruct& MapBoundsStruct::operator =( + MapBoundsStruct&& x) noexcept +{ + m_my_map = std::move(x.m_my_map); + + return *this; +} + +bool MapBoundsStruct::operator ==( + const MapBoundsStruct& x) const +{ + return (m_my_map == x.m_my_map); +} + +bool MapBoundsStruct::operator !=( + const MapBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t MapBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapBoundsStruct_max_cdr_typesize; +} + +size_t MapBoundsStruct::getCdrSerializedSize( + const MapBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + + return current_alignment - initial_alignment; +} + + +void MapBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map.size()); + for (const auto& pair : m_my_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map; + + +} + + +bool MapBoundsStruct::isKeyDefined() +{ + return false; +} + +void MapBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ +void MapBoundsStruct::my_map( + const std::map& _my_map) +{ + m_my_map = _my_map; +} + +/*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ +void MapBoundsStruct::my_map( + std::map&& _my_map) +{ + m_my_map = std::move(_my_map); +} + +/*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ +const std::map& MapBoundsStruct::my_map() const +{ + return m_my_map; +} + +/*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ +std::map& MapBoundsStruct::my_map() +{ + return m_my_map; +} + + + + + + + + + +MapMapStruct::MapMapStruct() +{ + // map> m_my_map_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapMapStruct::~MapMapStruct() +{ +} + +MapMapStruct::MapMapStruct( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + +} + +MapMapStruct::MapMapStruct( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + +} + +MapMapStruct& MapMapStruct::operator =( + const MapMapStruct& x) +{ + m_my_map_map = x.m_my_map_map; + + return *this; +} + +MapMapStruct& MapMapStruct::operator =( + MapMapStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + + return *this; +} + +bool MapMapStruct::operator ==( + const MapMapStruct& x) const +{ + return (m_my_map_map == x.m_my_map_map); +} + +bool MapMapStruct::operator !=( + const MapMapStruct& x) const +{ + return !(*this == x); +} + +size_t MapMapStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapMapStruct_max_cdr_typesize; +} + +size_t MapMapStruct::getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + } + + + return current_alignment - initial_alignment; +} + + +void MapMapStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_map.size()); + for (const auto& pair : m_my_map_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapMapStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_map; + + +} + + +bool MapMapStruct::isKeyDefined() +{ + return false; +} + +void MapMapStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ +void MapMapStruct::my_map_map( + const std::map>& _my_map_map) +{ + m_my_map_map = _my_map_map; +} + +/*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ +void MapMapStruct::my_map_map( + std::map>&& _my_map_map) +{ + m_my_map_map = std::move(_my_map_map); +} + +/*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ +const std::map>& MapMapStruct::my_map_map() const +{ + return m_my_map_map; +} + +/*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ +std::map>& MapMapStruct::my_map_map() +{ + return m_my_map_map; +} + + + + + + + + + +MapMapBoundsStruct::MapMapBoundsStruct() +{ + // map> m_my_map_map + + + // Just to register all known types + registerTypesTypes(); +} + +MapMapBoundsStruct::~MapMapBoundsStruct() +{ +} + +MapMapBoundsStruct::MapMapBoundsStruct( + const MapMapBoundsStruct& x) +{ + m_my_map_map = x.m_my_map_map; + +} + +MapMapBoundsStruct::MapMapBoundsStruct( + MapMapBoundsStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + +} + +MapMapBoundsStruct& MapMapBoundsStruct::operator =( + const MapMapBoundsStruct& x) +{ + m_my_map_map = x.m_my_map_map; + + return *this; +} + +MapMapBoundsStruct& MapMapBoundsStruct::operator =( + MapMapBoundsStruct&& x) noexcept +{ + m_my_map_map = std::move(x.m_my_map_map); + + return *this; +} + +bool MapMapBoundsStruct::operator ==( + const MapMapBoundsStruct& x) const +{ + return (m_my_map_map == x.m_my_map_map); +} + +bool MapMapBoundsStruct::operator !=( + const MapMapBoundsStruct& x) const +{ + return !(*this == x); +} + +size_t MapMapBoundsStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return MapMapBoundsStruct_max_cdr_typesize; +} + +size_t MapMapBoundsStruct::getCdrSerializedSize( + const MapMapBoundsStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto a : data.my_map_map()) + { + (void)a; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + for(auto b : a.second) + { + (void)b; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + } + + } + + + return current_alignment - initial_alignment; +} + + +void MapMapBoundsStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << static_cast(m_my_map_map.size()); + for (const auto& pair : m_my_map_map) + { + scdr << pair.first; + scdr << pair.second; + } + +} + +void MapMapBoundsStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + + dcdr >> m_my_map_map; + + +} + + +bool MapMapBoundsStruct::isKeyDefined() +{ + return false; +} + +void MapMapBoundsStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ +void MapMapBoundsStruct::my_map_map( + const std::map>& _my_map_map) +{ + m_my_map_map = _my_map_map; +} + +/*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ +void MapMapBoundsStruct::my_map_map( + std::map>&& _my_map_map) +{ + m_my_map_map = std::move(_my_map_map); +} + +/*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ +const std::map>& MapMapBoundsStruct::my_map_map() const +{ + return m_my_map_map; +} + +/*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ +std::map>& MapMapBoundsStruct::my_map_map() +{ + return m_my_map_map; +} + + + + + +SimpleUnion::SimpleUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleUnion::~SimpleUnion() +{ +} + +SimpleUnion::SimpleUnion( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion::SimpleUnion( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleUnion& SimpleUnion::operator =( + const SimpleUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleUnion& SimpleUnion::operator =( + SimpleUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleUnion::operator ==( + const SimpleUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleUnion::operator !=( + const SimpleUnion& x) const +{ + return !(*this == x); +} + +void SimpleUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleUnion::_d() +{ + return m__d; +} + +void SimpleUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleUnion::getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleUnionNames::SimpleUnionNames() +{ + m__d = A; + // long m_first_case + m_first_case = 0; + // long long m_second_case + m_second_case = 0; +} + +SimpleUnionNames::~SimpleUnionNames() +{ +} + +SimpleUnionNames::SimpleUnionNames( + const SimpleUnionNames& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } +} + +SimpleUnionNames::SimpleUnionNames( + SimpleUnionNames&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } +} + +SimpleUnionNames& SimpleUnionNames::operator =( + const SimpleUnionNames& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } + + return *this; +} + +SimpleUnionNames& SimpleUnionNames::operator =( + SimpleUnionNames&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first_case = x.m_first_case; + break; + + + case B: + m_second_case = x.m_second_case; + break; + + default: + break; + } + + return *this; +} + +bool SimpleUnionNames::operator ==( + const SimpleUnionNames& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first_case == x.m_first_case); + break; + + + case B: + return (m_second_case == x.m_second_case); + break; + + default: + break; + } + return false; +} + +bool SimpleUnionNames::operator !=( + const SimpleUnionNames& x) const +{ + return !(*this == x); +} + +void SimpleUnionNames::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleUnionNames::_d() const +{ + return m__d; +} + +int32_t& SimpleUnionNames::_d() +{ + return m__d; +} + +void SimpleUnionNames::first_case( + int32_t _first_case) +{ + m_first_case = _first_case; + m__d = A; + +} + +int32_t SimpleUnionNames::first_case() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first_case; +} + +int32_t& SimpleUnionNames::first_case() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first_case; +} + + +void SimpleUnionNames::second_case( + int64_t _second_case) +{ + m_second_case = _second_case; + m__d = B; + +} + +int64_t SimpleUnionNames::second_case() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second_case; +} + +int64_t& SimpleUnionNames::second_case() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second_case; +} + + +// TODO(Ricardo) Review +size_t SimpleUnionNames::getCdrSerializedSize( + const SimpleUnionNames& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleUnionNames::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first_case; + + break; + + + case B: + scdr << m_second_case; + + break; + + default: + break; + } +} + +void SimpleUnionNames::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first_case; + + + break; + + + case B: + dcdr >> m_second_case; + + + break; + + default: + break; + } +} + + + + + +SimpleTypeUnion::SimpleTypeUnion() +{ + m__d = A; + // octet m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleTypeUnion::~SimpleTypeUnion() +{ +} + +SimpleTypeUnion::SimpleTypeUnion( + const SimpleTypeUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleTypeUnion::SimpleTypeUnion( + SimpleTypeUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleTypeUnion& SimpleTypeUnion::operator =( + const SimpleTypeUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleTypeUnion& SimpleTypeUnion::operator =( + SimpleTypeUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case B: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleTypeUnion::operator ==( + const SimpleTypeUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case B: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleTypeUnion::operator !=( + const SimpleTypeUnion& x) const +{ + return !(*this == x); +} + +void SimpleTypeUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case B: + switch(__d) + { + case B: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleTypeUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleTypeUnion::_d() +{ + return m__d; +} + +void SimpleTypeUnion::first( + uint8_t _first) +{ + m_first = _first; + m__d = A; + +} + +uint8_t SimpleTypeUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +uint8_t& SimpleTypeUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleTypeUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = B; + +} + +int64_t SimpleTypeUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleTypeUnion::second() +{ + bool b = false; + + switch(m__d) + { + case B: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleTypeUnion::getCdrSerializedSize( + const SimpleTypeUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + break; + + + case B: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleTypeUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case B: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleTypeUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case B: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleBadUnion::SimpleBadUnion() +{ + m__d = A; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleBadUnion::~SimpleBadUnion() +{ +} + +SimpleBadUnion::SimpleBadUnion( + const SimpleBadUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadUnion::SimpleBadUnion( + SimpleBadUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadUnion& SimpleBadUnion::operator =( + const SimpleBadUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleBadUnion& SimpleBadUnion::operator =( + SimpleBadUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case A: + m_first = x.m_first; + break; + + + case C: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleBadUnion::operator ==( + const SimpleBadUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case A: + return (m_first == x.m_first); + break; + + + case C: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleBadUnion::operator !=( + const SimpleBadUnion& x) const +{ + return !(*this == x); +} + +void SimpleBadUnion::_d( + int32_t __d) +{ + bool b = false; + + switch(m__d) + { + case A: + switch(__d) + { + case A: + b = true; + break; + default: + break; + } + break; + + + case C: + switch(__d) + { + case C: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +int32_t SimpleBadUnion::_d() const +{ + return m__d; +} + +int32_t& SimpleBadUnion::_d() +{ + return m__d; +} + +void SimpleBadUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = A; + +} + +int32_t SimpleBadUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleBadUnion::first() +{ + bool b = false; + + switch(m__d) + { + case A: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleBadUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = C; + +} + +int64_t SimpleBadUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleBadUnion::second() +{ + bool b = false; + + switch(m__d) + { + case C: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleBadUnion::getCdrSerializedSize( + const SimpleBadUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + + + switch(data.m__d) + { + case A: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case C: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleBadUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case A: + scdr << m_first; + + break; + + + case C: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleBadUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case A: + dcdr >> m_first; + + + break; + + + case C: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleBadDiscUnion::SimpleBadDiscUnion() +{ + m__d = 0; + // long m_first + m_first = 0; + // long long m_second + m_second = 0; +} + +SimpleBadDiscUnion::~SimpleBadDiscUnion() +{ +} + +SimpleBadDiscUnion::SimpleBadDiscUnion( + const SimpleBadDiscUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadDiscUnion::SimpleBadDiscUnion( + SimpleBadDiscUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } +} + +SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( + const SimpleBadDiscUnion& x) +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( + SimpleBadDiscUnion&& x) noexcept +{ + m__d = x.m__d; + + switch(m__d) + { + case 0: + m_first = x.m_first; + break; + + + case 1: + m_second = x.m_second; + break; + + default: + break; + } + + return *this; +} + +bool SimpleBadDiscUnion::operator ==( + const SimpleBadDiscUnion& x) const +{ + if (m__d != x.m__d) + { + return false; + } + + switch(m__d) + { + case 0: + return (m_first == x.m_first); + break; + + + case 1: + return (m_second == x.m_second); + break; + + default: + break; + } + return false; +} + +bool SimpleBadDiscUnion::operator !=( + const SimpleBadDiscUnion& x) const +{ + return !(*this == x); +} + +void SimpleBadDiscUnion::_d( + uint8_t __d) +{ + bool b = false; + + switch(m__d) + { + case 0: + switch(__d) + { + case 0: + b = true; + break; + default: + break; + } + break; + + + case 1: + switch(__d) + { + case 1: + b = true; + break; + default: + break; + } + break; + + } + + if(!b) + { + throw BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; +} + +uint8_t SimpleBadDiscUnion::_d() const +{ + return m__d; +} + +uint8_t& SimpleBadDiscUnion::_d() +{ + return m__d; +} + +void SimpleBadDiscUnion::first( + int32_t _first) +{ + m_first = _first; + m__d = 0; + +} + +int32_t SimpleBadDiscUnion::first() const +{ + bool b = false; + + switch(m__d) + { + case 0: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + +int32_t& SimpleBadDiscUnion::first() +{ + bool b = false; + + switch(m__d) + { + case 0: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_first; +} + + +void SimpleBadDiscUnion::second( + int64_t _second) +{ + m_second = _second; + m__d = 1; + +} + +int64_t SimpleBadDiscUnion::second() const +{ + bool b = false; + + switch(m__d) + { + case 1: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + +int64_t& SimpleBadDiscUnion::second() +{ + bool b = false; + + switch(m__d) + { + case 1: + b = true; + break; + default: + break; + } + + if(!b) + { + throw BadParamException("This member has not been selected"); + } + + return m_second; +} + + +// TODO(Ricardo) Review +size_t SimpleBadDiscUnion::getCdrSerializedSize( + const SimpleBadDiscUnion& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); + + + + switch(data.m__d) + { + case 0: + current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); + + break; + + + case 1: + current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); + + break; + + default: + break; + } + + return current_alignment - initial_alignment; +} + + +void SimpleBadDiscUnion::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m__d; + + switch(m__d) + { + case 0: + scdr << m_first; + + break; + + + case 1: + scdr << m_second; + + break; + + default: + break; + } +} + +void SimpleBadDiscUnion::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m__d; + + + switch(m__d) + { + case 0: + dcdr >> m_first; + + + break; + + + case 1: + dcdr >> m_second; + + + break; + + default: + break; + } +} + + + + + +SimpleUnionStruct::SimpleUnionStruct() +{ + // SimpleUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionStruct::~SimpleUnionStruct() +{ +} + +SimpleUnionStruct::SimpleUnionStruct( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleUnionStruct::SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + const SimpleUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleUnionStruct& SimpleUnionStruct::operator =( + SimpleUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleUnionStruct::operator ==( + const SimpleUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleUnionStruct::operator !=( + const SimpleUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionStruct_max_cdr_typesize; +} + +size_t SimpleUnionStruct::getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleUnionStruct::my_union( + const SimpleUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleUnionStruct::my_union( + SimpleUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleUnion& SimpleUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleUnion& SimpleUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleUnionStructEqual::SimpleUnionStructEqual() +{ + // SimpleUnion m_my_union_equal + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionStructEqual::~SimpleUnionStructEqual() +{ +} + +SimpleUnionStructEqual::SimpleUnionStructEqual( + const SimpleUnionStructEqual& x) +{ + m_my_union_equal = x.m_my_union_equal; + +} + +SimpleUnionStructEqual::SimpleUnionStructEqual( + SimpleUnionStructEqual&& x) noexcept +{ + m_my_union_equal = std::move(x.m_my_union_equal); + +} + +SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( + const SimpleUnionStructEqual& x) +{ + m_my_union_equal = x.m_my_union_equal; + + return *this; +} + +SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( + SimpleUnionStructEqual&& x) noexcept +{ + m_my_union_equal = std::move(x.m_my_union_equal); + + return *this; +} + +bool SimpleUnionStructEqual::operator ==( + const SimpleUnionStructEqual& x) const +{ + return (m_my_union_equal == x.m_my_union_equal); +} + +bool SimpleUnionStructEqual::operator !=( + const SimpleUnionStructEqual& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionStructEqual_max_cdr_typesize; +} + +size_t SimpleUnionStructEqual::getCdrSerializedSize( + const SimpleUnionStructEqual& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionStructEqual::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union_equal; + +} + +void SimpleUnionStructEqual::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union_equal; + + +} + + +bool SimpleUnionStructEqual::isKeyDefined() +{ + return false; +} + +void SimpleUnionStructEqual::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union_equal + * @param _my_union_equal New value to be copied in member my_union_equal + */ +void SimpleUnionStructEqual::my_union_equal( + const SimpleUnion& _my_union_equal) +{ + m_my_union_equal = _my_union_equal; +} + +/*! + * @brief This function moves the value in member my_union_equal + * @param _my_union_equal New value to be moved in member my_union_equal + */ +void SimpleUnionStructEqual::my_union_equal( + SimpleUnion&& _my_union_equal) +{ + m_my_union_equal = std::move(_my_union_equal); +} + +/*! + * @brief This function returns a constant reference to member my_union_equal + * @return Constant reference to member my_union_equal + */ +const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const +{ + return m_my_union_equal; +} + +/*! + * @brief This function returns a reference to member my_union_equal + * @return Reference to member my_union_equal + */ +SimpleUnion& SimpleUnionStructEqual::my_union_equal() +{ + return m_my_union_equal; +} + + + + + +SimpleUnionNamesStruct::SimpleUnionNamesStruct() +{ + // SimpleUnionNames m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleUnionNamesStruct::~SimpleUnionNamesStruct() +{ +} + +SimpleUnionNamesStruct::SimpleUnionNamesStruct( + const SimpleUnionNamesStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleUnionNamesStruct::SimpleUnionNamesStruct( + SimpleUnionNamesStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( + const SimpleUnionNamesStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( + SimpleUnionNamesStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleUnionNamesStruct::operator ==( + const SimpleUnionNamesStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleUnionNamesStruct::operator !=( + const SimpleUnionNamesStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleUnionNamesStruct_max_cdr_typesize; +} + +size_t SimpleUnionNamesStruct::getCdrSerializedSize( + const SimpleUnionNamesStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleUnionNamesStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleUnionNamesStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleUnionNamesStruct::isKeyDefined() +{ + return false; +} + +void SimpleUnionNamesStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleUnionNamesStruct::my_union( + const SimpleUnionNames& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleUnionNamesStruct::my_union( + SimpleUnionNames&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleUnionNames& SimpleUnionNamesStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleTypeUnionStruct::SimpleTypeUnionStruct() +{ + // SimpleTypeUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleTypeUnionStruct::~SimpleTypeUnionStruct() +{ +} + +SimpleTypeUnionStruct::SimpleTypeUnionStruct( + const SimpleTypeUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleTypeUnionStruct::SimpleTypeUnionStruct( + SimpleTypeUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( + const SimpleTypeUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( + SimpleTypeUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleTypeUnionStruct::operator ==( + const SimpleTypeUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleTypeUnionStruct::operator !=( + const SimpleTypeUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleTypeUnionStruct_max_cdr_typesize; +} + +size_t SimpleTypeUnionStruct::getCdrSerializedSize( + const SimpleTypeUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleTypeUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleTypeUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleTypeUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleTypeUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleTypeUnionStruct::my_union( + const SimpleTypeUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleTypeUnionStruct::my_union( + SimpleTypeUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleTypeUnion& SimpleTypeUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimpleBadUnionStruct::SimpleBadUnionStruct() +{ + // SimpleBadUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimpleBadUnionStruct::~SimpleBadUnionStruct() +{ +} + +SimpleBadUnionStruct::SimpleBadUnionStruct( + const SimpleBadUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimpleBadUnionStruct::SimpleBadUnionStruct( + SimpleBadUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( + const SimpleBadUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( + SimpleBadUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimpleBadUnionStruct::operator ==( + const SimpleBadUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimpleBadUnionStruct::operator !=( + const SimpleBadUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimpleBadUnionStruct_max_cdr_typesize; +} + +size_t SimpleBadUnionStruct::getCdrSerializedSize( + const SimpleBadUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimpleBadUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimpleBadUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimpleBadUnionStruct::isKeyDefined() +{ + return false; +} + +void SimpleBadUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimpleBadUnionStruct::my_union( + const SimpleBadUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimpleBadUnionStruct::my_union( + SimpleBadUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleBadUnion& SimpleBadUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleBadUnion& SimpleBadUnionStruct::my_union() +{ + return m_my_union; +} + + + + + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() +{ + // SimpleBadDiscUnion m_my_union + + + // Just to register all known types + registerTypesTypes(); +} + +SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() +{ +} + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( + const SimplBadDiscUnionStruct& x) +{ + m_my_union = x.m_my_union; + +} + +SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( + SimplBadDiscUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + +} + +SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( + const SimplBadDiscUnionStruct& x) +{ + m_my_union = x.m_my_union; + + return *this; +} + +SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( + SimplBadDiscUnionStruct&& x) noexcept +{ + m_my_union = std::move(x.m_my_union); + + return *this; +} + +bool SimplBadDiscUnionStruct::operator ==( + const SimplBadDiscUnionStruct& x) const +{ + return (m_my_union == x.m_my_union); +} + +bool SimplBadDiscUnionStruct::operator !=( + const SimplBadDiscUnionStruct& x) const +{ + return !(*this == x); +} + +size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( + size_t current_alignment) +{ + static_cast(current_alignment); + return SimplBadDiscUnionStruct_max_cdr_typesize; +} + +size_t SimplBadDiscUnionStruct::getCdrSerializedSize( + const SimplBadDiscUnionStruct& data, + size_t current_alignment) +{ + (void)data; + size_t initial_alignment = current_alignment; + + current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); + + + return current_alignment - initial_alignment; +} + + +void SimplBadDiscUnionStruct::serialize( + eprosima::fastcdr::Cdr& scdr) const +{ + scdr << m_my_union; + +} + +void SimplBadDiscUnionStruct::deserialize( + eprosima::fastcdr::Cdr& dcdr) +{ + dcdr >> m_my_union; + + +} + + +bool SimplBadDiscUnionStruct::isKeyDefined() +{ + return false; +} + +void SimplBadDiscUnionStruct::serializeKey( + eprosima::fastcdr::Cdr& scdr) const +{ + (void) scdr; +} + +/*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ +void SimplBadDiscUnionStruct::my_union( + const SimpleBadDiscUnion& _my_union) +{ + m_my_union = _my_union; +} + +/*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ +void SimplBadDiscUnionStruct::my_union( + SimpleBadDiscUnion&& _my_union) +{ + m_my_union = std::move(_my_union); +} + +/*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ +const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const +{ + return m_my_union; +} + +/*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ +SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() +{ + return m_my_union; +} + + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/xtypes/idl/Typesv1.h b/test/xtypes/idl/Typesv1.h new file mode 100644 index 00000000000..9cf664ae223 --- /dev/null +++ b/test/xtypes/idl/Typesv1.h @@ -0,0 +1,6495 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// 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. + +/*! + * @file Types.h + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#include + +#if FASTCDR_VERSION_MAJOR == 1 + +#ifndef _FAST_DDS_GENERATED_TYPES_H_ +#define _FAST_DDS_GENERATED_TYPES_H_ + + +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(TYPES_SOURCE) +#define TYPES_DllAPI __declspec( dllexport ) +#else +#define TYPES_DllAPI __declspec( dllimport ) +#endif // TYPES_SOURCE +#else +#define TYPES_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define TYPES_DllAPI +#endif // _WIN32 + +namespace eprosima { +namespace fastcdr { +class Cdr; +} // namespace fastcdr +} // namespace eprosima + + + +/*! + * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. + * @ingroup Types + */ +enum MyEnum : uint32_t +{ + A, + B, + C +}; +/*! + * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. + * @ingroup Types + */ +enum MyBadEnum : uint32_t +{ + A1, + B1, + C1 +}; + + +/*! + * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct( + const MyEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct( + MyEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct& operator =( + const MyEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyEnumStruct that will be copied. + */ + eProsima_user_DllExport MyEnumStruct& operator =( + MyEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyEnum m_my_enum; + +}; + + + +/*! + * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyBadEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyBadEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyBadEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct( + const MyBadEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct( + MyBadEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct& operator =( + const MyBadEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyBadEnumStruct that will be copied. + */ + eProsima_user_DllExport MyBadEnumStruct& operator =( + MyBadEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyBadEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyBadEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyBadEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyBadEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyBadEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyBadEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyBadEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyBadEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyBadEnum m_my_enum; + +}; + +typedef MyEnum MyAliasEnum; + + + +/*! + * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MyAliasEnumStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MyAliasEnumStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MyAliasEnumStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct( + const MyAliasEnumStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct( + MyAliasEnumStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct& operator =( + const MyAliasEnumStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MyAliasEnumStruct that will be copied. + */ + eProsima_user_DllExport MyAliasEnumStruct& operator =( + MyAliasEnumStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MyAliasEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MyAliasEnumStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MyAliasEnumStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MyAliasEnumStruct& x) const; + + /*! + * @brief This function sets a value in member my_enum + * @param _my_enum New value for member my_enum + */ + eProsima_user_DllExport void my_enum( + MyAliasEnum _my_enum); + + /*! + * @brief This function returns the value of member my_enum + * @return Value of member my_enum + */ + eProsima_user_DllExport MyAliasEnum my_enum() const; + + /*! + * @brief This function returns a reference to member my_enum + * @return Reference to member my_enum + */ + eProsima_user_DllExport MyAliasEnum& my_enum(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MyAliasEnumStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + MyAliasEnum m_my_enum; + +}; + + + +/*! + * @brief This class represents the structure BasicStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + const BasicStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct( + BasicStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + const BasicStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicStruct that will be copied. + */ + eProsima_user_DllExport BasicStruct& operator =( + BasicStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicNamesStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicNamesStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicNamesStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct( + const BasicNamesStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct( + BasicNamesStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct& operator =( + const BasicNamesStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicNamesStruct that will be copied. + */ + eProsima_user_DllExport BasicNamesStruct& operator =( + BasicNamesStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicNamesStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicNamesStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool_name + * @param _my_bool_name New value for member my_bool_name + */ + eProsima_user_DllExport void my_bool_name( + bool _my_bool_name); + + /*! + * @brief This function returns the value of member my_bool_name + * @return Value of member my_bool_name + */ + eProsima_user_DllExport bool my_bool_name() const; + + /*! + * @brief This function returns a reference to member my_bool_name + * @return Reference to member my_bool_name + */ + eProsima_user_DllExport bool& my_bool_name(); + + + /*! + * @brief This function sets a value in member my_int32_name + * @param _my_int32_name New value for member my_int32_name + */ + eProsima_user_DllExport void my_int32_name( + int32_t _my_int32_name); + + /*! + * @brief This function returns the value of member my_int32_name + * @return Value of member my_int32_name + */ + eProsima_user_DllExport int32_t my_int32_name() const; + + /*! + * @brief This function returns a reference to member my_int32_name + * @return Reference to member my_int32_name + */ + eProsima_user_DllExport int32_t& my_int32_name(); + + + /*! + * @brief This function copies the value in member my_string_name + * @param _my_string_name New value to be copied in member my_string_name + */ + eProsima_user_DllExport void my_string_name( + const std::string& _my_string_name); + + /*! + * @brief This function moves the value in member my_string_name + * @param _my_string_name New value to be moved in member my_string_name + */ + eProsima_user_DllExport void my_string_name( + std::string&& _my_string_name); + + /*! + * @brief This function returns a constant reference to member my_string_name + * @return Constant reference to member my_string_name + */ + eProsima_user_DllExport const std::string& my_string_name() const; + + /*! + * @brief This function returns a reference to member my_string_name + * @return Reference to member my_string_name + */ + eProsima_user_DllExport std::string& my_string_name(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicNamesStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool_name; + int32_t m_my_int32_name; + std::string m_my_string_name; + +}; + + + +/*! + * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct( + const BasicBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct( + BasicBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct& operator =( + const BasicBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicBadStruct that will be copied. + */ + eProsima_user_DllExport BasicBadStruct& operator =( + BasicBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicBadStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + uint8_t _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport uint8_t my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport uint8_t& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + uint8_t m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BasicWideStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BasicWideStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BasicWideStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct( + const BasicWideStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct( + BasicWideStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct& operator =( + const BasicWideStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BasicWideStruct that will be copied. + */ + eProsima_user_DllExport BasicWideStruct& operator =( + BasicWideStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BasicWideStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BasicWideStruct& x) const; + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ + eProsima_user_DllExport void new_int32( + int32_t _new_int32); + + /*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ + eProsima_user_DllExport int32_t new_int32() const; + + /*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ + eProsima_user_DllExport int32_t& new_int32(); + + + /*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ + eProsima_user_DllExport void new_string( + const std::string& _new_string); + + /*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ + eProsima_user_DllExport void new_string( + std::string&& _new_string); + + /*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ + eProsima_user_DllExport const std::string& new_string() const; + + /*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ + eProsima_user_DllExport std::string& new_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BasicWideStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + int32_t m_new_int32; + std::string m_new_string; + +}; + + + +/*! + * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. + * @ingroup Types + */ +class BadBasicWideStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BadBasicWideStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BadBasicWideStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct( + const BadBasicWideStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct( + BadBasicWideStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct& operator =( + const BadBasicWideStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object BadBasicWideStruct that will be copied. + */ + eProsima_user_DllExport BadBasicWideStruct& operator =( + BadBasicWideStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x BadBasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BadBasicWideStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x BadBasicWideStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BadBasicWideStruct& x) const; + + /*! + * @brief This function sets a value in member new_int32 + * @param _new_int32 New value for member new_int32 + */ + eProsima_user_DllExport void new_int32( + int32_t _new_int32); + + /*! + * @brief This function returns the value of member new_int32 + * @return Value of member new_int32 + */ + eProsima_user_DllExport int32_t new_int32() const; + + /*! + * @brief This function returns a reference to member new_int32 + * @return Reference to member new_int32 + */ + eProsima_user_DllExport int32_t& new_int32(); + + + /*! + * @brief This function copies the value in member new_string + * @param _new_string New value to be copied in member new_string + */ + eProsima_user_DllExport void new_string( + const std::string& _new_string); + + /*! + * @brief This function moves the value in member new_string + * @param _new_string New value to be moved in member new_string + */ + eProsima_user_DllExport void new_string( + std::string&& _new_string); + + /*! + * @brief This function returns a constant reference to member new_string + * @return Constant reference to member new_string + */ + eProsima_user_DllExport const std::string& new_string() const; + + /*! + * @brief This function returns a reference to member new_string + * @return Reference to member new_string + */ + eProsima_user_DllExport std::string& new_string(); + + + /*! + * @brief This function sets a value in member my_bool + * @param _my_bool New value for member my_bool + */ + eProsima_user_DllExport void my_bool( + bool _my_bool); + + /*! + * @brief This function returns the value of member my_bool + * @return Value of member my_bool + */ + eProsima_user_DllExport bool my_bool() const; + + /*! + * @brief This function returns a reference to member my_bool + * @return Reference to member my_bool + */ + eProsima_user_DllExport bool& my_bool(); + + + /*! + * @brief This function sets a value in member my_int32 + * @param _my_int32 New value for member my_int32 + */ + eProsima_user_DllExport void my_int32( + int32_t _my_int32); + + /*! + * @brief This function returns the value of member my_int32 + * @return Value of member my_int32 + */ + eProsima_user_DllExport int32_t my_int32() const; + + /*! + * @brief This function returns a reference to member my_int32 + * @return Reference to member my_int32 + */ + eProsima_user_DllExport int32_t& my_int32(); + + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const BadBasicWideStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + int32_t m_new_int32; + std::string m_new_string; + bool m_my_bool; + int32_t m_my_int32; + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure StringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class StringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + const StringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct( + StringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + const StringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object StringStruct that will be copied. + */ + eProsima_user_DllExport StringStruct& operator =( + StringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x StringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringStruct& x) const; + + /*! + * @brief This function copies the value in member my_string + * @param _my_string New value to be copied in member my_string + */ + eProsima_user_DllExport void my_string( + const std::string& _my_string); + + /*! + * @brief This function moves the value in member my_string + * @param _my_string New value to be moved in member my_string + */ + eProsima_user_DllExport void my_string( + std::string&& _my_string); + + /*! + * @brief This function returns a constant reference to member my_string + * @return Constant reference to member my_string + */ + eProsima_user_DllExport const std::string& my_string() const; + + /*! + * @brief This function returns a reference to member my_string + * @return Reference to member my_string + */ + eProsima_user_DllExport std::string& my_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const StringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::string m_my_string; + +}; + + + +/*! + * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class LargeStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + const LargeStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + const LargeStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeStringStruct that will be copied. + */ + eProsima_user_DllExport LargeStringStruct& operator =( + LargeStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_string + * @param _my_large_string New value to be copied in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + const eprosima::fastrtps::fixed_string<41925>& _my_large_string); + + /*! + * @brief This function moves the value in member my_large_string + * @param _my_large_string New value to be moved in member my_large_string + */ + eProsima_user_DllExport void my_large_string( + eprosima::fastrtps::fixed_string<41925>&& _my_large_string); + + /*! + * @brief This function returns a constant reference to member my_large_string + * @return Constant reference to member my_large_string + */ + eProsima_user_DllExport const eprosima::fastrtps::fixed_string<41925>& my_large_string() const; + + /*! + * @brief This function returns a reference to member my_large_string + * @return Reference to member my_large_string + */ + eProsima_user_DllExport eprosima::fastrtps::fixed_string<41925>& my_large_string(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + eprosima::fastrtps::fixed_string<41925> m_my_large_string; + +}; + + + +/*! + * @brief This class represents the structure WStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class WStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + const WStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct( + WStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + const WStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object WStringStruct that will be copied. + */ + eProsima_user_DllExport WStringStruct& operator =( + WStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x WStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_wstring + * @param _my_wstring New value to be copied in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + const std::wstring& _my_wstring); + + /*! + * @brief This function moves the value in member my_wstring + * @param _my_wstring New value to be moved in member my_wstring + */ + eProsima_user_DllExport void my_wstring( + std::wstring&& _my_wstring); + + /*! + * @brief This function returns a constant reference to member my_wstring + * @return Constant reference to member my_wstring + */ + eProsima_user_DllExport const std::wstring& my_wstring() const; + + /*! + * @brief This function returns a reference to member my_wstring + * @return Reference to member my_wstring + */ + eProsima_user_DllExport std::wstring& my_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const WStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_wstring; + +}; + + + +/*! + * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. + * @ingroup Types + */ +class LargeWStringStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LargeWStringStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LargeWStringStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + const LargeWStringStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + const LargeWStringStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object LargeWStringStruct that will be copied. + */ + eProsima_user_DllExport LargeWStringStruct& operator =( + LargeWStringStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LargeWStringStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x LargeWStringStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LargeWStringStruct& x) const; + + /*! + * @brief This function copies the value in member my_large_wstring + * @param _my_large_wstring New value to be copied in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + const std::wstring& _my_large_wstring); + + /*! + * @brief This function moves the value in member my_large_wstring + * @param _my_large_wstring New value to be moved in member my_large_wstring + */ + eProsima_user_DllExport void my_large_wstring( + std::wstring&& _my_large_wstring); + + /*! + * @brief This function returns a constant reference to member my_large_wstring + * @return Constant reference to member my_large_wstring + */ + eProsima_user_DllExport const std::wstring& my_large_wstring() const; + + /*! + * @brief This function returns a reference to member my_large_wstring + * @return Reference to member my_large_wstring + */ + eProsima_user_DllExport std::wstring& my_large_wstring(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const LargeWStringStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::wstring m_my_large_wstring; + +}; + + + +/*! + * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct( + const ArrayStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct( + ArrayStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct& operator =( + const ArrayStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayStruct that will be copied. + */ + eProsima_user_DllExport ArrayStruct& operator =( + ArrayStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual( + const ArrayStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual( + ArrayStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual& operator =( + const ArrayStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayStructEqual that will be copied. + */ + eProsima_user_DllExport ArrayStructEqual& operator =( + ArrayStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_array_equal + * @param _my_array_equal New value to be copied in member my_array_equal + */ + eProsima_user_DllExport void my_array_equal( + const std::array& _my_array_equal); + + /*! + * @brief This function moves the value in member my_array_equal + * @param _my_array_equal New value to be moved in member my_array_equal + */ + eProsima_user_DllExport void my_array_equal( + std::array&& _my_array_equal); + + /*! + * @brief This function returns a constant reference to member my_array_equal + * @return Constant reference to member my_array_equal + */ + eProsima_user_DllExport const std::array& my_array_equal() const; + + /*! + * @brief This function returns a reference to member my_array_equal + * @return Reference to member my_array_equal + */ + eProsima_user_DllExport std::array& my_array_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array_equal; + +}; + + + +/*! + * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct( + const ArrayBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct( + ArrayBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct& operator =( + const ArrayBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayBadStruct that will be copied. + */ + eProsima_user_DllExport ArrayBadStruct& operator =( + ArrayBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayBadStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArrayDimensionsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArrayDimensionsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArrayDimensionsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct( + const ArrayDimensionsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct( + ArrayDimensionsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct& operator =( + const ArrayDimensionsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArrayDimensionsStruct that will be copied. + */ + eProsima_user_DllExport ArrayDimensionsStruct& operator =( + ArrayDimensionsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArrayDimensionsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArrayDimensionsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArrayDimensionsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArrayDimensionsStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array, 2>& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array, 2>&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array, 2>& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array, 2>& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArrayDimensionsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array, 2> m_my_array; + +}; + + + +/*! + * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. + * @ingroup Types + */ +class ArraySizeStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ArraySizeStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ArraySizeStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct( + const ArraySizeStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct( + ArraySizeStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct& operator =( + const ArraySizeStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object ArraySizeStruct that will be copied. + */ + eProsima_user_DllExport ArraySizeStruct& operator =( + ArraySizeStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x ArraySizeStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ArraySizeStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x ArraySizeStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ArraySizeStruct& x) const; + + /*! + * @brief This function copies the value in member my_array + * @param _my_array New value to be copied in member my_array + */ + eProsima_user_DllExport void my_array( + const std::array& _my_array); + + /*! + * @brief This function moves the value in member my_array + * @param _my_array New value to be moved in member my_array + */ + eProsima_user_DllExport void my_array( + std::array&& _my_array); + + /*! + * @brief This function returns a constant reference to member my_array + * @return Constant reference to member my_array + */ + eProsima_user_DllExport const std::array& my_array() const; + + /*! + * @brief This function returns a reference to member my_array + * @return Reference to member my_array + */ + eProsima_user_DllExport std::array& my_array(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const ArraySizeStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::array m_my_array; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + const SequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct( + SequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + const SequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceStruct& operator =( + SequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual( + const SequenceStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual( + SequenceStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual& operator =( + const SequenceStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceStructEqual that will be copied. + */ + eProsima_user_DllExport SequenceStructEqual& operator =( + SequenceStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_sequence_equal + * @param _my_sequence_equal New value to be copied in member my_sequence_equal + */ + eProsima_user_DllExport void my_sequence_equal( + const std::vector& _my_sequence_equal); + + /*! + * @brief This function moves the value in member my_sequence_equal + * @param _my_sequence_equal New value to be moved in member my_sequence_equal + */ + eProsima_user_DllExport void my_sequence_equal( + std::vector&& _my_sequence_equal); + + /*! + * @brief This function returns a constant reference to member my_sequence_equal + * @return Constant reference to member my_sequence_equal + */ + eProsima_user_DllExport const std::vector& my_sequence_equal() const; + + /*! + * @brief This function returns a reference to member my_sequence_equal + * @return Reference to member my_sequence_equal + */ + eProsima_user_DllExport std::vector& my_sequence_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence_equal; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceBadStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceBadStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceBadStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct( + const SequenceBadStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct( + SequenceBadStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct& operator =( + const SequenceBadStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceBadStruct that will be copied. + */ + eProsima_user_DllExport SequenceBadStruct& operator =( + SequenceBadStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceBadStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceBadStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceBadStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceBadStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceBadStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct( + const SequenceBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct( + SequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct& operator =( + const SequenceBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceBoundsStruct& operator =( + SequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence + * @param _my_sequence New value to be copied in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + const std::vector& _my_sequence); + + /*! + * @brief This function moves the value in member my_sequence + * @param _my_sequence New value to be moved in member my_sequence + */ + eProsima_user_DllExport void my_sequence( + std::vector&& _my_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence + * @return Constant reference to member my_sequence + */ + eProsima_user_DllExport const std::vector& my_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence + * @return Reference to member my_sequence + */ + eProsima_user_DllExport std::vector& my_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector m_my_sequence; + +}; + + + + + + + +/*! + * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceSequenceStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceSequenceStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceSequenceStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + const SequenceSequenceStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + const SequenceSequenceStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceSequenceStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceStruct& operator =( + SequenceSequenceStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceSequenceStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceSequenceStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + const std::vector>& _my_sequence_sequence); + + /*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + std::vector>&& _my_sequence_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ + eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ + eProsima_user_DllExport std::vector>& my_sequence_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceSequenceStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector> m_my_sequence_sequence; + +}; + + + + + + + +/*! + * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SequenceSequenceBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct( + const SequenceSequenceBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct( + SequenceSequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( + const SequenceSequenceBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. + */ + eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( + SequenceSequenceBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SequenceSequenceBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SequenceSequenceBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SequenceSequenceBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + const std::vector>& _my_sequence_sequence); + + /*! + * @brief This function moves the value in member my_sequence_sequence + * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence + */ + eProsima_user_DllExport void my_sequence_sequence( + std::vector>&& _my_sequence_sequence); + + /*! + * @brief This function returns a constant reference to member my_sequence_sequence + * @return Constant reference to member my_sequence_sequence + */ + eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; + + /*! + * @brief This function returns a reference to member my_sequence_sequence + * @return Reference to member my_sequence_sequence + */ + eProsima_user_DllExport std::vector>& my_sequence_sequence(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SequenceSequenceBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::vector> m_my_sequence_sequence; + +}; + + + + + +/*! + * @brief This class represents the structure MapStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + const MapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct( + MapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + const MapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapStruct that will be copied. + */ + eProsima_user_DllExport MapStruct& operator =( + MapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class MapStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual( + const MapStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual( + MapStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual& operator =( + const MapStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapStructEqual that will be copied. + */ + eProsima_user_DllExport MapStructEqual& operator =( + MapStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x MapStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_map_equal + * @param _my_map_equal New value to be copied in member my_map_equal + */ + eProsima_user_DllExport void my_map_equal( + const std::map& _my_map_equal); + + /*! + * @brief This function moves the value in member my_map_equal + * @param _my_map_equal New value to be moved in member my_map_equal + */ + eProsima_user_DllExport void my_map_equal( + std::map&& _my_map_equal); + + /*! + * @brief This function returns a constant reference to member my_map_equal + * @return Constant reference to member my_map_equal + */ + eProsima_user_DllExport const std::map& my_map_equal() const; + + /*! + * @brief This function returns a reference to member my_map_equal + * @return Reference to member my_map_equal + */ + eProsima_user_DllExport std::map& my_map_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map_equal; + +}; + + + + + +/*! + * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBadKeyStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBadKeyStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBadKeyStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct( + const MapBadKeyStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct( + MapBadKeyStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct& operator =( + const MapBadKeyStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBadKeyStruct that will be copied. + */ + eProsima_user_DllExport MapBadKeyStruct& operator =( + MapBadKeyStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBadKeyStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBadKeyStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBadKeyStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBadKeyStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBadKeyStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBadElemStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBadElemStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBadElemStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct( + const MapBadElemStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct( + MapBadElemStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct& operator =( + const MapBadElemStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBadElemStruct that will be copied. + */ + eProsima_user_DllExport MapBadElemStruct& operator =( + MapBadElemStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBadElemStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBadElemStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBadElemStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBadElemStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBadElemStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + +/*! + * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct( + const MapBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct( + MapBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct& operator =( + const MapBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapBoundsStruct& operator =( + MapBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_map + * @param _my_map New value to be copied in member my_map + */ + eProsima_user_DllExport void my_map( + const std::map& _my_map); + + /*! + * @brief This function moves the value in member my_map + * @param _my_map New value to be moved in member my_map + */ + eProsima_user_DllExport void my_map( + std::map&& _my_map); + + /*! + * @brief This function returns a constant reference to member my_map + * @return Constant reference to member my_map + */ + eProsima_user_DllExport const std::map& my_map() const; + + /*! + * @brief This function returns a reference to member my_map + * @return Reference to member my_map + */ + eProsima_user_DllExport std::map& my_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map m_my_map; + +}; + + + + + + + +/*! + * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapMapStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapMapStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapMapStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + const MapMapStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct( + MapMapStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + const MapMapStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapMapStruct that will be copied. + */ + eProsima_user_DllExport MapMapStruct& operator =( + MapMapStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapMapStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapMapStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapMapStruct& x) const; + + /*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + const std::map>& _my_map_map); + + /*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + std::map>&& _my_map_map); + + /*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ + eProsima_user_DllExport const std::map>& my_map_map() const; + + /*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ + eProsima_user_DllExport std::map>& my_map_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapMapStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map> m_my_map_map; + +}; + + + + + + + +/*! + * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. + * @ingroup Types + */ +class MapMapBoundsStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MapMapBoundsStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MapMapBoundsStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct( + const MapMapBoundsStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct( + MapMapBoundsStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct& operator =( + const MapMapBoundsStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object MapMapBoundsStruct that will be copied. + */ + eProsima_user_DllExport MapMapBoundsStruct& operator =( + MapMapBoundsStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x MapMapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MapMapBoundsStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x MapMapBoundsStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MapMapBoundsStruct& x) const; + + /*! + * @brief This function copies the value in member my_map_map + * @param _my_map_map New value to be copied in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + const std::map>& _my_map_map); + + /*! + * @brief This function moves the value in member my_map_map + * @param _my_map_map New value to be moved in member my_map_map + */ + eProsima_user_DllExport void my_map_map( + std::map>&& _my_map_map); + + /*! + * @brief This function returns a constant reference to member my_map_map + * @return Constant reference to member my_map_map + */ + eProsima_user_DllExport const std::map>& my_map_map() const; + + /*! + * @brief This function returns a reference to member my_map_map + * @return Reference to member my_map_map + */ + eProsima_user_DllExport std::map>& my_map_map(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const MapMapBoundsStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + std::map> m_my_map_map; + +}; + + + +/*! + * @brief This class represents the union SimpleUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + const SimpleUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion( + SimpleUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + const SimpleUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnion that will be copied. + */ + eProsima_user_DllExport SimpleUnion& operator =( + SimpleUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionNames +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionNames(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionNames(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames( + const SimpleUnionNames& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames( + SimpleUnionNames&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames& operator =( + const SimpleUnionNames& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionNames that will be copied. + */ + eProsima_user_DllExport SimpleUnionNames& operator =( + SimpleUnionNames&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNames object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionNames& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNames object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionNames& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first_case + * @param _first_case New value for member first_case + */ + eProsima_user_DllExport void first_case( + int32_t _first_case); + + /*! + * @brief This function returns the value of member first_case + * @return Value of member first_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first_case() const; + + /*! + * @brief This function returns a reference to member first_case + * @return Reference to member first_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first_case(); + + + /*! + * @brief This function sets a value in member second_case + * @param _second_case New value for member second_case + */ + eProsima_user_DllExport void second_case( + int64_t _second_case); + + /*! + * @brief This function returns the value of member second_case + * @return Value of member second_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second_case() const; + + /*! + * @brief This function returns a reference to member second_case + * @return Reference to member second_case + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second_case(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionNames& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first_case; + int64_t m_second_case; +}; + + + +/*! + * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleTypeUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleTypeUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleTypeUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion( + const SimpleTypeUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion( + SimpleTypeUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion& operator =( + const SimpleTypeUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleTypeUnion that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnion& operator =( + SimpleTypeUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleTypeUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleTypeUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + uint8_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleTypeUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + uint8_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion( + const SimpleBadUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion( + SimpleBadUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion& operator =( + const SimpleBadUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadUnion& operator =( + SimpleBadUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + int32_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport int32_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport int32_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + int32_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadDiscUnion +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadDiscUnion(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadDiscUnion(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion( + const SimpleBadDiscUnion& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion( + SimpleBadDiscUnion&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion& operator =( + const SimpleBadDiscUnion& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadDiscUnion that will be copied. + */ + eProsima_user_DllExport SimpleBadDiscUnion& operator =( + SimpleBadDiscUnion&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadDiscUnion object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadDiscUnion& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadDiscUnion object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadDiscUnion& x) const; + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d); + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const; + + /*! + * @brief This function returns a reference to the discriminator. + * @return Reference to the discriminator. + */ + eProsima_user_DllExport uint8_t& _d(); + + /*! + * @brief This function sets a value in member first + * @param _first New value for member first + */ + eProsima_user_DllExport void first( + int32_t _first); + + /*! + * @brief This function returns the value of member first + * @return Value of member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t first() const; + + /*! + * @brief This function returns a reference to member first + * @return Reference to member first + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& first(); + + + /*! + * @brief This function sets a value in member second + * @param _second New value for member second + */ + eProsima_user_DllExport void second( + int64_t _second); + + /*! + * @brief This function returns the value of member second + * @return Value of member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t second() const; + + /*! + * @brief This function returns a reference to member second + * @return Reference to member second + * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& second(); + + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadDiscUnion& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + +private: + + uint8_t m__d; + + int32_t m_first; + int64_t m_second; +}; + + + +/*! + * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + const SimpleUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + const SimpleUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionStruct& operator =( + SimpleUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionStructEqual +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionStructEqual(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionStructEqual(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual( + const SimpleUnionStructEqual& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual( + SimpleUnionStructEqual&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual& operator =( + const SimpleUnionStructEqual& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionStructEqual that will be copied. + */ + eProsima_user_DllExport SimpleUnionStructEqual& operator =( + SimpleUnionStructEqual&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStructEqual object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionStructEqual& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionStructEqual object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionStructEqual& x) const; + + /*! + * @brief This function copies the value in member my_union_equal + * @param _my_union_equal New value to be copied in member my_union_equal + */ + eProsima_user_DllExport void my_union_equal( + const SimpleUnion& _my_union_equal); + + /*! + * @brief This function moves the value in member my_union_equal + * @param _my_union_equal New value to be moved in member my_union_equal + */ + eProsima_user_DllExport void my_union_equal( + SimpleUnion&& _my_union_equal); + + /*! + * @brief This function returns a constant reference to member my_union_equal + * @return Constant reference to member my_union_equal + */ + eProsima_user_DllExport const SimpleUnion& my_union_equal() const; + + /*! + * @brief This function returns a reference to member my_union_equal + * @return Reference to member my_union_equal + */ + eProsima_user_DllExport SimpleUnion& my_union_equal(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionStructEqual& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnion m_my_union_equal; + +}; + + + +/*! + * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleUnionNamesStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleUnionNamesStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleUnionNamesStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct( + const SimpleUnionNamesStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct( + SimpleUnionNamesStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct& operator =( + const SimpleUnionNamesStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleUnionNamesStruct that will be copied. + */ + eProsima_user_DllExport SimpleUnionNamesStruct& operator =( + SimpleUnionNamesStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleUnionNamesStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleUnionNamesStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleUnionNamesStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleUnionNames& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleUnionNames&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleUnionNames& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleUnionNames& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleUnionNamesStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleUnionNames m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleTypeUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleTypeUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleTypeUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct( + const SimpleTypeUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct( + SimpleTypeUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct& operator =( + const SimpleTypeUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleTypeUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleTypeUnionStruct& operator =( + SimpleTypeUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleTypeUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleTypeUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleTypeUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleTypeUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleTypeUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleTypeUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleTypeUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleTypeUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleTypeUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimpleBadUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimpleBadUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimpleBadUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct( + const SimpleBadUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct( + SimpleBadUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct& operator =( + const SimpleBadUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimpleBadUnionStruct that will be copied. + */ + eProsima_user_DllExport SimpleBadUnionStruct& operator =( + SimpleBadUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimpleBadUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimpleBadUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimpleBadUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleBadUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleBadUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleBadUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleBadUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimpleBadUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleBadUnion m_my_union; + +}; + + + +/*! + * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. + * @ingroup Types + */ +class SimplBadDiscUnionStruct +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct(); + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~SimplBadDiscUnionStruct(); + + /*! + * @brief Copy constructor. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct( + const SimplBadDiscUnionStruct& x); + + /*! + * @brief Move constructor. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct( + SimplBadDiscUnionStruct&& x) noexcept; + + /*! + * @brief Copy assignment. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( + const SimplBadDiscUnionStruct& x); + + /*! + * @brief Move assignment. + * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. + */ + eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( + SimplBadDiscUnionStruct&& x) noexcept; + + /*! + * @brief Comparison operator. + * @param x SimplBadDiscUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator ==( + const SimplBadDiscUnionStruct& x) const; + + /*! + * @brief Comparison operator. + * @param x SimplBadDiscUnionStruct object to compare. + */ + eProsima_user_DllExport bool operator !=( + const SimplBadDiscUnionStruct& x) const; + + /*! + * @brief This function copies the value in member my_union + * @param _my_union New value to be copied in member my_union + */ + eProsima_user_DllExport void my_union( + const SimpleBadDiscUnion& _my_union); + + /*! + * @brief This function moves the value in member my_union + * @param _my_union New value to be moved in member my_union + */ + eProsima_user_DllExport void my_union( + SimpleBadDiscUnion&& _my_union); + + /*! + * @brief This function returns a constant reference to member my_union + * @return Constant reference to member my_union + */ + eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; + + /*! + * @brief This function returns a reference to member my_union + * @return Reference to member my_union + */ + eProsima_user_DllExport SimpleBadDiscUnion& my_union(); + + + /*! + * @brief This function returns the maximum serialized size of an object + * depending on the buffer alignment. + * @param current_alignment Buffer alignment. + * @return Maximum serialized size. + */ + eProsima_user_DllExport static size_t getMaxCdrSerializedSize( + size_t current_alignment = 0); + + /*! + * @brief This function returns the serialized size of a data depending on the buffer alignment. + * @param data Data which is calculated its serialized size. + * @param current_alignment Buffer alignment. + * @return Serialized size. + */ + eProsima_user_DllExport static size_t getCdrSerializedSize( + const SimplBadDiscUnionStruct& data, + size_t current_alignment = 0); + + + + /*! + * @brief This function serializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& cdr) const; + + /*! + * @brief This function deserializes an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr); + + + + + /*! + * @brief This function tells you if the Key has been defined for this type + */ + eProsima_user_DllExport static bool isKeyDefined(); + + /*! + * @brief This function serializes the key members of an object using CDR serialization. + * @param cdr CDR serialization object. + */ + eProsima_user_DllExport void serializeKey( + eprosima::fastcdr::Cdr& cdr) const; + + +private: + + SimpleBadDiscUnion m_my_union; + +}; + + +#endif // _FAST_DDS_GENERATED_TYPES_H_ + + + +#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh index ca04cca3827..cd92641bf91 100755 --- a/utils/scripts/update_generated_code_from_idl.sh +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -27,11 +27,14 @@ files_needing_output_dir=( ) +red='\E[1;31m' yellow='\E[1;33m' textreset='\E[1;0m' -if [[ $(ls update_generated_code_from_idl.sh 2>/dev/null | wc -l) != 1 ]]; then - echo "Please, execute this script from its directory" +current_dir=$(git rev-parse --show-toplevel) + +if [[ ! "$(pwd -P)" -ef "$current_dir" ]]; then + echo -e "${red}This script must be executed in the repository root directory.${textreset}" exit -1 fi @@ -40,8 +43,6 @@ if [[ -z "$(which fastddsgen)" ]]; then exit -1 fi -cd ../.. - readarray -d '' idl_files < <(find . -iname \*.idl -print0) for del in ${files_to_exclude[@]} @@ -75,14 +76,14 @@ for idl_file in "${idl_files[@]}"; do od_entry_split=(${od_entry//\|/ }) for od_entry_split_element in ${od_entry_split[@]:1}; do od_arg="-d ${od_entry_split_element}" - fastddsgen -replace $to_arg $cs_arg $od_arg "$file_from_gen" + fastddsgen -cdr both -replace $to_arg $cs_arg $od_arg "$file_from_gen" done break fi done if $not_processed ; then - fastddsgen -replace $to_arg $cs_arg "$file_from_gen" + fastddsgen -cdr both -replace $to_arg $cs_arg "$file_from_gen" fi if [[ $? != 0 ]]; then @@ -92,6 +93,4 @@ for idl_file in "${idl_files[@]}"; do cd - done -cd utils/scripts - exit $ret_value