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 
83 
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 
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::fastrtps::types::TypeObjectHashId::hash
const EquivalenceHash & hash() const
This function returns a constant reference to member hash.
eprosima::fastrtps::types::TypeObjectHashId
This class represents the union TypeObjectHashId defined by the user in the IDL file.
Definition: TypeObjectHashId.h:52
eprosima::fastrtps::types::TypeObjectHashId::TypeObjectHashId
TypeObjectHashId()
Default constructor.
eprosima::fastrtps::types::TypeObjectHashId::deserialize
void deserialize(eprosima::fastcdr::Cdr &cdr)
This function deserializes an object using CDR serialization.
eprosima::fastrtps::types::TypeObjectHashId::isKeyDefined
static bool isKeyDefined()
This function tells you if the Key has been defined for this type.
eprosima::fastrtps::types::TypeObjectHashId::serialize
void serialize(eprosima::fastcdr::Cdr &cdr) const
This function serializes an object using CDR serialization.
eprosima::fastrtps::types::TypeObjectHashId::_d
uint8_t _d() const
This function returns the value of the discriminator.
eprosima::fastrtps::types::TypeObjectHashId::getKeyMaxCdrSerializedSize
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...
eprosima::fastrtps::types::TypeObjectHashId::serializeKey
void serializeKey(eprosima::fastcdr::Cdr &cdr) const
This function serializes the key members of an object using CDR serialization.
eprosima::fastrtps::types::TypeObjectHashId::operator=
TypeObjectHashId & operator=(const TypeObjectHashId &x)
Copy assignment.
eprosima::fastrtps::types::TypeObjectHashId::~TypeObjectHashId
~TypeObjectHashId()
Default destructor.
eprosima
Definition: LibrarySettingsAttributes.h:23
eprosima::fastrtps::types::TypeObjectHashId::getCdrSerializedSize
static size_t getCdrSerializedSize(const TypeObjectHashId &data, size_t current_alignment=0)
This function returns the serialized size of a data depending on the buffer alignment.
eprosima::fastrtps::types::EquivalenceHash
octet EquivalenceHash[14]
Definition: TypeObjectHashId.h:47