Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_DeleteModel_h
00002 #define _ROS_SERVICE_DeleteModel_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007
00008 namespace gazebo_msgs
00009 {
00010
00011 static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel";
00012
00013 class DeleteModelRequest : public ros::Msg
00014 {
00015 public:
00016 const char* model_name;
00017
00018 virtual int serialize(unsigned char *outbuffer) const
00019 {
00020 int offset = 0;
00021 uint32_t length_model_name = strlen(this->model_name);
00022 memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t));
00023 offset += 4;
00024 memcpy(outbuffer + offset, this->model_name, length_model_name);
00025 offset += length_model_name;
00026 return offset;
00027 }
00028
00029 virtual int deserialize(unsigned char *inbuffer)
00030 {
00031 int offset = 0;
00032 uint32_t length_model_name;
00033 memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t));
00034 offset += 4;
00035 for(unsigned int k= offset; k< offset+length_model_name; ++k){
00036 inbuffer[k-1]=inbuffer[k];
00037 }
00038 inbuffer[offset+length_model_name-1]=0;
00039 this->model_name = (char *)(inbuffer + offset-1);
00040 offset += length_model_name;
00041 return offset;
00042 }
00043
00044 const char * getType(){ return DELETEMODEL; };
00045 const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; };
00046
00047 };
00048
00049 class DeleteModelResponse : public ros::Msg
00050 {
00051 public:
00052 bool success;
00053 const char* status_message;
00054
00055 virtual int serialize(unsigned char *outbuffer) const
00056 {
00057 int offset = 0;
00058 union {
00059 bool real;
00060 uint8_t base;
00061 } u_success;
00062 u_success.real = this->success;
00063 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00064 offset += sizeof(this->success);
00065 uint32_t length_status_message = strlen(this->status_message);
00066 memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t));
00067 offset += 4;
00068 memcpy(outbuffer + offset, this->status_message, length_status_message);
00069 offset += length_status_message;
00070 return offset;
00071 }
00072
00073 virtual int deserialize(unsigned char *inbuffer)
00074 {
00075 int offset = 0;
00076 union {
00077 bool real;
00078 uint8_t base;
00079 } u_success;
00080 u_success.base = 0;
00081 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00082 this->success = u_success.real;
00083 offset += sizeof(this->success);
00084 uint32_t length_status_message;
00085 memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t));
00086 offset += 4;
00087 for(unsigned int k= offset; k< offset+length_status_message; ++k){
00088 inbuffer[k-1]=inbuffer[k];
00089 }
00090 inbuffer[offset+length_status_message-1]=0;
00091 this->status_message = (char *)(inbuffer + offset-1);
00092 offset += length_status_message;
00093 return offset;
00094 }
00095
00096 const char * getType(){ return DELETEMODEL; };
00097 const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; };
00098
00099 };
00100
00101 class DeleteModel {
00102 public:
00103 typedef DeleteModelRequest Request;
00104 typedef DeleteModelResponse Response;
00105 };
00106
00107 }
00108 #endif