Fast DDS  Version 3.6.1.0
Fast DDS
DomainParticipantQos.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 
20 #ifndef FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP
21 #define FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP
22 
23 #include <string>
24 
25 #include <fastdds/dds/core/policy/QosPolicies.hpp>
26 #include <fastdds/rtps/attributes/BuiltinTransports.hpp>
27 #include <fastdds/rtps/attributes/ThreadSettings.hpp>
28 #include <fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp>
29 #include <fastdds/fastdds_dll.hpp>
30 
31 namespace eprosima {
32 namespace fastdds {
33 namespace dds {
34 
42 {
43 public:
44 
46 
52  using FlowControllerDescriptorList = std::vector<std::shared_ptr<fastdds::rtps::FlowControllerDescriptor>>;
53 
57  FASTDDS_EXPORTED_API DomainParticipantQos()
58  {
59 #ifdef FASTDDS_STATISTICS
60  /*
61  * In the case of Statistics, the following properties are set with an empty value. This is because if these
62  * properties are set and empty during the enabling of the DomainParticipant, they are fill with the default
63  * mechanism
64  */
65  properties_.properties().emplace_back(parameter_policy_physical_data_host, "");
66  properties_.properties().emplace_back(parameter_policy_physical_data_user, "");
67  properties_.properties().emplace_back(parameter_policy_physical_data_process, "");
68 #endif // ifdef FASTDDS_STATISTICS
69  }
70 
74  FASTDDS_EXPORTED_API virtual ~DomainParticipantQos()
75  {
76  }
77 
78  virtual bool operator ==(
79  const DomainParticipantQos& b) const
80  {
81  return (this->user_data_ == b.user_data()) &&
82  (this->entity_factory_ == b.entity_factory()) &&
83  (this->allocation_ == b.allocation()) &&
84  (this->properties_ == b.properties()) &&
85  (this->wire_protocol_ == b.wire_protocol()) &&
86  (this->transport_ == b.transport()) &&
87  (this->name_ == b.name()) &&
88  (this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) &&
89  (this->timed_events_thread_ == b.timed_events_thread()) &&
90  (this->discovery_server_thread_ == b.discovery_server_thread()) &&
91  (this->typelookup_service_thread_ == b.typelookup_service_thread()) &&
92 #if HAVE_SECURITY
93  (this->security_log_thread_ == b.security_log_thread()) &&
94 #endif // if HAVE_SECURITY
96  }
97 
103  const UserDataQosPolicy& user_data() const
104  {
105  return user_data_;
106  }
107 
113  UserDataQosPolicy& user_data()
114  {
115  return user_data_;
116  }
117 
123  void user_data(
124  const UserDataQosPolicy& value)
125  {
126  user_data_ = value;
127  }
128 
135  {
136  return entity_factory_;
137  }
138 
145  {
146  return entity_factory_;
147  }
148 
155  const EntityFactoryQosPolicy& value)
156  {
157  entity_factory_ = value;
158  }
159 
166  {
167  return allocation_;
168  }
169 
176  {
177  return allocation_;
178  }
179 
187  {
188  allocation_ = allocation;
189  }
190 
197  {
198  return properties_;
199  }
200 
207  {
208  return properties_;
209  }
210 
218  {
219  properties_ = properties;
220  }
221 
228  {
229  return wire_protocol_;
230  }
231 
238  {
239  return wire_protocol_;
240  }
241 
249  {
250  wire_protocol_ = wire_protocol;
251  }
252 
259  {
260  return transport_;
261  }
262 
269  {
270  return transport_;
271  }
272 
278  void transport(
280  {
281  transport_ = transport;
282  }
283 
289  const fastcdr::string_255& name() const
290  {
291  return name_;
292  }
293 
299  fastcdr::string_255& name()
300  {
301  return name_;
302  }
303 
309  void name(
310  const fastcdr::string_255& value)
311  {
312  name_ = value;
313  }
314 
321  {
322  return flow_controllers_;
323  }
324 
331  FASTDDS_EXPORTED_API bool compare_flow_controllers(
332  const DomainParticipantQos& qos) const;
333 
340  {
341  return flow_controllers_;
342  }
343 
350  {
351  return builtin_controllers_sender_thread_;
352  }
353 
360  {
361  return builtin_controllers_sender_thread_;
362  }
363 
371  FASTDDS_EXPORTED_API void setup_transports(
372  rtps::BuiltinTransports transports,
374 
381  const rtps::ThreadSettings& value)
382  {
383  builtin_controllers_sender_thread_ = value;
384  }
385 
392  {
393  return timed_events_thread_;
394  }
395 
402  {
403  return timed_events_thread_;
404  }
405 
412  const rtps::ThreadSettings& value)
413  {
414  timed_events_thread_ = value;
415  }
416 
423  {
424  return discovery_server_thread_;
425  }
426 
433  {
434  return discovery_server_thread_;
435  }
436 
443  const rtps::ThreadSettings& value)
444  {
445  discovery_server_thread_ = value;
446  }
447 
454  {
455  return typelookup_service_thread_;
456  }
457 
464  {
465  return typelookup_service_thread_;
466  }
467 
474  const rtps::ThreadSettings& value)
475  {
476  typelookup_service_thread_ = value;
477  }
478 
479 #if HAVE_SECURITY
485  rtps::ThreadSettings& security_log_thread()
486  {
487  return security_log_thread_;
488  }
489 
495  const rtps::ThreadSettings& security_log_thread() const
496  {
497  return security_log_thread_;
498  }
499 
505  void security_log_thread(
506  const rtps::ThreadSettings& value)
507  {
508  security_log_thread_ = value;
509  }
510 
511 #endif // if HAVE_SECURITY
512 
513 private:
514 
516  UserDataQosPolicy user_data_;
517 
519  EntityFactoryQosPolicy entity_factory_;
520 
522  ParticipantResourceLimitsQos allocation_;
523 
525  PropertyPolicyQos properties_;
526 
528  WireProtocolConfigQos wire_protocol_;
529 
531  TransportConfigQos transport_;
532 
534  fastcdr::string_255 name_ = "RTPSParticipant";
535 
540  FlowControllerDescriptorList flow_controllers_;
541 
543  rtps::ThreadSettings builtin_controllers_sender_thread_;
544 
546  rtps::ThreadSettings timed_events_thread_;
547 
549  rtps::ThreadSettings discovery_server_thread_;
550 
552  rtps::ThreadSettings typelookup_service_thread_;
553 
554 #if HAVE_SECURITY
556  rtps::ThreadSettings security_log_thread_;
557 #endif // if HAVE_SECURITY
558 
559 };
560 
561 FASTDDS_EXPORTED_API extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT;
562 
563 
564 } // namespace dds
565 } // namespace fastdds
566 } // namespace eprosima
567 
568 #endif // FASTDDS_DDS_DOMAIN_QOS__DOMAINPARTICIPANTQOS_HPP
Definition: DomainParticipantExtendedQos.hpp:32
Class DomainParticipantQos, contains all the possible Qos that can be set for a determined participan...
Definition: DomainParticipantQos.hpp:42
void allocation(const ParticipantResourceLimitsQos &allocation)
Setter for ParticipantResourceLimitsQos.
Definition: DomainParticipantQos.hpp:185
PropertyPolicyQos & properties()
Getter for PropertyPolicyQos.
Definition: DomainParticipantQos.hpp:206
TransportConfigQos & transport()
Getter for TransportConfigQos.
Definition: DomainParticipantQos.hpp:268
WireProtocolConfigQos & wire_protocol()
Getter for WireProtocolConfigQos.
Definition: DomainParticipantQos.hpp:237
const WireProtocolConfigQos & wire_protocol() const
Getter for WireProtocolConfigQos.
Definition: DomainParticipantQos.hpp:227
rtps::ThreadSettings & builtin_controllers_sender_thread()
Getter for builtin flow controllers sender threads ThreadSettings.
Definition: DomainParticipantQos.hpp:349
FASTDDS_EXPORTED_API void setup_transports(rtps::BuiltinTransports transports, const rtps::BuiltinTransportsOptions &options=rtps::BuiltinTransportsOptions())
Provides a way of easily configuring transport related configuration on certain pre-defined scenarios...
const FlowControllerDescriptorList & flow_controllers() const
Getter for FlowControllerDescriptorList.
Definition: DomainParticipantQos.hpp:339
const rtps::ThreadSettings & typelookup_service_thread() const
Getter for TypeLookup service ThreadSettings.
Definition: DomainParticipantQos.hpp:463
void discovery_server_thread(const rtps::ThreadSettings &value)
Setter for the discovery server ThreadSettings.
Definition: DomainParticipantQos.hpp:442
virtual bool operator==(const DomainParticipantQos &b) const
Definition: DomainParticipantQos.hpp:78
void entity_factory(const EntityFactoryQosPolicy &value)
Setter for EntityFactoryQosPolicy.
Definition: DomainParticipantQos.hpp:154
const fastcdr::string_255 & name() const
Getter for the Participant name.
Definition: DomainParticipantQos.hpp:289
const UserDataQosPolicy & user_data() const
Getter for UserDataQosPolicy.
Definition: DomainParticipantQos.hpp:103
rtps::ThreadSettings & typelookup_service_thread()
Getter for TypeLookup service ThreadSettings.
Definition: DomainParticipantQos.hpp:453
void wire_protocol(const WireProtocolConfigQos &wire_protocol)
Setter for WireProtocolConfigQos.
Definition: DomainParticipantQos.hpp:247
const PropertyPolicyQos & properties() const
Getter for PropertyPolicyQos.
Definition: DomainParticipantQos.hpp:196
virtual FASTDDS_EXPORTED_API ~DomainParticipantQos()
Destructor.
Definition: DomainParticipantQos.hpp:74
rtps::ThreadSettings & timed_events_thread()
Getter for timed event ThreadSettings.
Definition: DomainParticipantQos.hpp:391
const rtps::ThreadSettings & builtin_controllers_sender_thread() const
Getter for builtin flow controllers sender threads ThreadSettings.
Definition: DomainParticipantQos.hpp:359
const TransportConfigQos & transport() const
Getter for TransportConfigQos.
Definition: DomainParticipantQos.hpp:258
void transport(const TransportConfigQos &transport)
Setter for TransportConfigQos.
Definition: DomainParticipantQos.hpp:278
void typelookup_service_thread(const rtps::ThreadSettings &value)
Setter for the TypeLookup service ThreadSettings.
Definition: DomainParticipantQos.hpp:473
void builtin_controllers_sender_thread(const rtps::ThreadSettings &value)
Setter for the builtin flow controllers sender threads ThreadSettings.
Definition: DomainParticipantQos.hpp:380
FASTDDS_EXPORTED_API bool compare_flow_controllers(const DomainParticipantQos &qos) const
Compares the flow controllers of two DomainParticipantQos element-wise.
rtps::ThreadSettings & discovery_server_thread()
Getter for discovery server ThreadSettings.
Definition: DomainParticipantQos.hpp:422
const ParticipantResourceLimitsQos & allocation() const
Getter for ParticipantResourceLimitsQos.
Definition: DomainParticipantQos.hpp:165
FASTDDS_EXPORTED_API DomainParticipantQos()
Constructor.
Definition: DomainParticipantQos.hpp:57
void user_data(const UserDataQosPolicy &value)
Setter for UserDataQosPolicy.
Definition: DomainParticipantQos.hpp:123
const rtps::ThreadSettings & timed_events_thread() const
Getter for timed event ThreadSettings.
Definition: DomainParticipantQos.hpp:401
UserDataQosPolicy & user_data()
Getter for UserDataQosPolicy.
Definition: DomainParticipantQos.hpp:113
FlowControllerDescriptorList & flow_controllers()
Getter for FlowControllerDescriptorList.
Definition: DomainParticipantQos.hpp:320
const EntityFactoryQosPolicy & entity_factory() const
Getter for EntityFactoryQosPolicy.
Definition: DomainParticipantQos.hpp:134
ParticipantResourceLimitsQos & allocation()
Getter for ParticipantResourceLimitsQos.
Definition: DomainParticipantQos.hpp:175
EntityFactoryQosPolicy & entity_factory()
Getter for EntityFactoryQosPolicy.
Definition: DomainParticipantQos.hpp:144
fastcdr::string_255 & name()
Getter for the Participant name.
Definition: DomainParticipantQos.hpp:299
const rtps::ThreadSettings & discovery_server_thread() const
Getter for discovery server ThreadSettings.
Definition: DomainParticipantQos.hpp:432
void properties(const PropertyPolicyQos &properties)
Setter for PropertyPolicyQos.
Definition: DomainParticipantQos.hpp:216
void name(const fastcdr::string_255 &value)
Setter for the Participant name.
Definition: DomainParticipantQos.hpp:309
void timed_events_thread(const rtps::ThreadSettings &value)
Setter for the timed event ThreadSettings.
Definition: DomainParticipantQos.hpp:411
std::vector< std::shared_ptr< fastdds::rtps::FlowControllerDescriptor > > FlowControllerDescriptorList
User defined flow controllers to use alongside.
Definition: DomainParticipantQos.hpp:52
Controls the behavior of the entity when acting as a factory for other entities.
Definition: QosPolicies.hpp:189
Qos Policy to configure the transport layer.
Definition: QosPolicies.hpp:2759
Qos Policy that configures the wire protocol.
Definition: QosPolicies.hpp:2635
Definition: PropertyPolicy.hpp:30
FASTDDS_EXPORTED_API const PropertySeq & properties() const
Get properties.
Definition: PropertyPolicy.hpp:81
const char *const parameter_policy_physical_data_host
Parameter property value for Host physical data.
Definition: ParameterTypes.hpp:1210
const char *const parameter_policy_physical_data_process
Parameter property value for Process physical data.
Definition: ParameterTypes.hpp:1224
const char *const parameter_policy_physical_data_user
Parameter property value for User physical data.
Definition: ParameterTypes.hpp:1217
Definition: DomainParticipant.hpp:46
FASTDDS_EXPORTED_API const DomainParticipantQos PARTICIPANT_QOS_DEFAULT
fastdds::rtps::PropertyPolicy PropertyPolicyQos
Property policies.
Definition: QosPolicies.hpp:2631
fastdds::rtps::RTPSParticipantAllocationAttributes ParticipantResourceLimitsQos
Holds allocation limits affecting collections managed by a participant.
Definition: QosPolicies.hpp:2628
BuiltinTransports
Defines the kind of transports automatically instantiated upon the creation of a participant.
Definition: BuiltinTransports.hpp:106
Options for configuring the built-in transports when using LARGE_DATA mode.
Definition: BuiltinTransports.hpp:37
Holds allocation limits affecting collections managed by a participant.
Definition: RTPSParticipantAllocationAttributes.hpp:129
Struct ThreadSettings to specify various thread settings.
Definition: ThreadSettings.hpp:37