-
Notifications
You must be signed in to change notification settings - Fork 941
Expand file tree
/
Copy pathPublisherAttributes.hpp
More file actions
145 lines (117 loc) · 4.09 KB
/
Copy pathPublisherAttributes.hpp
File metadata and controls
145 lines (117 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @file PublisherAttributes.hpp
*/
#ifndef _FASTDDS_PUBLISHERATTRIBUTES_H_
#define _FASTDDS_PUBLISHERATTRIBUTES_H_
#include <fastdds/rtps/attributes/ResourceManagement.hpp>
#include <fastdds/dds/publisher/qos/WriterQos.hpp>
#include <fastdds/rtps/attributes/ExternalLocators.hpp>
#include <fastdds/rtps/attributes/PropertyPolicy.h>
#include <fastdds/rtps/attributes/TopicAttributes.h>
#include <fastdds/rtps/attributes/WriterAttributes.h>
#include <fastdds/rtps/common/Locator.h>
#include <fastdds/rtps/common/Time_t.h>
namespace eprosima {
namespace fastdds {
/**
* Class PublisherAttributes, used by the user to define the attributes of a Publisher.
* @ingroup FASTDDS_ATTRIBUTES_MODULE
*/
class PublisherAttributes
{
public:
PublisherAttributes() = default;
virtual ~PublisherAttributes() = default;
bool operator ==(
const PublisherAttributes& b) const
{
return (this->m_userDefinedID == b.m_userDefinedID) &&
(this->m_entityID == b.m_entityID) &&
(this->topic == b.topic) &&
(this->qos == b.qos) &&
(this->times == b.times) &&
(this->unicastLocatorList == b.unicastLocatorList) &&
(this->multicastLocatorList == b.multicastLocatorList) &&
(this->remoteLocatorList == b.remoteLocatorList) &&
(this->historyMemoryPolicy == b.historyMemoryPolicy) &&
(this->properties == b.properties);
}
//! Topic Attributes for the Publisher
fastdds::TopicAttributes topic;
//! QOS for the Publisher
dds::WriterQos qos;
//! Writer Attributes
rtps::WriterTimes times;
//! Unicast locator list
rtps::LocatorList_t unicastLocatorList;
//! Multicast locator list
rtps::LocatorList_t multicastLocatorList;
//! Remote locator list
rtps::LocatorList_t remoteLocatorList;
//! The collection of external locators to use for communication.
rtps::ExternalLocators external_unicast_locators;
//! Whether locators that don't match with the announced locators should be kept.
bool ignore_non_matching_locators = false;
//! Underlying History memory policy
rtps::MemoryManagementPolicy_t historyMemoryPolicy =
rtps::MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
//! Properties
rtps::PropertyPolicy properties;
//! Allocation limits on the matched subscribers collections
fastdds::ResourceLimitedContainerConfig matched_subscriber_allocation;
/**
* Get the user defined ID
* @return User defined ID
*/
inline int16_t getUserDefinedID() const
{
return m_userDefinedID;
}
/**
* Get the entity defined ID
* @return Entity ID
*/
inline int16_t getEntityID() const
{
return m_entityID;
}
/**
* Set the user defined ID
* @param id User defined ID to be set
*/
inline void setUserDefinedID(
uint8_t id)
{
m_userDefinedID = id;
}
/**
* Set the entity ID
* @param id Entity ID to be set
*/
inline void setEntityID(
uint8_t id)
{
m_entityID = id;
}
private:
//! User Defined ID, used for StaticEndpointDiscovery, default value -1.
int16_t m_userDefinedID = -1;
//! Entity ID, if the user want to specify the EntityID of the enpoint, default value -1.
int16_t m_entityID = -1;
};
} // namespace fastdds
} // namespace eprosima
#endif /* _FASTDDS_PUBLISHERATTRIBUTES_H_ */