diff --git a/libuavcan/include/uavcan/node/service_client.hpp b/libuavcan/include/uavcan/node/service_client.hpp index ab09addd5e..419459e6ac 100644 --- a/libuavcan/include/uavcan/node/service_client.hpp +++ b/libuavcan/include/uavcan/node/service_client.hpp @@ -71,9 +71,9 @@ static Stream& operator<<(Stream& s, const ServiceCallResult& scr) template = UAVCAN_CPP11 - typename Callback = std::function&)> + typename Callback_ = std::function&)> #else - typename Callback = void (*)(const ServiceCallResult&) + typename Callback_ = void (*)(const ServiceCallResult&) #endif > class ServiceClient @@ -86,6 +86,7 @@ public: typedef typename DataType::Request RequestType; typedef typename DataType::Response ResponseType; typedef ServiceCallResult ServiceCallResultType; + typedef Callback_ Callback; private: typedef ServiceClient SelfType; diff --git a/libuavcan/include/uavcan/node/service_server.hpp b/libuavcan/include/uavcan/node/service_server.hpp index 05146550c3..345c13dc1b 100644 --- a/libuavcan/include/uavcan/node/service_server.hpp +++ b/libuavcan/include/uavcan/node/service_server.hpp @@ -21,11 +21,11 @@ namespace uavcan template = UAVCAN_CPP11 - typename Callback = std::function&, - typename DataType_::Response&)>, + typename Callback_ = std::function&, + typename DataType_::Response&)>, #else - typename Callback = void (*)(const ReceivedDataStructure&, - typename DataType_::Response&), + typename Callback_ = void (*)(const ReceivedDataStructure&, + typename DataType_::Response&), #endif unsigned NumStaticReceivers = 2, unsigned NumStaticBufs = 1> @@ -38,6 +38,7 @@ public: typedef DataType_ DataType; typedef typename DataType::Request RequestType; typedef typename DataType::Response ResponseType; + typedef Callback_ Callback; private: typedef typename TransferListenerInstantiationHelper::Type diff --git a/libuavcan/include/uavcan/node/subscriber.hpp b/libuavcan/include/uavcan/node/subscriber.hpp index 27a5d46318..d374ebb9b7 100644 --- a/libuavcan/include/uavcan/node/subscriber.hpp +++ b/libuavcan/include/uavcan/node/subscriber.hpp @@ -21,9 +21,9 @@ namespace uavcan template = UAVCAN_CPP11 - typename Callback = std::function&)>, + typename Callback_ = std::function&)>, #else - typename Callback = void (*)(const ReceivedDataStructure&), + typename Callback_ = void (*)(const ReceivedDataStructure&), #endif unsigned NumStaticReceivers = 2, unsigned NumStaticBufs = 1> @@ -32,6 +32,10 @@ class Subscriber : public GenericSubscriber::Type> { +public: + typedef Callback_ Callback; + +private: typedef typename TransferListenerInstantiationHelper::Type TransferListenerType; typedef GenericSubscriber BaseType; diff --git a/libuavcan/include/uavcan/node/timer.hpp b/libuavcan/include/uavcan/node/timer.hpp index 3f291677b3..4020f65933 100644 --- a/libuavcan/include/uavcan/node/timer.hpp +++ b/libuavcan/include/uavcan/node/timer.hpp @@ -64,9 +64,13 @@ public: }; -template +template class TimerEventForwarder : public TimerBase { +public: + typedef Callback_ Callback; + +private: Callback callback_; void handleTimerEvent(const TimerEvent& event)