Fast RTPS  Version 2.11.2
Fast RTPS
Loading...
Searching...
No Matches
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
24namespace eprosima {
25namespace fastrtps {
26namespace types {
27
28class DynamicPubSubType : public eprosima::fastdds::dds::TopicDataType
29{
30protected:
31
33
36 unsigned char* m_keyBuffer;
37
38public:
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
Class MD5, for calculating MD5 hashes of strings or byte arrays it is not meant to be fast or secure.
Definition md5.h:55
Definition DynamicDataPtr.h:27
Definition DynamicPubSubType.h:29
RTPS_DllAPI DynamicPubSubType(DynamicType_ptr pDynamicType)
RTPS_DllAPI void deleteData(void *data) override
RTPS_DllAPI bool serialize(void *data, eprosima::fastrtps::rtps::SerializedPayload_t *payload) override
DynamicType_ptr dynamic_type_
Definition DynamicPubSubType.h:34
RTPS_DllAPI DynamicType_ptr GetDynamicType() const
RTPS_DllAPI ReturnCode_t SetDynamicType(DynamicData_ptr pData)
RTPS_DllAPI bool deserialize(eprosima::fastrtps::rtps::SerializedPayload_t *payload, void *data) override
RTPS_DllAPI bool getKey(void *data, eprosima::fastrtps::rtps::InstanceHandle_t *ihandle, bool force_md5=false) override
RTPS_DllAPI void * createData() override
RTPS_DllAPI std::function< uint32_t()> getSerializedSizeProvider(void *data) override
RTPS_DllAPI ReturnCode_t SetDynamicType(DynamicType_ptr pType)
MD5 m_md5
Definition DynamicPubSubType.h:35
unsigned char * m_keyBuffer
Definition DynamicPubSubType.h:36
Definition DynamicTypePtr.h:27
This class represents the enumeration ReturnCode_t.
Definition TypesBase.h:189
eProsima namespace.
Definition LibrarySettingsAttributes.h:23