SubscriberQos.hpp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 SubscriberQos.hpp
  16. *
  17. */
  18. #ifndef _FASTDDS_SUBSCRIBERQOS_HPP_
  19. #define _FASTDDS_SUBSCRIBERQOS_HPP_
  20. #include <fastdds/dds/core/policy/QosPolicies.hpp>
  21. #include <fastrtps/attributes/SubscriberAttributes.h>
  22. namespace eprosima {
  23. namespace fastdds {
  24. namespace dds {
  25. /**
  26. * Class SubscriberQos, contains all the possible Qos that can be set for a determined Subscriber.
  27. * Although these values can be set and are transmitted
  28. * during the Endpoint Discovery Protocol, not all of the behaviour associated with them has been implemented in the library.
  29. * Please consult each of them to check for implementation details and default values.
  30. * @ingroup FASTDDS_QOS_MODULE
  31. */
  32. class SubscriberQos
  33. {
  34. public:
  35. /**
  36. * @brief Constructor
  37. */
  38. RTPS_DllAPI SubscriberQos()
  39. {
  40. }
  41. /**
  42. * @brief Destructor
  43. */
  44. RTPS_DllAPI virtual ~SubscriberQos()
  45. {
  46. }
  47. bool operator ==(
  48. const SubscriberQos& b) const
  49. {
  50. return (presentation_ == b.presentation_) &&
  51. (partition_ == b.partition_) &&
  52. (group_data_ == b.group_data_) &&
  53. (entity_factory_ == b.entity_factory_);
  54. }
  55. /**
  56. * Getter for PresentationQosPolicy
  57. * @return PresentationQosPolicy reference
  58. */
  59. const PresentationQosPolicy& presentation() const
  60. {
  61. return presentation_;
  62. }
  63. /**
  64. * Getter for PresentationQosPolicy
  65. * @return PresentationQosPolicy reference
  66. */
  67. PresentationQosPolicy& presentation()
  68. {
  69. return presentation_;
  70. }
  71. /**
  72. * Setter for PresentationQosPolicy
  73. * @param presentation new value for the PresentationQosPolicy
  74. */
  75. void presentation(
  76. const PresentationQosPolicy& presentation)
  77. {
  78. presentation_ = presentation;
  79. }
  80. /**
  81. * Getter for PartitionQosPolicy
  82. * @return PartitionQosPolicy reference
  83. */
  84. const PartitionQosPolicy& partition() const
  85. {
  86. return partition_;
  87. }
  88. /**
  89. * Getter for PartitionQosPolicy
  90. * @return PartitionQosPolicy reference
  91. */
  92. PartitionQosPolicy& partition()
  93. {
  94. return partition_;
  95. }
  96. /**
  97. * Setter for PartitionQosPolicy
  98. * @param partition new value for the PartitionQosPolicy
  99. */
  100. void partition(
  101. const PartitionQosPolicy& partition)
  102. {
  103. partition_ = partition;
  104. }
  105. /**
  106. * Getter for GroupDataQosPolicy
  107. * @return GroupDataQosPolicy reference
  108. */
  109. const GroupDataQosPolicy& group_data() const
  110. {
  111. return group_data_;
  112. }
  113. /**
  114. * Getter for GroupDataQosPolicy
  115. * @return GroupDataQosPolicy reference
  116. */
  117. GroupDataQosPolicy& group_data()
  118. {
  119. return group_data_;
  120. }
  121. /**
  122. * Setter for GroupDataQosPolicy
  123. * @param group_data new value for the GroupDataQosPolicy
  124. */
  125. void group_data(
  126. const GroupDataQosPolicy& group_data)
  127. {
  128. group_data_ = group_data;
  129. }
  130. /**
  131. * Getter for EntityFactoryQosPolicy
  132. * @return EntityFactoryQosPolicy reference
  133. */
  134. const EntityFactoryQosPolicy& entity_factory() const
  135. {
  136. return entity_factory_;
  137. }
  138. /**
  139. * Getter for EntityFactoryQosPolicy
  140. * @return EntityFactoryQosPolicy reference
  141. */
  142. EntityFactoryQosPolicy& entity_factory()
  143. {
  144. return entity_factory_;
  145. }
  146. /**
  147. * Setter for EntityFactoryQosPolicy
  148. * @param entity_factory new value for the EntityFactoryQosPolicy
  149. */
  150. void entity_factory(
  151. const EntityFactoryQosPolicy& entity_factory)
  152. {
  153. entity_factory_ = entity_factory;
  154. }
  155. private:
  156. //!Presentation Qos, NOT implemented in the library.
  157. PresentationQosPolicy presentation_;
  158. //!Partition Qos, implemented in the library.
  159. PartitionQosPolicy partition_;
  160. //!Group Data Qos, implemented in the library.
  161. GroupDataQosPolicy group_data_;
  162. //!Entity Factory Qos, implemented in the library
  163. EntityFactoryQosPolicy entity_factory_;
  164. };
  165. RTPS_DllAPI extern const SubscriberQos SUBSCRIBER_QOS_DEFAULT;
  166. } /* namespace dds */
  167. } /* namespace fastdds */
  168. } /* namespace eprosima */
  169. #endif /* _FASTDDS_SUBSCRIBERQOS_HPP_ */