Coverage Report

Created: 2025-06-13 06:46

/src/Fast-DDS/include/fastdds/rtps/common/MatchingInfo.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 MatchingInfo.hpp
17
 */
18
19
#ifndef FASTDDS_RTPS_COMMON__MATCHINGINFO_HPP
20
#define FASTDDS_RTPS_COMMON__MATCHINGINFO_HPP
21
22
#include <fastdds/rtps/common/Guid.hpp>
23
24
namespace eprosima {
25
namespace fastdds {
26
namespace rtps {
27
28
/**
29
 * Indicates whether the matched publication/subscription method of the PublisherListener or SubscriberListener has
30
 * been called for a matching or a removal of a remote endpoint.
31
 */
32
#if defined(_WIN32)
33
enum FASTDDS_EXPORTED_API MatchingStatus
34
{
35
#else
36
enum MatchingStatus
37
{
38
#endif                // if defined(_WIN32)
39
    MATCHED_MATCHING, //!< MATCHED_MATCHING, new publisher/subscriber found
40
    REMOVED_MATCHING  //!< REMOVED_MATCHING, publisher/subscriber removed
41
};
42
43
/**
44
 * Class MatchingInfo contains information about the matching between two endpoints.
45
 * @ingroup COMMON_MODULE
46
 */
47
class FASTDDS_EXPORTED_API MatchingInfo
48
{
49
public:
50
51
    //! Default constructor
52
    MatchingInfo()
53
0
        : status(MATCHED_MATCHING)
54
0
    {
55
0
    }
56
57
    /**
58
     * @param stat Status
59
     * @param guid GUID
60
     */
61
    MatchingInfo(
62
            MatchingStatus stat,
63
            const GUID_t& guid)
64
        : status(stat)
65
        , remoteEndpointGuid(guid)
66
0
    {
67
0
    }
68
69
    ~MatchingInfo()
70
0
    {
71
0
    }
72
73
    //! Status
74
    MatchingStatus status;
75
    //! Remote endpoint GUID
76
    GUID_t remoteEndpointGuid;
77
};
78
} // namespace rtps
79
} // namespace fastdds
80
} // namespace eprosima
81
82
#endif // FASTDDS_RTPS_COMMON__MATCHINGINFO_HPP