Coverage Report

Created: 2022-08-24 06:19

/src/Fast-DDS/include/fastdds/dds/domain/qos/DomainParticipantQos.hpp
Line
Count
Source (jump to first uncovered line)
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
15
/**
16
 * @file DomainParticipantQos.hpp
17
 *
18
 */
19
20
#ifndef _FASTDDS_PARTICIPANTQOS_HPP_
21
#define _FASTDDS_PARTICIPANTQOS_HPP_
22
23
#include <string>
24
25
#include <fastrtps/fastrtps_dll.h>
26
#include <fastdds/dds/core/policy/QosPolicies.hpp>
27
#include <fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp>
28
29
namespace eprosima {
30
namespace fastdds {
31
namespace dds {
32
33
/**
34
 * Class DomainParticipantQos, contains all the possible Qos that can be set for a determined participant.
35
 * Please consult each of them to check for implementation details and default values.
36
 *
37
 * @ingroup FASTDDS_QOS_MODULE
38
 */
39
class DomainParticipantQos
40
{
41
public:
42
43
    /*!
44
     * User defined flow controllers to use alongside.
45
     *
46
     * @since 2.4.0
47
     */
48
    using FlowControllerDescriptorList = std::vector<std::shared_ptr<fastdds::rtps::FlowControllerDescriptor>>;
49
50
    /**
51
     * @brief Constructor
52
     */
53
    RTPS_DllAPI DomainParticipantQos()
54
2
    {
55
#ifdef FASTDDS_STATISTICS
56
        /*
57
         * In the case of Statistics, the following properties are set with an empty value. This is because if these
58
         * properties are set and empty during the enabling of the DomainParticipant, they are fill with the default
59
         * mechanism
60
         */
61
        properties_.properties().emplace_back(parameter_policy_physical_data_host, "");
62
        properties_.properties().emplace_back(parameter_policy_physical_data_user, "");
63
        properties_.properties().emplace_back(parameter_policy_physical_data_process, "");
64
#endif // ifdef FASTDDS_STATISTICS
65
2
    }
66
67
    /**
68
     * @brief Destructor
69
     */
70
    RTPS_DllAPI virtual ~DomainParticipantQos()
71
0
    {
72
0
    }
73
74
    bool operator ==(
75
            const DomainParticipantQos& b) const
76
0
    {
77
0
        return (this->user_data_ == b.user_data()) &&
78
0
               (this->entity_factory_ == b.entity_factory()) &&
79
0
               (this->allocation_ == b.allocation()) &&
80
0
               (this->properties_ == b.properties()) &&
81
0
               (this->wire_protocol_ == b.wire_protocol()) &&
82
0
               (this->transport_ == b.transport()) &&
83
0
               (this->name_ == b.name()) &&
84
0
               (this->flow_controllers_ == b.flow_controllers());
85
0
    }
86
87
    /**
88
     * Getter for UserDataQosPolicy
89
     *
90
     * @return UserDataQosPolicy reference
91
     */
92
    const UserDataQosPolicy& user_data() const
93
0
    {
94
0
        return user_data_;
95
0
    }
96
97
    /**
98
     * Getter for UserDataQosPolicy
99
     *
100
     * @return UserDataQosPolicy reference
101
     */
102
    UserDataQosPolicy& user_data()
103
0
    {
104
0
        return user_data_;
105
0
    }
106
107
    /**
108
     * Setter for UserDataQosPolicy
109
     *
110
     * @param value UserDataQosPolicy
111
     */
112
    void user_data(
113
            const UserDataQosPolicy& value)
114
0
    {
115
0
        user_data_ = value;
116
0
    }
117
118
    /**
119
     * Getter for EntityFactoryQosPolicy
120
     *
121
     * @return EntityFactoryQosPolicy reference
122
     */
123
    const EntityFactoryQosPolicy& entity_factory() const
124
0
    {
125
0
        return entity_factory_;
126
0
    }
127
128
    /**
129
     * Getter for EntityFactoryQosPolicy
130
     *
131
     * @return EntityFactoryQosPolicy reference
132
     */
133
    EntityFactoryQosPolicy& entity_factory()
134
0
    {
135
0
        return entity_factory_;
136
0
    }
137
138
    /**
139
     * Setter for EntityFactoryQosPolicy
140
     *
141
     * @param value EntityFactoryQosPolicy
142
     */
143
    void entity_factory(
144
            const EntityFactoryQosPolicy& value)
145
0
    {
146
0
        entity_factory_ = value;
147
0
    }
148
149
    /**
150
     * Getter for ParticipantResourceLimitsQos
151
     *
152
     * @return ParticipantResourceLimitsQos reference
153
     */
154
    const ParticipantResourceLimitsQos& allocation() const
155
0
    {
156
0
        return allocation_;
157
0
    }
158
159
    /**
160
     * Getter for ParticipantResourceLimitsQos
161
     *
162
     * @return ParticipantResourceLimitsQos reference
163
     */
164
    ParticipantResourceLimitsQos& allocation()
165
0
    {
166
0
        return allocation_;
167
0
    }
168
169
    /**
170
     * Setter for ParticipantResourceLimitsQos
171
     *
172
     * @param allocation ParticipantResourceLimitsQos
173
     */
174
    void allocation(
175
            const ParticipantResourceLimitsQos& allocation)
176
0
    {
177
0
        allocation_ = allocation;
178
0
    }
179
180
    /**
181
     * Getter for PropertyPolicyQos
182
     *
183
     * @return PropertyPolicyQos reference
184
     */
185
    const PropertyPolicyQos& properties() const
186
0
    {
187
0
        return properties_;
188
0
    }
189
190
    /**
191
     * Getter for PropertyPolicyQos
192
     *
193
     * @return PropertyPolicyQos reference
194
     */
195
    PropertyPolicyQos& properties()
196
0
    {
197
0
        return properties_;
198
0
    }
199
200
    /**
201
     * Setter for PropertyPolicyQos
202
     *
203
     * @param properties PropertyPolicyQos
204
     */
205
    void properties(
206
            const PropertyPolicyQos& properties)
207
0
    {
208
0
        properties_ = properties;
209
0
    }
210
211
    /**
212
     * Getter for WireProtocolConfigQos
213
     *
214
     * @return WireProtocolConfigQos reference
215
     */
216
    const WireProtocolConfigQos& wire_protocol() const
217
0
    {
218
0
        return wire_protocol_;
219
0
    }
220
221
    /**
222
     * Getter for WireProtocolConfigQos
223
     *
224
     * @return WireProtocolConfigQos reference
225
     */
226
    WireProtocolConfigQos& wire_protocol()
227
0
    {
228
0
        return wire_protocol_;
229
0
    }
230
231
    /**
232
     * Setter for WireProtocolConfigQos
233
     *
234
     * @param wire_protocol WireProtocolConfigQos
235
     */
236
    void wire_protocol(
237
            const WireProtocolConfigQos& wire_protocol)
238
0
    {
239
0
        wire_protocol_ = wire_protocol;
240
0
    }
241
242
    /**
243
     * Getter for TransportConfigQos
244
     *
245
     * @return TransportConfigQos reference
246
     */
247
    const TransportConfigQos& transport() const
248
0
    {
249
0
        return transport_;
250
0
    }
251
252
    /**
253
     * Getter for TransportConfigQos
254
     *
255
     * @return TransportConfigQos reference
256
     */
257
    TransportConfigQos& transport()
258
0
    {
259
0
        return transport_;
260
0
    }
261
262
    /**
263
     * Setter for TransportConfigQos
264
     *
265
     * @param transport TransportConfigQos
266
     */
267
    void transport(
268
            const TransportConfigQos& transport)
269
0
    {
270
0
        transport_ = transport;
271
0
    }
272
273
    /**
274
     * Getter for the Participant name
275
     *
276
     * @return name
277
     */
278
    const fastrtps::string_255& name() const
279
0
    {
280
0
        return name_;
281
0
    }
282
283
    /**
284
     * Getter for the Participant name
285
     *
286
     * @return name
287
     */
288
    fastrtps::string_255& name()
289
0
    {
290
0
        return name_;
291
0
    }
292
293
    /**
294
     * Setter for the Participant name
295
     *
296
     * @param value New name to be set
297
     */
298
    void name(
299
            const fastrtps::string_255& value)
300
0
    {
301
0
        name_ = value;
302
0
    }
303
304
    /**
305
     * Getter for FlowControllerDescriptorList
306
     *
307
     * @return FlowControllerDescriptorList reference
308
     */
309
    FlowControllerDescriptorList& flow_controllers()
310
0
    {
311
0
        return flow_controllers_;
312
0
    }
313
314
    /**
315
     * Getter for FlowControllerDescriptorList
316
     *
317
     * @return FlowControllerDescriptorList reference
318
     */
319
    const FlowControllerDescriptorList& flow_controllers() const
320
0
    {
321
0
        return flow_controllers_;
322
0
    }
323
324
private:
325
326
    //!UserData Qos, implemented in the library.
327
    UserDataQosPolicy user_data_;
328
329
    //!EntityFactory Qos, implemented in the library.
330
    EntityFactoryQosPolicy entity_factory_;
331
332
    //!Participant allocation limits
333
    ParticipantResourceLimitsQos allocation_;
334
335
    //!Property policies
336
    PropertyPolicyQos properties_;
337
338
    //!Wire Protocol options
339
    WireProtocolConfigQos wire_protocol_;
340
341
    //!Transport options
342
    TransportConfigQos transport_;
343
344
    //!Name of the participant.
345
    fastrtps::string_255 name_ = "RTPSParticipant";
346
347
    /*! User defined flow controller to use alongside.
348
     *
349
     *  @since 2.4.0
350
     */
351
    FlowControllerDescriptorList flow_controllers_;
352
353
};
354
355
RTPS_DllAPI extern const DomainParticipantQos PARTICIPANT_QOS_DEFAULT;
356
357
358
} /* namespace dds */
359
} /* namespace fastdds */
360
} /* namespace eprosima */
361
362
#endif /* _FASTDDS_PARTICIPANTQOS_HPP_ */