Coverage Report

Created: 2022-08-24 06:19

/src/Fast-DDS/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.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 ParticipantDiscoveryInfo.h
17
 *
18
 */
19
20
#ifndef _FASTDDS_RTPS_PARTICIPANT_PARTICIPANTDISCOVERYINFO_H__
21
#define _FASTDDS_RTPS_PARTICIPANT_PARTICIPANTDISCOVERYINFO_H__
22
23
#include <fastrtps/fastrtps_dll.h>
24
#include <fastdds/rtps/builtin/data/ParticipantProxyData.h>
25
26
namespace eprosima {
27
namespace fastrtps {
28
namespace rtps {
29
30
/**
31
* Class ParticipantDiscoveryInfo with discovery information of the Participant.
32
* @ingroup RTPS_MODULE
33
*/
34
struct ParticipantDiscoveryInfo
35
{
36
    //!Enum DISCOVERY_STATUS, four different status for discovered participants.
37
    //!@ingroup RTPS_MODULE
38
#if defined(_WIN32)
39
    enum RTPS_DllAPI DISCOVERY_STATUS
40
#else
41
    enum DISCOVERY_STATUS
42
#endif
43
    {
44
        DISCOVERED_PARTICIPANT,
45
        CHANGED_QOS_PARTICIPANT,
46
        REMOVED_PARTICIPANT,
47
        DROPPED_PARTICIPANT
48
    };
49
50
    ParticipantDiscoveryInfo(const ParticipantProxyData& data)
51
        : status(DISCOVERED_PARTICIPANT)
52
        , info(data)
53
0
    {}
54
55
0
    virtual ~ParticipantDiscoveryInfo() {}
56
57
    //! Status
58
    DISCOVERY_STATUS status;
59
60
    //! Participant discovery info
61
    const ParticipantProxyData& info;
62
};
63
64
#if HAVE_SECURITY
65
struct ParticipantAuthenticationInfo
66
{
67
    enum RTPS_DllAPI AUTHENTICATION_STATUS
68
    {
69
        AUTHORIZED_PARTICIPANT,
70
        UNAUTHORIZED_PARTICIPANT
71
    };
72
73
    ParticipantAuthenticationInfo() : status(UNAUTHORIZED_PARTICIPANT) {}
74
75
    ~ParticipantAuthenticationInfo() {}
76
77
    //! Status
78
    AUTHENTICATION_STATUS status;
79
80
    //! Associated GUID
81
    GUID_t guid;
82
};
83
84
inline bool operator==(const ParticipantAuthenticationInfo& l, const ParticipantAuthenticationInfo& r)
85
{
86
    return l.status == r.status &&
87
        l.guid == r.guid;
88
}
89
#endif
90
91
}
92
}
93
}
94
95
#endif // _FASTDDS_RTPS_PARTICIPANT_PARTICIPANTDISCOVERYINFO_H__