Coverage Report

Created: 2022-08-24 06:19

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