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
7272 const std::vector<std::string> & start_interfaces,
7373 const std::vector<std::string> & stop_interfaces);
7474
75- std::string get_name () const ;
75+ const std::string & get_name () const ;
7676
77- std::string get_group_name () const ;
77+ const std::string & get_group_name () const ;
7878
7979 const rclcpp_lifecycle::State & get_lifecycle_state () const ;
8080
Original file line number Diff line number Diff line change @@ -461,13 +461,13 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
461461 /* *
462462 * \return name.
463463 */
464- virtual std::string get_name () const { return info_.name ; }
464+ const std::string & get_name () const { return info_.name ; }
465465
466466 // / Get name of the actuator hardware group to which it belongs to.
467467 /* *
468468 * \return group name.
469469 */
470- virtual std::string get_group_name () const { return info_.group ; }
470+ const std::string & get_group_name () const { return info_.group ; }
471471
472472 // / Get life-cycle state of the actuator hardware.
473473 /* *
Original file line number Diff line number Diff line change @@ -158,11 +158,11 @@ struct InterfaceDescription
158158 */
159159 std::string interface_name;
160160
161- std::string get_prefix_name () const { return prefix_name; }
161+ const std::string & get_prefix_name () const { return prefix_name; }
162162
163- std::string get_interface_name () const { return interface_info.name ; }
163+ const std::string & get_interface_name () const { return interface_info.name ; }
164164
165- std::string get_name () const { return interface_name; }
165+ const std::string & get_name () const { return interface_name; }
166166};
167167
168168// / 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
6262
6363 std::vector<StateInterface::ConstSharedPtr> export_state_interfaces ();
6464
65- std::string get_name () const ;
65+ const std::string & get_name () const ;
6666
67- std::string get_group_name () const ;
67+ const std::string & get_group_name () const ;
6868
6969 const rclcpp_lifecycle::State & get_lifecycle_state () const ;
7070
Original file line number Diff line number Diff line change @@ -275,13 +275,13 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
275275 /* *
276276 * \return name.
277277 */
278- virtual std::string get_name () const { return info_.name ; }
278+ const std::string & get_name () const { return info_.name ; }
279279
280280 // / Get name of the actuator hardware group to which it belongs to.
281281 /* *
282282 * \return group name.
283283 */
284- virtual std::string get_group_name () const { return info_.group ; }
284+ const std::string & get_group_name () const { return info_.group ; }
285285
286286 // / Get life-cycle state of the actuator hardware.
287287 /* *
Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ class System final
7272 const std::vector<std::string> & start_interfaces,
7373 const std::vector<std::string> & stop_interfaces);
7474
75- std::string get_name () const ;
75+ const std::string & get_name () const ;
7676
77- std::string get_group_name () const ;
77+ const std::string & get_group_name () const ;
7878
7979 const rclcpp_lifecycle::State & get_lifecycle_state () const ;
8080
Original file line number Diff line number Diff line change @@ -490,13 +490,13 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
490490 /* *
491491 * \return name.
492492 */
493- virtual std::string get_name () const { return info_.name ; }
493+ const std::string & get_name () const { return info_.name ; }
494494
495495 // / Get name of the actuator hardware group to which it belongs to.
496496 /* *
497497 * \return group name.
498498 */
499- virtual std::string get_group_name () const { return info_.group ; }
499+ const std::string & get_group_name () const { return info_.group ; }
500500
501501 // / Get life-cycle state of the actuator hardware.
502502 /* *
Original file line number Diff line number Diff line change @@ -277,9 +277,9 @@ return_type Actuator::perform_command_mode_switch(
277277 return impl_->perform_command_mode_switch (start_interfaces, stop_interfaces);
278278}
279279
280- std::string Actuator::get_name () const { return impl_->get_name (); }
280+ const std::string & Actuator::get_name () const { return impl_->get_name (); }
281281
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 (); }
283283
284284const rclcpp_lifecycle::State & Actuator::get_lifecycle_state () const
285285{
Original file line number Diff line number Diff line change @@ -233,9 +233,9 @@ std::vector<StateInterface::ConstSharedPtr> Sensor::export_state_interfaces()
233233 // END: for backward compatibility
234234}
235235
236- std::string Sensor::get_name () const { return impl_->get_name (); }
236+ const std::string & Sensor::get_name () const { return impl_->get_name (); }
237237
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 (); }
239239
240240const rclcpp_lifecycle::State & Sensor::get_lifecycle_state () const
241241{
Original file line number Diff line number Diff line change @@ -275,9 +275,9 @@ return_type System::perform_command_mode_switch(
275275 return impl_->perform_command_mode_switch (start_interfaces, stop_interfaces);
276276}
277277
278- std::string System::get_name () const { return impl_->get_name (); }
278+ const std::string & System::get_name () const { return impl_->get_name (); }
279279
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 (); }
281281
282282const rclcpp_lifecycle::State & System::get_lifecycle_state () const
283283{
You can’t perform that action at this time.
0 commit comments