From 397a8597cb8f083cc709179f9f1b06350f26bc51 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Wed, 8 Apr 2020 17:10:58 -0500 Subject: [PATCH] more --- rmw_cyclonedds_cpp/src/CDR.hpp | 3 +++ rmw_cyclonedds_cpp/src/Deserialization.cpp | 13 ++++++++----- rmw_cyclonedds_cpp/src/Deserialization.hpp | 8 ++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/rmw_cyclonedds_cpp/src/CDR.hpp b/rmw_cyclonedds_cpp/src/CDR.hpp index 92a5612d..bea4342b 100644 --- a/rmw_cyclonedds_cpp/src/CDR.hpp +++ b/rmw_cyclonedds_cpp/src/CDR.hpp @@ -4,8 +4,11 @@ #ifndef ROS2_MASTER_CDR_HPP #define ROS2_MASTER_CDR_HPP +#include #include #include + +#include "bytewise.hpp" namespace rmw_cyclonedds_cpp { enum class EncodingVersion { diff --git a/rmw_cyclonedds_cpp/src/Deserialization.cpp b/rmw_cyclonedds_cpp/src/Deserialization.cpp index 1c76a09a..796c09c8 100644 --- a/rmw_cyclonedds_cpp/src/Deserialization.cpp +++ b/rmw_cyclonedds_cpp/src/Deserialization.cpp @@ -15,22 +15,25 @@ #include "CDR.hpp" #include "CDRCursor.hpp" + namespace rmw_cyclonedds_cpp { class CDRReader : public AbstractCDRReader { protected: + std::unique_ptr m_value_type; CDREncodingInfo m_cdr; public: explicit CDRReader(std::unique_ptr value_type) - : m_cdr{EncodingVersion::CDR_Legacy} - { - std::ignore = (value_type); //todo - } + : m_cdr{EncodingVersion::CDR_Legacy}, + m_value_type{ std::move(value_type)} + { } void deserialize_top_level( - void * destination_object, const void * data, const StructValueType * ts); + void * destination_object, const void * data, const StructValueType * ts) { + + } uint32_t read_u32(CDRReadCursor * data_cursor) { diff --git a/rmw_cyclonedds_cpp/src/Deserialization.hpp b/rmw_cyclonedds_cpp/src/Deserialization.hpp index 753a0ae3..10f60cef 100644 --- a/rmw_cyclonedds_cpp/src/Deserialization.hpp +++ b/rmw_cyclonedds_cpp/src/Deserialization.hpp @@ -14,13 +14,17 @@ #ifndef ROS2_MASTER_DESERIALIZATION_HPP #define ROS2_MASTER_DESERIALIZATION_HPP +#include "CDR.hpp" #include "TypeSupport2.hpp" #include "serdata.hpp" namespace rmw_cyclonedds_cpp { -void deserialize_top_level( - void * destination_object, const void * data, const StructValueType * ts); +void deserialize_top_level(void * destination_object, const void * data, const StructValueType * ts) { + EncapsulationHeader enc_hdr; // todo + // todo: create deserialization stream using the encapsulation header (endian, eversion) + // todo: pull data out of that stream, structurally recursing on data and types +} class AbstractCDRReader {