00001
00002 #ifndef STD_MSGS_MESSAGE_MULTIARRAYLAYOUT_H
00003 #define STD_MSGS_MESSAGE_MULTIARRAYLAYOUT_H
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 #include <ostream>
00008 #include "ros/serialization.h"
00009 #include "ros/builtin_message_traits.h"
00010 #include "ros/message_operations.h"
00011 #include "ros/time.h"
00012
00013 #include "ros/macros.h"
00014
00015 #include "ros/assert.h"
00016
00017 #include "std_msgs/MultiArrayDimension.h"
00018
00019 namespace std_msgs
00020 {
00021 template <class ContainerAllocator>
00022 struct MultiArrayLayout_ {
00023 typedef MultiArrayLayout_<ContainerAllocator> Type;
00024
00025 MultiArrayLayout_()
00026 : dim()
00027 , data_offset(0)
00028 {
00029 }
00030
00031 MultiArrayLayout_(const ContainerAllocator& _alloc)
00032 : dim(_alloc)
00033 , data_offset(0)
00034 {
00035 }
00036
00037 typedef std::vector< ::std_msgs::MultiArrayDimension_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::std_msgs::MultiArrayDimension_<ContainerAllocator> >::other > _dim_type;
00038 std::vector< ::std_msgs::MultiArrayDimension_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::std_msgs::MultiArrayDimension_<ContainerAllocator> >::other > dim;
00039
00040 typedef uint32_t _data_offset_type;
00041 uint32_t data_offset;
00042
00043
00044 ROS_DEPRECATED uint32_t get_dim_size() const { return (uint32_t)dim.size(); }
00045 ROS_DEPRECATED void set_dim_size(uint32_t size) { dim.resize((size_t)size); }
00046 ROS_DEPRECATED void get_dim_vec(std::vector< ::std_msgs::MultiArrayDimension_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::std_msgs::MultiArrayDimension_<ContainerAllocator> >::other > & vec) const { vec = this->dim; }
00047 ROS_DEPRECATED void set_dim_vec(const std::vector< ::std_msgs::MultiArrayDimension_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::std_msgs::MultiArrayDimension_<ContainerAllocator> >::other > & vec) { this->dim = vec; }
00048 private:
00049 static const char* __s_getDataType_() { return "std_msgs/MultiArrayLayout"; }
00050 public:
00051 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00052
00053 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00054
00055 private:
00056 static const char* __s_getMD5Sum_() { return "0fed2a11c13e11c5571b4e2a995a91a3"; }
00057 public:
00058 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00059
00060 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00061
00062 private:
00063 static const char* __s_getMessageDefinition_() { return "# The multiarray declares a generic multi-dimensional array of a\n\
00064 # particular data type. Dimensions are ordered from outer most\n\
00065 # to inner most.\n\
00066 \n\
00067 MultiArrayDimension[] dim # Array of dimension properties\n\
00068 uint32 data_offset # padding bytes at front of data\n\
00069 \n\
00070 # Accessors should ALWAYS be written in terms of dimension stride\n\
00071 # and specified outer-most dimension first.\n\
00072 # \n\
00073 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]\n\
00074 #\n\
00075 # A standard, 3-channel 640x480 image with interleaved color channels\n\
00076 # would be specified as:\n\
00077 #\n\
00078 # dim[0].label = \"height\"\n\
00079 # dim[0].size = 480\n\
00080 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image)\n\
00081 # dim[1].label = \"width\"\n\
00082 # dim[1].size = 640\n\
00083 # dim[1].stride = 3*640 = 1920\n\
00084 # dim[2].label = \"channel\"\n\
00085 # dim[2].size = 3\n\
00086 # dim[2].stride = 3\n\
00087 #\n\
00088 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.\n\
00089 ================================================================================\n\
00090 MSG: std_msgs/MultiArrayDimension\n\
00091 string label # label of given dimension\n\
00092 uint32 size # size of given dimension (in type units)\n\
00093 uint32 stride # stride of given dimension\n\
00094 "; }
00095 public:
00096 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00097
00098 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00099
00100 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00101 {
00102 ros::serialization::OStream stream(write_ptr, 1000000000);
00103 ros::serialization::serialize(stream, dim);
00104 ros::serialization::serialize(stream, data_offset);
00105 return stream.getData();
00106 }
00107
00108 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00109 {
00110 ros::serialization::IStream stream(read_ptr, 1000000000);
00111 ros::serialization::deserialize(stream, dim);
00112 ros::serialization::deserialize(stream, data_offset);
00113 return stream.getData();
00114 }
00115
00116 ROS_DEPRECATED virtual uint32_t serializationLength() const
00117 {
00118 uint32_t size = 0;
00119 size += ros::serialization::serializationLength(dim);
00120 size += ros::serialization::serializationLength(data_offset);
00121 return size;
00122 }
00123
00124 typedef boost::shared_ptr< ::std_msgs::MultiArrayLayout_<ContainerAllocator> > Ptr;
00125 typedef boost::shared_ptr< ::std_msgs::MultiArrayLayout_<ContainerAllocator> const> ConstPtr;
00126 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00127 };
00128 typedef ::std_msgs::MultiArrayLayout_<std::allocator<void> > MultiArrayLayout;
00129
00130 typedef boost::shared_ptr< ::std_msgs::MultiArrayLayout> MultiArrayLayoutPtr;
00131 typedef boost::shared_ptr< ::std_msgs::MultiArrayLayout const> MultiArrayLayoutConstPtr;
00132
00133
00134 template<typename ContainerAllocator>
00135 std::ostream& operator<<(std::ostream& s, const ::std_msgs::MultiArrayLayout_<ContainerAllocator> & v)
00136 {
00137 ros::message_operations::Printer< ::std_msgs::MultiArrayLayout_<ContainerAllocator> >::stream(s, "", v);
00138 return s;}
00139
00140 }
00141
00142 namespace ros
00143 {
00144 namespace message_traits
00145 {
00146 template<class ContainerAllocator> struct IsMessage< ::std_msgs::MultiArrayLayout_<ContainerAllocator> > : public TrueType {};
00147 template<class ContainerAllocator> struct IsMessage< ::std_msgs::MultiArrayLayout_<ContainerAllocator> const> : public TrueType {};
00148 template<class ContainerAllocator>
00149 struct MD5Sum< ::std_msgs::MultiArrayLayout_<ContainerAllocator> > {
00150 static const char* value()
00151 {
00152 return "0fed2a11c13e11c5571b4e2a995a91a3";
00153 }
00154
00155 static const char* value(const ::std_msgs::MultiArrayLayout_<ContainerAllocator> &) { return value(); }
00156 static const uint64_t static_value1 = 0x0fed2a11c13e11c5ULL;
00157 static const uint64_t static_value2 = 0x571b4e2a995a91a3ULL;
00158 };
00159
00160 template<class ContainerAllocator>
00161 struct DataType< ::std_msgs::MultiArrayLayout_<ContainerAllocator> > {
00162 static const char* value()
00163 {
00164 return "std_msgs/MultiArrayLayout";
00165 }
00166
00167 static const char* value(const ::std_msgs::MultiArrayLayout_<ContainerAllocator> &) { return value(); }
00168 };
00169
00170 template<class ContainerAllocator>
00171 struct Definition< ::std_msgs::MultiArrayLayout_<ContainerAllocator> > {
00172 static const char* value()
00173 {
00174 return "# The multiarray declares a generic multi-dimensional array of a\n\
00175 # particular data type. Dimensions are ordered from outer most\n\
00176 # to inner most.\n\
00177 \n\
00178 MultiArrayDimension[] dim # Array of dimension properties\n\
00179 uint32 data_offset # padding bytes at front of data\n\
00180 \n\
00181 # Accessors should ALWAYS be written in terms of dimension stride\n\
00182 # and specified outer-most dimension first.\n\
00183 # \n\
00184 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]\n\
00185 #\n\
00186 # A standard, 3-channel 640x480 image with interleaved color channels\n\
00187 # would be specified as:\n\
00188 #\n\
00189 # dim[0].label = \"height\"\n\
00190 # dim[0].size = 480\n\
00191 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image)\n\
00192 # dim[1].label = \"width\"\n\
00193 # dim[1].size = 640\n\
00194 # dim[1].stride = 3*640 = 1920\n\
00195 # dim[2].label = \"channel\"\n\
00196 # dim[2].size = 3\n\
00197 # dim[2].stride = 3\n\
00198 #\n\
00199 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.\n\
00200 ================================================================================\n\
00201 MSG: std_msgs/MultiArrayDimension\n\
00202 string label # label of given dimension\n\
00203 uint32 size # size of given dimension (in type units)\n\
00204 uint32 stride # stride of given dimension\n\
00205 ";
00206 }
00207
00208 static const char* value(const ::std_msgs::MultiArrayLayout_<ContainerAllocator> &) { return value(); }
00209 };
00210
00211 }
00212 }
00213
00214 namespace ros
00215 {
00216 namespace serialization
00217 {
00218
00219 template<class ContainerAllocator> struct Serializer< ::std_msgs::MultiArrayLayout_<ContainerAllocator> >
00220 {
00221 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00222 {
00223 stream.next(m.dim);
00224 stream.next(m.data_offset);
00225 }
00226
00227 ROS_DECLARE_ALLINONE_SERIALIZER;
00228 };
00229 }
00230 }
00231
00232 namespace ros
00233 {
00234 namespace message_operations
00235 {
00236
00237 template<class ContainerAllocator>
00238 struct Printer< ::std_msgs::MultiArrayLayout_<ContainerAllocator> >
00239 {
00240 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::std_msgs::MultiArrayLayout_<ContainerAllocator> & v)
00241 {
00242 s << indent << "dim[]" << std::endl;
00243 for (size_t i = 0; i < v.dim.size(); ++i)
00244 {
00245 s << indent << " dim[" << i << "]: ";
00246 s << std::endl;
00247 s << indent;
00248 Printer< ::std_msgs::MultiArrayDimension_<ContainerAllocator> >::stream(s, indent + " ", v.dim[i]);
00249 }
00250 s << indent << "data_offset: ";
00251 Printer<uint32_t>::stream(s, indent + " ", v.data_offset);
00252 }
00253 };
00254
00255
00256 }
00257 }
00258
00259 #endif // STD_MSGS_MESSAGE_MULTIARRAYLAYOUT_H
00260