uorb subscription: remove _interval & use orb_get_interval() instead

This commit is contained in:
Beat Küng
2016-08-24 21:24:35 +02:00
parent 6b4c24fb12
commit aefd217fc0
2 changed files with 14 additions and 13 deletions
+9 -8
View File
@@ -86,7 +86,14 @@ public:
// accessors
const struct orb_metadata *getMeta() { return _meta; }
int getHandle() { return _handle; }
int getHandle() const { return _handle; }
unsigned getInterval() const
{
unsigned int interval;
orb_get_interval(getHandle(), &interval);
return interval;
}
protected:
// accessors
void setHandle(int handle) { _handle = handle; }
@@ -130,8 +137,7 @@ public:
unsigned interval = 0,
int instance = 0,
List<SubscriptionNode *> *list = nullptr) :
SubscriptionBase(meta, interval, instance),
_interval(interval)
SubscriptionBase(meta, interval, instance)
{
if (list != nullptr) { list->add(this); }
}
@@ -141,11 +147,6 @@ public:
* updates, a child class must implement it.
*/
virtual void update() = 0;
// accessors
unsigned getInterval() { return _interval; }
protected:
// attributes
unsigned _interval;
};