Ignition Transport

API Reference

6.0.0
MessageInfo.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef IGN_TRANSPORT_MESSAGEINFO_HH_
19 #define IGN_TRANSPORT_MESSAGEINFO_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "ignition/transport/config.hh"
25 #include "ignition/transport/Export.hh"
26 
27 namespace ignition
28 {
29  namespace transport
30  {
31  // Inline bracket to help doxygen filtering.
32  inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
33  //
34  class MessageInfoPrivate;
35 
37  class IGNITION_TRANSPORT_VISIBLE MessageInfo
38  {
40  public: MessageInfo();
41 
45  public: MessageInfo(const MessageInfo &_other);
46 
49  public: MessageInfo(MessageInfo &&_other); // NOLINT
50 
52  public: ~MessageInfo();
53 
56  public: const std::string &Topic() const;
57 
59  public: void SetTopic(const std::string &_topic);
60 
63  public: const std::string &Type() const;
64 
67  public: void SetType(const std::string &_type);
68 
71  public: const std::string &Partition() const;
72 
75  public: void SetPartition(const std::string &_partition);
76 
82  public: bool SetTopicAndPartition(const std::string &_fullyQualifiedName);
83 
84 #ifdef _WIN32
85 // Disable warning C4251 which is triggered by
86 // std::unique_ptr
87 #pragma warning(push)
88 #pragma warning(disable: 4251)
89 #endif
90  protected: std::unique_ptr<MessageInfoPrivate> dataPtr;
93 #ifdef _WIN32
94 #pragma warning(pop)
95 #endif
96  };
97  }
98  }
99 }
100 #endif
STL class.
A class that provides information about the message received.
Definition: MessageInfo.hh:37
Definition: AdvertiseOptions.hh:28