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