diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-11 15:33:32 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-11 15:33:32 +0100 |
commit | 998646f03b229ae86bd6e57ff0bd15dd1763c342 (patch) | |
tree | 340fa4c7d15b9a92158bd142a9e53a53d7b178cf /src/platforms/px4_publisher.h | |
parent | c68c277c94cacd2a64b634dd9c45ace2a04c2911 (diff) | |
download | px4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.tar.gz px4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.tar.bz2 px4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.zip |
add base class and template subscriber class as well to improve interface to get last msg value
Diffstat (limited to 'src/platforms/px4_publisher.h')
-rw-r--r-- | src/platforms/px4_publisher.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/platforms/px4_publisher.h b/src/platforms/px4_publisher.h index cb15eeb58..6b6d8e39e 100644 --- a/src/platforms/px4_publisher.h +++ b/src/platforms/px4_publisher.h @@ -48,15 +48,30 @@ namespace px4 { + +/** + * Untemplated publisher base class + * */ +class PublisherBase +{ +public: + PublisherBase() {}; + ~PublisherBase() {}; + +}; + #if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) -class Publisher +class Publisher : + public PublisherBase { public: /** * Construct Publisher by providing a ros::Publisher * @param ros_pub the ros publisher which will be used to perform the publications */ - Publisher(ros::Publisher ros_pub) : _ros_pub(ros_pub) + Publisher(ros::Publisher ros_pub) : + PublisherBase(), + _ros_pub(ros_pub) {} ~Publisher() {}; @@ -71,7 +86,8 @@ private: }; #else class Publisher : - public uORB::PublicationNode + public uORB::PublicationNode, + public PublisherBase { public: /** @@ -81,7 +97,8 @@ public: */ Publisher(const struct orb_metadata *meta, List<uORB::PublicationNode *> *list) : - uORB::PublicationNode(meta, list) + uORB::PublicationNode(meta, list), + PublisherBase() {} ~Publisher() {}; |