CARLA
PointPubSubTypes.h
Go to the documentation of this file.
1 // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 /*!
16  * @file PointPubSubTypes.h
17  * This header file contains the declaration of the serialization functions.
18  *
19  * This file was generated by the tool fastcdrgen.
20  */
21 
22 #ifndef _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_
23 #define _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_
24 
25 #include <fastdds/dds/topic/TopicDataType.hpp>
26 #include <fastrtps/utils/md5.h>
27 
28 #include "Point.h"
29 
30 #if !defined(GEN_API_VER) || (GEN_API_VER != 1)
31 #error \
32  Generated Point is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
33 #endif // GEN_API_VER
34 
35 namespace geometry_msgs
36 {
37  namespace msg
38  {
39  #ifndef SWIG
40  namespace detail {
41 
42  template<typename Tag, typename Tag::type M>
43  struct Point_rob
44  {
45  friend constexpr typename Tag::type get(
46  Tag)
47  {
48  return M;
49  }
50  };
51 
52  struct Point_f
53  {
54  typedef double Point::* type;
55  friend constexpr type get(
56  Point_f);
57  };
58 
59  template struct Point_rob<Point_f, &Point::m_z>;
60 
61  template <typename T, typename Tag>
62  inline size_t constexpr Point_offset_of() {
63  return ((::size_t) &reinterpret_cast<char const volatile&>((((T*)0)->*get(Tag()))));
64  }
65  }
66  #endif
67 
68  /*!
69  * @brief This class represents the TopicDataType of the type Point defined by the user in the IDL file.
70  * @ingroup POINT
71  */
72  class PointPubSubType : public eprosima::fastdds::dds::TopicDataType
73  {
74  public:
75 
76  typedef Point type;
77 
79 
80  eProsima_user_DllExport virtual ~PointPubSubType() override;
81 
82  eProsima_user_DllExport virtual bool serialize(
83  void* data,
85 
86  eProsima_user_DllExport virtual bool deserialize(
88  void* data) override;
89 
90  eProsima_user_DllExport virtual std::function<uint32_t()> getSerializedSizeProvider(
91  void* data) override;
92 
93  eProsima_user_DllExport virtual bool getKey(
94  void* data,
96  bool force_md5 = false) override;
97 
98  eProsima_user_DllExport virtual void* createData() override;
99 
100  eProsima_user_DllExport virtual void deleteData(
101  void* data) override;
102 
103  #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
104  eProsima_user_DllExport inline bool is_bounded() const override
105  {
106  return true;
107  }
108 
109  #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
110 
111  #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
112  eProsima_user_DllExport inline bool is_plain() const override
113  {
114  return is_plain_impl();
115  }
116 
117  #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
118 
119  #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
120  eProsima_user_DllExport inline bool construct_sample(
121  void* memory) const override
122  {
123  new (memory) Point();
124  return true;
125  }
126 
127  #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
128 
129  MD5 m_md5;
130  unsigned char* m_keyBuffer;
131 
132  private:
133 
134  static constexpr bool is_plain_impl()
135  {
136  return 24ULL == (detail::Point_offset_of<Point, detail::Point_f>() + sizeof(double));
137 
138  }};
139  }
140 }
141 
142 #endif // _FAST_DDS_GENERATED_GEOMETRY_MSGS_MSG_POINT_PUBSUBTYPES_H_
eprosima::fastrtps::rtps::InstanceHandle_t InstanceHandle_t
static constexpr bool is_plain_impl()
#define eProsima_user_DllExport
Definition: CameraInfo.h:44
eprosima::fastrtps::rtps::SerializedPayload_t SerializedPayload_t
This class represents the TopicDataType of the type Point defined by the user in the IDL file...
size_t constexpr Point_offset_of()
This class represents the structure Point defined by the user in the IDL file.
Definition: Point.h:70