Personal fork
Fork of rosserial_mbed_lib by
rosgraph_msgs/Clock.h@3:1cf99502f396, 2011-11-12 (annotated)
- Committer:
- nucho
- Date:
- Sat Nov 12 23:54:45 2011 +0000
- Revision:
- 3:1cf99502f396
This program supported the revision of 167 of rosserial.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 3:1cf99502f396 | 1 | #ifndef _ROS_rosgraph_msgs_Clock_h |
nucho | 3:1cf99502f396 | 2 | #define _ROS_rosgraph_msgs_Clock_h |
nucho | 3:1cf99502f396 | 3 | |
nucho | 3:1cf99502f396 | 4 | #include <stdint.h> |
nucho | 3:1cf99502f396 | 5 | #include <string.h> |
nucho | 3:1cf99502f396 | 6 | #include <stdlib.h> |
nucho | 3:1cf99502f396 | 7 | #include "ros/msg.h" |
nucho | 3:1cf99502f396 | 8 | #include "ros/time.h" |
nucho | 3:1cf99502f396 | 9 | |
nucho | 3:1cf99502f396 | 10 | namespace rosgraph_msgs |
nucho | 3:1cf99502f396 | 11 | { |
nucho | 3:1cf99502f396 | 12 | |
nucho | 3:1cf99502f396 | 13 | class Clock : public ros::Msg |
nucho | 3:1cf99502f396 | 14 | { |
nucho | 3:1cf99502f396 | 15 | public: |
nucho | 3:1cf99502f396 | 16 | ros::Time clock; |
nucho | 3:1cf99502f396 | 17 | |
nucho | 3:1cf99502f396 | 18 | virtual int serialize(unsigned char *outbuffer) const |
nucho | 3:1cf99502f396 | 19 | { |
nucho | 3:1cf99502f396 | 20 | int offset = 0; |
nucho | 3:1cf99502f396 | 21 | *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; |
nucho | 3:1cf99502f396 | 22 | *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; |
nucho | 3:1cf99502f396 | 23 | *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; |
nucho | 3:1cf99502f396 | 24 | *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; |
nucho | 3:1cf99502f396 | 25 | offset += sizeof(this->clock.sec); |
nucho | 3:1cf99502f396 | 26 | *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; |
nucho | 3:1cf99502f396 | 27 | *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; |
nucho | 3:1cf99502f396 | 28 | *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; |
nucho | 3:1cf99502f396 | 29 | *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; |
nucho | 3:1cf99502f396 | 30 | offset += sizeof(this->clock.nsec); |
nucho | 3:1cf99502f396 | 31 | return offset; |
nucho | 3:1cf99502f396 | 32 | } |
nucho | 3:1cf99502f396 | 33 | |
nucho | 3:1cf99502f396 | 34 | virtual int deserialize(unsigned char *inbuffer) |
nucho | 3:1cf99502f396 | 35 | { |
nucho | 3:1cf99502f396 | 36 | int offset = 0; |
nucho | 3:1cf99502f396 | 37 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 3:1cf99502f396 | 38 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
nucho | 3:1cf99502f396 | 39 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
nucho | 3:1cf99502f396 | 40 | this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
nucho | 3:1cf99502f396 | 41 | offset += sizeof(this->clock.sec); |
nucho | 3:1cf99502f396 | 42 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 3:1cf99502f396 | 43 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
nucho | 3:1cf99502f396 | 44 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
nucho | 3:1cf99502f396 | 45 | this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
nucho | 3:1cf99502f396 | 46 | offset += sizeof(this->clock.nsec); |
nucho | 3:1cf99502f396 | 47 | return offset; |
nucho | 3:1cf99502f396 | 48 | } |
nucho | 3:1cf99502f396 | 49 | |
nucho | 3:1cf99502f396 | 50 | virtual const char * getType(){ return "rosgraph_msgs/Clock"; }; |
nucho | 3:1cf99502f396 | 51 | virtual const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; |
nucho | 3:1cf99502f396 | 52 | |
nucho | 3:1cf99502f396 | 53 | }; |
nucho | 3:1cf99502f396 | 54 | |
nucho | 3:1cf99502f396 | 55 | } |
nucho | 3:1cf99502f396 | 56 | #endif |