RTC Toolkit  1.0.0
agnostictopicifPubSubTypes.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 
23 #ifndef _RTCTK_AGNOSTICTOPICIF_PUBSUBTYPES_H_
24 #define _RTCTK_AGNOSTICTOPICIF_PUBSUBTYPES_H_
25 
26 #include <fastdds/dds/topic/TopicDataType.hpp>
27 #include <fastrtps/utils/md5.h>
28 
29 #include "agnostictopicif.h"
30 
31 #if !defined(GEN_API_VER) || (GEN_API_VER != 1)
32 #error Generated agnostictopicif is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
33 #endif // GEN_API_VER
34 
35 namespace rtctk
36 {
37  typedef double TimeStamp;
38  typedef std::vector<uint8_t> GenPayLoad;
43  class AgnosticTopicPubSubType : public eprosima::fastdds::dds::TopicDataType
44  {
45  public:
46 
48 
50 
52 
54  void* data,
56 
59  void* data) override;
60 
62  void* data) override;
63 
64  eProsima_user_DllExport virtual bool getKey(
65  void* data,
67  bool force_md5 = false) override;
68 
69  eProsima_user_DllExport virtual void* createData() override;
70 
72  void* data) override;
73 
74  #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
75  eProsima_user_DllExport inline bool is_bounded() const override
76  {
77  return true;
78  }
79 
80  #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
81 
82  #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
83  eProsima_user_DllExport inline bool is_plain() const override
84  {
85  return false;
86  }
87 
88  #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
89 
90  #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
91  eProsima_user_DllExport inline bool construct_sample(
92  void* memory) const override
93  {
94  (void)memory;
95  return false;
96  }
97 
98  #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
99 
100  MD5 m_md5;
101  unsigned char* m_keyBuffer;
102  };
103 }
104 
105 #endif // _RTCTK_AGNOSTICTOPICIF_PUBSUBTYPES_H_
rtctk::AgnosticTopicPubSubType::serialize
virtual eProsima_user_DllExport bool serialize(void *data, eprosima::fastrtps::rtps::SerializedPayload_t *payload) override
Definition: agnostictopicifPubSubTypes.cpp:55
rtctk::AgnosticTopicPubSubType::~AgnosticTopicPubSubType
virtual eProsima_user_DllExport ~AgnosticTopicPubSubType()
Definition: agnostictopicifPubSubTypes.cpp:47
rtctk::AgnosticTopicPubSubType::m_keyBuffer
unsigned char * m_keyBuffer
Definition: agnostictopicifPubSubTypes.h:101
rtctk::AgnosticTopicPubSubType::deserialize
virtual eProsima_user_DllExport bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t *payload, void *data) override
Definition: agnostictopicifPubSubTypes.cpp:84
agnostictopicif.h
rtctk::GenPayLoad
std::vector< uint8_t > GenPayLoad
Definition: agnostictopicif.h:66
rtctk::AgnosticTopicPubSubType::m_md5
MD5 m_md5
Definition: agnostictopicifPubSubTypes.h:100
SerializedPayload_t
eprosima::fastrtps::rtps::SerializedPayload_t SerializedPayload_t
Definition: agnostictopicifPubSubTypes.cpp:28
rtctk::AgnosticTopicPubSubType
This class represents the TopicDataType of the type AgnosticTopic defined by the user in the IDL file...
Definition: agnostictopicifPubSubTypes.h:44
rtctk::AgnosticTopicPubSubType::getKey
virtual eProsima_user_DllExport bool getKey(void *data, eprosima::fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5=false) override
Definition: agnostictopicifPubSubTypes.cpp:135
rtctk::AgnosticTopicPubSubType::createData
virtual eProsima_user_DllExport void * createData() override
Definition: agnostictopicifPubSubTypes.cpp:124
rtctk::AgnosticTopicPubSubType::type
AgnosticTopic type
Definition: agnostictopicifPubSubTypes.h:47
rtctk::TimeStamp
double TimeStamp
Definition: agnostictopicif.h:65
rtctk::AgnosticTopic
This class represents the structure AgnosticTopic defined by the user in the IDL file.
Definition: agnostictopicif.h:72
rtctk::AgnosticTopicPubSubType::AgnosticTopicPubSubType
eProsima_user_DllExport AgnosticTopicPubSubType()
Definition: agnostictopicifPubSubTypes.cpp:34
eProsima_user_DllExport
#define eProsima_user_DllExport
Definition: agnostictopicif.h:40
rtctk::AgnosticTopicPubSubType::deleteData
virtual eProsima_user_DllExport void deleteData(void *data) override
Definition: agnostictopicifPubSubTypes.cpp:129
mudpi::uint32_t
unsigned int uint32_t
Definition: mudpi.h:16
rtctk::AgnosticTopicPubSubType::getSerializedSizeProvider
virtual eProsima_user_DllExport std::function< uint32_t()> getSerializedSizeProvider(void *data) override
Definition: agnostictopicifPubSubTypes.cpp:114
InstanceHandle_t
eprosima::fastrtps::rtps::InstanceHandle_t InstanceHandle_t
Definition: agnostictopicifPubSubTypes.cpp:29
rtctk
Definition: agnostictopicifPubSubTypes.cpp:31