Fast DDS  Version 3.1.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};
116
117inline std::ostream& operator <<(
118 std::ostream& output,
119 BuiltinTransports transports)
120{
121 switch (transports)
122 {
124 output << "NONE";
125 break;
127 output << "DEFAULT";
128 break;
130 output << "DEFAULTv6";
131 break;
133 output << "SHM";
134 break;
136 output << "UDPv4";
137 break;
139 output << "UDPv6";
140 break;
142 output << "LARGE_DATA";
143 break;
145 output << "LARGE_DATAv6";
146 break;
147 default:
148 output << "UNKNOWN";
149 break;
150 }
151 return output;
152}
153
154} // namespace rtps
155} // namespace fastdds
156} // namespace eprosima
157
158#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:117
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