00001
00002 #ifndef PERF_ROSCPP_MESSAGE_LATENCYMESSAGE_H
00003 #define PERF_ROSCPP_MESSAGE_LATENCYMESSAGE_H
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 #include "ros/serialization.h"
00008 #include "ros/builtin_message_traits.h"
00009 #include "ros/message_operations.h"
00010 #include "ros/message.h"
00011 #include "ros/time.h"
00012
00013
00014 namespace perf_roscpp
00015 {
00016 template <class ContainerAllocator>
00017 struct LatencyMessage_ : public ros::Message
00018 {
00019 typedef LatencyMessage_<ContainerAllocator> Type;
00020
00021 LatencyMessage_()
00022 : publish_time(0.0)
00023 , receipt_time(0.0)
00024 , count(0)
00025 , thread_index(0)
00026 , array()
00027 {
00028 }
00029
00030 LatencyMessage_(const ContainerAllocator& _alloc)
00031 : publish_time(0.0)
00032 , receipt_time(0.0)
00033 , count(0)
00034 , thread_index(0)
00035 , array(_alloc)
00036 {
00037 }
00038
00039 typedef double _publish_time_type;
00040 double publish_time;
00041
00042 typedef double _receipt_time_type;
00043 double receipt_time;
00044
00045 typedef uint64_t _count_type;
00046 uint64_t count;
00047
00048 typedef uint32_t _thread_index_type;
00049 uint32_t thread_index;
00050
00051 typedef std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > _array_type;
00052 std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > array;
00053
00054
00055 ROS_DEPRECATED uint32_t get_array_size() const { return (uint32_t)array.size(); }
00056 ROS_DEPRECATED void set_array_size(uint32_t size) { array.resize((size_t)size); }
00057 ROS_DEPRECATED void get_array_vec(std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) const { vec = this->array; }
00058 ROS_DEPRECATED void set_array_vec(const std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) { this->array = vec; }
00059 private:
00060 static const char* __s_getDataType_() { return "perf_roscpp/LatencyMessage"; }
00061 public:
00062 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00063
00064 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00065
00066 private:
00067 static const char* __s_getMD5Sum_() { return "be90d117303321f392404ed7edeb7c8c"; }
00068 public:
00069 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00070
00071 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00072
00073 private:
00074 static const char* __s_getMessageDefinition_() { return "float64 publish_time\n\
00075 float64 receipt_time\n\
00076 uint64 count\n\
00077 uint32 thread_index\n\
00078 uint8[] array\n\
00079 \n\
00080 \n\
00081 "; }
00082 public:
00083 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00084
00085 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00086
00087 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00088 {
00089 ros::serialization::OStream stream(write_ptr, 1000000000);
00090 ros::serialization::serialize(stream, publish_time);
00091 ros::serialization::serialize(stream, receipt_time);
00092 ros::serialization::serialize(stream, count);
00093 ros::serialization::serialize(stream, thread_index);
00094 ros::serialization::serialize(stream, array);
00095 return stream.getData();
00096 }
00097
00098 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00099 {
00100 ros::serialization::IStream stream(read_ptr, 1000000000);
00101 ros::serialization::deserialize(stream, publish_time);
00102 ros::serialization::deserialize(stream, receipt_time);
00103 ros::serialization::deserialize(stream, count);
00104 ros::serialization::deserialize(stream, thread_index);
00105 ros::serialization::deserialize(stream, array);
00106 return stream.getData();
00107 }
00108
00109 ROS_DEPRECATED virtual uint32_t serializationLength() const
00110 {
00111 uint32_t size = 0;
00112 size += ros::serialization::serializationLength(publish_time);
00113 size += ros::serialization::serializationLength(receipt_time);
00114 size += ros::serialization::serializationLength(count);
00115 size += ros::serialization::serializationLength(thread_index);
00116 size += ros::serialization::serializationLength(array);
00117 return size;
00118 }
00119
00120 typedef boost::shared_ptr< ::perf_roscpp::LatencyMessage_<ContainerAllocator> > Ptr;
00121 typedef boost::shared_ptr< ::perf_roscpp::LatencyMessage_<ContainerAllocator> const> ConstPtr;
00122 };
00123 typedef ::perf_roscpp::LatencyMessage_<std::allocator<void> > LatencyMessage;
00124
00125 typedef boost::shared_ptr< ::perf_roscpp::LatencyMessage> LatencyMessagePtr;
00126 typedef boost::shared_ptr< ::perf_roscpp::LatencyMessage const> LatencyMessageConstPtr;
00127
00128
00129 template<typename ContainerAllocator>
00130 std::ostream& operator<<(std::ostream& s, const ::perf_roscpp::LatencyMessage_<ContainerAllocator> & v)
00131 {
00132 ros::message_operations::Printer< ::perf_roscpp::LatencyMessage_<ContainerAllocator> >::stream(s, "", v);
00133 return s;}
00134
00135 }
00136
00137 namespace ros
00138 {
00139 namespace message_traits
00140 {
00141 template<class ContainerAllocator>
00142 struct MD5Sum< ::perf_roscpp::LatencyMessage_<ContainerAllocator> > {
00143 static const char* value()
00144 {
00145 return "be90d117303321f392404ed7edeb7c8c";
00146 }
00147
00148 static const char* value(const ::perf_roscpp::LatencyMessage_<ContainerAllocator> &) { return value(); }
00149 static const uint64_t static_value1 = 0xbe90d117303321f3ULL;
00150 static const uint64_t static_value2 = 0x92404ed7edeb7c8cULL;
00151 };
00152
00153 template<class ContainerAllocator>
00154 struct DataType< ::perf_roscpp::LatencyMessage_<ContainerAllocator> > {
00155 static const char* value()
00156 {
00157 return "perf_roscpp/LatencyMessage";
00158 }
00159
00160 static const char* value(const ::perf_roscpp::LatencyMessage_<ContainerAllocator> &) { return value(); }
00161 };
00162
00163 template<class ContainerAllocator>
00164 struct Definition< ::perf_roscpp::LatencyMessage_<ContainerAllocator> > {
00165 static const char* value()
00166 {
00167 return "float64 publish_time\n\
00168 float64 receipt_time\n\
00169 uint64 count\n\
00170 uint32 thread_index\n\
00171 uint8[] array\n\
00172 \n\
00173 \n\
00174 ";
00175 }
00176
00177 static const char* value(const ::perf_roscpp::LatencyMessage_<ContainerAllocator> &) { return value(); }
00178 };
00179
00180 }
00181 }
00182
00183 namespace ros
00184 {
00185 namespace serialization
00186 {
00187
00188 template<class ContainerAllocator> struct Serializer< ::perf_roscpp::LatencyMessage_<ContainerAllocator> >
00189 {
00190 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00191 {
00192 stream.next(m.publish_time);
00193 stream.next(m.receipt_time);
00194 stream.next(m.count);
00195 stream.next(m.thread_index);
00196 stream.next(m.array);
00197 }
00198
00199 ROS_DECLARE_ALLINONE_SERIALIZER;
00200 };
00201 }
00202 }
00203
00204 namespace ros
00205 {
00206 namespace message_operations
00207 {
00208
00209 template<class ContainerAllocator>
00210 struct Printer< ::perf_roscpp::LatencyMessage_<ContainerAllocator> >
00211 {
00212 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::perf_roscpp::LatencyMessage_<ContainerAllocator> & v)
00213 {
00214 s << indent << "publish_time: ";
00215 Printer<double>::stream(s, indent + " ", v.publish_time);
00216 s << indent << "receipt_time: ";
00217 Printer<double>::stream(s, indent + " ", v.receipt_time);
00218 s << indent << "count: ";
00219 Printer<uint64_t>::stream(s, indent + " ", v.count);
00220 s << indent << "thread_index: ";
00221 Printer<uint32_t>::stream(s, indent + " ", v.thread_index);
00222 s << indent << "array[]" << std::endl;
00223 for (size_t i = 0; i < v.array.size(); ++i)
00224 {
00225 s << indent << " array[" << i << "]: ";
00226 Printer<uint8_t>::stream(s, indent + " ", v.array[i]);
00227 }
00228 }
00229 };
00230
00231
00232 }
00233 }
00234
00235 #endif // PERF_ROSCPP_MESSAGE_LATENCYMESSAGE_H
00236