Coverage Report

Created: 2025-06-13 06:46

/src/Fast-DDS/include/fastdds/dds/publisher/qos/WriterQos.hpp
Line
Count
Source (jump to first uncovered line)
1
// Copyright 2016 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 WriterQos.hpp
17
 *
18
 */
19
20
#ifndef FASTDDS_DDS_PUBLISHER_QOS__WRITERQOS_HPP
21
#define FASTDDS_DDS_PUBLISHER_QOS__WRITERQOS_HPP
22
23
#include <fastdds/dds/core/policy/QosPolicies.hpp>
24
25
namespace eprosima {
26
namespace fastdds {
27
namespace dds {
28
29
/**
30
 * Class WriterQos, containing all the possible Qos that can be set for a determined Publisher.
31
 * Although these values can be set and are transmitted
32
 * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
33
 * Please consult each of them to check for implementation details and default values.
34
 * @ingroup FASTDDS_QOS_MODULE
35
 */
36
FASTDDS_TODO_BEFORE(4, 0, "Remove this class in favor of PublicationBuiltinTopicData");
37
class WriterQos
38
{
39
public:
40
41
    FASTDDS_EXPORTED_API WriterQos();
42
    FASTDDS_EXPORTED_API virtual ~WriterQos();
43
44
    bool operator ==(
45
            const WriterQos& b) const
46
0
    {
47
0
        return (this->m_durability == b.m_durability) &&
48
0
               (this->m_durabilityService == b.m_durabilityService) &&
49
0
               (this->m_deadline == b.m_deadline) &&
50
0
               (this->m_latencyBudget == b.m_latencyBudget) &&
51
0
               (this->m_liveliness == b.m_liveliness) &&
52
0
               (this->m_reliability == b.m_reliability) &&
53
0
               (this->m_lifespan == b.m_lifespan) &&
54
0
               (this->m_userData == b.m_userData) &&
55
0
               (this->m_timeBasedFilter == b.m_timeBasedFilter) &&
56
0
               (this->m_ownership == b.m_ownership) &&
57
0
               (this->m_ownershipStrength == b.m_ownershipStrength) &&
58
0
               (this->m_destinationOrder == b.m_destinationOrder) &&
59
0
               (this->m_presentation == b.m_presentation) &&
60
0
               (this->m_partition == b.m_partition) &&
61
0
               (this->m_topicData == b.m_topicData) &&
62
0
               (this->m_groupData == b.m_groupData) &&
63
0
               (this->m_publishMode == b.m_publishMode) &&
64
0
               (this->m_disablePositiveACKs == b.m_disablePositiveACKs) &&
65
0
               (this->representation == b.representation) &&
66
0
               (this->data_sharing == b.data_sharing);
67
0
    }
68
69
    //!Durability Qos, implemented in the library.
70
    DurabilityQosPolicy m_durability;
71
72
    //!Durability Service Qos, NOT implemented in the library.
73
    DurabilityServiceQosPolicy m_durabilityService;
74
75
    //!Deadline Qos, implemented in the library.
76
    DeadlineQosPolicy m_deadline;
77
78
    //!Latency Budget Qos, NOT implemented in the library.
79
    LatencyBudgetQosPolicy m_latencyBudget;
80
81
    //!Liveliness Qos, implemented in the library.
82
    LivelinessQosPolicy m_liveliness;
83
84
    //!Reliability Qos, implemented in the library.
85
    ReliabilityQosPolicy m_reliability;
86
87
    //!Lifespan Qos, NOT implemented in the library.
88
    LifespanQosPolicy m_lifespan;
89
90
    //!UserData Qos, NOT implemented in the library.
91
    UserDataQosPolicy m_userData;
92
93
    //!Time Based Filter Qos, NOT implemented in the library.
94
    TimeBasedFilterQosPolicy m_timeBasedFilter;
95
96
    //!Ownership Qos, implemented in the library.
97
    OwnershipQosPolicy m_ownership;
98
99
    //!Owenership Strength Qos, implemented in the library.
100
    OwnershipStrengthQosPolicy m_ownershipStrength;
101
102
    //!Destination Order Qos, NOT implemented in the library.
103
    DestinationOrderQosPolicy m_destinationOrder;
104
105
    //!Presentation Qos, NOT implemented in the library.
106
    PresentationQosPolicy m_presentation;
107
108
    //!Partition Qos, implemented in the library.
109
    PartitionQosPolicy m_partition;
110
111
    //!Topic Data Qos, NOT implemented in the library.
112
    TopicDataQosPolicy m_topicData;
113
114
    //!Group Data Qos, NOT implemented in the library.
115
    GroupDataQosPolicy m_groupData;
116
117
    //!Publication Mode Qos, implemented in the library.
118
    PublishModeQosPolicy m_publishMode;
119
120
    //!Data Representation Qos, implemented in the library.
121
    DataRepresentationQosPolicy representation;
122
123
    //!Disable positive acks QoS, implemented in the library.
124
    DisablePositiveACKsQosPolicy m_disablePositiveACKs;
125
126
    //!Information for data sharing compatibility check.
127
    DataSharingQosPolicy data_sharing;
128
129
    //! Disable heartbeat piggyback mechanism.
130
    bool disable_heartbeat_piggyback = false;
131
132
    /**
133
     * Set Qos from another class
134
     * @param qos Reference from a WriterQos object.
135
     * @param first_time Boolean indicating whether is the first time (If not some parameters cannot be set).
136
     *
137
     * @warning The use of this class and methods is discourgaed, consider using PublicationBuiltinTopicData instead.
138
     */
139
    FASTDDS_EXPORTED_API void setQos(
140
            const WriterQos& qos,
141
            bool first_time);
142
143
    /**
144
     * Check if the Qos values are compatible between each other.
145
     * @return True if correct.
146
     *
147
     * @warning The use of this class and methods is discourgaed, consider using PublicationBuiltinTopicData instead.
148
     */
149
    FASTDDS_EXPORTED_API bool checkQos() const;
150
151
    /**
152
     * @warning The use of this class and methods is discourgaed, consider using PublicationBuiltinTopicData instead.
153
     */
154
    FASTDDS_EXPORTED_API bool canQosBeUpdated(
155
            const WriterQos& qos) const;
156
157
    /**
158
     * @warning The use of this class and methods is discourgaed, consider using PublicationBuiltinTopicData instead.
159
     */
160
    void clear();
161
};
162
163
//FASTDDS_EXPORTED_API extern const WriterQos DATAWRITER_QOS_DEFAULT;
164
165
} //namespace dds
166
} //namespace fastdds
167
} //namespace eprosima
168
169
#endif // FASTDDS_DDS_PUBLISHER_QOS__WRITERQOS_HPP