Fast RTPS  Version 2.1.0
Fast RTPS
DynamicPubSubType.h
1 // Copyright 2018 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 #ifndef TYPES_DYNAMIC_PUB_SUB_TYPE_H
16 #define TYPES_DYNAMIC_PUB_SUB_TYPE_H
17 
18 #include <fastrtps/types/TypesBase.h>
19 #include <fastdds/dds/topic/TopicDataType.hpp>
20 #include <fastrtps/types/DynamicTypePtr.h>
21 #include <fastrtps/types/DynamicDataPtr.h>
22 #include <fastrtps/utils/md5.h>
23 
24 namespace eprosima {
25 namespace fastrtps {
26 namespace types {
27 
28 class DynamicPubSubType : public eprosima::fastdds::dds::TopicDataType
29 {
30 protected:
31 
33 
36  unsigned char* m_keyBuffer;
37 
38 public:
39 
40  RTPS_DllAPI DynamicPubSubType();
41 
42  RTPS_DllAPI DynamicPubSubType(
43  DynamicType_ptr pDynamicType);
44 
45  RTPS_DllAPI virtual ~DynamicPubSubType();
46 
47  RTPS_DllAPI void* createData() override;
48 
49  RTPS_DllAPI void deleteData (
50  void * data) override;
51 
52  RTPS_DllAPI bool deserialize (
53  eprosima::fastrtps::rtps::SerializedPayload_t* payload,
54  void* data) override;
55 
56  RTPS_DllAPI bool getKey(
57  void* data,
58  eprosima::fastrtps::rtps::InstanceHandle_t* ihandle,
59  bool force_md5 = false) override;
60 
61  RTPS_DllAPI std::function<uint32_t()> getSerializedSizeProvider(
62  void* data) override;
63 
64  RTPS_DllAPI bool serialize(
65  void* data,
66  eprosima::fastrtps::rtps::SerializedPayload_t* payload) override;
67 
68  RTPS_DllAPI void CleanDynamicType();
69 
70  RTPS_DllAPI DynamicType_ptr GetDynamicType() const;
71 
73  DynamicData_ptr pData);
74 
76  DynamicType_ptr pType);
77 };
78 
79 } // namespace types
80 } // namespace fastrtps
81 } // namespace eprosima
82 
83 #endif // TYPES_DYNAMIC_PUB_SUB_TYPE_H
eprosima::fastrtps::types::DynamicPubSubType::serialize
RTPS_DllAPI bool serialize(void *data, eprosima::fastrtps::rtps::SerializedPayload_t *payload) override
eprosima::fastrtps::types::DynamicData_ptr
Definition: DynamicDataPtr.h:27
eprosima::fastrtps::types::DynamicPubSubType::SetDynamicType
RTPS_DllAPI ReturnCode_t SetDynamicType(DynamicType_ptr pType)
eprosima::fastrtps::types::DynamicPubSubType::GetDynamicType
RTPS_DllAPI DynamicType_ptr GetDynamicType() const
eprosima::fastrtps::types::DynamicPubSubType::m_md5
MD5 m_md5
Definition: DynamicPubSubType.h:35
eprosima::fastrtps::types::DynamicPubSubType::~DynamicPubSubType
virtual RTPS_DllAPI ~DynamicPubSubType()
eprosima::fastrtps::types::DynamicPubSubType::dynamic_type_
DynamicType_ptr dynamic_type_
Definition: DynamicPubSubType.h:34
eprosima::fastrtps::types::DynamicPubSubType::getKey
RTPS_DllAPI bool getKey(void *data, eprosima::fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5=false) override
eprosima::fastrtps::types::DynamicPubSubType::DynamicPubSubType
RTPS_DllAPI DynamicPubSubType()
eprosima::fastrtps::types::DynamicPubSubType
Definition: DynamicPubSubType.h:29
eprosima::fastrtps::types::ReturnCode_t
Definition: TypesBase.h:204
eprosima::fastrtps::types::DynamicPubSubType::getSerializedSizeProvider
RTPS_DllAPI std::function< uint32_t()> getSerializedSizeProvider(void *data) override
eprosima::fastrtps::types::DynamicPubSubType::createData
RTPS_DllAPI void * createData() override
eprosima::fastrtps::types::DynamicPubSubType::UpdateDynamicTypeInfo
void UpdateDynamicTypeInfo()
MD5
Class MD5, for calculating MD5 hashes of strings or byte arrays it is not meant to be fast or secure.
Definition: md5.h:55
eprosima::fastrtps::types::DynamicPubSubType::m_keyBuffer
unsigned char * m_keyBuffer
Definition: DynamicPubSubType.h:36
eprosima::fastrtps::types::DynamicPubSubType::deserialize
RTPS_DllAPI bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t *payload, void *data) override
eprosima::fastrtps::types::DynamicPubSubType::DynamicPubSubType
RTPS_DllAPI DynamicPubSubType(DynamicType_ptr pDynamicType)
eprosima::fastrtps::types::DynamicPubSubType::deleteData
RTPS_DllAPI void deleteData(void *data) override
eprosima::fastrtps::types::DynamicPubSubType::SetDynamicType
RTPS_DllAPI ReturnCode_t SetDynamicType(DynamicData_ptr pData)
eprosima::fastrtps::types::DynamicPubSubType::CleanDynamicType
RTPS_DllAPI void CleanDynamicType()
eprosima::fastrtps::types::DynamicType_ptr
Definition: DynamicTypePtr.h:27
eprosima
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23