Fast DDS  Version 3.0.0
Fast DDS
Loading...
Searching...
No Matches
PortBasedTransportDescriptor.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
15#ifndef FASTDDS_RTPS_TRANSPORT__PORTBASEDTRANSPORTDESCRIPTOR_HPP
16#define FASTDDS_RTPS_TRANSPORT__PORTBASEDTRANSPORTDESCRIPTOR_HPP
17
18#include <cstdint>
19#include <map>
20
21#include <fastdds/rtps/attributes/ThreadSettings.hpp>
22#include <fastdds/rtps/transport/TransportDescriptorInterface.hpp>
23#include <fastdds/fastdds_dll.hpp>
24
25namespace eprosima {
26namespace fastdds {
27namespace rtps {
28
38{
39public:
40
41 using ReceptionThreadsConfigMap = std::map<uint32_t, ThreadSettings>;
42
44 FASTDDS_EXPORTED_API PortBasedTransportDescriptor(
45 uint32_t maximumMessageSize,
46 uint32_t maximumInitialPeersRange);
47
49 FASTDDS_EXPORTED_API PortBasedTransportDescriptor(
50 const PortBasedTransportDescriptor& t) = default;
51
54 const PortBasedTransportDescriptor& t) = default;
55
57 virtual FASTDDS_EXPORTED_API ~PortBasedTransportDescriptor() = default;
58
60 bool FASTDDS_EXPORTED_API operator ==(
61 const PortBasedTransportDescriptor& t) const;
62
79 virtual FASTDDS_EXPORTED_API const ThreadSettings& get_thread_config_for_port(
80 uint32_t port) const;
81
82 virtual FASTDDS_EXPORTED_API bool set_thread_config_for_port(
83 const uint32_t& port,
84 const ThreadSettings& thread_settings);
85
87 FASTDDS_EXPORTED_API const ThreadSettings& default_reception_threads() const;
88
90 virtual FASTDDS_EXPORTED_API void default_reception_threads(
92
94 FASTDDS_EXPORTED_API const ReceptionThreadsConfigMap& reception_threads() const;
95
97 virtual FASTDDS_EXPORTED_API bool reception_threads(
99
100protected:
101
104
107};
108
109} // namespace rtps
110} // namespace fastdds
111} // namespace eprosima
112
113#endif // FASTDDS_RTPS_TRANSPORT__PORTBASEDTRANSPORTDESCRIPTOR_HPP
Base class for all port based transport descriptors.
Definition PortBasedTransportDescriptor.hpp:38
FASTDDS_EXPORTED_API const ReceptionThreadsConfigMap & reception_threads() const
Returns the ThreadSettings for the user-configured reception threads.
FASTDDS_EXPORTED_API PortBasedTransportDescriptor(const PortBasedTransportDescriptor &t)=default
Copy constructor.
ThreadSettings default_reception_threads_
Thread settings for the default reception threads.
Definition PortBasedTransportDescriptor.hpp:103
virtual FASTDDS_EXPORTED_API bool reception_threads(const ReceptionThreadsConfigMap &reception_threads)
Set the ThreadSettings for the user-configured reception threads.
virtual FASTDDS_EXPORTED_API bool set_thread_config_for_port(const uint32_t &port, const ThreadSettings &thread_settings)
bool FASTDDS_EXPORTED_API operator==(const PortBasedTransportDescriptor &t) const
Comparison operator.
FASTDDS_EXPORTED_API PortBasedTransportDescriptor & operator=(const PortBasedTransportDescriptor &t)=default
Copy assignment.
virtual FASTDDS_EXPORTED_API void default_reception_threads(const ThreadSettings &default_reception_threads)
Set the ThreadSettings for the default reception threads.
std::map< uint32_t, ThreadSettings > ReceptionThreadsConfigMap
Definition PortBasedTransportDescriptor.hpp:41
FASTDDS_EXPORTED_API const ThreadSettings & default_reception_threads() const
Returns the ThreadSettings for the default reception threads.
ReceptionThreadsConfigMap reception_threads_
Thread settings for the specific reception threads, indexed by port.
Definition PortBasedTransportDescriptor.hpp:106
virtual FASTDDS_EXPORTED_API const ThreadSettings & get_thread_config_for_port(uint32_t port) const
Get the ThreadSettings for a specific port.
virtual FASTDDS_EXPORTED_API ~PortBasedTransportDescriptor()=default
Destructor.
FASTDDS_EXPORTED_API PortBasedTransportDescriptor(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
eProsima namespace.
Struct ThreadSettings to specify various thread settings.
Definition ThreadSettings.hpp:37
Virtual base class for the data type used to define transport configuration.
Definition TransportDescriptorInterface.hpp:48