00001
00002 #ifndef THEORA_IMAGE_TRANSPORT_MESSAGE_PACKET_H
00003 #define THEORA_IMAGE_TRANSPORT_MESSAGE_PACKET_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 #include "std_msgs/Header.h"
00014
00015 namespace theora_image_transport
00016 {
00017 template <class ContainerAllocator>
00018 struct Packet_ : public ros::Message
00019 {
00020 typedef Packet_<ContainerAllocator> Type;
00021
00022 Packet_()
00023 : header()
00024 , data()
00025 , b_o_s(0)
00026 , e_o_s(0)
00027 , granulepos(0)
00028 , packetno(0)
00029 {
00030 }
00031
00032 Packet_(const ContainerAllocator& _alloc)
00033 : header(_alloc)
00034 , data(_alloc)
00035 , b_o_s(0)
00036 , e_o_s(0)
00037 , granulepos(0)
00038 , packetno(0)
00039 {
00040 }
00041
00042 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00043 ::std_msgs::Header_<ContainerAllocator> header;
00044
00045 typedef std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > _data_type;
00046 std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > data;
00047
00048 typedef int32_t _b_o_s_type;
00049 int32_t b_o_s;
00050
00051 typedef int32_t _e_o_s_type;
00052 int32_t e_o_s;
00053
00054 typedef int64_t _granulepos_type;
00055 int64_t granulepos;
00056
00057 typedef int64_t _packetno_type;
00058 int64_t packetno;
00059
00060
00061 ROS_DEPRECATED uint32_t get_data_size() const { return (uint32_t)data.size(); }
00062 ROS_DEPRECATED void set_data_size(uint32_t size) { data.resize((size_t)size); }
00063 ROS_DEPRECATED void get_data_vec(std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) const { vec = this->data; }
00064 ROS_DEPRECATED void set_data_vec(const std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) { this->data = vec; }
00065 private:
00066 static const char* __s_getDataType_() { return "theora_image_transport/Packet"; }
00067 public:
00068 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00069
00070 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00071
00072 private:
00073 static const char* __s_getMD5Sum_() { return "33ac4e14a7cff32e7e0d65f18bb410f3"; }
00074 public:
00075 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00076
00077 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00078
00079 private:
00080 static const char* __s_getMessageDefinition_() { return "# ROS message adaptation of the ogg_packet struct from libogg,\n\
00081 # see http://www.xiph.org/ogg/doc/libogg/ogg_packet.html.\n\
00082 \n\
00083 Header header # Original sensor_msgs/Image header\n\
00084 uint8[] data # Raw Theora packet data (combines packet and bytes fields from ogg_packet)\n\
00085 int32 b_o_s # Flag indicating whether this packet begins a logical bitstream\n\
00086 int32 e_o_s # Flag indicating whether this packet ends a bitstream\n\
00087 int64 granulepos # A number indicating the position of this packet in the decoded data\n\
00088 int64 packetno # Sequential number of this packet in the ogg bitstream\n\
00089 \n\
00090 ================================================================================\n\
00091 MSG: std_msgs/Header\n\
00092 # Standard metadata for higher-level stamped data types.\n\
00093 # This is generally used to communicate timestamped data \n\
00094 # in a particular coordinate frame.\n\
00095 # \n\
00096 # sequence ID: consecutively increasing ID \n\
00097 uint32 seq\n\
00098 #Two-integer timestamp that is expressed as:\n\
00099 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00100 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00101 # time-handling sugar is provided by the client library\n\
00102 time stamp\n\
00103 #Frame this data is associated with\n\
00104 # 0: no frame\n\
00105 # 1: global frame\n\
00106 string frame_id\n\
00107 \n\
00108 "; }
00109 public:
00110 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00111
00112 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00113
00114 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00115 {
00116 ros::serialization::OStream stream(write_ptr, 1000000000);
00117 ros::serialization::serialize(stream, header);
00118 ros::serialization::serialize(stream, data);
00119 ros::serialization::serialize(stream, b_o_s);
00120 ros::serialization::serialize(stream, e_o_s);
00121 ros::serialization::serialize(stream, granulepos);
00122 ros::serialization::serialize(stream, packetno);
00123 return stream.getData();
00124 }
00125
00126 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00127 {
00128 ros::serialization::IStream stream(read_ptr, 1000000000);
00129 ros::serialization::deserialize(stream, header);
00130 ros::serialization::deserialize(stream, data);
00131 ros::serialization::deserialize(stream, b_o_s);
00132 ros::serialization::deserialize(stream, e_o_s);
00133 ros::serialization::deserialize(stream, granulepos);
00134 ros::serialization::deserialize(stream, packetno);
00135 return stream.getData();
00136 }
00137
00138 ROS_DEPRECATED virtual uint32_t serializationLength() const
00139 {
00140 uint32_t size = 0;
00141 size += ros::serialization::serializationLength(header);
00142 size += ros::serialization::serializationLength(data);
00143 size += ros::serialization::serializationLength(b_o_s);
00144 size += ros::serialization::serializationLength(e_o_s);
00145 size += ros::serialization::serializationLength(granulepos);
00146 size += ros::serialization::serializationLength(packetno);
00147 return size;
00148 }
00149
00150 typedef boost::shared_ptr< ::theora_image_transport::Packet_<ContainerAllocator> > Ptr;
00151 typedef boost::shared_ptr< ::theora_image_transport::Packet_<ContainerAllocator> const> ConstPtr;
00152 };
00153 typedef ::theora_image_transport::Packet_<std::allocator<void> > Packet;
00154
00155 typedef boost::shared_ptr< ::theora_image_transport::Packet> PacketPtr;
00156 typedef boost::shared_ptr< ::theora_image_transport::Packet const> PacketConstPtr;
00157
00158
00159 template<typename ContainerAllocator>
00160 std::ostream& operator<<(std::ostream& s, const ::theora_image_transport::Packet_<ContainerAllocator> & v)
00161 {
00162 ros::message_operations::Printer< ::theora_image_transport::Packet_<ContainerAllocator> >::stream(s, "", v);
00163 return s;}
00164
00165 }
00166
00167 namespace ros
00168 {
00169 namespace message_traits
00170 {
00171 template<class ContainerAllocator>
00172 struct MD5Sum< ::theora_image_transport::Packet_<ContainerAllocator> > {
00173 static const char* value()
00174 {
00175 return "33ac4e14a7cff32e7e0d65f18bb410f3";
00176 }
00177
00178 static const char* value(const ::theora_image_transport::Packet_<ContainerAllocator> &) { return value(); }
00179 static const uint64_t static_value1 = 0x33ac4e14a7cff32eULL;
00180 static const uint64_t static_value2 = 0x7e0d65f18bb410f3ULL;
00181 };
00182
00183 template<class ContainerAllocator>
00184 struct DataType< ::theora_image_transport::Packet_<ContainerAllocator> > {
00185 static const char* value()
00186 {
00187 return "theora_image_transport/Packet";
00188 }
00189
00190 static const char* value(const ::theora_image_transport::Packet_<ContainerAllocator> &) { return value(); }
00191 };
00192
00193 template<class ContainerAllocator>
00194 struct Definition< ::theora_image_transport::Packet_<ContainerAllocator> > {
00195 static const char* value()
00196 {
00197 return "# ROS message adaptation of the ogg_packet struct from libogg,\n\
00198 # see http://www.xiph.org/ogg/doc/libogg/ogg_packet.html.\n\
00199 \n\
00200 Header header # Original sensor_msgs/Image header\n\
00201 uint8[] data # Raw Theora packet data (combines packet and bytes fields from ogg_packet)\n\
00202 int32 b_o_s # Flag indicating whether this packet begins a logical bitstream\n\
00203 int32 e_o_s # Flag indicating whether this packet ends a bitstream\n\
00204 int64 granulepos # A number indicating the position of this packet in the decoded data\n\
00205 int64 packetno # Sequential number of this packet in the ogg bitstream\n\
00206 \n\
00207 ================================================================================\n\
00208 MSG: std_msgs/Header\n\
00209 # Standard metadata for higher-level stamped data types.\n\
00210 # This is generally used to communicate timestamped data \n\
00211 # in a particular coordinate frame.\n\
00212 # \n\
00213 # sequence ID: consecutively increasing ID \n\
00214 uint32 seq\n\
00215 #Two-integer timestamp that is expressed as:\n\
00216 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00217 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00218 # time-handling sugar is provided by the client library\n\
00219 time stamp\n\
00220 #Frame this data is associated with\n\
00221 # 0: no frame\n\
00222 # 1: global frame\n\
00223 string frame_id\n\
00224 \n\
00225 ";
00226 }
00227
00228 static const char* value(const ::theora_image_transport::Packet_<ContainerAllocator> &) { return value(); }
00229 };
00230
00231 template<class ContainerAllocator> struct HasHeader< ::theora_image_transport::Packet_<ContainerAllocator> > : public TrueType {};
00232 template<class ContainerAllocator> struct HasHeader< const ::theora_image_transport::Packet_<ContainerAllocator> > : public TrueType {};
00233 }
00234 }
00235
00236 namespace ros
00237 {
00238 namespace serialization
00239 {
00240
00241 template<class ContainerAllocator> struct Serializer< ::theora_image_transport::Packet_<ContainerAllocator> >
00242 {
00243 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00244 {
00245 stream.next(m.header);
00246 stream.next(m.data);
00247 stream.next(m.b_o_s);
00248 stream.next(m.e_o_s);
00249 stream.next(m.granulepos);
00250 stream.next(m.packetno);
00251 }
00252
00253 ROS_DECLARE_ALLINONE_SERIALIZER;
00254 };
00255 }
00256 }
00257
00258 namespace ros
00259 {
00260 namespace message_operations
00261 {
00262
00263 template<class ContainerAllocator>
00264 struct Printer< ::theora_image_transport::Packet_<ContainerAllocator> >
00265 {
00266 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::theora_image_transport::Packet_<ContainerAllocator> & v)
00267 {
00268 s << indent << "header: ";
00269 s << std::endl;
00270 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00271 s << indent << "data[]" << std::endl;
00272 for (size_t i = 0; i < v.data.size(); ++i)
00273 {
00274 s << indent << " data[" << i << "]: ";
00275 Printer<uint8_t>::stream(s, indent + " ", v.data[i]);
00276 }
00277 s << indent << "b_o_s: ";
00278 Printer<int32_t>::stream(s, indent + " ", v.b_o_s);
00279 s << indent << "e_o_s: ";
00280 Printer<int32_t>::stream(s, indent + " ", v.e_o_s);
00281 s << indent << "granulepos: ";
00282 Printer<int64_t>::stream(s, indent + " ", v.granulepos);
00283 s << indent << "packetno: ";
00284 Printer<int64_t>::stream(s, indent + " ", v.packetno);
00285 }
00286 };
00287
00288
00289 }
00290 }
00291
00292 #endif // THEORA_IMAGE_TRANSPORT_MESSAGE_PACKET_H
00293