Merge pull request #208 from ros2/timer_specialization

Only enable Timer if clock type is steady
This commit is contained in:
Jackie Kay 2016-03-15 18:20:33 -07:00
commit 2be9568498

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.
template<
typename FunctorT,
class Clock = std::chrono::high_resolution_clock,
class Clock,
typename std::enable_if<
rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value ||
rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value
(rclcpp::function_traits::same_arguments<FunctorT, VoidCallbackType>::value ||
rclcpp::function_traits::same_arguments<FunctorT, TimerCallbackType>::value) &&
Clock::is_steady
>::type * = nullptr
>
class GenericTimer : public TimerBase