Coverage Report

Created: 2025-06-13 06:46

/src/Fast-DDS/include/fastdds/dds/topic/qos/TopicQos.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 TopicQos.hpp
17
 */
18
19
20
#ifndef FASTDDS_DDS_TOPIC_QOS__TOPICQOS_HPP
21
#define FASTDDS_DDS_TOPIC_QOS__TOPICQOS_HPP
22
23
#include <fastdds/dds/core/policy/QosPolicies.hpp>
24
25
#include <fastdds/dds/log/Log.hpp>
26
27
namespace eprosima {
28
namespace fastdds {
29
namespace dds {
30
31
/**
32
 * Class TopicQos, containing all the possible Qos that can be set for a determined Topic.
33
 * Although these values can be set and are transmitted
34
 * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
35
 * Please consult each of them to check for implementation details and default values.
36
 *
37
 * @ingroup FASTDDS_QOS_MODULE
38
 */
39
class TopicQos
40
{
41
public:
42
43
    /**
44
     * @brief Constructor
45
     */
46
    FASTDDS_EXPORTED_API TopicQos();
47
48
    bool operator ==(
49
            const TopicQos& b) const
50
0
    {
51
0
        return (this->topic_data_ == b.topic_data()) &&
52
0
               (this->durability_ == b.durability()) &&
53
0
               (this->durability_service_ == b.durability_service()) &&
54
0
               (this->deadline_ == b.deadline()) &&
55
0
               (this->latency_budget_ == b.latency_budget()) &&
56
0
               (this->liveliness_ == b.liveliness()) &&
57
0
               (this->reliability_ == b.reliability()) &&
58
0
               (this->destination_order_ == b.destination_order()) &&
59
0
               (this->history_ == b.history()) &&
60
0
               (this->resource_limits_ == b.resource_limits()) &&
61
0
               (this->transport_priority_ == b.transport_priority()) &&
62
0
               (this->lifespan_ == b.lifespan()) &&
63
0
               (this->ownership_ == b.ownership());
64
0
    }
65
66
    /**
67
     * Getter for TopicDataQosPolicy
68
     *
69
     * @return TopicDataQos reference
70
     */
71
    const TopicDataQosPolicy& topic_data() const
72
0
    {
73
0
        return topic_data_;
74
0
    }
75
76
    /**
77
     * Getter for TopicDataQosPolicy
78
     *
79
     * @return TopicDataQos reference
80
     */
81
    TopicDataQosPolicy& topic_data()
82
0
    {
83
0
        return topic_data_;
84
0
    }
85
86
    /**
87
     * Setter for TopicDataQosPolicy
88
     *
89
     * @param value new value for the TopicDataQosPolicy
90
     */
91
    void topic_data(
92
            const TopicDataQosPolicy& value)
93
0
    {
94
0
        topic_data_ = value;
95
0
    }
96
97
    /**
98
     * Getter for DurabilityQosPolicy
99
     *
100
     * @return DurabilityQos reference
101
     */
102
    const DurabilityQosPolicy& durability() const
103
0
    {
104
0
        return durability_;
105
0
    }
106
107
    /**
108
     * Getter for DurabilityQosPolicy
109
     *
110
     * @return DurabilityQos reference
111
     */
112
    DurabilityQosPolicy& durability()
113
0
    {
114
0
        return durability_;
115
0
    }
116
117
    /**
118
     * Setter for DurabilityQosPolicy
119
     *
120
     * @param durability new value for the DurabilityQosPolicy
121
     */
122
    void durability(
123
            const DurabilityQosPolicy& durability)
124
0
    {
125
0
        durability_ = durability;
126
0
    }
127
128
    /**
129
     * Getter for DurabilityServiceQosPolicy
130
     *
131
     * @return DurabilityServiceQos reference
132
     */
133
    const DurabilityServiceQosPolicy& durability_service() const
134
0
    {
135
0
        return durability_service_;
136
0
    }
137
138
    /**
139
     * Getter for DurabilityServiceQosPolicy
140
     *
141
     * @return DurabilityServiceQos reference
142
     */
143
    DurabilityServiceQosPolicy& durability_service()
144
0
    {
145
0
        return durability_service_;
146
0
    }
147
148
    /**
149
     * Setter for DurabilityServiceQosPolicy
150
     *
151
     * @param durability_service new value for the DurabilityServiceQosPolicy
152
     */
153
    void durability_service(
154
            const DurabilityServiceQosPolicy& durability_service)
155
0
    {
156
0
        durability_service_ = durability_service;
157
0
    }
158
159
    /**
160
     * Getter for DeadlineQosPolicy
161
     *
162
     * @return DeadlineQos reference
163
     */
164
    const DeadlineQosPolicy& deadline() const
165
0
    {
166
0
        return deadline_;
167
0
    }
168
169
    /**
170
     * Getter for DeadlineQosPolicy
171
     *
172
     * @return DeadlineQos reference
173
     */
174
    DeadlineQosPolicy& deadline()
175
0
    {
176
0
        return deadline_;
177
0
    }
178
179
    /**
180
     * Setter for DeadlineQosPolicy
181
     *
182
     * @param deadline new value for the DeadlineQosPolicy
183
     */
184
    void deadline(
185
            const DeadlineQosPolicy& deadline)
186
0
    {
187
0
        deadline_ = deadline;
188
0
    }
189
190
    /**
191
     * Getter for LatencyBudgetQosPolicy
192
     *
193
     * @return LatencyBudgetQos reference
194
     */
195
    const LatencyBudgetQosPolicy& latency_budget() const
196
0
    {
197
0
        return latency_budget_;
198
0
    }
199
200
    /**
201
     * Getter for LatencyBudgetQosPolicy
202
     *
203
     * @return LatencyBudgetQos reference
204
     */
205
    LatencyBudgetQosPolicy& latency_budget()
206
0
    {
207
0
        return latency_budget_;
208
0
    }
209
210
    /**
211
     * Setter for LatencyBudgetQosPolicy
212
     *
213
     * @param latency_budget new value for the LatencyBudgetQosPolicy
214
     */
215
    void latency_budget(
216
            const LatencyBudgetQosPolicy& latency_budget)
217
0
    {
218
0
        latency_budget_ = latency_budget;
219
0
    }
220
221
    /**
222
     * Getter for LivelinessQosPolicy
223
     *
224
     * @return LivelinessQos reference
225
     */
226
    const LivelinessQosPolicy& liveliness() const
227
0
    {
228
0
        return liveliness_;
229
0
    }
230
231
    /**
232
     * Getter for LivelinessQosPolicy
233
     *
234
     * @return LivelinessQos reference
235
     */
236
    LivelinessQosPolicy& liveliness()
237
0
    {
238
0
        return liveliness_;
239
0
    }
240
241
    /**
242
     * Setter for LivelinessQosPolicy
243
     *
244
     * @param liveliness new value for the LivelinessQosPolicy
245
     */
246
    void liveliness(
247
            const LivelinessQosPolicy& liveliness)
248
0
    {
249
0
        liveliness_ = liveliness;
250
0
    }
251
252
    /**
253
     * Getter for ReliabilityQosPolicy
254
     *
255
     * @return ReliabilityQos reference
256
     */
257
    const ReliabilityQosPolicy& reliability() const
258
0
    {
259
0
        return reliability_;
260
0
    }
261
262
    /**
263
     * Getter for ReliabilityQosPolicy
264
     *
265
     * @return ReliabilityQos reference
266
     */
267
    ReliabilityQosPolicy& reliability()
268
0
    {
269
0
        return reliability_;
270
0
    }
271
272
    /**
273
     * Setter for ReliabilityQosPolicy
274
     *
275
     * @param reliability new value for the ReliabilityQosPolicy
276
     */
277
    void reliability(
278
            const ReliabilityQosPolicy& reliability)
279
0
    {
280
0
        reliability_ = reliability;
281
0
    }
282
283
    /**
284
     * Getter for DestinationOrderQosPolicy
285
     *
286
     * @return DestinationOrderQos reference
287
     */
288
    const DestinationOrderQosPolicy& destination_order() const
289
0
    {
290
0
        return destination_order_;
291
0
    }
292
293
    /**
294
     * Getter for DestinationOrderQosPolicy
295
     *
296
     * @return DestinationOrderQos reference
297
     */
298
    DestinationOrderQosPolicy& destination_order()
299
0
    {
300
0
        return destination_order_;
301
0
    }
302
303
    /**
304
     * Setter for DestinationOrderQosPolicy
305
     *
306
     * @param destination_order new value for the DestinationOrderQosPolicy
307
     */
308
    void destination_order(
309
            const DestinationOrderQosPolicy& destination_order)
310
0
    {
311
0
        destination_order_ = destination_order;
312
0
    }
313
314
    /**
315
     * Getter for HistoryQosPolicy
316
     *
317
     * @return HistoryQos reference
318
     */
319
    const HistoryQosPolicy& history() const
320
0
    {
321
0
        return history_;
322
0
    }
323
324
    /**
325
     * Getter for HistoryQosPolicy
326
     *
327
     * @return HistoryQos reference
328
     */
329
    HistoryQosPolicy& history()
330
0
    {
331
0
        return history_;
332
0
    }
333
334
    /**
335
     * Setter for HistoryQosPolicy
336
     *
337
     * @param history new value for the HistoryQosPolicy
338
     */
339
    void history(
340
            const HistoryQosPolicy& history)
341
0
    {
342
0
        history_ = history;
343
0
    }
344
345
    /**
346
     * Getter for ResourceLimitsQosPolicy
347
     *
348
     * @return ResourceLimitsQos reference
349
     */
350
    const ResourceLimitsQosPolicy& resource_limits() const
351
0
    {
352
0
        return resource_limits_;
353
0
    }
354
355
    /**
356
     * Getter for ResourceLimitsQosPolicy
357
     *
358
     * @return ResourceLimitsQos reference
359
     */
360
    ResourceLimitsQosPolicy& resource_limits()
361
0
    {
362
0
        return resource_limits_;
363
0
    }
364
365
    /**
366
     * Setter for ResourceLimitsQosPolicy
367
     *
368
     * @param resource_limits new value for the ResourceLimitsQosPolicy
369
     */
370
    void resource_limits(
371
            const ResourceLimitsQosPolicy& resource_limits)
372
0
    {
373
0
        resource_limits_ = resource_limits;
374
0
    }
375
376
    /**
377
     * Getter for TransportPriorityQosPolicy
378
     *
379
     * @return TransportPriorityQos reference
380
     */
381
    const TransportPriorityQosPolicy& transport_priority() const
382
0
    {
383
0
        return transport_priority_;
384
0
    }
385
386
    /**
387
     * Getter for TransportPriorityQosPolicy
388
     *
389
     * @return TransportPriorityQos reference
390
     */
391
    TransportPriorityQosPolicy& transport_priority()
392
0
    {
393
0
        return transport_priority_;
394
0
    }
395
396
    /**
397
     * Setter for TransportPriorityQosPolicy
398
     *
399
     * @param transport_priority new value for the TransportPriorityQosPolicy
400
     */
401
    void transport_priority(
402
            const TransportPriorityQosPolicy& transport_priority)
403
0
    {
404
0
        transport_priority_ = transport_priority;
405
0
    }
406
407
    /**
408
     * Getter for LifespanQosPolicy
409
     *
410
     * @return LifespanQos reference
411
     */
412
    const LifespanQosPolicy& lifespan() const
413
0
    {
414
0
        return lifespan_;
415
0
    }
416
417
    /**
418
     * Getter for LifespanQosPolicy
419
     *
420
     * @return LifespanQos reference
421
     */
422
    LifespanQosPolicy& lifespan()
423
0
    {
424
0
        return lifespan_;
425
0
    }
426
427
    /**
428
     * Setter for LifespanQosPolicy
429
     *
430
     * @param lifespan new value for the LifespanQosPolicy
431
     */
432
    void lifespan(
433
            const LifespanQosPolicy& lifespan)
434
0
    {
435
0
        lifespan_ = lifespan;
436
0
    }
437
438
    /**
439
     * Getter for OwnershipQosPolicy
440
     *
441
     * @return OwnershipQos reference
442
     */
443
    const OwnershipQosPolicy& ownership() const
444
0
    {
445
0
        return ownership_;
446
0
    }
447
448
    /**
449
     * Getter for OwnershipQosPolicy
450
     *
451
     * @return OwnershipQos reference
452
     */
453
    OwnershipQosPolicy& ownership()
454
0
    {
455
0
        return ownership_;
456
0
    }
457
458
    /**
459
     * Setter for OwnershipQosPolicy
460
     *
461
     * @param ownership new value for the OwnershipQosPolicy
462
     */
463
    void ownership(
464
            const OwnershipQosPolicy& ownership)
465
0
    {
466
0
        ownership_ = ownership;
467
0
    }
468
469
    /**
470
     * Getter for DataRepresentationQosPolicy
471
     *
472
     * @return DataRepresentationQosPolicy reference
473
     */
474
    const DataRepresentationQosPolicy& representation() const
475
0
    {
476
0
        return representation_;
477
0
    }
478
479
    /**
480
     * Getter for DataRepresentationQosPolicy
481
     *
482
     * @return DataRepresentationQosPolicy reference
483
     */
484
    DataRepresentationQosPolicy& representation()
485
0
    {
486
0
        return representation_;
487
0
    }
488
489
    /**
490
     * Setter for DataRepresentationQosPolicy
491
     *
492
     * @param representation new value for the DataRepresentationQosPolicy
493
     */
494
    void representation(
495
            const DataRepresentationQosPolicy& representation)
496
0
    {
497
0
        representation_ = representation;
498
0
    }
499
500
private:
501
502
    //!Topic Data Qos, NOT implemented in the library.
503
    TopicDataQosPolicy topic_data_;
504
505
    //!Durability Qos, implemented in the library.
506
    DurabilityQosPolicy durability_;
507
508
    //!Durability Service Qos, NOT implemented in the library.
509
    DurabilityServiceQosPolicy durability_service_;
510
511
    //!Deadline Qos, implemented in the library.
512
    DeadlineQosPolicy deadline_;
513
514
    //!Latency Budget Qos, NOT implemented in the library.
515
    LatencyBudgetQosPolicy latency_budget_;
516
517
    //!Liveliness Qos, implemented in the library.
518
    LivelinessQosPolicy liveliness_;
519
520
    //!Reliability Qos, implemented in the library.
521
    ReliabilityQosPolicy reliability_;
522
523
    //!Destination Order Qos, NOT implemented in the library.
524
    DestinationOrderQosPolicy destination_order_;
525
526
    //!History Qos, implemented in the library.
527
    HistoryQosPolicy history_;
528
529
    //!Resource Limits Qos, implemented in the library.
530
    ResourceLimitsQosPolicy resource_limits_;
531
532
    //!Transport Priority Qos, NOT implemented in the library.
533
    TransportPriorityQosPolicy transport_priority_;
534
535
    //!Lifespan Qos, implemented in the library.
536
    LifespanQosPolicy lifespan_;
537
538
    //!Ownership Qos, NOT implemented in the library.
539
    OwnershipQosPolicy ownership_;
540
541
    //!Data Representation Qos, (XTypes extension).
542
    DataRepresentationQosPolicy representation_;
543
};
544
545
FASTDDS_EXPORTED_API extern const TopicQos TOPIC_QOS_DEFAULT;
546
547
} // namespace dds
548
} // namespace fastdds
549
} // namespace eprosima
550
551
#endif // FASTDDS_DDS_TOPIC_QOS__TOPICQOS_HPP