FastRTPS  Version 2.11.2
FastRTPS
TypeObjectHashId.h
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 
22 #ifndef _TYPEOBJECTHASHID_H_
23 #define _TYPEOBJECTHASHID_H_
24 
25 #include <fastrtps/types/TypesBase.h>
26 #include <stdint.h>
27 #include <array>
28 #include <string>
29 #include <vector>
30 
31 namespace eprosima
32 {
33  namespace fastcdr
34  {
35  class Cdr;
36  }
37 }
38 
39 // The types in this file shall be serialized with XCDR encoding version 2
40 namespace eprosima {
41 namespace fastrtps {
42 
43 namespace types {
44 
45 // First 14 bytes of MD5 of the serialized TypeObject using XCDR
46 // version 2 with Little Endian encoding
47 typedef octet EquivalenceHash[14];
48 
53 {
54 public:
55 
60 
65 
71 
77 
82  TypeObjectHashId& operator=(const TypeObjectHashId &x);
83 
88  TypeObjectHashId& operator=(TypeObjectHashId &&x);
89 
95  void _d(uint8_t __d);
96 
101  uint8_t _d() const;
102 
107  uint8_t& _d();
108 
113  void hash(const EquivalenceHash &_hash);
114 
119  void hash(EquivalenceHash &&_hash);
120 
126  const EquivalenceHash& hash() const;
127 
133  EquivalenceHash& hash();
134 
141  static size_t getCdrSerializedSize(const TypeObjectHashId& data, size_t current_alignment = 0);
142 
143 
148  void serialize(eprosima::fastcdr::Cdr &cdr) const;
149 
154  void deserialize(eprosima::fastcdr::Cdr &cdr);
155 
156 
157 
164  static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);
165 
169  static bool isKeyDefined();
170 
175  void serializeKey(eprosima::fastcdr::Cdr &cdr) const;
176 
177 private:
178  uint8_t m__d;
179 
180  EquivalenceHash m_hash;
181 };
182 
183 } // namespace types
184 } // namespace fastrtps
185 } // namespace eprosima
186 
187 #endif // _TYPEOBJECTHASHID_H_
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
This class represents the union TypeObjectHashId defined by the user in the IDL file.
Definition: TypeObjectHashId.h:52