message.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008, Morgan Quigley and Willow Garage, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice,
7  * this list of conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution.
11  * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef ROSCPP_MESSAGE_H
29 #define ROSCPP_MESSAGE_H
30 
31 // #warning You should not be using this file
32 
33 #include "ros/macros.h"
34 #include "ros/assert.h"
35 #include <string>
36 #include <string.h>
37 #include <boost/shared_ptr.hpp>
38 #include <boost/array.hpp>
39 #include <stdint.h>
40 
41 
42 #define ROSCPP_MESSAGE_HAS_DEFINITION
43 
44 namespace ros
45 {
46 
47 typedef std::map<std::string, std::string> M_string;
48 
52 #if 0
53 class Message
54 {
55 public:
56  typedef boost::shared_ptr<Message> Ptr;
57  typedef boost::shared_ptr<Message const> ConstPtr;
58  Message()
59  {
60  }
61  virtual ~Message()
62  {
63  }
64  virtual const std::string __getDataType() const = 0;
65  virtual const std::string __getMD5Sum() const = 0;
66  virtual const std::string __getMessageDefinition() const = 0;
67  inline static std::string __s_getDataType() { ROS_BREAK(); return std::string(""); }
68  inline static std::string __s_getMD5Sum() { ROS_BREAK(); return std::string(""); }
69  inline static std::string __s_getMessageDefinition() { ROS_BREAK(); return std::string(""); }
70  virtual uint32_t serializationLength() const = 0;
71  virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const = 0;
72  virtual uint8_t *deserialize(uint8_t *read_ptr) = 0;
73  uint32_t __serialized_length;
74 };
75 
76 typedef boost::shared_ptr<Message> MessagePtr;
77 typedef boost::shared_ptr<Message const> MessageConstPtr;
78 #endif
79 
80 #define SROS_SERIALIZE_PRIMITIVE(ptr, data) { memcpy(ptr, &data, sizeof(data)); ptr += sizeof(data); }
81 #define SROS_SERIALIZE_BUFFER(ptr, data, data_size) { if (data_size > 0) { memcpy(ptr, data, data_size); ptr += data_size; } }
82 #define SROS_DESERIALIZE_PRIMITIVE(ptr, data) { memcpy(&data, ptr, sizeof(data)); ptr += sizeof(data); }
83 #define SROS_DESERIALIZE_BUFFER(ptr, data, data_size) { if (data_size > 0) { memcpy(data, ptr, data_size); ptr += data_size; } }
84 
85 }
86 
87 #endif
88 
std::map< std::string, std::string > M_string
void serialize(Stream &stream, const T &t)
uint32_t serializationLength(const T &t)
#define ROS_BREAK()
void deserialize(Stream &stream, T &t)


roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
autogenerated on Mon Nov 2 2020 03:52:26