diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-23 07:17:06 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-23 07:17:06 +0100 |
commit | 2dfd30c25e2839b762ca127fd4af696284df34b9 (patch) | |
tree | 26271d46867b7e845e229061f0a7ba4577d06756 /src/platforms/px4_nodehandle.h | |
parent | 1ad6e00234e990d44f2a9ca93bcc50696c4c530c (diff) | |
download | px4-firmware-2dfd30c25e2839b762ca127fd4af696284df34b9.tar.gz px4-firmware-2dfd30c25e2839b762ca127fd4af696284df34b9.tar.bz2 px4-firmware-2dfd30c25e2839b762ca127fd4af696284df34b9.zip |
move uorb::subscriptionbase into constructor of subscriber
Diffstat (limited to 'src/platforms/px4_nodehandle.h')
-rw-r--r-- | src/platforms/px4_nodehandle.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/platforms/px4_nodehandle.h b/src/platforms/px4_nodehandle.h index 40604aa86..f2d09c15c 100644 --- a/src/platforms/px4_nodehandle.h +++ b/src/platforms/px4_nodehandle.h @@ -190,8 +190,7 @@ public: template<typename T> Subscriber<T> *subscribe(void(*fp)(const T &), unsigned interval=10) //XXX interval { - uORB::SubscriptionBase * uorb_sub = new uORB::SubscriptionBase(T::handle(), interval);//XXX needs cleanup in destructor ore move into class - SubscriberUORBCallback<T> *sub_px4 = new SubscriberUORBCallback<T>(uorb_sub, interval, std::bind(fp, std::placeholders::_1)); + SubscriberUORBCallback<T> *sub_px4 = new SubscriberUORBCallback<T>(interval, std::bind(fp, std::placeholders::_1)); /* Check if this is the smallest interval so far and update _sub_min_interval */ if (_sub_min_interval == nullptr || _sub_min_interval->get_interval() > interval) { @@ -210,8 +209,7 @@ public: template<typename T, typename C> Subscriber<T> *subscribe(void(C::*fp)(const T &), C *obj, unsigned interval=10) { - uORB::SubscriptionBase * uorb_sub = new uORB::SubscriptionBase(T::handle(), interval);//XXX needs cleanup in destructor ore move into class - SubscriberUORBCallback<T> *sub_px4 = new SubscriberUORBCallback<T>(uorb_sub, interval, std::bind(fp, obj, std::placeholders::_1)); + SubscriberUORBCallback<T> *sub_px4 = new SubscriberUORBCallback<T>(interval, std::bind(fp, obj, std::placeholders::_1)); /* Check if this is the smallest interval so far and update _sub_min_interval */ if (_sub_min_interval == nullptr || _sub_min_interval->get_interval() > interval) { @@ -230,9 +228,7 @@ public: template<typename T> Subscriber<T> *subscribe(unsigned interval=10) //XXX interval { - uORB::SubscriptionBase * uorb_sub = new uORB::SubscriptionBase(T::handle(), interval);//XXX needs cleanup in destructor ore move into class - - SubscriberUORB<T> *sub_px4 = new SubscriberUORB<T>(uorb_sub, interval); + SubscriberUORB<T> *sub_px4 = new SubscriberUORB<T>(interval); /* Check if this is the smallest interval so far and update _sub_min_interval */ if (_sub_min_interval == nullptr || _sub_min_interval->get_interval() > interval) { |