| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
RTPSParticipantAllocationAttributes.hpp
1// Copyright 2019 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
18
19#ifndef FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP
20#define FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP
21
22#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
23
24#include <fastdds/utils/collections/ResourceLimitedContainerConfig.hpp>
25
26 namespace eprosima {
27 namespace fastdds {
28 namespace rtps {
29
33 struct RemoteLocatorsAllocationAttributes
34{
35 bool operator ==(
36 const RemoteLocatorsAllocationAttributes& b) const
37 {
38 return (this->max_unicast_locators == b.max_unicast_locators) &&
39 (this->max_multicast_locators == b.max_multicast_locators);
40 }
41
49 size_t max_unicast_locators = 4u;
50
58 size_t max_multicast_locators = 1u;
59};
60
64 struct SendBuffersAllocationAttributes
65{
66 bool operator ==(
67 const SendBuffersAllocationAttributes& b) const
68 {
69 return (this->preallocated_number == b.preallocated_number) &&
70 (this->dynamic == b.dynamic) &&
71 (this->network_buffers_config == b.network_buffers_config);
72 }
73
81 size_t preallocated_number = 0u;
82
89 bool dynamic = false;
90
97 ResourceLimitedContainerConfig network_buffers_config = ResourceLimitedContainerConfig(16u,
98 std::numeric_limits<size_t>::max dummy_avoid_winmax (), 16u);
99};
100
104 struct VariableLengthDataLimits
105{
106 bool operator ==(
107 const VariableLengthDataLimits& b) const
108 {
109 return (this->max_properties == b.max_properties) &&
110 (this->max_user_data == b.max_user_data) &&
111 (this->max_partitions == b.max_partitions) &&
112 (this->max_datasharing_domains == b.max_datasharing_domains);
113 }
114
116 size_t max_properties = 0;
118 size_t max_user_data = 0;
120 size_t max_partitions = 0;
122 size_t max_datasharing_domains = 0;
123};
124
128 struct RTPSParticipantAllocationAttributes
129{
131 RemoteLocatorsAllocationAttributes locators;
133 ResourceLimitedContainerConfig participants;
135 ResourceLimitedContainerConfig readers;
137 ResourceLimitedContainerConfig writers;
139 SendBuffersAllocationAttributes send_buffers;
141 VariableLengthDataLimits data_limits;
143 fastdds::rtps::ContentFilterProperty::AllocationConfiguration content_filter;
144
146 ResourceLimitedContainerConfig total_readers() const
147 {
148 return total_endpoints(readers);
149 }
150
152 ResourceLimitedContainerConfig total_writers() const
153 {
154 return total_endpoints(writers);
155 }
156
157 bool operator ==(
158 const RTPSParticipantAllocationAttributes& b) const
159 {
160 return (this->locators == b.locators) &&
161 (this->participants == b.participants) &&
162 (this->readers == b.readers) &&
163 (this->writers == b.writers) &&
164 (this->send_buffers == b.send_buffers) &&
165 (this->data_limits == b.data_limits);
166 }
167
168 private:
169
170 ResourceLimitedContainerConfig total_endpoints(
171 const ResourceLimitedContainerConfig& endpoints) const
172 {
173 constexpr size_t max = (std::numeric_limits<size_t>::max)();
174 size_t initial;
175 size_t maximum;
176 size_t increment;
177
178 initial = participants.initial * endpoints.initial;
179 maximum = (participants.maximum == max || endpoints.maximum == max)
180 ? max : participants.maximum * endpoints.maximum;
181 increment = (std::max)(participants.increment, endpoints.increment);
182
183 return { initial, maximum, increment };
184 }
185
186};
187
188 const RTPSParticipantAllocationAttributes c_default_RTPSParticipantAllocationAttributes
189 = RTPSParticipantAllocationAttributes();
190
191} // namespace rtps
192} // namespace fastdds
193} // namespace eprosima
194
195#endif // FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP
eprosima::fastdds::rtps
Contains the RTPS protocol implementation.
eprosima::fastdds::rtps::c_default_RTPSParticipantAllocationAttributes
const RTPSParticipantAllocationAttributes c_default_RTPSParticipantAllocationAttributes
Definition RTPSParticipantAllocationAttributes.hpp:189
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::ResourceLimitedContainerConfig
Specifies the configuration of a resource limited collection.
Definition ResourceLimitedContainerConfig.hpp:36
eprosima::fastdds::ResourceLimitedContainerConfig::increment
size_t increment
Number of items to add when capacity limit is reached.
Definition ResourceLimitedContainerConfig.hpp:53
eprosima::fastdds::ResourceLimitedContainerConfig::maximum
size_t maximum
Maximum number of elements allowed in the collection.
Definition ResourceLimitedContainerConfig.hpp:51
eprosima::fastdds::ResourceLimitedContainerConfig::initial
size_t initial
Number of elements to be preallocated in the collection.
Definition ResourceLimitedContainerConfig.hpp:49
eprosima::fastdds::rtps::ContentFilterProperty::AllocationConfiguration
Allocation configuration for a ContentFilterProperty.
Definition ContentFilterProperty.hpp:43
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes
Holds allocation limits affecting collections managed by a participant.
Definition RTPSParticipantAllocationAttributes.hpp:129
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::content_filter
fastdds::rtps::ContentFilterProperty::AllocationConfiguration content_filter
Defines the allocation behavior of content filter discovery information.
Definition RTPSParticipantAllocationAttributes.hpp:143
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::participants
ResourceLimitedContainerConfig participants
Defines the allocation behaviour for collections dependent on the total number of participants.
Definition RTPSParticipantAllocationAttributes.hpp:133
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::locators
RemoteLocatorsAllocationAttributes locators
Holds limits for collections of remote locators.
Definition RTPSParticipantAllocationAttributes.hpp:131
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::writers
ResourceLimitedContainerConfig writers
Defines the allocation behaviour for collections dependent on the total number of writers per partici...
Definition RTPSParticipantAllocationAttributes.hpp:137
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::total_readers
ResourceLimitedContainerConfig total_readers() const
Definition RTPSParticipantAllocationAttributes.hpp:146
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::data_limits
VariableLengthDataLimits data_limits
Holds limits for variable-length data.
Definition RTPSParticipantAllocationAttributes.hpp:141
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::operator==
bool operator==(const RTPSParticipantAllocationAttributes &b) const
Definition RTPSParticipantAllocationAttributes.hpp:157
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::readers
ResourceLimitedContainerConfig readers
Defines the allocation behaviour for collections dependent on the total number of readers per partici...
Definition RTPSParticipantAllocationAttributes.hpp:135
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::total_writers
ResourceLimitedContainerConfig total_writers() const
Definition RTPSParticipantAllocationAttributes.hpp:152
eprosima::fastdds::rtps::RTPSParticipantAllocationAttributes::send_buffers
SendBuffersAllocationAttributes send_buffers
Defines the allocation behaviour for the send buffer manager.
Definition RTPSParticipantAllocationAttributes.hpp:139
eprosima::fastdds::rtps::RemoteLocatorsAllocationAttributes
Holds limits for collections of remote locators.
Definition RTPSParticipantAllocationAttributes.hpp:34
eprosima::fastdds::rtps::RemoteLocatorsAllocationAttributes::max_multicast_locators
size_t max_multicast_locators
Maximum number of multicast locators per remote entity.
Definition RTPSParticipantAllocationAttributes.hpp:58
eprosima::fastdds::rtps::RemoteLocatorsAllocationAttributes::max_unicast_locators
size_t max_unicast_locators
Maximum number of unicast locators per remote entity.
Definition RTPSParticipantAllocationAttributes.hpp:49
eprosima::fastdds::rtps::RemoteLocatorsAllocationAttributes::operator==
bool operator==(const RemoteLocatorsAllocationAttributes &b) const
Definition RTPSParticipantAllocationAttributes.hpp:35
eprosima::fastdds::rtps::SendBuffersAllocationAttributes
Holds limits for send buffers allocations.
Definition RTPSParticipantAllocationAttributes.hpp:65
eprosima::fastdds::rtps::SendBuffersAllocationAttributes::network_buffers_config
ResourceLimitedContainerConfig network_buffers_config
Configuration for the network buffers.
Definition RTPSParticipantAllocationAttributes.hpp:97
eprosima::fastdds::rtps::SendBuffersAllocationAttributes::operator==
bool operator==(const SendBuffersAllocationAttributes &b) const
Definition RTPSParticipantAllocationAttributes.hpp:66
eprosima::fastdds::rtps::SendBuffersAllocationAttributes::preallocated_number
size_t preallocated_number
Initial number of send buffers to allocate.
Definition RTPSParticipantAllocationAttributes.hpp:81
eprosima::fastdds::rtps::SendBuffersAllocationAttributes::dynamic
bool dynamic
Whether the number of send buffers is allowed to grow.
Definition RTPSParticipantAllocationAttributes.hpp:89
eprosima::fastdds::rtps::VariableLengthDataLimits
Holds limits for variable-length data.
Definition RTPSParticipantAllocationAttributes.hpp:105
eprosima::fastdds::rtps::VariableLengthDataLimits::max_user_data
size_t max_user_data
Defines the maximum size (in octets) of user data in the local or remote participant.
Definition RTPSParticipantAllocationAttributes.hpp:118
eprosima::fastdds::rtps::VariableLengthDataLimits::max_partitions
size_t max_partitions
Defines the maximum size (in octets) of partitions data.
Definition RTPSParticipantAllocationAttributes.hpp:120
eprosima::fastdds::rtps::VariableLengthDataLimits::max_properties
size_t max_properties
Defines the maximum size (in octets) of properties data in the local or remote participant.
Definition RTPSParticipantAllocationAttributes.hpp:116
eprosima::fastdds::rtps::VariableLengthDataLimits::operator==
bool operator==(const VariableLengthDataLimits &b) const
Definition RTPSParticipantAllocationAttributes.hpp:106
eprosima::fastdds::rtps::VariableLengthDataLimits::max_datasharing_domains
size_t max_datasharing_domains
Defines the maximum size (in elements) of the list of data sharing domain IDs.
Definition RTPSParticipantAllocationAttributes.hpp:122