Coverage Report

Created: 2025-06-13 06:46

/src/Fast-DDS/include/fastdds/rtps/attributes/ReaderAttributes.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 ReaderAttributes.hpp
17
 *
18
 */
19
20
#ifndef FASTDDS_RTPS_ATTRIBUTES__READERATTRIBUTES_HPP
21
#define FASTDDS_RTPS_ATTRIBUTES__READERATTRIBUTES_HPP
22
23
#include <fastdds/dds/core/policy/QosPolicies.hpp>
24
#include <fastdds/rtps/attributes/EndpointAttributes.hpp>
25
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
26
#include <fastdds/rtps/common/Time_t.hpp>
27
#include <fastdds/utils/collections/ResourceLimitedContainerConfig.hpp>
28
29
namespace eprosima {
30
namespace fastdds {
31
namespace rtps {
32
33
/**
34
 * Class ReaderTimes, defining the times associated with the Reliable Readers events.
35
 * @ingroup RTPS_ATTRIBUTES_MODULE
36
 */
37
class ReaderTimes
38
{
39
public:
40
41
    bool operator ==(
42
            const ReaderTimes& b) const
43
0
    {
44
0
        return (initial_acknack_delay == b.initial_acknack_delay)  &&
45
0
               (heartbeat_response_delay == b.heartbeat_response_delay);
46
0
    }
47
48
    //! Initial AckNack delay. Default value 70ms.
49
    dds::Duration_t initial_acknack_delay {0, 70 * 1000 * 1000};
50
    //! Delay to be applied when a HEARTBEAT message is received, default value 5ms.
51
    dds::Duration_t heartbeat_response_delay {0,  5 * 1000 * 1000};
52
};
53
54
/**
55
 * Class ReaderAttributes, to define the attributes of a RTPSReader.
56
 * @ingroup RTPS_ATTRIBUTES_MODULE
57
 */
58
class ReaderAttributes
59
{
60
public:
61
62
    ReaderAttributes()
63
0
    {
64
0
        endpoint.endpointKind = READER;
65
0
        endpoint.durabilityKind = VOLATILE;
66
0
        endpoint.reliabilityKind = BEST_EFFORT;
67
0
    }
68
69
    //! Attributes of the associated endpoint.
70
    EndpointAttributes endpoint {};
71
72
    //! Times associated with this reader (only for stateful readers)
73
    ReaderTimes times {};
74
75
    //! Liveliness kind
76
    fastdds::dds::LivelinessQosPolicyKind liveliness_kind =
77
            fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS;
78
79
    //! Liveliness lease duration
80
    dds::Duration_t liveliness_lease_duration {TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS};
81
82
    //! Indicates if the reader expects Inline qos, default value false.
83
    bool expects_inline_qos = false;
84
85
    //! Disable positive ACKs
86
    bool disable_positive_acks = false;
87
88
    //! Enable or disable the reception of messages from unknown writers.
89
    bool accept_messages_from_unkown_writers = false;
90
91
    //! Define the allocation behaviour for matched-writer-dependent collections.
92
    ResourceLimitedContainerConfig matched_writers_allocation {};
93
94
    //! Thread settings for the data-sharing listener thread
95
    fastdds::rtps::ThreadSettings data_sharing_listener_thread {};
96
};
97
98
} // namespace rtps
99
} // namespace fastdds
100
} // namespace eprosima
101
102
#endif // FASTDDS_RTPS_ATTRIBUTES__READERATTRIBUTES_HPP