ReaderAttributes.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 ReaderAttributes.h
  16. *
  17. */
  18. #ifndef _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_
  19. #define _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_
  20. #include <fastdds/rtps/common/Time_t.h>
  21. #include <fastdds/rtps/common/Guid.h>
  22. #include <fastdds/rtps/attributes/EndpointAttributes.h>
  23. #include <fastrtps/qos/QosPolicies.h>
  24. #include <fastrtps/utils/collections/ResourceLimitedContainerConfig.hpp>
  25. #include <functional>
  26. namespace eprosima {
  27. namespace fastrtps {
  28. namespace rtps {
  29. /**
  30. * Class ReaderTimes, defining the times associated with the Reliable Readers events.
  31. * @ingroup RTPS_ATTRIBUTES_MODULE
  32. */
  33. class ReaderTimes
  34. {
  35. public:
  36. ReaderTimes()
  37. {
  38. initialAcknackDelay.nanosec = 70*1000*1000;
  39. heartbeatResponseDelay.nanosec = 5*1000*1000;
  40. }
  41. virtual ~ReaderTimes() {}
  42. bool operator==(
  43. const ReaderTimes& b) const
  44. {
  45. return (this->initialAcknackDelay == b.initialAcknackDelay) &&
  46. (this->heartbeatResponseDelay == b.heartbeatResponseDelay);
  47. }
  48. //!Initial AckNack delay. Default value 70ms.
  49. Duration_t initialAcknackDelay;
  50. //!Delay to be applied when a hearbeat message is received, default value 5ms.
  51. Duration_t heartbeatResponseDelay;
  52. };
  53. /**
  54. * Class ReaderAttributes, to define the attributes of a RTPSReader.
  55. * @ingroup RTPS_ATTRIBUTES_MODULE
  56. */
  57. class ReaderAttributes
  58. {
  59. public:
  60. ReaderAttributes()
  61. : liveliness_kind_(AUTOMATIC_LIVELINESS_QOS)
  62. , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
  63. , expectsInlineQos(false)
  64. , disable_positive_acks(false)
  65. {
  66. endpoint.endpointKind = READER;
  67. endpoint.durabilityKind = VOLATILE;
  68. endpoint.reliabilityKind = BEST_EFFORT;
  69. };
  70. virtual ~ReaderAttributes() {};
  71. //!Attributes of the associated endpoint.
  72. EndpointAttributes endpoint;
  73. //!Times associated with this reader (only for stateful readers)
  74. ReaderTimes times;
  75. //! Liveliness kind
  76. LivelinessQosPolicyKind liveliness_kind_;
  77. //! Liveliness lease duration
  78. Duration_t liveliness_lease_duration;
  79. //!Indicates if the reader expects Inline qos, default value 0.
  80. bool expectsInlineQos;
  81. //! Disable positive ACKs
  82. bool disable_positive_acks;
  83. //! Define the allocation behaviour for matched-writer-dependent collections.
  84. ResourceLimitedContainerConfig matched_writers_allocation;
  85. };
  86. } /* namespace rtps */
  87. } /* namespace fastrtps */
  88. } /* namespace eprosima */
  89. #endif /* _FASTDDS_RTPS_ATTRIBUTES_READERATTRIBUTES_H_ */