diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-28 13:59:32 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-28 13:59:32 +0100 |
commit | b0cfc2d1226c2b62a6bf3aac1809458b04902728 (patch) | |
tree | 551c57a2d7665b1eb39115ce5a1ca168973ee096 /src/modules/uORB/Subscription.hpp | |
parent | 16f21d36dce17868f455318273140013febb6770 (diff) | |
download | px4-firmware-b0cfc2d1226c2b62a6bf3aac1809458b04902728.tar.gz px4-firmware-b0cfc2d1226c2b62a6bf3aac1809458b04902728.tar.bz2 px4-firmware-b0cfc2d1226c2b62a6bf3aac1809458b04902728.zip |
uORB::SubscriptionNode stores interval
Diffstat (limited to 'src/modules/uORB/Subscription.hpp')
-rw-r--r-- | src/modules/uORB/Subscription.hpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/modules/uORB/Subscription.hpp b/src/modules/uORB/Subscription.hpp index bab1ef2ea..f82586285 100644 --- a/src/modules/uORB/Subscription.hpp +++ b/src/modules/uORB/Subscription.hpp @@ -58,10 +58,10 @@ public: /** * Constructor * - * @param meta The uORB metadata (usually from the ORB_ID() + * @param meta The uORB metadata (usually from the ORB_ID() * macro) for the topic. * - * @param interval The minimum interval in milliseconds + * @param interval The minimum interval in milliseconds * between updates */ SubscriptionBase(const struct orb_metadata *meta, @@ -126,17 +126,18 @@ public: * Constructor * * - * @param meta The uORB metadata (usually from the ORB_ID() + * @param meta The uORB metadata (usually from the ORB_ID() * macro) for the topic. - * @param interval The minimum interval in milliseconds + * @param interval The minimum interval in milliseconds * between updates - * @param list A pointer to a list of subscriptions + * @param list A pointer to a list of subscriptions * that this should be appended to. */ SubscriptionNode(const struct orb_metadata *meta, unsigned interval=0, List<SubscriptionNode *> * list=nullptr) : - SubscriptionBase(meta, interval) { + SubscriptionBase(meta, interval), + _interval(interval) { if (list != nullptr) list->add(this); } @@ -145,6 +146,12 @@ public: * updates, a child class must implement it. */ virtual void update() = 0; +// accessors + unsigned getInterval() { return _interval; } +protected: +// attributes + unsigned _interval; + }; /** @@ -159,14 +166,14 @@ public: /** * Constructor * - * @param meta The uORB metadata (usually from + * @param meta The uORB metadata (usually from * the ORB_ID() macro) for the topic. - * @param interval The minimum interval in milliseconds + * @param interval The minimum interval in milliseconds * between updates - * @param list A list interface for adding to + * @param list A list interface for adding to * list during construction */ - Subscription(const struct orb_metadata *meta, + Subscription(const struct orb_metadata *meta, unsigned interval=0, List<SubscriptionNode *> * list=nullptr); /** |