Fast DDS  Version 3.3.0
Fast DDS
Loading...
Searching...
No Matches
BuiltinTransports.hpp
1// Copyright 2023 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
19#ifndef FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP
20#define FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP
21
22#include <ostream>
23#include <cstdint>
24
25#include <fastdds/fastdds_dll.hpp>
26#include <fastdds/rtps/transport/TransportInterface.hpp>
27
28namespace eprosima {
29namespace fastdds {
30namespace rtps {
31
32
36struct FASTDDS_EXPORTED_API BuiltinTransportsOptions
37{
39 bool non_blocking_send = false;
40
48 uint32_t maxMessageSize = fastdds::rtps::s_maximumMessageSize;
49
58 uint32_t sockets_buffer_size = 0;
59
68 uint32_t tcp_negotiation_timeout = 0;
69};
70
79inline bool operator ==(
80 const BuiltinTransportsOptions& bto1,
81 const BuiltinTransportsOptions& bto2)
82{
83 if (bto1.non_blocking_send != bto2.non_blocking_send)
84 {
85 return false;
86 }
87 if (bto1.maxMessageSize != bto2.maxMessageSize)
88 {
89 return false;
90 }
92 {
93 return false;
94 }
96 {
97 return false;
98 }
99 return true;
100}
101
105enum class BuiltinTransports : uint16_t
106{
107 NONE = 0, //< No transport will be instantiated
108 DEFAULT = 1, //< Default value that will instantiate UDPv4 and SHM transports
109 DEFAULTv6 = 2, //< Instantiate UDPv6 and SHM transports
110 SHM = 3, //< Instantiate SHM transport only
111 UDPv4 = 4, //< Instantiate UDPv4 transport only
112 UDPv6 = 5, //< Instantiate UDPv6 transport only
113 LARGE_DATA = 6, //< Instantiate SHM, UDPv4 and TCPv4 transports, but UDPv4 is only used for bootstrapping discovery
114 LARGE_DATAv6 = 7, //< Instantiate SHM, UDPv6 and TCPv6 transports, but UDPv6 is only used for bootstrapping discovery
115 P2P = 8 //< Instantiate SHM, UDPv4 (unicast) and TCPv4 transports, shall only be used along with ROS2_EASY_MODE=<ip>
116};
117
118inline std::ostream& operator <<(
119 std::ostream& output,
120 BuiltinTransports transports)
121{
122 switch (transports)
123 {
125 output << "NONE";
126 break;
128 output << "DEFAULT";
129 break;
131 output << "DEFAULTv6";
132 break;
134 output << "SHM";
135 break;
137 output << "UDPv4";
138 break;
140 output << "UDPv6";
141 break;
143 output << "LARGE_DATA";
144 break;
146 output << "LARGE_DATAv6";
147 break;
149 output << "P2P";
150 break;
151 default:
152 output << "UNKNOWN";
153 break;
154 }
155 return output;
156}
157
158} // namespace rtps
159} // namespace fastdds
160} // namespace eprosima
161
162#endif // FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP
bool operator==(const BuiltinTransportsOptions &bto1, const BuiltinTransportsOptions &bto2)
Equal to operator.
Definition BuiltinTransports.hpp:79
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition BuiltinTransports.hpp:118
BuiltinTransports
Defines the kind of transports automatically instantiated upon the creation of a participant.
Definition BuiltinTransports.hpp:106
eProsima namespace.
Options for configuring the built-in transports when using LARGE_DATA mode.
Definition BuiltinTransports.hpp:37
uint32_t sockets_buffer_size
The value used to configure the send and receive fuffer sizes of the sockets.
Definition BuiltinTransports.hpp:58
bool non_blocking_send
Whether to use non-blocking send operation.
Definition BuiltinTransports.hpp:39
uint32_t maxMessageSize
The maximum message size to be used.
Definition BuiltinTransports.hpp:48
uint32_t tcp_negotiation_timeout
Time to wait for logical port negotiation (ms).
Definition BuiltinTransports.hpp:68