diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-23 15:16:13 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-23 15:16:13 +0100 |
commit | 73f342616e275ca726d70807212a733f9971bf66 (patch) | |
tree | a8509abb34b197ac1b7e8bbca5f92f0cb28cc02f /src/platforms/px4_subscriber.h | |
parent | 1ab9ec5811a5b945ca49a8e6aeef59557dd2970c (diff) | |
download | px4-firmware-73f342616e275ca726d70807212a733f9971bf66.tar.gz px4-firmware-73f342616e275ca726d70807212a733f9971bf66.tar.bz2 px4-firmware-73f342616e275ca726d70807212a733f9971bf66.zip |
add better accessor
Diffstat (limited to 'src/platforms/px4_subscriber.h')
-rw-r--r-- | src/platforms/px4_subscriber.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/platforms/px4_subscriber.h b/src/platforms/px4_subscriber.h index 6a81ef8d2..6ca35b173 100644 --- a/src/platforms/px4_subscriber.h +++ b/src/platforms/px4_subscriber.h @@ -84,7 +84,15 @@ public: /** * Get the last message value */ - virtual T get() {return _msg_current;} + virtual T& get() {return _msg_current;} + + /** + * Get the last native message value + */ + virtual decltype(((T*)nullptr)->data()) data() + { + return _msg_current.data(); + } protected: T _msg_current; /**< Current Message value */ |