Program Listing for File BuiltinTransports.hpp
↰ Return to documentation for file (include/fastdds/rtps/attributes/BuiltinTransports.hpp)
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP
#define FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP
#include <ostream>
#include <cstdint>
#include <fastdds/fastdds_dll.hpp>
#include <fastdds/rtps/transport/TransportInterface.hpp>
namespace eprosima {
namespace fastdds {
namespace rtps {
struct FASTDDS_EXPORTED_API BuiltinTransportsOptions
{
bool non_blocking_send = false;
uint32_t maxMessageSize = fastdds::rtps::s_maximumMessageSize;
uint32_t sockets_buffer_size = 0;
uint32_t tcp_negotiation_timeout = 0;
};
inline bool operator ==(
const BuiltinTransportsOptions& bto1,
const BuiltinTransportsOptions& bto2)
{
if (bto1.non_blocking_send != bto2.non_blocking_send)
{
return false;
}
if (bto1.maxMessageSize != bto2.maxMessageSize)
{
return false;
}
if (bto1.sockets_buffer_size != bto2.sockets_buffer_size)
{
return false;
}
if (bto1.tcp_negotiation_timeout != bto2.tcp_negotiation_timeout)
{
return false;
}
return true;
}
enum class BuiltinTransports : uint16_t
{
NONE = 0, //< No transport will be instantiated
DEFAULT = 1, //< Default value that will instantiate UDPv4 and SHM transports
DEFAULTv6 = 2, //< Instantiate UDPv6 and SHM transports
SHM = 3, //< Instantiate SHM transport only
UDPv4 = 4, //< Instantiate UDPv4 transport only
UDPv6 = 5, //< Instantiate UDPv6 transport only
LARGE_DATA = 6, //< Instantiate SHM, UDPv4 and TCPv4 transports, but UDPv4 is only used for bootstrapping discovery
LARGE_DATAv6 = 7, //< Instantiate SHM, UDPv6 and TCPv6 transports, but UDPv6 is only used for bootstrapping discovery
P2P = 8 //< Instantiate SHM, UDPv4 (unicast) and TCPv4 transports, shall only be used along with ROS2_EASY_MODE=<ip>
};
inline std::ostream& operator <<(
std::ostream& output,
BuiltinTransports transports)
{
switch (transports)
{
case BuiltinTransports::NONE:
output << "NONE";
break;
case BuiltinTransports::DEFAULT:
output << "DEFAULT";
break;
case BuiltinTransports::DEFAULTv6:
output << "DEFAULTv6";
break;
case BuiltinTransports::SHM:
output << "SHM";
break;
case BuiltinTransports::UDPv4:
output << "UDPv4";
break;
case BuiltinTransports::UDPv6:
output << "UDPv6";
break;
case BuiltinTransports::LARGE_DATA:
output << "LARGE_DATA";
break;
case BuiltinTransports::LARGE_DATAv6:
output << "LARGE_DATAv6";
break;
case BuiltinTransports::P2P:
output << "P2P";
break;
default:
output << "UNKNOWN";
break;
}
return output;
}
} // namespace rtps
} // namespace fastdds
} // namespace eprosima
#endif // FASTDDS_RTPS_ATTRIBUTES__BUILTINTRANSPORTS_HPP