Only enable Timer if clock type is steady

This commit is contained in:
Jackie Kay 2016-03-15 16:23:39 -07:00
parent 02311dee4c
commit e7833fa709

View file

@ -84,10 +84,11 @@ using TimerCallbackType = std::function<void(TimerBase &)>;
/// Generic timer templated on the clock type. Periodically executes a user-specified callback. /// Generic timer templated on the clock type. Periodically executes a user-specified callback.
template< template<
typename FunctorT, typename FunctorT,
class Clock = std::chrono::high_resolution_clock, class Clock,
typename std::enable_if< typename std::enable_if<
rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value || (rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value ||
rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value) &&
Clock::is_steady
>::type * = nullptr >::type * = nullptr
> >
class GenericTimer : public TimerBase class GenericTimer : public TimerBase