奥特QT DDS 插件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
5.5KB

  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 HelloWorld.hpp
  16. * This header file contains the declaration of the described types in the IDL file.
  17. *
  18. * This file was generated by the tool fastddsgen.
  19. */
  20. #ifndef FAST_DDS_GENERATED__HELLOWORLD_HPP
  21. #define FAST_DDS_GENERATED__HELLOWORLD_HPP
  22. #include <cstdint>
  23. #include <string>
  24. #include <utility>
  25. #include <fastcdr/cdr/fixed_size_string.hpp>
  26. #if defined(_WIN32)
  27. #if defined(EPROSIMA_USER_DLL_EXPORT)
  28. #define eProsima_user_DllExport __declspec( dllexport )
  29. #else
  30. #define eProsima_user_DllExport
  31. #endif // EPROSIMA_USER_DLL_EXPORT
  32. #else
  33. #define eProsima_user_DllExport
  34. #endif // _WIN32
  35. #if defined(_WIN32)
  36. #if defined(EPROSIMA_USER_DLL_EXPORT)
  37. #if defined(HELLOWORLD_SOURCE)
  38. #define HELLOWORLD_DllAPI __declspec( dllexport )
  39. #else
  40. #define HELLOWORLD_DllAPI __declspec( dllimport )
  41. #endif // HELLOWORLD_SOURCE
  42. #else
  43. #define HELLOWORLD_DllAPI
  44. #endif // EPROSIMA_USER_DLL_EXPORT
  45. #else
  46. #define HELLOWORLD_DllAPI
  47. #endif // _WIN32
  48. /*!
  49. * @brief This class represents the structure HelloWorld defined by the user in the IDL file.
  50. * @ingroup HelloWorld
  51. */
  52. class HelloWorld
  53. {
  54. public:
  55. /*!
  56. * @brief Default constructor.
  57. */
  58. eProsima_user_DllExport HelloWorld()
  59. {
  60. }
  61. /*!
  62. * @brief Default destructor.
  63. */
  64. eProsima_user_DllExport ~HelloWorld()
  65. {
  66. }
  67. /*!
  68. * @brief Copy constructor.
  69. * @param x Reference to the object HelloWorld that will be copied.
  70. */
  71. eProsima_user_DllExport HelloWorld(
  72. const HelloWorld& x)
  73. {
  74. m_index = x.m_index;
  75. m_message = x.m_message;
  76. }
  77. /*!
  78. * @brief Move constructor.
  79. * @param x Reference to the object HelloWorld that will be copied.
  80. */
  81. eProsima_user_DllExport HelloWorld(
  82. HelloWorld&& x) noexcept
  83. {
  84. m_index = x.m_index;
  85. m_message = std::move(x.m_message);
  86. }
  87. /*!
  88. * @brief Copy assignment.
  89. * @param x Reference to the object HelloWorld that will be copied.
  90. */
  91. eProsima_user_DllExport HelloWorld& operator =(
  92. const HelloWorld& x)
  93. {
  94. m_index = x.m_index;
  95. m_message = x.m_message;
  96. return *this;
  97. }
  98. /*!
  99. * @brief Move assignment.
  100. * @param x Reference to the object HelloWorld that will be copied.
  101. */
  102. eProsima_user_DllExport HelloWorld& operator =(
  103. HelloWorld&& x) noexcept
  104. {
  105. m_index = x.m_index;
  106. m_message = std::move(x.m_message);
  107. return *this;
  108. }
  109. /*!
  110. * @brief Comparison operator.
  111. * @param x HelloWorld object to compare.
  112. */
  113. eProsima_user_DllExport bool operator ==(
  114. const HelloWorld& x) const
  115. {
  116. return (m_index == x.m_index &&
  117. m_message == x.m_message);
  118. }
  119. /*!
  120. * @brief Comparison operator.
  121. * @param x HelloWorld object to compare.
  122. */
  123. eProsima_user_DllExport bool operator !=(
  124. const HelloWorld& x) const
  125. {
  126. return !(*this == x);
  127. }
  128. /*!
  129. * @brief This function sets a value in member index
  130. * @param _index New value for member index
  131. */
  132. eProsima_user_DllExport void index(
  133. uint32_t _index)
  134. {
  135. m_index = _index;
  136. }
  137. /*!
  138. * @brief This function returns the value of member index
  139. * @return Value of member index
  140. */
  141. eProsima_user_DllExport uint32_t index() const
  142. {
  143. return m_index;
  144. }
  145. /*!
  146. * @brief This function returns a reference to member index
  147. * @return Reference to member index
  148. */
  149. eProsima_user_DllExport uint32_t& index()
  150. {
  151. return m_index;
  152. }
  153. /*!
  154. * @brief This function copies the value in member message
  155. * @param _message New value to be copied in member message
  156. */
  157. eProsima_user_DllExport void message(
  158. const std::string& _message)
  159. {
  160. m_message = _message;
  161. }
  162. /*!
  163. * @brief This function moves the value in member message
  164. * @param _message New value to be moved in member message
  165. */
  166. eProsima_user_DllExport void message(
  167. std::string&& _message)
  168. {
  169. m_message = std::move(_message);
  170. }
  171. /*!
  172. * @brief This function returns a constant reference to member message
  173. * @return Constant reference to member message
  174. */
  175. eProsima_user_DllExport const std::string& message() const
  176. {
  177. return m_message;
  178. }
  179. /*!
  180. * @brief This function returns a reference to member message
  181. * @return Reference to member message
  182. */
  183. eProsima_user_DllExport std::string& message()
  184. {
  185. return m_message;
  186. }
  187. private:
  188. uint32_t m_index{0};
  189. std::string m_message;
  190. };
  191. #endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_