FastRTPS  Version 2.11.2
FastRTPS
SubscriberAttributes.h
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 
19 #ifndef SUBSCRIBERATTRIBUTES_H_
20 #define SUBSCRIBERATTRIBUTES_H_
21 
22 #include <fastdds/rtps/attributes/ExternalLocators.hpp>
23 #include <fastdds/rtps/attributes/PropertyPolicy.h>
24 #include <fastdds/rtps/attributes/ReaderAttributes.h>
25 #include <fastdds/rtps/common/Time_t.h>
26 #include <fastdds/rtps/common/Locator.h>
27 #include <fastdds/rtps/resources/ResourceManagement.h>
28 #include <fastrtps/attributes/TopicAttributes.h>
29 #include <fastrtps/qos/ReaderQos.h>
30 
31 namespace eprosima {
32 namespace fastrtps {
33 
39 {
40 public:
41 
44 
47 
49  rtps::ReaderTimes times;
50 
52  rtps::LocatorList_t unicastLocatorList;
53 
55  rtps::LocatorList_t multicastLocatorList;
56 
58  rtps::LocatorList_t remoteLocatorList;
59 
61  fastdds::rtps::ExternalLocators external_unicast_locators;
62 
65 
67  bool expectsInlineQos = false;
68 
70  rtps::MemoryManagementPolicy_t historyMemoryPolicy = rtps::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
71 
73  rtps::PropertyPolicy properties;
74 
77 
78  SubscriberAttributes() = default;
79 
80  virtual ~SubscriberAttributes() = default;
81 
83  const SubscriberAttributes& b) const
84  {
85  return (this->topic == b.topic) &&
86  (this->qos == b.qos) &&
87  (this->times == b.times) &&
88  (this->unicastLocatorList == b.unicastLocatorList) &&
89  (this->multicastLocatorList == b.multicastLocatorList) &&
90  (this->remoteLocatorList == b.remoteLocatorList) &&
91  (this->historyMemoryPolicy == b.historyMemoryPolicy) &&
92  (this->properties == b.properties);
93  }
94 
96  const SubscriberAttributes& b) const
97  {
98  return !(*this == b);
99  }
100 
105  inline int16_t getUserDefinedID() const
106  {
107  return m_userDefinedID;
108  }
109 
114  inline int16_t getEntityID() const
115  {
116  return m_entityID;
117  }
118 
123  inline void setUserDefinedID(
124  uint8_t id)
125  {
126  m_userDefinedID = id;
127  }
128 
133  inline void setEntityID(
134  uint8_t id)
135  {
136  m_entityID = id;
137  }
138 
139 private:
140 
142  int16_t m_userDefinedID = -1;
143 
145  int16_t m_entityID = -1;
146 };
147 
148 } /* namespace fastrtps */
149 } /* namespace eprosima */
150 
151 #endif /* SUBSCRIBERPARAMS_H_ */
eprosima::fastrtps::SubscriberAttributes::getEntityID
int16_t getEntityID() const
Get the entity defined ID.
Definition: SubscriberAttributes.h:114
eprosima::fastrtps::SubscriberAttributes::unicastLocatorList
rtps::LocatorList_t unicastLocatorList
Unicast locator list.
Definition: SubscriberAttributes.h:52
eprosima::fastrtps::SubscriberAttributes::multicastLocatorList
rtps::LocatorList_t multicastLocatorList
Multicast locator list.
Definition: SubscriberAttributes.h:55
eprosima::fastrtps::SubscriberAttributes::expectsInlineQos
bool expectsInlineQos
Expects Inline QOS.
Definition: SubscriberAttributes.h:67
eprosima::fastrtps::SubscriberAttributes::SubscriberAttributes
SubscriberAttributes()=default
eprosima::fastrtps::SubscriberAttributes::ignore_non_matching_locators
bool ignore_non_matching_locators
Whether locators that don't match with the announced locators should be kept.
Definition: SubscriberAttributes.h:64
eprosima::fastrtps::SubscriberAttributes::remoteLocatorList
rtps::LocatorList_t remoteLocatorList
Remote locator list.
Definition: SubscriberAttributes.h:58
eprosima::fastrtps::SubscriberAttributes::times
rtps::ReaderTimes times
Times for a RELIABLE Reader.
Definition: SubscriberAttributes.h:49
eprosima::fastrtps::SubscriberAttributes::external_unicast_locators
fastdds::rtps::ExternalLocators external_unicast_locators
The collection of external locators to use for communication.
Definition: SubscriberAttributes.h:61
eprosima::fastrtps::SubscriberAttributes::properties
rtps::PropertyPolicy properties
Properties.
Definition: SubscriberAttributes.h:73
eprosima::fastrtps::SubscriberAttributes::getUserDefinedID
int16_t getUserDefinedID() const
Get the user defined ID.
Definition: SubscriberAttributes.h:105
eprosima::fastrtps::SubscriberAttributes::matched_publisher_allocation
ResourceLimitedContainerConfig matched_publisher_allocation
Matched publishers allocation limits.
Definition: SubscriberAttributes.h:76
eprosima::fastrtps::TopicAttributes
Class TopicAttributes, used by the user to define the attributes of the topic associated with a Publi...
Definition: TopicAttributes.h:35
eprosima::fastrtps::SubscriberAttributes::setUserDefinedID
void setUserDefinedID(uint8_t id)
Set the user defined ID.
Definition: SubscriberAttributes.h:123
eprosima::fastrtps::SubscriberAttributes::operator!=
bool operator!=(const SubscriberAttributes &b) const
Definition: SubscriberAttributes.h:95
eprosima::fastrtps::SubscriberAttributes::historyMemoryPolicy
rtps::MemoryManagementPolicy_t historyMemoryPolicy
Underlying History memory policy.
Definition: SubscriberAttributes.h:70
eprosima::fastrtps::SubscriberAttributes::qos
ReaderQos qos
Reader QOs.
Definition: SubscriberAttributes.h:46
eprosima::fastrtps::SubscriberAttributes::topic
TopicAttributes topic
Topic Attributes.
Definition: SubscriberAttributes.h:43
eprosima::fastrtps::SubscriberAttributes::~SubscriberAttributes
virtual ~SubscriberAttributes()=default
eprosima::fastrtps::ReaderQos
fastdds::dds::ReaderQos ReaderQos
Definition: ReaderQos.h:30
eprosima
Definition: LibrarySettingsAttributes.h:23
eprosima::fastrtps::SubscriberAttributes
Class SubscriberAttributes, used by the user to define the attributes of a Subscriber.
Definition: SubscriberAttributes.h:38
eprosima::fastrtps::SubscriberAttributes::operator==
bool operator==(const SubscriberAttributes &b) const
Definition: SubscriberAttributes.h:82
eprosima::fastrtps::ResourceLimitedContainerConfig
Specifies the configuration of a resource limited collection.
Definition: ResourceLimitedContainerConfig.hpp:35
eprosima::fastrtps::SubscriberAttributes::setEntityID
void setEntityID(uint8_t id)
Set the entity ID.
Definition: SubscriberAttributes.h:133