Fast DDS  Version 3.6.1.0
Fast DDS
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 
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 
34 {
37  {
38  return (this->max_unicast_locators == b.max_unicast_locators) &&
40  }
41 
49  size_t max_unicast_locators = 4u;
50 
59 };
60 
65 {
67  const SendBuffersAllocationAttributes& b) const
68  {
69  return (this->preallocated_number == b.preallocated_number) &&
70  (this->dynamic == b.dynamic) &&
72  }
73 
81  size_t preallocated_number = 0u;
82 
89  bool dynamic = false;
90 
98  std::numeric_limits<size_t>::max dummy_avoid_winmax (), 16u);
99 };
100 
105 {
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) &&
113  }
114 
116  size_t max_properties = 0;
118  size_t max_user_data = 0;
120  size_t max_partitions = 0;
123 };
124 
129 {
144 
147  {
148  return total_endpoints(readers);
149  }
150 
153  {
154  return total_endpoints(writers);
155  }
156 
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 
190 
191 } // namespace rtps
192 } // namespace fastdds
193 } // namespace eprosima
194 
195 #endif // FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTALLOCATIONATTRIBUTES_HPP
const RTPSParticipantAllocationAttributes c_default_RTPSParticipantAllocationAttributes
Definition: RTPSParticipantAllocationAttributes.hpp:189
Specifies the configuration of a resource limited collection.
Definition: ResourceLimitedContainerConfig.hpp:36
size_t increment
Number of items to add when capacity limit is reached.
Definition: ResourceLimitedContainerConfig.hpp:53
size_t maximum
Maximum number of elements allowed in the collection.
Definition: ResourceLimitedContainerConfig.hpp:51
size_t initial
Number of elements to be preallocated in the collection.
Definition: ResourceLimitedContainerConfig.hpp:49
Allocation configuration for a ContentFilterProperty.
Definition: ContentFilterProperty.hpp:43
Holds allocation limits affecting collections managed by a participant.
Definition: RTPSParticipantAllocationAttributes.hpp:129
fastdds::rtps::ContentFilterProperty::AllocationConfiguration content_filter
Defines the allocation behavior of content filter discovery information.
Definition: RTPSParticipantAllocationAttributes.hpp:143
ResourceLimitedContainerConfig participants
Defines the allocation behaviour for collections dependent on the total number of participants.
Definition: RTPSParticipantAllocationAttributes.hpp:133
RemoteLocatorsAllocationAttributes locators
Holds limits for collections of remote locators.
Definition: RTPSParticipantAllocationAttributes.hpp:131
ResourceLimitedContainerConfig writers
Defines the allocation behaviour for collections dependent on the total number of writers per partici...
Definition: RTPSParticipantAllocationAttributes.hpp:137
ResourceLimitedContainerConfig total_readers() const
Definition: RTPSParticipantAllocationAttributes.hpp:146
VariableLengthDataLimits data_limits
Holds limits for variable-length data.
Definition: RTPSParticipantAllocationAttributes.hpp:141
bool operator==(const RTPSParticipantAllocationAttributes &b) const
Definition: RTPSParticipantAllocationAttributes.hpp:157
ResourceLimitedContainerConfig readers
Defines the allocation behaviour for collections dependent on the total number of readers per partici...
Definition: RTPSParticipantAllocationAttributes.hpp:135
ResourceLimitedContainerConfig total_writers() const
Definition: RTPSParticipantAllocationAttributes.hpp:152
SendBuffersAllocationAttributes send_buffers
Defines the allocation behaviour for the send buffer manager.
Definition: RTPSParticipantAllocationAttributes.hpp:139
Holds limits for collections of remote locators.
Definition: RTPSParticipantAllocationAttributes.hpp:34
size_t max_multicast_locators
Maximum number of multicast locators per remote entity.
Definition: RTPSParticipantAllocationAttributes.hpp:58
size_t max_unicast_locators
Maximum number of unicast locators per remote entity.
Definition: RTPSParticipantAllocationAttributes.hpp:49
bool operator==(const RemoteLocatorsAllocationAttributes &b) const
Definition: RTPSParticipantAllocationAttributes.hpp:35
Holds limits for send buffers allocations.
Definition: RTPSParticipantAllocationAttributes.hpp:65
ResourceLimitedContainerConfig network_buffers_config
Configuration for the network buffers.
Definition: RTPSParticipantAllocationAttributes.hpp:97
bool operator==(const SendBuffersAllocationAttributes &b) const
Definition: RTPSParticipantAllocationAttributes.hpp:66
size_t preallocated_number
Initial number of send buffers to allocate.
Definition: RTPSParticipantAllocationAttributes.hpp:81
bool dynamic
Whether the number of send buffers is allowed to grow.
Definition: RTPSParticipantAllocationAttributes.hpp:89
Holds limits for variable-length data.
Definition: RTPSParticipantAllocationAttributes.hpp:105
size_t max_user_data
Defines the maximum size (in octets) of user data in the local or remote participant.
Definition: RTPSParticipantAllocationAttributes.hpp:118
size_t max_partitions
Defines the maximum size (in octets) of partitions data.
Definition: RTPSParticipantAllocationAttributes.hpp:120
size_t max_properties
Defines the maximum size (in octets) of properties data in the local or remote participant.
Definition: RTPSParticipantAllocationAttributes.hpp:116
bool operator==(const VariableLengthDataLimits &b) const
Definition: RTPSParticipantAllocationAttributes.hpp:106
size_t max_datasharing_domains
Defines the maximum size (in elements) of the list of data sharing domain IDs.
Definition: RTPSParticipantAllocationAttributes.hpp:122