Gazebo Transport

API Reference

13.4.1
TransportTypes.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 #ifndef GZ_TRANSPORT_TRANSPORTTYPES_HH_
18 #define GZ_TRANSPORT_TRANSPORTTYPES_HH_
19 
20 #ifdef _MSC_VER
21 #pragma warning(push)
22 #pragma warning(disable: 4251)
23 #endif
24 #include <google/protobuf/message.h>
25 #ifdef _MSC_VER
26 #pragma warning(pop)
27 #endif
28 
29 #include <chrono>
30 #include <functional>
31 #include <map>
32 #include <memory>
33 #include <string>
34 #include <vector>
35 
36 #include "gz/transport/config.hh"
38 
39 namespace gz::transport
40 {
41  // Inline bracket to help doxygen filtering.
42  inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
43  //
45  class IRepHandler;
46  class IReqHandler;
47  class ISubscriptionHandler;
48  class RawSubscriptionHandler;
49  class MessageInfo;
50 
56  template<typename T>
58 
62 
66 
69  using ProtoMsg = google::protobuf::Message;
70 
74 
78 
82 
90 
97 
101 
105 
113 
119  template <typename T>
120  using DiscoveryCallback = std::function<void(const T &_publisher)>;
121 
126  std::function<void(const MessagePublisher &_publisher)>;
127 
132  std::function<void(const ServicePublisher &_publisher)>;
133 
138  template <typename T>
139  using MsgCallback =
140  std::function<void(const T &_msg, const MessageInfo &_info)>;
141 
148  using RawCallback =
149  std::function<void(const char *_msgData, const size_t _size,
150  const MessageInfo &_info)>;
151 
154  using Timestamp = std::chrono::steady_clock::time_point;
155 
170  using DeallocFunc = void(void *_data, void *_hint);
171 
173  const std::string kGenericMessageType = "google.protobuf.Message";
174 
177  const int kDefaultRcvHwm = 1000;
178 
181  const int kDefaultSndHwm = 1000;
182  }
183 }
184 #endif