ServerAttributes.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 2019 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 ServerAttributes.h
  16. *
  17. */
  18. #ifndef _FASTDDS_SERVERATTRIBUTES_H_
  19. #define _FASTDDS_SERVERATTRIBUTES_H_
  20. #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
  21. #include <fastdds/rtps/common/Guid.h>
  22. #include <fastdds/rtps/common/Locator.h>
  23. #include <list>
  24. namespace eprosima {
  25. namespace fastrtps{
  26. namespace rtps {
  27. class ParticipantProxyData;
  28. /**
  29. * Class RemoteServerAttributes, to define the attributes of the Discovery Server Protocol.
  30. * @ingroup RTPS_ATTRIBUTES_MODULE
  31. */
  32. class RemoteServerAttributes
  33. {
  34. public:
  35. RTPS_DllAPI inline bool operator==(const RemoteServerAttributes& r) const
  36. { return guidPrefix == r.guidPrefix; }
  37. RTPS_DllAPI GUID_t GetParticipant() const;
  38. RTPS_DllAPI GUID_t GetPDPReader() const;
  39. RTPS_DllAPI GUID_t GetPDPWriter() const;
  40. RTPS_DllAPI GUID_t GetEDPPublicationsReader() const;
  41. RTPS_DllAPI GUID_t GetEDPSubscriptionsWriter() const;
  42. RTPS_DllAPI GUID_t GetEDPPublicationsWriter() const;
  43. RTPS_DllAPI GUID_t GetEDPSubscriptionsReader() const;
  44. RTPS_DllAPI inline bool ReadguidPrefix(const char * pfx)
  45. {
  46. return bool(std::istringstream(pfx) >> guidPrefix);
  47. }
  48. //!Metatraffic Unicast Locator List
  49. LocatorList_t metatrafficUnicastLocatorList;
  50. //!Metatraffic Multicast Locator List.
  51. LocatorList_t metatrafficMulticastLocatorList;
  52. //!Guid prefix
  53. GuidPrefix_t guidPrefix;
  54. // Live participant proxy reference
  55. const ParticipantProxyData * proxy{};
  56. };
  57. typedef std::list<RemoteServerAttributes> RemoteServerList_t;
  58. }
  59. } /* namespace rtps */
  60. } /* namespace eprosima */
  61. #endif
  62. #endif /* _FASTDDS_SERVERATTRIBUTES_H_ */