MessageType.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (C) 2014 by Ralf Kaestner                                        *
00003  * ralf.kaestner@gmail.com                                                    *
00004  *                                                                            *
00005  * This program is free software; you can redistribute it and/or modify       *
00006  * it under the terms of the Lesser GNU General Public License as published by*
00007  * the Free Software Foundation; either version 3 of the License, or          *
00008  * (at your option) any later version.                                        *
00009  *                                                                            *
00010  * This program is distributed in the hope that it will be useful,            *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the               *
00013  * Lesser GNU General Public License for more details.                        *
00014  *                                                                            *
00015  * You should have received a copy of the Lesser GNU General Public License   *
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.       *
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


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Tue Jul 9 2019 03:18:42