| Fast DDS Version 3.3.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
25 namespace eprosima {
26 namespace fastdds {
27 namespace rtps {
28
37 class PortBasedTransportDescriptor : public TransportDescriptorInterface
38{
39 public:
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
53 FASTDDS_EXPORTED_API PortBasedTransportDescriptor& operator =(
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(
91 const ThreadSettings& default_reception_threads);
92
94 FASTDDS_EXPORTED_API const ReceptionThreadsConfigMap& reception_threads() const;
95
97 virtual FASTDDS_EXPORTED_API bool reception_threads(
98 const ReceptionThreadsConfigMap& reception_threads);
99
100 protected:
101
103 ThreadSettings default_reception_threads_;
104
106 ReceptionThreadsConfigMap reception_threads_;
107};
108
109} // namespace rtps
110} // namespace fastdds
111} // namespace eprosima
112
113#endif // FASTDDS_RTPS_TRANSPORT__PORTBASEDTRANSPORTDESCRIPTOR_HPP
eprosima::fastdds::rtps::PortBasedTransportDescriptor::reception_threads
FASTDDS_EXPORTED_API const ReceptionThreadsConfigMap & reception_threads() const
Returns the ThreadSettings for the user-configured reception threads.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::PortBasedTransportDescriptor
FASTDDS_EXPORTED_API PortBasedTransportDescriptor(const PortBasedTransportDescriptor &t)=default
Copy constructor.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::default_reception_threads_
ThreadSettings default_reception_threads_
Thread settings for the default reception threads.
Definition PortBasedTransportDescriptor.hpp:103
eprosima::fastdds::rtps::PortBasedTransportDescriptor::reception_threads
virtual FASTDDS_EXPORTED_API bool reception_threads(const ReceptionThreadsConfigMap &reception_threads)
Set the ThreadSettings for the user-configured reception threads.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::set_thread_config_for_port
virtual FASTDDS_EXPORTED_API bool set_thread_config_for_port(const uint32_t &port, const ThreadSettings &thread_settings)
eprosima::fastdds::rtps::PortBasedTransportDescriptor::operator==
bool FASTDDS_EXPORTED_API operator==(const PortBasedTransportDescriptor &t) const
Comparison operator.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::operator=
FASTDDS_EXPORTED_API PortBasedTransportDescriptor & operator=(const PortBasedTransportDescriptor &t)=default
Copy assignment.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::default_reception_threads
virtual FASTDDS_EXPORTED_API void default_reception_threads(const ThreadSettings &default_reception_threads)
Set the ThreadSettings for the default reception threads.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap
std::map< uint32_t, ThreadSettings > ReceptionThreadsConfigMap
Definition PortBasedTransportDescriptor.hpp:41
eprosima::fastdds::rtps::PortBasedTransportDescriptor::default_reception_threads
FASTDDS_EXPORTED_API const ThreadSettings & default_reception_threads() const
Returns the ThreadSettings for the default reception threads.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::reception_threads_
ReceptionThreadsConfigMap reception_threads_
Thread settings for the specific reception threads, indexed by port.
Definition PortBasedTransportDescriptor.hpp:106
eprosima::fastdds::rtps::PortBasedTransportDescriptor::get_thread_config_for_port
virtual FASTDDS_EXPORTED_API const ThreadSettings & get_thread_config_for_port(uint32_t port) const
Get the ThreadSettings for a specific port.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::~PortBasedTransportDescriptor
virtual FASTDDS_EXPORTED_API ~PortBasedTransportDescriptor()=default
Destructor.
eprosima::fastdds::rtps::PortBasedTransportDescriptor::PortBasedTransportDescriptor
FASTDDS_EXPORTED_API PortBasedTransportDescriptor(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
eprosima::fastdds::rtps
Contains the RTPS protocol implementation.
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::rtps::ThreadSettings
Struct ThreadSettings to specify various thread settings.
Definition ThreadSettings.hpp:37
eprosima::fastdds::rtps::TransportDescriptorInterface::TransportDescriptorInterface
FASTDDS_EXPORTED_API TransportDescriptorInterface(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
Definition TransportDescriptorInterface.hpp:50