ParticipantDiscoveryInfo.h 2.3 KB

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