Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef VARIANT_TOPIC_TOOLS_MESSAGE_TYPE_H
00024 #define VARIANT_TOPIC_TOOLS_MESSAGE_TYPE_H
00025
00026 #include <ros/ros.h>
00027
00028 #include <variant_topic_tools/Forwards.h>
00029
00030 namespace variant_topic_tools {
00033 class MessageType {
00034 public:
00037 MessageType(const std::string& dataType = std::string(),
00038 const std::string& md5Sum = "*", const std::string&
00039 definition = std::string());
00040
00043 MessageType(const MessageDataType& dataType);
00044
00047 MessageType(const MessageType& src);
00048
00051 ~MessageType();
00052
00055 void setDataType(const std::string& dataType);
00056
00059 const std::string& getDataType() const;
00060
00063 void setMD5Sum(const std::string& md5Sum);
00064
00067 const std::string& getMD5Sum() const;
00068
00071 void setDefinition(const std::string& definition);
00072
00075 const std::string& getDefinition() const;
00076
00079 bool isValid() const;
00080
00083 template <typename T> static MessageType create();
00084
00088 void load(const std::string& messageDataType);
00089
00092 void clear();
00093
00096 void write(std::ostream& stream) const;
00097
00100 Publisher advertise(ros::NodeHandle& nodeHandle, const
00101 std::string& topic, size_t queueSize, bool latch = false,
00102 const ros::SubscriberStatusCallback& connectCallback =
00103 ros::SubscriberStatusCallback());
00104
00107 Subscriber subscribe(ros::NodeHandle& nodeHandle, const std::string&
00108 topic, size_t queueSize, const SubscriberCallback& callback);
00109
00112 bool operator==(const MessageType& type) const;
00113
00116 bool operator!=(const MessageType& type) const;
00117
00118 protected:
00121 std::string dataType;
00122
00125 std::string md5Sum;
00126
00129 std::string definition;
00130 };
00131
00134 std::ostream& operator<<(std::ostream& stream, const MessageType&
00135 messageType);
00136 };
00137
00138 #include <variant_topic_tools/MessageType.tpp>
00139
00140 #endif