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