rmw_dds_common  master
Define a common interface between DDS implementations of ROS middleware.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
gid_utils.hpp
1 // Copyright 2019 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RMW_DDS_COMMON__GID_UTILS_HPP_
16 #define RMW_DDS_COMMON__GID_UTILS_HPP_
17 
18 #include "rmw/types.h"
19 
20 #include "rmw_dds_common/visibility_control.h"
21 #include "rmw_dds_common/msg/gid.hpp"
22 
23 namespace rmw_dds_common
24 {
25 
27 struct RMW_DDS_COMMON_PUBLIC_TYPE Compare_rmw_gid_t
28 {
30  bool operator()(const rmw_gid_t & lhs, const rmw_gid_t & rhs) const;
31 };
32 
34 RMW_DDS_COMMON_PUBLIC
36 operator<<(std::ostream & ostream, const rmw_gid_t & gid);
37 
39 RMW_DDS_COMMON_PUBLIC
40 bool
41 operator==(const rmw_gid_t & lhs, const rmw_gid_t & rhs);
42 
44 
47 RMW_DDS_COMMON_PUBLIC
48 void
49 convert_gid_to_msg(
50  const rmw_gid_t * gid,
51  rmw_dds_common::msg::Gid * msg_gid);
52 
54 
57 RMW_DDS_COMMON_PUBLIC
58 void
59 convert_msg_to_gid(
60  const rmw_dds_common::msg::Gid * msg_gid,
61  rmw_gid_t * gid);
62 
63 } // namespace rmw_dds_common
64 
65 #endif // RMW_DDS_COMMON__GID_UTILS_HPP_
rmw_dds_common::Compare_rmw_gid_t
Comparator for rmw_gid_t, in order to use them as a key of a map.
Definition: gid_utils.hpp:27
operator==
bool operator==(const path &a, const path &b)
std::ostream
rmw_gid_t
operator<<
std::ostream & operator<<(std::ostream &os, const path &p)
types.h