Add hasStarted() const to WallTimer and SteadyTimer API#1565
Add hasStarted() const to WallTimer and SteadyTimer API#1565dirk-thomas merged 2 commits intoros:melodic-develfrom
Conversation
|
Please avoid unrelated white space changes as well as moving code unnecessarily. Both just make backporting changes across branches more difficult. |
The goal was to unify whitespace between steady_timer.cpp with timer.cpp and wall_timer.cpp, which are almost identical and only have been copied over the years. Some patches, like #1464, have only been applied to one of them, although they actually apply to all three implementations. The unified whitespace helps to compare those three on the same branch. I will minimize the diff as requested. |
…lTimer and ros::SteadyTimer ros::Timer::hasStarted() has been added in ros#1464. The same member function should exist in the other two timer implementations, too, for completeness.
a6bb2e3 to
721d683
Compare
|
Thank you for the patch and for iterating on it. The CI failures are due to tests known to be flaky 😞 |
* roscpp: copy hasStarted() member function from ros::Timer to ros::WallTimer and ros::SteadyTimer ros::Timer::hasStarted() has been added in ros#1464. The same member function should exist in the other two timer implementations, too, for completeness. * Check for nullptr in WallTimer::hasStarted() and SteadyTimer::hasStarted() Analogous to fe9479c (ros#1541).
Completes #1464 (Add hasStarted() const to Timer API):
Also add
hasStarted()method toros::WallTimerandros::SteadyTimer, such that the timer APIs are identical.Whitespace changes are the result of merging steady_timer.cpp with timer.cpp and wall_timer.cpp. In a future release it would be possible to define a template class
TimerBase<T,D,E>and threetypedefs forTimer,WallTimerandSteadyTimerto avoid code duplication.The patch is fully ABI-compatible because it only adds two new non-virtual member functions.
Addresses #1557 (comment):