Go to the documentation of this file.00001 #ifndef ros_SERVICE_FrameGraph_h
00002 #define ros_SERVICE_FrameGraph_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "../ros/msg.h"
00007
00008 namespace tf
00009 {
00010
00011 static const char FRAMEGRAPH[] = "tf/FrameGraph";
00012
00013 class FrameGraphRequest : public ros::Msg
00014 {
00015 public:
00016
00017 virtual int serialize(unsigned char *outbuffer)
00018 {
00019 int offset = 0;
00020 return offset;
00021 }
00022
00023 virtual int deserialize(unsigned char *inbuffer)
00024 {
00025 int offset = 0;
00026 return offset;
00027 }
00028
00029 const char * getType(){ return FRAMEGRAPH; };
00030
00031 };
00032
00033 class FrameGraphResponse : public ros::Msg
00034 {
00035 public:
00036 char * dot_graph;
00037
00038 virtual int serialize(unsigned char *outbuffer)
00039 {
00040 int offset = 0;
00041 long * length_dot_graph = (long *)(outbuffer + offset);
00042 *length_dot_graph = strlen( (const char*) this->dot_graph);
00043 offset += 4;
00044 memcpy(outbuffer + offset, this->dot_graph, *length_dot_graph);
00045 offset += *length_dot_graph;
00046 return offset;
00047 }
00048
00049 virtual int deserialize(unsigned char *inbuffer)
00050 {
00051 int offset = 0;
00052 uint32_t length_dot_graph = *(uint32_t *)(inbuffer + offset);
00053 offset += 4;
00054 for(unsigned int k= offset; k< offset+length_dot_graph; ++k){
00055 inbuffer[k-1]=inbuffer[k];
00056 }
00057 inbuffer[offset+length_dot_graph-1]=0;
00058 this->dot_graph = (char *)(inbuffer + offset-1);
00059 offset += length_dot_graph;
00060 return offset;
00061 }
00062
00063 const char * getType(){ return FRAMEGRAPH; };
00064
00065 };
00066
00067 }
00068 #endif