Skip to content

Commit b2b676d

Browse files
authored
use private member to keep the all reference underneath. (#1845)
Signed-off-by: Tomoya Fujita <[email protected]>
1 parent ee20dd3 commit b2b676d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

rclcpp/include/rclcpp/subscription.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ class Subscription : public SubscriptionBase
146146
options_(options),
147147
message_memory_strategy_(message_memory_strategy)
148148
{
149-
if (options.event_callbacks.deadline_callback) {
149+
if (options_.event_callbacks.deadline_callback) {
150150
this->add_event_handler(
151-
options.event_callbacks.deadline_callback,
151+
options_.event_callbacks.deadline_callback,
152152
RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
153153
}
154-
if (options.event_callbacks.liveliness_callback) {
154+
if (options_.event_callbacks.liveliness_callback) {
155155
this->add_event_handler(
156-
options.event_callbacks.liveliness_callback,
156+
options_.event_callbacks.liveliness_callback,
157157
RCL_SUBSCRIPTION_LIVELINESS_CHANGED);
158158
}
159-
if (options.event_callbacks.incompatible_qos_callback) {
159+
if (options_.event_callbacks.incompatible_qos_callback) {
160160
this->add_event_handler(
161-
options.event_callbacks.incompatible_qos_callback,
161+
options_.event_callbacks.incompatible_qos_callback,
162162
RCL_SUBSCRIPTION_REQUESTED_INCOMPATIBLE_QOS);
163163
} else if (options_.use_default_callbacks) {
164164
// Register default callback when not specified
@@ -172,14 +172,14 @@ class Subscription : public SubscriptionBase
172172
// pass
173173
}
174174
}
175-
if (options.event_callbacks.message_lost_callback) {
175+
if (options_.event_callbacks.message_lost_callback) {
176176
this->add_event_handler(
177-
options.event_callbacks.message_lost_callback,
177+
options_.event_callbacks.message_lost_callback,
178178
RCL_SUBSCRIPTION_MESSAGE_LOST);
179179
}
180180

181181
// Setup intra process publishing if requested.
182-
if (rclcpp::detail::resolve_use_intra_process(options, *node_base)) {
182+
if (rclcpp::detail::resolve_use_intra_process(options_, *node_base)) {
183183
using rclcpp::detail::resolve_intra_process_buffer_type;
184184

185185
// Check if the QoS is compatible with intra-process.
@@ -201,11 +201,11 @@ class Subscription : public SubscriptionBase
201201
auto context = node_base->get_context();
202202
subscription_intra_process_ = std::make_shared<SubscriptionIntraProcessT>(
203203
callback,
204-
options.get_allocator(),
204+
options_.get_allocator(),
205205
context,
206206
this->get_topic_name(), // important to get like this, as it has the fully-qualified name
207207
qos_profile,
208-
resolve_intra_process_buffer_type(options.intra_process_buffer_type, callback));
208+
resolve_intra_process_buffer_type(options_.intra_process_buffer_type, callback));
209209
TRACEPOINT(
210210
rclcpp_subscription_init,
211211
static_cast<const void *>(get_subscription_handle().get()),

0 commit comments

Comments
 (0)