Skip to content

Commit 70ef546

Browse files
authored
Change header include IPLocator from include/fastrtps to fastdds (#72)
* Change header include IPLocator from include/fastrtps to fastdds Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> * Refs #20566: Regenerate the type support Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --------- Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
1 parent 5885c2d commit 70ef546

10 files changed

Lines changed: 550 additions & 13 deletions

File tree

examples/HelloWorldExampleDS/HelloWorldPubSubTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <fastdds/dds/topic/TopicDataType.hpp>
2828
#include <fastdds/rtps/common/InstanceHandle.h>
2929
#include <fastdds/rtps/common/SerializedPayload.h>
30-
#include <fastrtps/utils/md5.h>
30+
#include <fastdds/utils/md5.h>
3131

3232
#include "HelloWorld.h"
3333

examples/HelloWorldExampleDS/HelloWorldPublisher.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
#include <fastdds/dds/publisher/DataWriter.hpp>
3232
#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
3333
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
34-
35-
#include <fastrtps/utils/IPLocator.h>
34+
#include <fastdds/utils/IPLocator.h>
3635

3736
using namespace eprosima::fastdds;
3837
using namespace eprosima::fastdds::rtps;

examples/HelloWorldExampleDS/HelloWorldServer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
#include <fastdds/dds/domain/DomainParticipant.hpp>
2626
#include <fastdds/rtps/transport/TCPv4TransportDescriptor.h>
2727
#include <fastdds/rtps/transport/TCPv6TransportDescriptor.h>
28-
29-
#include <fastrtps/utils/IPLocator.h>
28+
#include <fastdds/utils/IPLocator.h>
3029

3130
using namespace eprosima::fastrtps;
3231
using namespace eprosima::fastrtps::rtps;

examples/HelloWorldExampleDS/HelloWorldSubscriber.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
#include <fastdds/dds/subscriber/DataReader.hpp>
3131
#include <fastdds/dds/subscriber/qos/SubscriberQos.hpp>
3232
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
33-
34-
#include <fastrtps/utils/IPLocator.h>
33+
#include <fastdds/utils/IPLocator.h>
3534

3635
using namespace eprosima::fastdds;
3736
using namespace eprosima::fastrtps::rtps;

examples/HelloWorldExampleDS/HelloWorldv1.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
#define _FAST_DDS_GENERATED_HELLOWORLD_H_
2828

2929

30-
#include <fastrtps/utils/fixed_size_string.hpp>
31-
32-
#include <stdint.h>
3330
#include <array>
31+
#include <bitset>
32+
#include <cstdint>
33+
#include <map>
34+
#include <stdint.h>
3435
#include <string>
3536
#include <vector>
36-
#include <map>
37-
#include <bitset>
37+
38+
#include <fastcdr/cdr/fixed_size_string.hpp>
3839

3940
#if defined(_WIN32)
4041
#if defined(EPROSIMA_USER_DLL_EXPORT)

resources/static_types/HelloWorld.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ char dummy;
2828

2929
#include "HelloWorld.h"
3030

31+
#if FASTCDR_VERSION_MAJOR > 1
32+
3133
#include <fastcdr/Cdr.h>
3234

3335

@@ -163,3 +165,4 @@ std::string& HelloWorld::message()
163165
// Include auxiliary functions like for serializing/deserializing.
164166
#include "HelloWorldCdrAux.ipp"
165167

168+
#endif // FASTCDR_VERSION_MAJOR > 1

resources/static_types/HelloWorld.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
* This file was generated by the tool fastddsgen.
2020
*/
2121

22+
#include <fastcdr/config.h>
23+
#include "HelloWorldv1.h"
24+
25+
#if FASTCDR_VERSION_MAJOR > 1
26+
2227
#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_
2328
#define _FAST_DDS_GENERATED_HELLOWORLD_H_
2429

@@ -187,3 +192,4 @@ class HelloWorld
187192

188193

189194

195+
#endif // FASTCDR_VERSION_MAJOR > 1

resources/static_types/HelloWorldPubSubTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <fastdds/dds/topic/TopicDataType.hpp>
2828
#include <fastdds/rtps/common/InstanceHandle.h>
2929
#include <fastdds/rtps/common/SerializedPayload.h>
30-
#include <fastrtps/utils/md5.h>
30+
#include <fastdds/utils/md5.h>
3131

3232
#include "HelloWorld.h"
3333

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
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 HelloWorld.cpp
17+
* This source file contains the implementation of the described types in the IDL file.
18+
*
19+
* This file was generated by the tool fastddsgen.
20+
*/
21+
22+
#ifdef _WIN32
23+
// Remove linker warning LNK4221 on Visual Studio
24+
namespace {
25+
char dummy;
26+
} // namespace
27+
#endif // _WIN32
28+
29+
#include "HelloWorld.h"
30+
31+
#if FASTCDR_VERSION_MAJOR == 1
32+
33+
#include <fastcdr/Cdr.h>
34+
35+
36+
#include <fastcdr/exceptions/BadParamException.h>
37+
using namespace eprosima::fastcdr::exception;
38+
39+
#include <utility>
40+
41+
namespace helper { namespace internal {
42+
43+
enum class Size {
44+
UInt8,
45+
UInt16,
46+
UInt32,
47+
UInt64,
48+
};
49+
50+
constexpr Size get_size(int s) {
51+
return (s <= 8 ) ? Size::UInt8:
52+
(s <= 16) ? Size::UInt16:
53+
(s <= 32) ? Size::UInt32: Size::UInt64;
54+
}
55+
56+
template<Size s>
57+
struct FindTypeH;
58+
59+
template<>
60+
struct FindTypeH<Size::UInt8> {
61+
using type = std::uint8_t;
62+
};
63+
64+
template<>
65+
struct FindTypeH<Size::UInt16> {
66+
using type = std::uint16_t;
67+
};
68+
69+
template<>
70+
struct FindTypeH<Size::UInt32> {
71+
using type = std::uint32_t;
72+
};
73+
74+
template<>
75+
struct FindTypeH<Size::UInt64> {
76+
using type = std::uint64_t;
77+
};
78+
}
79+
80+
template<int S>
81+
struct FindType {
82+
using type = typename internal::FindTypeH<internal::get_size(S)>::type;
83+
};
84+
}
85+
86+
#define HelloWorld_max_cdr_typesize 268ULL;
87+
88+
89+
90+
91+
HelloWorld::HelloWorld()
92+
{
93+
// unsigned long m_index
94+
m_index = 0;
95+
// /type_d() m_message
96+
97+
98+
}
99+
100+
HelloWorld::~HelloWorld()
101+
{
102+
}
103+
104+
HelloWorld::HelloWorld(
105+
const HelloWorld& x)
106+
{
107+
m_index = x.m_index;
108+
109+
110+
m_message = x.m_message;
111+
112+
}
113+
114+
HelloWorld::HelloWorld(
115+
HelloWorld&& x) noexcept
116+
{
117+
m_index = x.m_index;
118+
119+
120+
m_message = std::move(x.m_message);
121+
122+
}
123+
124+
HelloWorld& HelloWorld::operator =(
125+
const HelloWorld& x)
126+
{
127+
m_index = x.m_index;
128+
129+
130+
m_message = x.m_message;
131+
132+
return *this;
133+
}
134+
135+
HelloWorld& HelloWorld::operator =(
136+
HelloWorld&& x) noexcept
137+
{
138+
m_index = x.m_index;
139+
140+
141+
m_message = std::move(x.m_message);
142+
143+
return *this;
144+
}
145+
146+
bool HelloWorld::operator ==(
147+
const HelloWorld& x) const
148+
{
149+
return (m_index == x.m_index &&
150+
m_message == x.m_message);
151+
}
152+
153+
bool HelloWorld::operator !=(
154+
const HelloWorld& x) const
155+
{
156+
return !(*this == x);
157+
}
158+
159+
size_t HelloWorld::getMaxCdrSerializedSize(
160+
size_t current_alignment)
161+
{
162+
static_cast<void>(current_alignment);
163+
return HelloWorld_max_cdr_typesize;
164+
}
165+
166+
size_t HelloWorld::getCdrSerializedSize(
167+
const HelloWorld& data,
168+
size_t current_alignment)
169+
{
170+
(void)data;
171+
size_t initial_alignment = current_alignment;
172+
173+
current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
174+
175+
176+
current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1;
177+
178+
179+
return current_alignment - initial_alignment;
180+
}
181+
182+
183+
void HelloWorld::serialize(
184+
eprosima::fastcdr::Cdr& scdr) const
185+
{
186+
scdr << m_index;
187+
188+
scdr << m_message.c_str();
189+
190+
}
191+
192+
void HelloWorld::deserialize(
193+
eprosima::fastcdr::Cdr& dcdr)
194+
{
195+
dcdr >> m_index;
196+
197+
198+
199+
dcdr >> m_message;
200+
201+
202+
}
203+
204+
205+
bool HelloWorld::isKeyDefined()
206+
{
207+
return false;
208+
}
209+
210+
void HelloWorld::serializeKey(
211+
eprosima::fastcdr::Cdr& scdr) const
212+
{
213+
(void) scdr;
214+
}
215+
216+
/*!
217+
* @brief This function sets a value in member index
218+
* @param _index New value for member index
219+
*/
220+
void HelloWorld::index(
221+
uint32_t _index)
222+
{
223+
m_index = _index;
224+
}
225+
226+
/*!
227+
* @brief This function returns the value of member index
228+
* @return Value of member index
229+
*/
230+
uint32_t HelloWorld::index() const
231+
{
232+
return m_index;
233+
}
234+
235+
/*!
236+
* @brief This function returns a reference to member index
237+
* @return Reference to member index
238+
*/
239+
uint32_t& HelloWorld::index()
240+
{
241+
return m_index;
242+
}
243+
244+
245+
/*!
246+
* @brief This function copies the value in member message
247+
* @param _message New value to be copied in member message
248+
*/
249+
void HelloWorld::message(
250+
const std::string& _message)
251+
{
252+
m_message = _message;
253+
}
254+
255+
/*!
256+
* @brief This function moves the value in member message
257+
* @param _message New value to be moved in member message
258+
*/
259+
void HelloWorld::message(
260+
std::string&& _message)
261+
{
262+
m_message = std::move(_message);
263+
}
264+
265+
/*!
266+
* @brief This function returns a constant reference to member message
267+
* @return Constant reference to member message
268+
*/
269+
const std::string& HelloWorld::message() const
270+
{
271+
return m_message;
272+
}
273+
274+
/*!
275+
* @brief This function returns a reference to member message
276+
* @return Reference to member message
277+
*/
278+
std::string& HelloWorld::message()
279+
{
280+
return m_message;
281+
}
282+
283+
284+
285+
286+
#endif // FASTCDR_VERSION_MAJOR == 1

0 commit comments

Comments
 (0)