EndpointAttributes.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 fastdds/rtps/attributes/EndpointAttributes.h
  16. */
  17. #ifndef _FASTDDS_ENDPOINTATTRIBUTES_H_
  18. #define _FASTDDS_ENDPOINTATTRIBUTES_H_
  19. #include <fastdds/rtps/common/Types.h>
  20. #include <fastdds/rtps/common/Locator.h>
  21. #include <fastdds/rtps/attributes/PropertyPolicy.h>
  22. #include <fastdds/rtps/security/accesscontrol/EndpointSecurityAttributes.h>
  23. namespace eprosima {
  24. namespace fastrtps{
  25. namespace rtps {
  26. /**
  27. * Structure EndpointAttributes, describing the attributes associated with an RTPS Endpoint.
  28. * @ingroup RTPS_ATTRIBUTES_MODULE
  29. */
  30. class EndpointAttributes
  31. {
  32. public:
  33. //!Endpoint kind, default value WRITER
  34. EndpointKind_t endpointKind;
  35. //!Topic kind, default value NO_KEY
  36. TopicKind_t topicKind;
  37. //!Reliability kind, default value BEST_EFFORT
  38. ReliabilityKind_t reliabilityKind;
  39. //!Durability kind, default value VOLATILE
  40. DurabilityKind_t durabilityKind;
  41. //!GUID used for persistence
  42. GUID_t persistence_guid;
  43. //!Unicast locator list
  44. LocatorList_t unicastLocatorList;
  45. //!Multicast locator list
  46. LocatorList_t multicastLocatorList;
  47. //! Remote locator list.
  48. LocatorList_t remoteLocatorList;
  49. //!Properties
  50. PropertyPolicy properties;
  51. EndpointAttributes()
  52. : endpointKind(WRITER)
  53. , topicKind(NO_KEY)
  54. , reliabilityKind(BEST_EFFORT)
  55. , durabilityKind(VOLATILE)
  56. , persistence_guid()
  57. , m_userDefinedID(-1)
  58. , m_entityID(-1)
  59. {
  60. }
  61. virtual ~EndpointAttributes(){};
  62. /**
  63. * Get the user defined ID
  64. * @return User defined ID
  65. */
  66. inline int16_t getUserDefinedID() const { return m_userDefinedID; }
  67. /**
  68. * Get the entity defined ID
  69. * @return Entity ID
  70. */
  71. inline int16_t getEntityID() const { return m_entityID; }
  72. /**
  73. * Set the user defined ID
  74. * @param id User defined ID to be set
  75. */
  76. inline void setUserDefinedID(uint8_t id) { m_userDefinedID = id; }
  77. /**
  78. * Set the entity ID
  79. * @param id Entity ID to be set
  80. */
  81. inline void setEntityID(uint8_t id) { m_entityID = id; }
  82. #if HAVE_SECURITY
  83. const security::EndpointSecurityAttributes& security_attributes() const { return security_attributes_; }
  84. security::EndpointSecurityAttributes& security_attributes() { return security_attributes_; }
  85. #endif
  86. private:
  87. //!User Defined ID, used for StaticEndpointDiscovery, default value -1.
  88. int16_t m_userDefinedID;
  89. //!Entity ID, if the user want to specify the EntityID of the enpoint, default value -1.
  90. int16_t m_entityID;
  91. #if HAVE_SECURITY
  92. security::EndpointSecurityAttributes security_attributes_;
  93. #endif
  94. };
  95. } /* namespace rtps */
  96. } /* namespace fastrtps */
  97. } /* namespace eprosima */
  98. #endif /* _FASTDDS_ENDPOINTATTRIBUTES_H_ */