Skip to content

Commit 397a859

Browse files
committed
more
1 parent 7ab017d commit 397a859

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

rmw_cyclonedds_cpp/src/CDR.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
#ifndef ROS2_MASTER_CDR_HPP
55
#define ROS2_MASTER_CDR_HPP
66

7+
#include <array>
78
#include <cstddef>
89
#include <cstdint>
10+
11+
#include "bytewise.hpp"
912
namespace rmw_cyclonedds_cpp
1013
{
1114
enum class EncodingVersion {

rmw_cyclonedds_cpp/src/Deserialization.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,25 @@
1515

1616
#include "CDR.hpp"
1717
#include "CDRCursor.hpp"
18+
1819
namespace rmw_cyclonedds_cpp
1920
{
2021
class CDRReader : public AbstractCDRReader
2122
{
2223
protected:
24+
std::unique_ptr<StructValueType> m_value_type;
2325
CDREncodingInfo m_cdr;
2426

2527
public:
2628
explicit CDRReader(std::unique_ptr<StructValueType> value_type)
27-
: m_cdr{EncodingVersion::CDR_Legacy}
28-
{
29-
std::ignore = (value_type); //todo
30-
}
29+
: m_cdr{EncodingVersion::CDR_Legacy},
30+
m_value_type{ std::move(value_type)}
31+
{ }
3132

3233
void deserialize_top_level(
33-
void * destination_object, const void * data, const StructValueType * ts);
34+
void * destination_object, const void * data, const StructValueType * ts) {
35+
36+
}
3437

3538
uint32_t read_u32(CDRReadCursor * data_cursor)
3639
{

rmw_cyclonedds_cpp/src/Deserialization.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
#ifndef ROS2_MASTER_DESERIALIZATION_HPP
1515
#define ROS2_MASTER_DESERIALIZATION_HPP
1616

17+
#include "CDR.hpp"
1718
#include "TypeSupport2.hpp"
1819
#include "serdata.hpp"
1920
namespace rmw_cyclonedds_cpp
2021
{
2122

22-
void deserialize_top_level(
23-
void * destination_object, const void * data, const StructValueType * ts);
23+
void deserialize_top_level(void * destination_object, const void * data, const StructValueType * ts) {
24+
EncapsulationHeader enc_hdr; // todo
25+
// todo: create deserialization stream using the encapsulation header (endian, eversion)
26+
// todo: pull data out of that stream, structurally recursing on data and types
27+
}
2428

2529
class AbstractCDRReader
2630
{

0 commit comments

Comments
 (0)