Skip to content

Commit

Permalink
update the other get_value method
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Jan 2, 2025
1 parent 169ba83 commit a01be64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hardware_interface/include/hardware_interface/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ class Handle
return value_ptr_ != nullptr ? *value_ptr_ : std::get<T>(value_);
}

[[nodiscard]] bool get_value(double & value) const
template <typename T>
[[nodiscard]] bool get_value(T & value) const
{
std::shared_lock<std::shared_mutex> lock(handle_mutex_, std::try_to_lock);
if (!lock.owns_lock())
Expand All @@ -193,8 +194,7 @@ class Handle
}
// BEGIN (Handle export change): for backward compatibility
// TODO(Manuel) set value directly if old functionality is removed
THROW_ON_NULLPTR(value_ptr_);
value = *value_ptr_;
value = value_ptr_ != nullptr ? *value_ptr_ : std::get<T>(value_);
return true;
// END
}
Expand Down

0 comments on commit a01be64

Please sign in to comment.