aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/px4_publisher.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-12-04 13:06:38 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-12-04 13:06:38 +0100
commite0bb713bb03c0aa79e69496c787c012a8e1b78d1 (patch)
treeb71614bc124479dbe7a57b434872fc7deb39eb20 /src/platforms/px4_publisher.h
parent0f094d35d5dd183e44148eb1acbd7b7d76fde669 (diff)
downloadpx4-firmware-e0bb713bb03c0aa79e69496c787c012a8e1b78d1.tar.gz
px4-firmware-e0bb713bb03c0aa79e69496c787c012a8e1b78d1.tar.bz2
px4-firmware-e0bb713bb03c0aa79e69496c787c012a8e1b78d1.zip
more documentation comments
Diffstat (limited to 'src/platforms/px4_publisher.h')
-rw-r--r--src/platforms/px4_publisher.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/platforms/px4_publisher.h b/src/platforms/px4_publisher.h
index 9ce211d25..b67421066 100644
--- a/src/platforms/px4_publisher.h
+++ b/src/platforms/px4_publisher.h
@@ -52,33 +52,53 @@ namespace px4
class Publisher
{
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() {};
+
+ /** Publishes msg
+ * @param msg the message which is published to the topic
+ */
template<typename M>
int publish(const M &msg) { _ros_pub.publish(msg); return 0; }
private:
- ros::Publisher _ros_pub;
+ ros::Publisher _ros_pub; /**< Handle to the ros publisher */
};
#else
class Publisher :
public uORB::PublicationNode
{
public:
+ /**
+ * Construct Publisher by providing orb meta data
+ * @param meta orb metadata for the topic which is used
+ * @param list publisher is added to this list
+ */
Publisher(const struct orb_metadata *meta,
List<uORB::PublicationNode *> * list) :
uORB::PublicationNode(meta, list)
{}
+
~Publisher() {};
+
+ /** Publishes msg
+ * @param msg the message which is published to the topic
+ */
template<typename M>
int publish(const M &msg) {
uORB::PublicationBase::update((void*)&msg);
return 0;
}
- void update() {
- //XXX list traversal callback, needed?
- } ;
+ /**
+ * Empty callback for list traversal
+ */
+ void update() {} ;
};
#endif
}