Fast RTPS  Version 2.14.5
Fast RTPS
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 namespace fastcdr {
33 class Cdr;
34 } // namespace fastcdr
35 } // namespace eprosima
36 
37 // The types in this file shall be serialized with XCDR encoding version 2
38 namespace eprosima {
39 namespace fastrtps {
40 
41 namespace types {
42 
43 // First 14 bytes of MD5 of the serialized TypeObject using XCDR
44 // version 2 with Little Endian encoding
45 typedef octet EquivalenceHash[14];
46 
52 {
53 public:
54 
59 
64 
70  const TypeObjectHashId& x);
71 
77  TypeObjectHashId&& x);
78 
84  const TypeObjectHashId& x);
85 
91  TypeObjectHashId&& x);
92 
98  void _d(
99  uint8_t __d);
100 
105  uint8_t _d() const;
106 
111  uint8_t& _d();
112 
117  void hash(
118  const EquivalenceHash& _hash);
119 
124  void hash(
125  EquivalenceHash&& _hash);
126 
132  const EquivalenceHash& hash() const;
133 
140 
145  void serialize(
146  eprosima::fastcdr::Cdr& cdr) const;
147 
153  eprosima::fastcdr::Cdr& cdr);
154 
162  size_t current_alignment = 0);
163 
167  static bool isKeyDefined();
168 
174  eprosima::fastcdr::Cdr& cdr) const;
175 
176 private:
177 
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_
This class represents the union TypeObjectHashId defined by the user in the IDL file.
Definition: TypeObjectHashId.h:52
uint8_t _d() const
This function returns the value of the discriminator.
EquivalenceHash & hash()
This function returns a reference to member hash.
void hash(const EquivalenceHash &_hash)
This function copies the value in member hash.
TypeObjectHashId(const TypeObjectHashId &x)
Copy constructor.
void hash(EquivalenceHash &&_hash)
This function moves the value in member hash.
static size_t getKeyMaxCdrSerializedSize(size_t current_alignment=0)
This function returns the maximum serialized size of the Key of an object depending on the buffer ali...
static bool isKeyDefined()
This function tells you if the Key has been defined for this type.
const EquivalenceHash & hash() const
This function returns a constant reference to member hash.
void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
uint8_t & _d()
This function returns a reference to the discriminator.
void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
TypeObjectHashId(TypeObjectHashId &&x)
Move constructor.
TypeObjectHashId & operator=(const TypeObjectHashId &x)
Copy assignment.
void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
void _d(uint8_t __d)
This function sets the discriminator value.
octet EquivalenceHash[14]
Definition: TypeObjectHashId.h:45
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23