Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ROSCPP_ADVERTISE_OPTIONS_H
00029 #define ROSCPP_ADVERTISE_OPTIONS_H
00030
00031 #include "ros/forwards.h"
00032 #include "ros/message_traits.h"
00033 #include "common.h"
00034
00035 namespace ros
00036 {
00037
00041 struct ROSCPP_DECL AdvertiseOptions
00042 {
00043 AdvertiseOptions()
00044 : callback_queue(0)
00045 , latch(false)
00046 {
00047 }
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 AdvertiseOptions(const std::string& _topic, uint32_t _queue_size, const std::string& _md5sum,
00059 const std::string& _datatype, const std::string& _message_definition,
00060 const SubscriberStatusCallback& _connect_cb = SubscriberStatusCallback(),
00061 const SubscriberStatusCallback& _disconnect_cb = SubscriberStatusCallback())
00062 : topic(_topic)
00063 , queue_size(_queue_size)
00064 , md5sum(_md5sum)
00065 , datatype(_datatype)
00066 , message_definition(_message_definition)
00067 , connect_cb(_connect_cb)
00068 , disconnect_cb(_disconnect_cb)
00069 , callback_queue(0)
00070 , latch(false)
00071 , has_header(false)
00072 {}
00073
00083 template <class M>
00084 void init(const std::string& _topic, uint32_t _queue_size,
00085 const SubscriberStatusCallback& _connect_cb = SubscriberStatusCallback(),
00086 const SubscriberStatusCallback& _disconnect_cb = SubscriberStatusCallback())
00087 {
00088 topic = _topic;
00089 queue_size = _queue_size;
00090 connect_cb = _connect_cb;
00091 disconnect_cb = _disconnect_cb;
00092 md5sum = message_traits::md5sum<M>();
00093 datatype = message_traits::datatype<M>();
00094 message_definition = message_traits::definition<M>();
00095 has_header = message_traits::hasHeader<M>();
00096 }
00097
00098 std::string topic;
00099 uint32_t queue_size;
00100
00101 std::string md5sum;
00102 std::string datatype;
00103 std::string message_definition;
00104
00105 SubscriberStatusCallback connect_cb;
00106 SubscriberStatusCallback disconnect_cb;
00107
00108 CallbackQueueInterface* callback_queue;
00109
00120 VoidConstPtr tracked_object;
00121
00126 bool latch;
00127
00131 bool has_header;
00132
00133
00147 template<class M>
00148 static AdvertiseOptions create(const std::string& topic, uint32_t queue_size,
00149 const SubscriberStatusCallback& connect_cb,
00150 const SubscriberStatusCallback& disconnect_cb,
00151 const VoidConstPtr& tracked_object,
00152 CallbackQueueInterface* queue)
00153 {
00154 AdvertiseOptions ops;
00155 ops.init<M>(topic, queue_size, connect_cb, disconnect_cb);
00156 ops.tracked_object = tracked_object;
00157 ops.callback_queue = queue;
00158 return ops;
00159 }
00160 };
00161
00162
00163 }
00164
00165 #endif
roscpp
Author(s): Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com, Troy Straszheim straszheim@willowgarage.com
autogenerated on Sat Dec 28 2013 17:35:52