File tree Expand file tree Collapse file tree 13 files changed +21
-45
lines changed
hardware_interface_testing/test
include/hardware_interface Expand file tree Collapse file tree 13 files changed +21
-45
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ class Actuator final
72
72
const std::vector<std::string> & start_interfaces,
73
73
const std::vector<std::string> & stop_interfaces);
74
74
75
- std::string get_name () const ;
75
+ const std::string & get_name () const ;
76
76
77
- std::string get_group_name () const ;
77
+ const std::string & get_group_name () const ;
78
78
79
79
const rclcpp_lifecycle::State & get_lifecycle_state () const ;
80
80
Original file line number Diff line number Diff line change @@ -461,13 +461,13 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
461
461
/* *
462
462
* \return name.
463
463
*/
464
- virtual std::string get_name () const { return info_.name ; }
464
+ const std::string & get_name () const { return info_.name ; }
465
465
466
466
// / Get name of the actuator hardware group to which it belongs to.
467
467
/* *
468
468
* \return group name.
469
469
*/
470
- virtual std::string get_group_name () const { return info_.group ; }
470
+ const std::string & get_group_name () const { return info_.group ; }
471
471
472
472
// / Get life-cycle state of the actuator hardware.
473
473
/* *
Original file line number Diff line number Diff line change @@ -158,11 +158,11 @@ struct InterfaceDescription
158
158
*/
159
159
std::string interface_name;
160
160
161
- std::string get_prefix_name () const { return prefix_name; }
161
+ const std::string & get_prefix_name () const { return prefix_name; }
162
162
163
- std::string get_interface_name () const { return interface_info.name ; }
163
+ const std::string & get_interface_name () const { return interface_info.name ; }
164
164
165
- std::string get_name () const { return interface_name; }
165
+ const std::string & get_name () const { return interface_name; }
166
166
};
167
167
168
168
// / This structure stores information about hardware defined in a robot's URDF.
Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ class Sensor final
62
62
63
63
std::vector<StateInterface::ConstSharedPtr> export_state_interfaces ();
64
64
65
- std::string get_name () const ;
65
+ const std::string & get_name () const ;
66
66
67
- std::string get_group_name () const ;
67
+ const std::string & get_group_name () const ;
68
68
69
69
const rclcpp_lifecycle::State & get_lifecycle_state () const ;
70
70
Original file line number Diff line number Diff line change @@ -275,13 +275,13 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
275
275
/* *
276
276
* \return name.
277
277
*/
278
- virtual std::string get_name () const { return info_.name ; }
278
+ const std::string & get_name () const { return info_.name ; }
279
279
280
280
// / Get name of the actuator hardware group to which it belongs to.
281
281
/* *
282
282
* \return group name.
283
283
*/
284
- virtual std::string get_group_name () const { return info_.group ; }
284
+ const std::string & get_group_name () const { return info_.group ; }
285
285
286
286
// / Get life-cycle state of the actuator hardware.
287
287
/* *
Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ class System final
72
72
const std::vector<std::string> & start_interfaces,
73
73
const std::vector<std::string> & stop_interfaces);
74
74
75
- std::string get_name () const ;
75
+ const std::string & get_name () const ;
76
76
77
- std::string get_group_name () const ;
77
+ const std::string & get_group_name () const ;
78
78
79
79
const rclcpp_lifecycle::State & get_lifecycle_state () const ;
80
80
Original file line number Diff line number Diff line change @@ -490,13 +490,13 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
490
490
/* *
491
491
* \return name.
492
492
*/
493
- virtual std::string get_name () const { return info_.name ; }
493
+ const std::string & get_name () const { return info_.name ; }
494
494
495
495
// / Get name of the actuator hardware group to which it belongs to.
496
496
/* *
497
497
* \return group name.
498
498
*/
499
- virtual std::string get_group_name () const { return info_.group ; }
499
+ const std::string & get_group_name () const { return info_.group ; }
500
500
501
501
// / Get life-cycle state of the actuator hardware.
502
502
/* *
Original file line number Diff line number Diff line change @@ -277,9 +277,9 @@ return_type Actuator::perform_command_mode_switch(
277
277
return impl_->perform_command_mode_switch (start_interfaces, stop_interfaces);
278
278
}
279
279
280
- std::string Actuator::get_name () const { return impl_->get_name (); }
280
+ const std::string & Actuator::get_name () const { return impl_->get_name (); }
281
281
282
- std::string Actuator::get_group_name () const { return impl_->get_group_name (); }
282
+ const std::string & Actuator::get_group_name () const { return impl_->get_group_name (); }
283
283
284
284
const rclcpp_lifecycle::State & Actuator::get_lifecycle_state () const
285
285
{
Original file line number Diff line number Diff line change @@ -233,9 +233,9 @@ std::vector<StateInterface::ConstSharedPtr> Sensor::export_state_interfaces()
233
233
// END: for backward compatibility
234
234
}
235
235
236
- std::string Sensor::get_name () const { return impl_->get_name (); }
236
+ const std::string & Sensor::get_name () const { return impl_->get_name (); }
237
237
238
- std::string Sensor::get_group_name () const { return impl_->get_group_name (); }
238
+ const std::string & Sensor::get_group_name () const { return impl_->get_group_name (); }
239
239
240
240
const rclcpp_lifecycle::State & Sensor::get_lifecycle_state () const
241
241
{
Original file line number Diff line number Diff line change @@ -275,9 +275,9 @@ return_type System::perform_command_mode_switch(
275
275
return impl_->perform_command_mode_switch (start_interfaces, stop_interfaces);
276
276
}
277
277
278
- std::string System::get_name () const { return impl_->get_name (); }
278
+ const std::string & System::get_name () const { return impl_->get_name (); }
279
279
280
- std::string System::get_group_name () const { return impl_->get_group_name (); }
280
+ const std::string & System::get_group_name () const { return impl_->get_group_name (); }
281
281
282
282
const rclcpp_lifecycle::State & System::get_lifecycle_state () const
283
283
{
You can’t perform that action at this time.
0 commit comments