Coverage Report

Created: 2022-08-24 06:19

/src/Fast-DDS/include/fastdds/dds/publisher/qos/PublisherQos.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 PublisherQos.hpp
17
 */
18
19
20
#ifndef _FASTDDS_PUBLISHERQOS_HPP_
21
#define _FASTDDS_PUBLISHERQOS_HPP_
22
23
#include <fastdds/dds/core/policy/QosPolicies.hpp>
24
#include <fastrtps/attributes/PublisherAttributes.h>
25
26
namespace eprosima {
27
namespace fastdds {
28
namespace dds {
29
30
/**
31
 * Class PublisherQos, containing all the possible Qos that can be set for a determined Publisher.
32
 * Although these values can be set and are transmitted
33
 * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been
34
 * 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 PublisherQos
40
{
41
public:
42
43
    /**
44
     * @brief Constructor
45
     */
46
    RTPS_DllAPI PublisherQos()
47
2
    {
48
2
    }
49
50
    /**
51
     * @brief Destructor
52
     */
53
0
    RTPS_DllAPI virtual ~PublisherQos() = default;
54
55
    bool operator ==(
56
            const PublisherQos& b) const
57
0
    {
58
0
        return (this->presentation_ == b.presentation()) &&
59
0
               (this->partition_ == b.partition()) &&
60
0
               (this->group_data_ == b.group_data()) &&
61
0
               (this->entity_factory_ == b.entity_factory());
62
0
    }
63
64
    /**
65
     * Getter for PresentationQosPolicy
66
     *
67
     * @return PresentationQosPolicy reference
68
     */
69
    const PresentationQosPolicy& presentation() const
70
0
    {
71
0
        return presentation_;
72
0
    }
73
74
    /**
75
     * Getter for PresentationQosPolicy
76
     *
77
     * @return PresentationQosPolicy reference
78
     */
79
    PresentationQosPolicy& presentation()
80
0
    {
81
0
        return presentation_;
82
0
    }
83
84
    /**
85
     * Setter for PresentationQosPolicy
86
     *
87
     * @param presentation PresentationQosPolicy
88
     */
89
    void presentation(
90
            const PresentationQosPolicy& presentation)
91
0
    {
92
0
        presentation_ = presentation;
93
0
    }
94
95
    /**
96
     * Getter for PartitionQosPolicy
97
     *
98
     * @return PartitionQosPolicy reference
99
     */
100
    const PartitionQosPolicy& partition() const
101
0
    {
102
0
        return partition_;
103
0
    }
104
105
    /**
106
     * Getter for PartitionQosPolicy
107
     *
108
     * @return PartitionQosPolicy reference
109
     */
110
    PartitionQosPolicy& partition()
111
0
    {
112
0
        return partition_;
113
0
    }
114
115
    /**
116
     * Setter for PartitionQosPolicy
117
     *
118
     * @param partition PartitionQosPolicy
119
     */
120
    void partition(
121
            const PartitionQosPolicy& partition)
122
0
    {
123
0
        partition_ = partition;
124
0
    }
125
126
    /**
127
     * Getter for GroupDataQosPolicy
128
     *
129
     * @return GroupDataQosPolicy reference
130
     */
131
    const GroupDataQosPolicy& group_data() const
132
0
    {
133
0
        return group_data_;
134
0
    }
135
136
    /**
137
     * Getter for GroupDataQosPolicy
138
     *
139
     * @return GroupDataQosPolicy reference
140
     */
141
    GroupDataQosPolicy& group_data()
142
0
    {
143
0
        return group_data_;
144
0
    }
145
146
    /**
147
     * Setter for GroupDataQosPolicy
148
     *
149
     * @param group_data GroupDataQosPolicy
150
     */
151
    void group_data(
152
            const GroupDataQosPolicy& group_data)
153
0
    {
154
0
        group_data_ = group_data;
155
0
    }
156
157
    /**
158
     * Getter for EntityFactoryQosPolicy
159
     *
160
     * @return EntityFactoryQosPolicy reference
161
     */
162
    const EntityFactoryQosPolicy& entity_factory() const
163
0
    {
164
0
        return entity_factory_;
165
0
    }
166
167
    /**
168
     * Getter for EntityFactoryQosPolicy
169
     *
170
     * @return EntityFactoryQosPolicy reference
171
     */
172
    EntityFactoryQosPolicy& entity_factory()
173
0
    {
174
0
        return entity_factory_;
175
0
    }
176
177
    /**
178
     * Setter for EntityFactoryQosPolicy
179
     *
180
     * @param entity_factory EntityFactoryQosPolicy
181
     */
182
    void entity_factory(
183
            const EntityFactoryQosPolicy& entity_factory)
184
0
    {
185
0
        entity_factory_ = entity_factory;
186
0
    }
187
188
private:
189
190
    //!Presentation Qos, NOT implemented in the library.
191
    PresentationQosPolicy presentation_;
192
193
    //!Partition Qos, implemented in the library.
194
    PartitionQosPolicy partition_;
195
196
    //!Group Data Qos, implemented in the library.
197
    GroupDataQosPolicy group_data_;
198
199
    //!Entity Factory Qos, implemented in the library
200
    EntityFactoryQosPolicy entity_factory_;
201
202
};
203
204
RTPS_DllAPI extern const PublisherQos PUBLISHER_QOS_DEFAULT;
205
206
} // namespace dds
207
} // namespace fastdds
208
} // namespace eprosima
209
210
#endif // _FASTDDS_PUBLISHERQOS_HPP_