Coverage Report

Created: 2025-07-03 06:58

/src/Fast-DDS/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp
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 DataWriterQos.cpp
17
 *
18
 */
19
20
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
21
#include <fastdds/core/policy/QosPolicyUtils.hpp>
22
namespace eprosima {
23
namespace fastdds {
24
namespace dds {
25
26
const DataWriterQos DATAWRITER_QOS_DEFAULT;
27
const DataWriterQos DATAWRITER_QOS_USE_TOPIC_QOS;
28
29
DataWriterQos::DataWriterQos()
30
12
{
31
12
    reliability_.kind = RELIABLE_RELIABILITY_QOS;
32
12
    durability_.kind = TRANSIENT_LOCAL_DURABILITY_QOS;
33
12
}
34
35
WriterQos DataWriterQos::get_writerqos(
36
        const PublisherQos& pqos,
37
        const TopicQos& tqos) const
38
0
{
39
0
    WriterQos qos;
40
0
    qos.m_deadline = deadline();
41
0
    qos.m_destinationOrder = destination_order();
42
0
    qos.m_disablePositiveACKs = reliable_writer_qos().disable_positive_acks;
43
0
    qos.m_durability = durability();
44
0
    qos.m_durabilityService = durability_service();
45
0
    qos.m_groupData = pqos.group_data();
46
0
    qos.m_latencyBudget = latency_budget();
47
0
    qos.m_lifespan = lifespan();
48
0
    qos.m_liveliness = liveliness();
49
0
    qos.m_ownership = ownership();
50
0
    qos.m_ownershipStrength = ownership_strength();
51
0
    qos.m_partition = pqos.partition();
52
0
    qos.m_presentation = pqos.presentation();
53
0
    qos.m_publishMode = publish_mode();
54
0
    qos.m_reliability = reliability();
55
0
    qos.m_topicData = tqos.topic_data();
56
0
    qos.m_userData = user_data();
57
0
    qos.representation = representation();
58
0
    qos.data_sharing = data_sharing();
59
60
0
    if (qos.data_sharing.kind() != OFF &&
61
0
            qos.data_sharing.domain_ids().empty())
62
0
    {
63
0
        qos.data_sharing.add_domain_id(utils::default_domain_id());
64
0
    }
65
66
0
    return qos;
67
0
}
68
69
} // namespace dds
70
} // namespace fastdds
71
} // namespace eprosima