TypeObjectHashId.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. /*!
  15. * @file TypeObjectHashId.h
  16. * This header file contains the declaration of the described types in the IDL file.
  17. *
  18. * This file was generated by the tool gen and modified manually.
  19. */
  20. #ifndef _TYPEOBJECTHASHID_H_
  21. #define _TYPEOBJECTHASHID_H_
  22. #include <fastrtps/types/TypesBase.h>
  23. #include <stdint.h>
  24. #include <array>
  25. #include <string>
  26. #include <vector>
  27. namespace eprosima
  28. {
  29. namespace fastcdr
  30. {
  31. class Cdr;
  32. }
  33. }
  34. // The types in this file shall be serialized with XCDR encoding version 2
  35. namespace eprosima {
  36. namespace fastrtps {
  37. namespace types {
  38. // First 14 bytes of MD5 of the serialized TypeObject using XCDR
  39. // version 2 with Little Endian encoding
  40. typedef octet EquivalenceHash[14];
  41. /*!
  42. * @brief This class represents the union TypeObjectHashId defined by the user in the IDL file.
  43. * @ingroup TYPEOBJECTHASHID
  44. */
  45. class TypeObjectHashId
  46. {
  47. public:
  48. /*!
  49. * @brief Default constructor.
  50. */
  51. TypeObjectHashId();
  52. /*!
  53. * @brief Default destructor.
  54. */
  55. ~TypeObjectHashId();
  56. /*!
  57. * @brief Copy constructor.
  58. * @param x Reference to the object TypeObjectHashId that will be copied.
  59. */
  60. TypeObjectHashId(const TypeObjectHashId &x);
  61. /*!
  62. * @brief Move constructor.
  63. * @param x Reference to the object TypeObjectHashId that will be copied.
  64. */
  65. TypeObjectHashId(TypeObjectHashId &&x);
  66. /*!
  67. * @brief Copy assignment.
  68. * @param x Reference to the object TypeObjectHashId that will be copied.
  69. */
  70. TypeObjectHashId& operator=(const TypeObjectHashId &x);
  71. /*!
  72. * @brief Move assignment.
  73. * @param x Reference to the object TypeObjectHashId that will be copied.
  74. */
  75. TypeObjectHashId& operator=(TypeObjectHashId &&x);
  76. /*!
  77. * @brief This function sets the discriminator value.
  78. * @param __d New value for the discriminator.
  79. * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member.
  80. */
  81. void _d(uint8_t __d);
  82. /*!
  83. * @brief This function returns the value of the discriminator.
  84. * @return Value of the discriminator
  85. */
  86. uint8_t _d() const;
  87. /*!
  88. * @brief This function returns a reference to the discriminator.
  89. * @return Reference to the discriminator.
  90. */
  91. uint8_t& _d();
  92. /*!
  93. * @brief This function copies the value in member hash
  94. * @param _hash New value to be copied in member hash
  95. */
  96. void hash(const EquivalenceHash &_hash);
  97. /*!
  98. * @brief This function moves the value in member hash
  99. * @param _hash New value to be moved in member hash
  100. */
  101. void hash(EquivalenceHash &&_hash);
  102. /*!
  103. * @brief This function returns a constant reference to member hash
  104. * @return Constant reference to member hash
  105. * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection.
  106. */
  107. const EquivalenceHash& hash() const;
  108. /*!
  109. * @brief This function returns a reference to member hash
  110. * @return Reference to member hash
  111. * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection.
  112. */
  113. EquivalenceHash& hash();
  114. /*!
  115. * @brief This function returns the serialized size of a data depending on the buffer alignment.
  116. * @param data Data which is calculated its serialized size.
  117. * @param current_alignment Buffer alignment.
  118. * @return Serialized size.
  119. */
  120. static size_t getCdrSerializedSize(const TypeObjectHashId& data, size_t current_alignment = 0);
  121. /*!
  122. * @brief This function serializes an object using CDR serialization.
  123. * @param cdr CDR serialization object.
  124. */
  125. void serialize(eprosima::fastcdr::Cdr &cdr) const;
  126. /*!
  127. * @brief This function deserializes an object using CDR serialization.
  128. * @param cdr CDR serialization object.
  129. */
  130. void deserialize(eprosima::fastcdr::Cdr &cdr);
  131. /*!
  132. * @brief This function returns the maximum serialized size of the Key of an object
  133. * depending on the buffer alignment.
  134. * @param current_alignment Buffer alignment.
  135. * @return Maximum serialized size.
  136. */
  137. static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);
  138. /*!
  139. * @brief This function tells you if the Key has been defined for this type
  140. */
  141. static bool isKeyDefined();
  142. /*!
  143. * @brief This function serializes the key members of an object using CDR serialization.
  144. * @param cdr CDR serialization object.
  145. */
  146. void serializeKey(eprosima::fastcdr::Cdr &cdr) const;
  147. private:
  148. uint8_t m__d;
  149. EquivalenceHash m_hash;
  150. };
  151. } // namespace types
  152. } // namespace fastrtps
  153. } // namespace eprosima
  154. #endif // _TYPEOBJECTHASHID_H_