Ignition Transport

API Reference

4.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/Export.hh"
25 
26 namespace ignition
27 {
28  namespace transport
29  {
30  class MessageInfoPrivate;
31 
33  class IGNITION_TRANSPORT_VISIBLE MessageInfo
34  {
36  public: MessageInfo();
37 
41  public: MessageInfo(const MessageInfo &_other);
42 
45  public: MessageInfo(MessageInfo &&_other); // NOLINT
46 
48  public: ~MessageInfo();
49 
52  public: std::string Topic() const;
53 
55  public: void SetTopic(const std::string &_topic);
56 
59  public: std::string Type() const;
60 
63  public: void SetType(const std::string &_type);
64 
67  public: std::string Partition() const;
68 
71  public: void SetPartition(const std::string &_partition);
72 
78  public: bool SetTopicAndPartition(const std::string &_fullyQualifiedName);
79 
83  };
84  }
85 }
86 #endif
A class that provides information about the message received.
Definition: MessageInfo.hh:34
void SetPartition(const std::string &_partition)
Set the partition of the topic the message was on.
MessageInfo(MessageInfo &&_other)
Move constructor.
void SetType(const std::string &_type)
Set the name of the message type.
std::unique_ptr< MessageInfoPrivate > dataPtr
Definition: MessageInfo.hh:82
std::string Topic() const
Get the topic name associated to the message.
MessageInfo()
Default constructor.
void SetTopic(const std::string &_topic)
Set the topic name associated to the message.
std::string Type() const
Get the name of the message type.
std::string Partition() const
Get the name of the partition.
bool SetTopicAndPartition(const std::string &_fullyQualifiedName)
Set both the topic and the partition from a single string.
MessageInfo(const MessageInfo &_other)
Explicit copy constructor (The copy constructor is deleted by default due to the use of std::unique_p...
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param[in] _topic Topic name associated to the service *param[in] _cb Callback to handle the service request with the *following void(*) const AdvertiseServiceOptions ReplyT const std::string _topic)
Definition: Node.hh:558
Definition: AdvertiseOptions.hh:28