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


ric_mc
Author(s): RoboTiCan
autogenerated on Thu Aug 27 2015 14:39:50