00001
00002 #ifndef JOY_MESSAGE_JOY_H
00003 #define JOY_MESSAGE_JOY_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 joy
00015 {
00016 template <class ContainerAllocator>
00017 struct Joy_ : public ros::Message
00018 {
00019 typedef Joy_<ContainerAllocator> Type;
00020
00021 Joy_()
00022 : axes()
00023 , buttons()
00024 {
00025 }
00026
00027 Joy_(const ContainerAllocator& _alloc)
00028 : axes(_alloc)
00029 , buttons(_alloc)
00030 {
00031 }
00032
00033 typedef std::vector<float, typename ContainerAllocator::template rebind<float>::other > _axes_type;
00034 std::vector<float, typename ContainerAllocator::template rebind<float>::other > axes;
00035
00036 typedef std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > _buttons_type;
00037 std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > buttons;
00038
00039
00040 ROS_DEPRECATED uint32_t get_axes_size() const { return (uint32_t)axes.size(); }
00041 ROS_DEPRECATED void set_axes_size(uint32_t size) { axes.resize((size_t)size); }
00042 ROS_DEPRECATED void get_axes_vec(std::vector<float, typename ContainerAllocator::template rebind<float>::other > & vec) const { vec = this->axes; }
00043 ROS_DEPRECATED void set_axes_vec(const std::vector<float, typename ContainerAllocator::template rebind<float>::other > & vec) { this->axes = vec; }
00044 ROS_DEPRECATED uint32_t get_buttons_size() const { return (uint32_t)buttons.size(); }
00045 ROS_DEPRECATED void set_buttons_size(uint32_t size) { buttons.resize((size_t)size); }
00046 ROS_DEPRECATED void get_buttons_vec(std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > & vec) const { vec = this->buttons; }
00047 ROS_DEPRECATED void set_buttons_vec(const std::vector<int32_t, typename ContainerAllocator::template rebind<int32_t>::other > & vec) { this->buttons = vec; }
00048 private:
00049 static const char* __s_getDataType_() { return "joy/Joy"; }
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 "e3ef016fcdf22397038b36036c66f7c8"; }
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 "float32[] axes\n\
00064 int32[] buttons\n\
00065 \n\
00066 "; }
00067 public:
00068 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00069
00070 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00071
00072 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00073 {
00074 ros::serialization::OStream stream(write_ptr, 1000000000);
00075 ros::serialization::serialize(stream, axes);
00076 ros::serialization::serialize(stream, buttons);
00077 return stream.getData();
00078 }
00079
00080 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00081 {
00082 ros::serialization::IStream stream(read_ptr, 1000000000);
00083 ros::serialization::deserialize(stream, axes);
00084 ros::serialization::deserialize(stream, buttons);
00085 return stream.getData();
00086 }
00087
00088 ROS_DEPRECATED virtual uint32_t serializationLength() const
00089 {
00090 uint32_t size = 0;
00091 size += ros::serialization::serializationLength(axes);
00092 size += ros::serialization::serializationLength(buttons);
00093 return size;
00094 }
00095
00096 typedef boost::shared_ptr< ::joy::Joy_<ContainerAllocator> > Ptr;
00097 typedef boost::shared_ptr< ::joy::Joy_<ContainerAllocator> const> ConstPtr;
00098 };
00099 typedef ::joy::Joy_<std::allocator<void> > Joy;
00100
00101 typedef boost::shared_ptr< ::joy::Joy> JoyPtr;
00102 typedef boost::shared_ptr< ::joy::Joy const> JoyConstPtr;
00103
00104
00105 template<typename ContainerAllocator>
00106 std::ostream& operator<<(std::ostream& s, const ::joy::Joy_<ContainerAllocator> & v)
00107 {
00108 ros::message_operations::Printer< ::joy::Joy_<ContainerAllocator> >::stream(s, "", v);
00109 return s;}
00110
00111 }
00112
00113 namespace ros
00114 {
00115 namespace message_traits
00116 {
00117 template<class ContainerAllocator>
00118 struct MD5Sum< ::joy::Joy_<ContainerAllocator> > {
00119 static const char* value()
00120 {
00121 return "e3ef016fcdf22397038b36036c66f7c8";
00122 }
00123
00124 static const char* value(const ::joy::Joy_<ContainerAllocator> &) { return value(); }
00125 static const uint64_t static_value1 = 0xe3ef016fcdf22397ULL;
00126 static const uint64_t static_value2 = 0x038b36036c66f7c8ULL;
00127 };
00128
00129 template<class ContainerAllocator>
00130 struct DataType< ::joy::Joy_<ContainerAllocator> > {
00131 static const char* value()
00132 {
00133 return "joy/Joy";
00134 }
00135
00136 static const char* value(const ::joy::Joy_<ContainerAllocator> &) { return value(); }
00137 };
00138
00139 template<class ContainerAllocator>
00140 struct Definition< ::joy::Joy_<ContainerAllocator> > {
00141 static const char* value()
00142 {
00143 return "float32[] axes\n\
00144 int32[] buttons\n\
00145 \n\
00146 ";
00147 }
00148
00149 static const char* value(const ::joy::Joy_<ContainerAllocator> &) { return value(); }
00150 };
00151
00152 }
00153 }
00154
00155 namespace ros
00156 {
00157 namespace serialization
00158 {
00159
00160 template<class ContainerAllocator> struct Serializer< ::joy::Joy_<ContainerAllocator> >
00161 {
00162 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00163 {
00164 stream.next(m.axes);
00165 stream.next(m.buttons);
00166 }
00167
00168 ROS_DECLARE_ALLINONE_SERIALIZER;
00169 };
00170 }
00171 }
00172
00173 namespace ros
00174 {
00175 namespace message_operations
00176 {
00177
00178 template<class ContainerAllocator>
00179 struct Printer< ::joy::Joy_<ContainerAllocator> >
00180 {
00181 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::joy::Joy_<ContainerAllocator> & v)
00182 {
00183 s << indent << "axes[]" << std::endl;
00184 for (size_t i = 0; i < v.axes.size(); ++i)
00185 {
00186 s << indent << " axes[" << i << "]: ";
00187 Printer<float>::stream(s, indent + " ", v.axes[i]);
00188 }
00189 s << indent << "buttons[]" << std::endl;
00190 for (size_t i = 0; i < v.buttons.size(); ++i)
00191 {
00192 s << indent << " buttons[" << i << "]: ";
00193 Printer<int32_t>::stream(s, indent + " ", v.buttons[i]);
00194 }
00195 }
00196 };
00197
00198
00199 }
00200 }
00201
00202 #endif // JOY_MESSAGE_JOY_H
00203