16
16
* @file HelloWorld.cpp
17
17
* This source file contains the definition of the described types in the IDL file.
18
18
*
19
- * This file was generated by the tool gen .
19
+ * This file was generated by the tool fastddsgen (version: 2.5.3) .
20
20
*/
21
21
22
22
#ifdef _WIN32
23
23
// Remove linker warning LNK4221 on Visual Studio
24
- namespace { char dummy; }
25
- #endif
24
+ namespace {
25
+ char dummy;
26
+ } // namespace
27
+ #endif // _WIN32
26
28
27
29
#include " HelloWorld.h"
28
30
#include < fastcdr/Cdr.h>
@@ -32,11 +34,14 @@ using namespace eprosima::fastcdr::exception;
32
34
33
35
#include < utility>
34
36
37
+ #define HelloWorld_max_cdr_typesize 264ULL ;
38
+ #define HelloWorld_max_key_cdr_typesize 0ULL ;
39
+
35
40
HelloWorld::HelloWorld ()
36
41
{
37
- // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@e720b71
42
+ // unsigned long m_index
38
43
m_index = 0 ;
39
- // m_message com.eprosima.idl.parser.typecode.StringTypeCode@74ad1f1f
44
+ // string m_message
40
45
m_message =" " ;
41
46
42
47
}
@@ -47,19 +52,22 @@ HelloWorld::~HelloWorld()
47
52
48
53
}
49
54
50
- HelloWorld::HelloWorld (const HelloWorld &x)
55
+ HelloWorld::HelloWorld (
56
+ const HelloWorld& x)
51
57
{
52
58
m_index = x.m_index ;
53
59
m_message = x.m_message ;
54
60
}
55
61
56
- HelloWorld::HelloWorld (HelloWorld &&x)
62
+ HelloWorld::HelloWorld (
63
+ HelloWorld&& x) noexcept
57
64
{
58
65
m_index = x.m_index ;
59
66
m_message = std::move (x.m_message );
60
67
}
61
68
62
- HelloWorld& HelloWorld::operator =(const HelloWorld &x)
69
+ HelloWorld& HelloWorld::operator =(
70
+ const HelloWorld& x)
63
71
{
64
72
65
73
m_index = x.m_index ;
@@ -68,7 +76,8 @@ HelloWorld& HelloWorld::operator=(const HelloWorld &x)
68
76
return *this ;
69
77
}
70
78
71
- HelloWorld& HelloWorld::operator =(HelloWorld &&x)
79
+ HelloWorld& HelloWorld::operator =(
80
+ HelloWorld&& x) noexcept
72
81
{
73
82
74
83
m_index = x.m_index ;
@@ -77,21 +86,29 @@ HelloWorld& HelloWorld::operator=(HelloWorld &&x)
77
86
return *this ;
78
87
}
79
88
80
- size_t HelloWorld::getMaxCdrSerializedSize (size_t current_alignment)
89
+ bool HelloWorld::operator ==(
90
+ const HelloWorld& x) const
81
91
{
82
- size_t initial_alignment = current_alignment;
83
-
84
-
85
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment (current_alignment, 4 );
86
92
93
+ return (m_index == x.m_index && m_message == x.m_message );
94
+ }
87
95
88
- current_alignment += 4 + eprosima::fastcdr::Cdr::alignment (current_alignment, 4 ) + 255 + 1 ;
89
-
96
+ bool HelloWorld::operator !=(
97
+ const HelloWorld& x) const
98
+ {
99
+ return !(*this == x);
100
+ }
90
101
91
- return current_alignment - initial_alignment;
102
+ size_t HelloWorld::getMaxCdrSerializedSize (
103
+ size_t current_alignment)
104
+ {
105
+ static_cast <void >(current_alignment);
106
+ return HelloWorld_max_cdr_typesize;
92
107
}
93
108
94
- size_t HelloWorld::getCdrSerializedSize (const HelloWorld& data, size_t current_alignment)
109
+ size_t HelloWorld::getCdrSerializedSize (
110
+ const HelloWorld& data,
111
+ size_t current_alignment)
95
112
{
96
113
(void )data;
97
114
size_t initial_alignment = current_alignment;
@@ -106,14 +123,17 @@ size_t HelloWorld::getCdrSerializedSize(const HelloWorld& data, size_t current_a
106
123
return current_alignment - initial_alignment;
107
124
}
108
125
109
- void HelloWorld::serialize (eprosima::fastcdr::Cdr &scdr) const
126
+ void HelloWorld::serialize (
127
+ eprosima::fastcdr::Cdr& scdr) const
110
128
{
111
129
112
130
scdr << m_index;
113
- scdr << m_message;
131
+ scdr << m_message.c_str ();
132
+
114
133
}
115
134
116
- void HelloWorld::deserialize (eprosima::fastcdr::Cdr &dcdr)
135
+ void HelloWorld::deserialize (
136
+ eprosima::fastcdr::Cdr& dcdr)
117
137
{
118
138
119
139
dcdr >> m_index;
@@ -124,9 +144,10 @@ void HelloWorld::deserialize(eprosima::fastcdr::Cdr &dcdr)
124
144
* @brief This function sets a value in member index
125
145
* @param _index New value for member index
126
146
*/
127
- void HelloWorld::index (uint32_t _index)
147
+ void HelloWorld::index (
148
+ uint32_t _index)
128
149
{
129
- m_index = _index;
150
+ m_index = _index;
130
151
}
131
152
132
153
/* !
@@ -151,18 +172,20 @@ uint32_t& HelloWorld::index()
151
172
* @brief This function copies the value in member message
152
173
* @param _message New value to be copied in member message
153
174
*/
154
- void HelloWorld::message (const std::string &_message)
175
+ void HelloWorld::message (
176
+ const std::string& _message)
155
177
{
156
- m_message = _message;
178
+ m_message = _message;
157
179
}
158
180
159
181
/* !
160
182
* @brief This function moves the value in member message
161
183
* @param _message New value to be moved in member message
162
184
*/
163
- void HelloWorld::message (std::string &&_message)
185
+ void HelloWorld::message (
186
+ std::string&& _message)
164
187
{
165
- m_message = std::move (_message);
188
+ m_message = std::move (_message);
166
189
}
167
190
168
191
/* !
@@ -183,25 +206,22 @@ std::string& HelloWorld::message()
183
206
return m_message;
184
207
}
185
208
186
- size_t HelloWorld::getKeyMaxCdrSerializedSize (size_t current_alignment)
187
- {
188
- size_t current_align = current_alignment;
189
-
190
-
191
209
192
-
193
-
194
- return current_align;
210
+ size_t HelloWorld::getKeyMaxCdrSerializedSize (
211
+ size_t current_alignment)
212
+ {
213
+ static_cast <void >(current_alignment);
214
+ return HelloWorld_max_key_cdr_typesize;
195
215
}
196
216
197
217
bool HelloWorld::isKeyDefined ()
198
218
{
199
- return false ;
219
+ return false ;
200
220
}
201
221
202
- void HelloWorld::serializeKey (eprosima::fastcdr::Cdr &scdr) const
222
+ void HelloWorld::serializeKey (
223
+ eprosima::fastcdr::Cdr& scdr) const
203
224
{
204
225
(void ) scdr;
205
-
206
-
207
226
}
227
+
0 commit comments