Topics.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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 Topics.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.
  19. */
  20. #ifndef _TOPICSAMPLE_TOPICS_H_
  21. #define _TOPICSAMPLE_TOPICS_H_
  22. // TODO Poner en el contexto.
  23. #include <stdint.h>
  24. #include <array>
  25. #include <string>
  26. #include <vector>
  27. #include <map>
  28. #include <bitset>
  29. #if defined(_WIN32)
  30. #if defined(EPROSIMA_USER_DLL_EXPORT)
  31. #define eProsima_user_DllExport __declspec( dllexport )
  32. #else
  33. #define eProsima_user_DllExport
  34. #endif
  35. #else
  36. #define eProsima_user_DllExport
  37. #endif
  38. #if defined(_WIN32)
  39. #if defined(EPROSIMA_USER_DLL_EXPORT)
  40. #if defined(Topics_SOURCE)
  41. #define Topics_DllAPI __declspec( dllexport )
  42. #else
  43. #define Topics_DllAPI __declspec( dllimport )
  44. #endif // Topics_SOURCE
  45. #else
  46. #define Topics_DllAPI
  47. #endif
  48. #else
  49. #define Topics_DllAPI
  50. #endif // _WIN32
  51. namespace eprosima
  52. {
  53. namespace fastcdr
  54. {
  55. class Cdr;
  56. }
  57. }
  58. namespace TopicSample
  59. {
  60. typedef std::vector<uint8_t> SomeBytes;
  61. /*!
  62. * @brief This class represents the structure Message defined by the user in the IDL file.
  63. * @ingroup TOPICS
  64. */
  65. class Message
  66. {
  67. public:
  68. /*!
  69. * @brief Default constructor.
  70. */
  71. eProsima_user_DllExport Message();
  72. /*!
  73. * @brief Default destructor.
  74. */
  75. eProsima_user_DllExport ~Message();
  76. /*!
  77. * @brief Copy constructor.
  78. * @param x Reference to the object TopicSample::Message that will be copied.
  79. */
  80. eProsima_user_DllExport Message(const Message &x);
  81. /*!
  82. * @brief Move constructor.
  83. * @param x Reference to the object TopicSample::Message that will be copied.
  84. */
  85. eProsima_user_DllExport Message(Message &&x);
  86. /*!
  87. * @brief Copy assignment.
  88. * @param x Reference to the object TopicSample::Message that will be copied.
  89. */
  90. eProsima_user_DllExport Message& operator=(const Message &x);
  91. /*!
  92. * @brief Move assignment.
  93. * @param x Reference to the object TopicSample::Message that will be copied.
  94. */
  95. eProsima_user_DllExport Message& operator=(Message &&x);
  96. /*!
  97. * @brief This function copies the value in member msgname
  98. * @param _msgname New value to be copied in member msgname
  99. */
  100. eProsima_user_DllExport void msgname(const std::string &_msgname);
  101. /*!
  102. * @brief This function moves the value in member msgname
  103. * @param _msgname New value to be moved in member msgname
  104. */
  105. eProsima_user_DllExport void msgname(std::string &&_msgname);
  106. /*!
  107. * @brief This function returns a constant reference to member msgname
  108. * @return Constant reference to member msgname
  109. */
  110. eProsima_user_DllExport const std::string& msgname() const;
  111. /*!
  112. * @brief This function returns a reference to member msgname
  113. * @return Reference to member msgname
  114. */
  115. eProsima_user_DllExport std::string& msgname();
  116. /*!
  117. * @brief This function sets a value in member counter
  118. * @param _counter New value for member counter
  119. */
  120. eProsima_user_DllExport void counter(int32_t _counter);
  121. /*!
  122. * @brief This function returns the value of member counter
  123. * @return Value of member counter
  124. */
  125. eProsima_user_DllExport int32_t counter() const;
  126. /*!
  127. * @brief This function returns a reference to member counter
  128. * @return Reference to member counter
  129. */
  130. eProsima_user_DllExport int32_t& counter();
  131. /*!
  132. * @brief This function sets a value in member sendtime
  133. * @param _sendtime New value for member sendtime
  134. */
  135. eProsima_user_DllExport void sendtime(int64_t _sendtime);
  136. /*!
  137. * @brief This function returns the value of member sendtime
  138. * @return Value of member sendtime
  139. */
  140. eProsima_user_DllExport int64_t sendtime() const;
  141. /*!
  142. * @brief This function returns a reference to member sendtime
  143. * @return Reference to member sendtime
  144. */
  145. eProsima_user_DllExport int64_t& sendtime();
  146. /*!
  147. * @brief This function copies the value in member xdata
  148. * @param _xdata New value to be copied in member xdata
  149. */
  150. eProsima_user_DllExport void xdata(const TopicSample::SomeBytes &_xdata);
  151. /*!
  152. * @brief This function moves the value in member xdata
  153. * @param _xdata New value to be moved in member xdata
  154. */
  155. eProsima_user_DllExport void xdata(TopicSample::SomeBytes &&_xdata);
  156. /*!
  157. * @brief This function returns a constant reference to member xdata
  158. * @return Constant reference to member xdata
  159. */
  160. eProsima_user_DllExport const TopicSample::SomeBytes& xdata() const;
  161. /*!
  162. * @brief This function returns a reference to member xdata
  163. * @return Reference to member xdata
  164. */
  165. eProsima_user_DllExport TopicSample::SomeBytes& xdata();
  166. /*!
  167. * @brief This function returns the maximum serialized size of an object
  168. * depending on the buffer alignment.
  169. * @param current_alignment Buffer alignment.
  170. * @return Maximum serialized size.
  171. */
  172. eProsima_user_DllExport static size_t getMaxCdrSerializedSize(size_t current_alignment = 0);
  173. /*!
  174. * @brief This function returns the serialized size of a data depending on the buffer alignment.
  175. * @param data Data which is calculated its serialized size.
  176. * @param current_alignment Buffer alignment.
  177. * @return Serialized size.
  178. */
  179. eProsima_user_DllExport static size_t getCdrSerializedSize(const TopicSample::Message& data, size_t current_alignment = 0);
  180. /*!
  181. * @brief This function serializes an object using CDR serialization.
  182. * @param cdr CDR serialization object.
  183. */
  184. eProsima_user_DllExport void serialize(eprosima::fastcdr::Cdr &cdr) const;
  185. /*!
  186. * @brief This function deserializes an object using CDR serialization.
  187. * @param cdr CDR serialization object.
  188. */
  189. eProsima_user_DllExport void deserialize(eprosima::fastcdr::Cdr &cdr);
  190. /*!
  191. * @brief This function returns the maximum serialized size of the Key of an object
  192. * depending on the buffer alignment.
  193. * @param current_alignment Buffer alignment.
  194. * @return Maximum serialized size.
  195. */
  196. eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0);
  197. /*!
  198. * @brief This function tells you if the Key has been defined for this type
  199. */
  200. eProsima_user_DllExport static bool isKeyDefined();
  201. /*!
  202. * @brief This function serializes the key members of an object using CDR serialization.
  203. * @param cdr CDR serialization object.
  204. */
  205. eProsima_user_DllExport void serializeKey(eprosima::fastcdr::Cdr &cdr) const;
  206. private:
  207. std::string m_msgname;
  208. int32_t m_counter;
  209. int64_t m_sendtime;
  210. TopicSample::SomeBytes m_xdata;
  211. };
  212. }
  213. #endif // _TOPICSAMPLE_TOPICS_H_