MessageDefinition.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2014 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
23 #ifndef VARIANT_TOPIC_TOOLS_MESSAGE_DEFINITION_H
24 #define VARIANT_TOPIC_TOOLS_MESSAGE_DEFINITION_H
25 
26 #include <iostream>
27 
28 #include <boost/enable_shared_from_this.hpp>
29 
30 #include <ros/ros.h>
31 
37 
38 namespace variant_topic_tools {
42  public MessageFieldCollection<DataType>,
43  public boost::enable_shared_from_this<MessageDefinition> {
44  public:
48 
52 
56 
60 
64 
68  void setMessageType(const MessageType& messageType);
69 
73  template <typename T> void setMessageType();
74 
78  void setMessageDataType(const MessageDataType& messageDataType);
79 
84 
87  bool isValid() const;
88 
91  template <typename T> static MessageDefinition create();
92 
96  void load(const std::string& messageDataType);
97 
100  void clear();
101 
104  void write(std::ostream& stream) const;
105 
106  protected:
110 
113  void fill(const MessageDataType& currentDataType,
114  MessageFieldCollection<DataType>& currentCollection);
115  };
116 
119  std::ostream& operator<<(std::ostream& stream, const MessageDefinition&
121 };
122 
123 #include <variant_topic_tools/MessageDefinition.tpp>
124 
125 #endif
Header file providing the DataType class interface.
DataType messageDataType
The message data type represented by this message definition.
Variant message type information.
Definition: MessageType.h:33
Header file providing forward declarations for the variant topic tools.
variant_topic_tools::MessageDefinition messageDefinition
Definition: info.cpp:30
void fill(const MessageDataType &currentDataType, MessageFieldCollection< DataType > &currentCollection)
Recursively fill the fields of the message definition.
Header file providing the MessageFieldCollection class interface.
static MessageDefinition create()
Create a message definition.
void write(std::ostream &stream) const
Write the message definition to a stream.
Header file providing the MessageField class interface.
void load(const std::string &messageDataType)
Attempt to load the message definition for the specified message data type.
void setMessageType()
Set the message type represented by this message definition (templated version)
MessageDataType getMessageDataType() const
Retrieve the message data type represented by this message definition.
std::ostream & operator<<(std::ostream &stream, const DataType &dataType)
Operator for writing the data type to a stream.
Definition: DataType.cpp:190
void clear()
Clear the message definition.
variant_topic_tools::MessageType messageType
Definition: publish.cpp:33
bool isValid() const
True, if this message definition is valid.
Header file providing the MessageType class interface.
void setMessageDataType(const MessageDataType &messageDataType)
Set the message data type represented by this message definition.
Forward declaration of the message field collection.
Definition: Forwards.h:64


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:49