PublisherQos.hpp 4.7 KB

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