29 #ifndef ROSCPP_MESSAGE_H
30 #define ROSCPP_MESSAGE_H
34 #include "ros/macros.h"
35 #include "ros/assert.h"
43 #define ROSCPP_MESSAGE_HAS_DEFINITION
48 typedef std::map<std::string, std::string>
M_string;
57 typedef std::shared_ptr<Message> Ptr;
58 typedef std::shared_ptr<Message const> ConstPtr;
65 virtual const std::string __getDataType()
const = 0;
66 virtual const std::string __getMD5Sum()
const = 0;
67 virtual const std::string __getMessageDefinition()
const = 0;
68 inline static std::string __s_getDataType() {
ROS_BREAK();
return std::string(
""); }
69 inline static std::string __s_getMD5Sum() {
ROS_BREAK();
return std::string(
""); }
70 inline static std::string __s_getMessageDefinition() {
ROS_BREAK();
return std::string(
""); }
72 virtual uint8_t *
serialize(uint8_t *write_ptr, uint32_t seq)
const = 0;
73 virtual uint8_t *
deserialize(uint8_t *read_ptr) = 0;
74 uint32_t __serialized_length;
77 typedef std::shared_ptr<Message> MessagePtr;
78 typedef std::shared_ptr<Message const> MessageConstPtr;
81 #define SROS_SERIALIZE_PRIMITIVE(ptr, data) { memcpy(ptr, &data, sizeof(data)); ptr += sizeof(data); }
82 #define SROS_SERIALIZE_BUFFER(ptr, data, data_size) { if (data_size > 0) { memcpy(ptr, data, data_size); ptr += data_size; } }
83 #define SROS_DESERIALIZE_PRIMITIVE(ptr, data) { memcpy(&data, ptr, sizeof(data)); ptr += sizeof(data); }
84 #define SROS_DESERIALIZE_BUFFER(ptr, data, data_size) { if (data_size > 0) { memcpy(data, ptr, data_size); ptr += data_size; } }