549 lines
20 KiB
C++
549 lines
20 KiB
C++
/****************************************************************
|
|
|
|
Generated by Eclipse Cyclone DDS IDL to CXX Translator
|
|
File name: /data/jenkins/workspace/workspace/ddkit_release_v3-9-x/cnn_l_0/.conan/data/ddkit/3.9.0/jenkins/stable/build/98937235a8ae97010a6498036572bf0d26e6de10/src/ddkit/idls/TestTopic.idl
|
|
Source: TestTopic.hpp
|
|
Cyclone DDS: v0.11.0
|
|
|
|
*****************************************************************/
|
|
#ifndef DDSCXX_TESTTOPIC_HPP_5D6BACE0D1D9ADC0287C638316554B9B
|
|
#define DDSCXX_TESTTOPIC_HPP_5D6BACE0D1D9ADC0287C638316554B9B
|
|
|
|
#include <utility>
|
|
#include <ostream>
|
|
#include <cstdint>
|
|
|
|
namespace ddkit_intern
|
|
{
|
|
class TestTopic
|
|
{
|
|
private:
|
|
int32_t id_ = 0;
|
|
int32_t val_ = 0;
|
|
|
|
public:
|
|
TestTopic() = default;
|
|
|
|
explicit TestTopic(
|
|
int32_t id,
|
|
int32_t val) :
|
|
id_(id),
|
|
val_(val) { }
|
|
|
|
int32_t id() const { return this->id_; }
|
|
int32_t& id() { return this->id_; }
|
|
void id(int32_t _val_) { this->id_ = _val_; }
|
|
int32_t val() const { return this->val_; }
|
|
int32_t& val() { return this->val_; }
|
|
void val(int32_t _val_) { this->val_ = _val_; }
|
|
|
|
bool operator==(const TestTopic& _other) const
|
|
{
|
|
(void) _other;
|
|
return id_ == _other.id_ &&
|
|
val_ == _other.val_;
|
|
}
|
|
|
|
bool operator!=(const TestTopic& _other) const
|
|
{
|
|
return !(*this == _other);
|
|
}
|
|
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, TestTopic const& rhs);
|
|
|
|
class TestTopic2
|
|
{
|
|
private:
|
|
int32_t id_ = 0;
|
|
int32_t val_ = 0;
|
|
|
|
public:
|
|
TestTopic2() = default;
|
|
|
|
explicit TestTopic2(
|
|
int32_t id,
|
|
int32_t val) :
|
|
id_(id),
|
|
val_(val) { }
|
|
|
|
int32_t id() const { return this->id_; }
|
|
int32_t& id() { return this->id_; }
|
|
void id(int32_t _val_) { this->id_ = _val_; }
|
|
int32_t val() const { return this->val_; }
|
|
int32_t& val() { return this->val_; }
|
|
void val(int32_t _val_) { this->val_ = _val_; }
|
|
|
|
bool operator==(const TestTopic2& _other) const
|
|
{
|
|
(void) _other;
|
|
return id_ == _other.id_ &&
|
|
val_ == _other.val_;
|
|
}
|
|
|
|
bool operator!=(const TestTopic2& _other) const
|
|
{
|
|
return !(*this == _other);
|
|
}
|
|
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, TestTopic2 const& rhs);
|
|
|
|
} //namespace ddkit_intern
|
|
|
|
#include "dds/topic/TopicTraits.hpp"
|
|
#include "org/eclipse/cyclonedds/topic/datatopic.hpp"
|
|
|
|
namespace org {
|
|
namespace eclipse {
|
|
namespace cyclonedds {
|
|
namespace topic {
|
|
|
|
template <> constexpr const char* TopicTraits<::ddkit_intern::TestTopic>::getTypeName()
|
|
{
|
|
return "ddkit_intern::TestTopic";
|
|
}
|
|
|
|
#ifdef DDSCXX_HAS_TYPELIB
|
|
template<> constexpr unsigned int TopicTraits<::ddkit_intern::TestTopic>::type_map_blob_sz() { return 242; }
|
|
template<> constexpr unsigned int TopicTraits<::ddkit_intern::TestTopic>::type_info_blob_sz() { return 100; }
|
|
template<> inline const uint8_t * TopicTraits<::ddkit_intern::TestTopic>::type_map_blob() {
|
|
alignas(4) static const uint8_t blob[] = {
|
|
0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b,
|
|
0x65, 0x3d, 0x6a, 0xef, 0x9a, 0xac, 0x32, 0x00, 0x33, 0x00, 0x00, 0x00, 0xf1, 0x51, 0x01, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
|
0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x04, 0xb8, 0x0b, 0xb7, 0x74, 0x00,
|
|
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x3a, 0x6d, 0x02, 0x84, 0x00,
|
|
0x76, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xd7, 0xaf, 0xad, 0x2b, 0xe3, 0xe9, 0xf7,
|
|
0x20, 0xd5, 0xec, 0x5e, 0xad, 0xb6, 0x6d, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xf2, 0x51, 0x01, 0x00,
|
|
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x64, 0x64, 0x6b, 0x69,
|
|
0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x3a, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x54, 0x6f,
|
|
0x70, 0x69, 0x63, 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x69, 0x64, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00,
|
|
0x04, 0x00, 0x00, 0x00, 0x76, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0xf2, 0xd7, 0xaf, 0xad, 0x2b, 0xe3, 0xe9, 0xf7, 0x20, 0xd5, 0xec, 0x5e,
|
|
0xad, 0xb6, 0x6d, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b, 0x65, 0x3d, 0x6a, 0xef, 0x9a,
|
|
0xac, 0x32, };
|
|
return blob;
|
|
}
|
|
template<> inline const uint8_t * TopicTraits<::ddkit_intern::TestTopic>::type_info_blob() {
|
|
alignas(4) static const uint8_t blob[] = {
|
|
0x60, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
|
0x14, 0x00, 0x00, 0x00, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b, 0x65, 0x3d, 0x6a, 0xef,
|
|
0x9a, 0xac, 0x32, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
|
0x14, 0x00, 0x00, 0x00, 0xf2, 0xd7, 0xaf, 0xad, 0x2b, 0xe3, 0xe9, 0xf7, 0x20, 0xd5, 0xec, 0x5e,
|
|
0xad, 0xb6, 0x6d, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, };
|
|
return blob;
|
|
}
|
|
#endif //DDSCXX_HAS_TYPELIB
|
|
|
|
template <> constexpr const char* TopicTraits<::ddkit_intern::TestTopic2>::getTypeName()
|
|
{
|
|
return "ddkit_intern::TestTopic2";
|
|
}
|
|
|
|
#ifdef DDSCXX_HAS_TYPELIB
|
|
template<> constexpr unsigned int TopicTraits<::ddkit_intern::TestTopic2>::type_map_blob_sz() { return 246; }
|
|
template<> constexpr unsigned int TopicTraits<::ddkit_intern::TestTopic2>::type_info_blob_sz() { return 100; }
|
|
template<> inline const uint8_t * TopicTraits<::ddkit_intern::TestTopic2>::type_map_blob() {
|
|
alignas(4) static const uint8_t blob[] = {
|
|
0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b,
|
|
0x65, 0x3d, 0x6a, 0xef, 0x9a, 0xac, 0x32, 0x00, 0x33, 0x00, 0x00, 0x00, 0xf1, 0x51, 0x01, 0x00,
|
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
|
0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x04, 0xb8, 0x0b, 0xb7, 0x74, 0x00,
|
|
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x3a, 0x6d, 0x02, 0x84, 0x00,
|
|
0x7a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xce, 0x3c, 0x46, 0x72, 0x20, 0xd5, 0x19,
|
|
0x8d, 0x0a, 0x7c, 0x19, 0x4d, 0xa2, 0xc7, 0x00, 0x62, 0x00, 0x00, 0x00, 0xf2, 0x51, 0x01, 0x00,
|
|
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x64, 0x64, 0x6b, 0x69,
|
|
0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x3a, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x54, 0x6f,
|
|
0x70, 0x69, 0x63, 0x32, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
|
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x04, 0x00, 0x03, 0x00, 0x00, 0x00,
|
|
0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
|
0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x76, 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf2, 0xce, 0x3c, 0x46, 0x72, 0x20, 0xd5, 0x19,
|
|
0x8d, 0x0a, 0x7c, 0x19, 0x4d, 0xa2, 0xc7, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b, 0x65,
|
|
0x3d, 0x6a, 0xef, 0x9a, 0xac, 0x32, };
|
|
return blob;
|
|
}
|
|
template<> inline const uint8_t * TopicTraits<::ddkit_intern::TestTopic2>::type_info_blob() {
|
|
alignas(4) static const uint8_t blob[] = {
|
|
0x60, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
|
0x14, 0x00, 0x00, 0x00, 0xf1, 0x16, 0xdb, 0x53, 0x06, 0x8c, 0x26, 0x7b, 0x65, 0x3d, 0x6a, 0xef,
|
|
0x9a, 0xac, 0x32, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x40, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
|
0x14, 0x00, 0x00, 0x00, 0xf2, 0xce, 0x3c, 0x46, 0x72, 0x20, 0xd5, 0x19, 0x8d, 0x0a, 0x7c, 0x19,
|
|
0x4d, 0xa2, 0xc7, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, };
|
|
return blob;
|
|
}
|
|
#endif //DDSCXX_HAS_TYPELIB
|
|
|
|
} //namespace topic
|
|
} //namespace cyclonedds
|
|
} //namespace eclipse
|
|
} //namespace org
|
|
|
|
namespace dds {
|
|
namespace topic {
|
|
|
|
template <>
|
|
struct topic_type_name<::ddkit_intern::TestTopic>
|
|
{
|
|
static std::string value()
|
|
{
|
|
return org::eclipse::cyclonedds::topic::TopicTraits<::ddkit_intern::TestTopic>::getTypeName();
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct topic_type_name<::ddkit_intern::TestTopic2>
|
|
{
|
|
static std::string value()
|
|
{
|
|
return org::eclipse::cyclonedds::topic::TopicTraits<::ddkit_intern::TestTopic2>::getTypeName();
|
|
}
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
REGISTER_TOPIC_TYPE(::ddkit_intern::TestTopic)
|
|
REGISTER_TOPIC_TYPE(::ddkit_intern::TestTopic2)
|
|
|
|
namespace org{
|
|
namespace eclipse{
|
|
namespace cyclonedds{
|
|
namespace core{
|
|
namespace cdr{
|
|
|
|
template<>
|
|
const propvec &get_type_props<::ddkit_intern::TestTopic>();
|
|
|
|
namespace {
|
|
static const volatile propvec &properties___ddkit_intern__TestTopic = get_type_props<::ddkit_intern::TestTopic>();
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool write(T& streamer, const ::ddkit_intern::TestTopic& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool write(S& str, const ::ddkit_intern::TestTopic& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic>();
|
|
str.set_mode(cdr_stream::stream_mode::write, key);
|
|
return write(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool read(T& streamer, ::ddkit_intern::TestTopic& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool read(S& str, ::ddkit_intern::TestTopic& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic>();
|
|
str.set_mode(cdr_stream::stream_mode::read, key);
|
|
return read(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool move(T& streamer, const ::ddkit_intern::TestTopic& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool move(S& str, const ::ddkit_intern::TestTopic& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic>();
|
|
str.set_mode(cdr_stream::stream_mode::move, key);
|
|
return move(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool max(T& streamer, const ::ddkit_intern::TestTopic& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool max(S& str, const ::ddkit_intern::TestTopic& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic>();
|
|
str.set_mode(cdr_stream::stream_mode::max, key);
|
|
return max(str, instance, props.data());
|
|
}
|
|
|
|
template<>
|
|
const propvec &get_type_props<::ddkit_intern::TestTopic2>();
|
|
|
|
namespace {
|
|
static const volatile propvec &properties___ddkit_intern__TestTopic2 = get_type_props<::ddkit_intern::TestTopic2>();
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool write(T& streamer, const ::ddkit_intern::TestTopic2& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!write(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool write(S& str, const ::ddkit_intern::TestTopic2& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic2>();
|
|
str.set_mode(cdr_stream::stream_mode::write, key);
|
|
return write(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool read(T& streamer, ::ddkit_intern::TestTopic2& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!read(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool read(S& str, ::ddkit_intern::TestTopic2& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic2>();
|
|
str.set_mode(cdr_stream::stream_mode::read, key);
|
|
return read(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool move(T& streamer, const ::ddkit_intern::TestTopic2& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!move(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool move(S& str, const ::ddkit_intern::TestTopic2& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic2>();
|
|
str.set_mode(cdr_stream::stream_mode::move, key);
|
|
return move(str, instance, props.data());
|
|
}
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<cdr_stream, T>::value, bool> = true >
|
|
bool max(T& streamer, const ::ddkit_intern::TestTopic2& instance, const entity_properties_t *props) {
|
|
(void)instance;
|
|
member_id_set member_ids;
|
|
if (!streamer.start_struct(*props))
|
|
return false;
|
|
auto prop = streamer.first_entity(props);
|
|
while (prop) {
|
|
switch (prop->m_id) {
|
|
case 0:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.id()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
case 1:
|
|
if (!streamer.start_member(*prop))
|
|
return false;
|
|
if (!max(streamer, instance.val()))
|
|
return false;
|
|
if (!streamer.finish_member(*prop, member_ids))
|
|
return false;
|
|
break;
|
|
}
|
|
prop = streamer.next_entity(prop);
|
|
}
|
|
return streamer.finish_struct(*props, member_ids);
|
|
}
|
|
|
|
template<typename S, std::enable_if_t<std::is_base_of<cdr_stream, S>::value, bool> = true >
|
|
bool max(S& str, const ::ddkit_intern::TestTopic2& instance, key_mode key) {
|
|
const auto &props = get_type_props<::ddkit_intern::TestTopic2>();
|
|
str.set_mode(cdr_stream::stream_mode::max, key);
|
|
return max(str, instance, props.data());
|
|
}
|
|
|
|
} //namespace cdr
|
|
} //namespace core
|
|
} //namespace cyclonedds
|
|
} //namespace eclipse
|
|
} //namespace org
|
|
|
|
#endif // DDSCXX_TESTTOPIC_HPP_5D6BACE0D1D9ADC0287C638316554B9B
|