Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed Apr 8, 2020
1 parent 7ab017d commit 397a859
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions rmw_cyclonedds_cpp/src/CDR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
#ifndef ROS2_MASTER_CDR_HPP
#define ROS2_MASTER_CDR_HPP

#include <array>
#include <cstddef>
#include <cstdint>

#include "bytewise.hpp"
namespace rmw_cyclonedds_cpp
{
enum class EncodingVersion {
Expand Down
13 changes: 8 additions & 5 deletions rmw_cyclonedds_cpp/src/Deserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@

#include "CDR.hpp"
#include "CDRCursor.hpp"

namespace rmw_cyclonedds_cpp
{
class CDRReader : public AbstractCDRReader
{
protected:
std::unique_ptr<StructValueType> m_value_type;
CDREncodingInfo m_cdr;

public:
explicit CDRReader(std::unique_ptr<StructValueType> 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)
{
Expand Down
8 changes: 6 additions & 2 deletions rmw_cyclonedds_cpp/src/Deserialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 397a859

Please sign in to comment.