12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- #ifndef IOX_DDS_INTERNAL_GATEWAY_DDS_TO_IOX_INL
16
- #define IOX_DDS_INTERNAL_GATEWAY_DDS_TO_IOX_INL
15
+ #ifndef IOX_DDS_DDS_TO_IOX_INL
16
+ #define IOX_DDS_DDS_TO_IOX_INL
17
17
18
+ #include " iceoryx_dds/dds/dds_config.hpp"
18
19
#include " iceoryx_dds/internal/log/logging.hpp"
19
20
#include " iceoryx_posh/capro/service_description.hpp"
20
21
#include " iceoryx_utils/cxx/string.hpp"
@@ -25,26 +26,31 @@ namespace dds
25
26
{
26
27
template <typename channel_t , typename gateway_t >
27
28
inline DDS2IceoryxGateway<channel_t , gateway_t >::DDS2IceoryxGateway() noexcept
28
- : gateway_t ()
29
+ : gateway_t (capro::Interfaces::DDS, DISCOVERY_PERIOD, FORWARDING_PERIOD )
29
30
{
30
31
}
31
32
32
33
template <typename channel_t , typename gateway_t >
33
- inline void DDS2IceoryxGateway<channel_t , gateway_t >::loadConfiguration(const GatewayConfig& config) noexcept
34
+ inline void DDS2IceoryxGateway<channel_t , gateway_t >::loadConfiguration(const config:: GatewayConfig& config) noexcept
34
35
{
35
- iox:: LogDebug () << " [DDS2IceoryxGateway] Configuring gateway." ;
36
+ LogDebug () << " [DDS2IceoryxGateway] Configuring gateway.. ." ;
36
37
for (const auto & service : config.m_configuredServices )
37
38
{
38
39
if (!this ->findChannel (service.m_serviceDescription ).has_value ())
39
40
{
40
- setupChannel (service.m_serviceDescription );
41
+ auto serviceDescription = service.m_serviceDescription ;
42
+ LogDebug () << " [DDS2IceoryxGateway] Setting up channel for service: {"
43
+ << serviceDescription.getServiceIDString () << " , "
44
+ << serviceDescription.getInstanceIDString () << " , "
45
+ << serviceDescription.getEventIDString () << " }" ;
46
+ setupChannel (serviceDescription);
41
47
}
42
48
}
43
49
}
44
50
45
51
template <typename channel_t , typename gateway_t >
46
52
inline void
47
- DDS2IceoryxGateway<channel_t , gateway_t >::discover([[gnu::unused]] const iox:: capro::CaproMessage& msg) noexcept
53
+ DDS2IceoryxGateway<channel_t , gateway_t >::discover([[gnu::unused]] const capro::CaproMessage& msg) noexcept
48
54
{
49
55
// / @note not implemented - requires dds discovery which is currently not implemented in the used dds stack.
50
56
}
@@ -53,7 +59,7 @@ template <typename channel_t, typename gateway_t>
53
59
inline void DDS2IceoryxGateway<channel_t , gateway_t >::forward(const channel_t & channel) noexcept
54
60
{
55
61
auto publisher = channel.getIceoryxTerminal ();
56
- auto reader = channel.getDDSTerminal ();
62
+ auto reader = channel.getExternalTerminal ();
57
63
58
64
reader->peekNextSize ().and_then ([&](uint64_t size) {
59
65
// reserve a chunk for the sample
@@ -67,19 +73,19 @@ inline void DDS2IceoryxGateway<channel_t, gateway_t>::forward(const channel_t& c
67
73
})
68
74
.or_else ([&](DataReaderError err) {
69
75
LogWarn () << " [DDS2IceoryxGateway] Encountered error reading from DDS network: "
70
- << iox:: dds::DataReaderErrorString[static_cast <uint8_t >(err)];
76
+ << dds::DataReaderErrorString[static_cast <uint8_t >(err)];
71
77
});
72
78
});
73
79
}
74
80
75
81
// ======================================== Private ======================================== //
76
82
template <typename channel_t , typename gateway_t >
77
- iox:: cxx::expected<channel_t , iox::dds ::GatewayError>
78
- DDS2IceoryxGateway<channel_t , gateway_t >::setupChannel(const iox:: capro::ServiceDescription& service) noexcept
83
+ cxx::expected<channel_t , gw ::GatewayError>
84
+ DDS2IceoryxGateway<channel_t , gateway_t >::setupChannel(const capro::ServiceDescription& service) noexcept
79
85
{
80
86
return this ->addChannel (service).and_then ([&service](channel_t channel) {
81
87
auto publisher = channel.getIceoryxTerminal ();
82
- auto reader = channel.getDDSTerminal ();
88
+ auto reader = channel.getExternalTerminal ();
83
89
publisher->offer ();
84
90
reader->connect ();
85
91
iox::LogDebug () << " [DDS2IceoryxGateway] Setup channel for service: {" << service.getServiceIDString () << " , "
@@ -90,4 +96,4 @@ DDS2IceoryxGateway<channel_t, gateway_t>::setupChannel(const iox::capro::Service
90
96
} // namespace dds
91
97
} // namespace iox
92
98
93
- #endif
99
+ #endif // IOX_DDS_DDS_TO_IOX_INL
0 commit comments