Gazebo Transport

API Reference

12.2.1
gz/transport/log/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 
29 namespace gz
30 {
31  namespace transport
32  {
33  namespace log
34  {
35  // Inline bracket to help doxygen filtering.
36  inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
37  //
38  // Forward declaration
39  class Log;
40 
45  class GZ_TRANSPORT_LOG_VISIBLE Descriptor
46  {
50 
54 
61  public: const NameToMap &TopicsToMsgTypesToId() const;
62 
69  public: const NameToMap &MsgTypesToTopicsToId() const;
70 
76  public: int64_t TopicId(
77  const std::string &_topicName,
78  const std::string &_msgType) const;
79 
80  // The Log class is a friend so that it can construct a Descriptor
81  friend class Log;
82 
84  public: ~Descriptor();
85 
88  private: Descriptor();
89 
92  public: Descriptor(Descriptor &&_orig); // NOLINT
93 
95  class Implementation;
96 
97 #ifdef _WIN32
98 // Disable warning C4251 which is triggered by
99 // std::*
100 #pragma warning(push)
101 #pragma warning(disable: 4251)
102 #endif
103  private: std::unique_ptr<Implementation> dataPtr;
105 #ifdef _WIN32
106 #pragma warning(pop)
107 #endif
108  };
109  }
110  }
111  }
112 }
113 
114 #endif