mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 03:03:34 +08:00
add better accessor
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user