$search
00001 /* Auto-generated by genmsg_cpp for file /home/rosbuild/hudson/workspace/doc-electric-joystick_drivers/doc_stacks/2013-03-01_15-52-25.763642/joystick_drivers/wiimote/msg/TimedSwitch.msg */ 00002 #ifndef WIIMOTE_MESSAGE_TIMEDSWITCH_H 00003 #define WIIMOTE_MESSAGE_TIMEDSWITCH_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 00018 namespace wiimote 00019 { 00020 template <class ContainerAllocator> 00021 struct TimedSwitch_ { 00022 typedef TimedSwitch_<ContainerAllocator> Type; 00023 00024 TimedSwitch_() 00025 : switch_mode(0) 00026 , num_cycles(0) 00027 , pulse_pattern() 00028 { 00029 } 00030 00031 TimedSwitch_(const ContainerAllocator& _alloc) 00032 : switch_mode(0) 00033 , num_cycles(0) 00034 , pulse_pattern(_alloc) 00035 { 00036 } 00037 00038 typedef int8_t _switch_mode_type; 00039 int8_t switch_mode; 00040 00041 typedef int32_t _num_cycles_type; 00042 int32_t num_cycles; 00043 00044 typedef std::vector<float, typename ContainerAllocator::template rebind<float>::other > _pulse_pattern_type; 00045 std::vector<float, typename ContainerAllocator::template rebind<float>::other > pulse_pattern; 00046 00047 enum { ON = 1 }; 00048 enum { OFF = 0 }; 00049 enum { NO_CHANGE = -2 }; 00050 enum { REPEAT = -1 }; 00051 enum { FOREVER = -1 }; 00052 00053 ROS_DEPRECATED uint32_t get_pulse_pattern_size() const { return (uint32_t)pulse_pattern.size(); } 00054 ROS_DEPRECATED void set_pulse_pattern_size(uint32_t size) { pulse_pattern.resize((size_t)size); } 00055 ROS_DEPRECATED void get_pulse_pattern_vec(std::vector<float, typename ContainerAllocator::template rebind<float>::other > & vec) const { vec = this->pulse_pattern; } 00056 ROS_DEPRECATED void set_pulse_pattern_vec(const std::vector<float, typename ContainerAllocator::template rebind<float>::other > & vec) { this->pulse_pattern = vec; } 00057 private: 00058 static const char* __s_getDataType_() { return "wiimote/TimedSwitch"; } 00059 public: 00060 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); } 00061 00062 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); } 00063 00064 private: 00065 static const char* __s_getMD5Sum_() { return "e4c8d9327409cef6066fa6c368032c1e"; } 00066 public: 00067 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); } 00068 00069 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); } 00070 00071 private: 00072 static const char* __s_getMessageDefinition_() { return "# TimedSwitch allows sender to:\n\ 00073 # o turn a switch on,\n\ 00074 # o turn a switch off, and\n\ 00075 # o repeat an on/off pattern forever or for a\n\ 00076 # given number of times.\n\ 00077 # Fields (refer to definitions of constants in the definition body):\n\ 00078 # o switch_mode:\n\ 00079 # ON: turn on (num_cycles and pulse_pattern fields are ignored)\n\ 00080 # OFF: turn off (num_cycles and pulse_pattern fields are ignored)\n\ 00081 # NO_CHANGE: leave LED in its current state\n\ 00082 # REPEAT: repeat an on/off pattern for as long\n\ 00083 # as is indicated in the num_cycles field. The\n\ 00084 # pattern is defined in the pulse_pattern field.\n\ 00085 #\n\ 00086 # o num_cycles:\n\ 00087 # n>=0: run the pattern that is defined in pulse_pattern\n\ 00088 # n times.\n\ 00089 # n==FOREVER: run the pattern that is defined in pulse_pattern\n\ 00090 # until a new TimedSwitch message is sent. \n\ 00091 #\n\ 00092 # o pulse_pattern:\n\ 00093 # A series of time durations in fractions of a second. The\n\ 00094 # first number is the duration for having the switch on.\n\ 00095 # The second number is the duration for which the switch\n\ 00096 # is off. The third is an 'on' period again, etc.\n\ 00097 # A pattern is terminated with the end of the array.\n\ 00098 # \n\ 00099 # Example: [1,1] specifies an on-off sequence of 1 second. \n\ 00100 \n\ 00101 int8 ON = 1\n\ 00102 int8 OFF = 0\n\ 00103 int8 NO_CHANGE = -2\n\ 00104 int8 REPEAT = -1\n\ 00105 int8 FOREVER = -1\n\ 00106 \n\ 00107 int8 switch_mode\n\ 00108 int32 num_cycles\n\ 00109 float32[] pulse_pattern\n\ 00110 \n\ 00111 "; } 00112 public: 00113 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); } 00114 00115 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); } 00116 00117 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const 00118 { 00119 ros::serialization::OStream stream(write_ptr, 1000000000); 00120 ros::serialization::serialize(stream, switch_mode); 00121 ros::serialization::serialize(stream, num_cycles); 00122 ros::serialization::serialize(stream, pulse_pattern); 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, switch_mode); 00130 ros::serialization::deserialize(stream, num_cycles); 00131 ros::serialization::deserialize(stream, pulse_pattern); 00132 return stream.getData(); 00133 } 00134 00135 ROS_DEPRECATED virtual uint32_t serializationLength() const 00136 { 00137 uint32_t size = 0; 00138 size += ros::serialization::serializationLength(switch_mode); 00139 size += ros::serialization::serializationLength(num_cycles); 00140 size += ros::serialization::serializationLength(pulse_pattern); 00141 return size; 00142 } 00143 00144 typedef boost::shared_ptr< ::wiimote::TimedSwitch_<ContainerAllocator> > Ptr; 00145 typedef boost::shared_ptr< ::wiimote::TimedSwitch_<ContainerAllocator> const> ConstPtr; 00146 boost::shared_ptr<std::map<std::string, std::string> > __connection_header; 00147 }; // struct TimedSwitch 00148 typedef ::wiimote::TimedSwitch_<std::allocator<void> > TimedSwitch; 00149 00150 typedef boost::shared_ptr< ::wiimote::TimedSwitch> TimedSwitchPtr; 00151 typedef boost::shared_ptr< ::wiimote::TimedSwitch const> TimedSwitchConstPtr; 00152 00153 00154 template<typename ContainerAllocator> 00155 std::ostream& operator<<(std::ostream& s, const ::wiimote::TimedSwitch_<ContainerAllocator> & v) 00156 { 00157 ros::message_operations::Printer< ::wiimote::TimedSwitch_<ContainerAllocator> >::stream(s, "", v); 00158 return s;} 00159 00160 } // namespace wiimote 00161 00162 namespace ros 00163 { 00164 namespace message_traits 00165 { 00166 template<class ContainerAllocator> struct IsMessage< ::wiimote::TimedSwitch_<ContainerAllocator> > : public TrueType {}; 00167 template<class ContainerAllocator> struct IsMessage< ::wiimote::TimedSwitch_<ContainerAllocator> const> : public TrueType {}; 00168 template<class ContainerAllocator> 00169 struct MD5Sum< ::wiimote::TimedSwitch_<ContainerAllocator> > { 00170 static const char* value() 00171 { 00172 return "e4c8d9327409cef6066fa6c368032c1e"; 00173 } 00174 00175 static const char* value(const ::wiimote::TimedSwitch_<ContainerAllocator> &) { return value(); } 00176 static const uint64_t static_value1 = 0xe4c8d9327409cef6ULL; 00177 static const uint64_t static_value2 = 0x066fa6c368032c1eULL; 00178 }; 00179 00180 template<class ContainerAllocator> 00181 struct DataType< ::wiimote::TimedSwitch_<ContainerAllocator> > { 00182 static const char* value() 00183 { 00184 return "wiimote/TimedSwitch"; 00185 } 00186 00187 static const char* value(const ::wiimote::TimedSwitch_<ContainerAllocator> &) { return value(); } 00188 }; 00189 00190 template<class ContainerAllocator> 00191 struct Definition< ::wiimote::TimedSwitch_<ContainerAllocator> > { 00192 static const char* value() 00193 { 00194 return "# TimedSwitch allows sender to:\n\ 00195 # o turn a switch on,\n\ 00196 # o turn a switch off, and\n\ 00197 # o repeat an on/off pattern forever or for a\n\ 00198 # given number of times.\n\ 00199 # Fields (refer to definitions of constants in the definition body):\n\ 00200 # o switch_mode:\n\ 00201 # ON: turn on (num_cycles and pulse_pattern fields are ignored)\n\ 00202 # OFF: turn off (num_cycles and pulse_pattern fields are ignored)\n\ 00203 # NO_CHANGE: leave LED in its current state\n\ 00204 # REPEAT: repeat an on/off pattern for as long\n\ 00205 # as is indicated in the num_cycles field. The\n\ 00206 # pattern is defined in the pulse_pattern field.\n\ 00207 #\n\ 00208 # o num_cycles:\n\ 00209 # n>=0: run the pattern that is defined in pulse_pattern\n\ 00210 # n times.\n\ 00211 # n==FOREVER: run the pattern that is defined in pulse_pattern\n\ 00212 # until a new TimedSwitch message is sent. \n\ 00213 #\n\ 00214 # o pulse_pattern:\n\ 00215 # A series of time durations in fractions of a second. The\n\ 00216 # first number is the duration for having the switch on.\n\ 00217 # The second number is the duration for which the switch\n\ 00218 # is off. The third is an 'on' period again, etc.\n\ 00219 # A pattern is terminated with the end of the array.\n\ 00220 # \n\ 00221 # Example: [1,1] specifies an on-off sequence of 1 second. \n\ 00222 \n\ 00223 int8 ON = 1\n\ 00224 int8 OFF = 0\n\ 00225 int8 NO_CHANGE = -2\n\ 00226 int8 REPEAT = -1\n\ 00227 int8 FOREVER = -1\n\ 00228 \n\ 00229 int8 switch_mode\n\ 00230 int32 num_cycles\n\ 00231 float32[] pulse_pattern\n\ 00232 \n\ 00233 "; 00234 } 00235 00236 static const char* value(const ::wiimote::TimedSwitch_<ContainerAllocator> &) { return value(); } 00237 }; 00238 00239 } // namespace message_traits 00240 } // namespace ros 00241 00242 namespace ros 00243 { 00244 namespace serialization 00245 { 00246 00247 template<class ContainerAllocator> struct Serializer< ::wiimote::TimedSwitch_<ContainerAllocator> > 00248 { 00249 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) 00250 { 00251 stream.next(m.switch_mode); 00252 stream.next(m.num_cycles); 00253 stream.next(m.pulse_pattern); 00254 } 00255 00256 ROS_DECLARE_ALLINONE_SERIALIZER; 00257 }; // struct TimedSwitch_ 00258 } // namespace serialization 00259 } // namespace ros 00260 00261 namespace ros 00262 { 00263 namespace message_operations 00264 { 00265 00266 template<class ContainerAllocator> 00267 struct Printer< ::wiimote::TimedSwitch_<ContainerAllocator> > 00268 { 00269 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::wiimote::TimedSwitch_<ContainerAllocator> & v) 00270 { 00271 s << indent << "switch_mode: "; 00272 Printer<int8_t>::stream(s, indent + " ", v.switch_mode); 00273 s << indent << "num_cycles: "; 00274 Printer<int32_t>::stream(s, indent + " ", v.num_cycles); 00275 s << indent << "pulse_pattern[]" << std::endl; 00276 for (size_t i = 0; i < v.pulse_pattern.size(); ++i) 00277 { 00278 s << indent << " pulse_pattern[" << i << "]: "; 00279 Printer<float>::stream(s, indent + " ", v.pulse_pattern[i]); 00280 } 00281 } 00282 }; 00283 00284 00285 } // namespace message_operations 00286 } // namespace ros 00287 00288 #endif // WIIMOTE_MESSAGE_TIMEDSWITCH_H 00289