Gazebo Transport

API Reference

14.1.0
Descriptor.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 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 GZ_TRANSPORT_LOG_DESCRIPTOR_HH_
19#define GZ_TRANSPORT_LOG_DESCRIPTOR_HH_
20
21#include <cstdint>
22#include <map>
23#include <memory>
24#include <string>
25
26#include <gz/transport/config.hh>
27#include <gz/transport/log/Export.hh>
28
29namespace gz::transport::log
30{
31 // Inline bracket to help doxygen filtering.
32 inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
33 //
34 // Forward declaration
35 class Log;
36
41 class GZ_TRANSPORT_LOG_VISIBLE Descriptor
42 {
46
50
57 public: const NameToMap &TopicsToMsgTypesToId() const;
58
65 public: const NameToMap &MsgTypesToTopicsToId() const;
66
71 public: int64_t TopicId(
72 const std::string &_topicName,
73 const std::string &_msgType) const;
74
75 // The Log class is a friend so that it can construct a Descriptor
76 friend class Log;
77
79 public: ~Descriptor();
80
83 private: Descriptor();
84
87 public: Descriptor(Descriptor &&_orig); // NOLINT
88
90 class Implementation;
91
92#ifdef _WIN32
93// Disable warning C4251 which is triggered by
94// std::*
95#pragma warning(push)
96#pragma warning(disable: 4251)
97#endif
99 private: std::unique_ptr<Implementation> dataPtr;
100#ifdef _WIN32
101#pragma warning(pop)
102#endif
103 };
104 }
105}
106
107#endif