scenario_simulator_v2 C++ API
member_detector.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
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 CONCEALER__MEMBER_DETECTOR_HPP_
16 #define CONCEALER__MEMBER_DETECTOR_HPP_
17 
18 #include <type_traits>
19 
20 namespace concealer
21 {
22 #define DEFINE_MEMBER_DETECTOR(IDENTIFIER) \
23  template <typename T, typename = void> \
24  struct DetectMember_##IDENTIFIER : public std::false_type \
25  { \
26  }; \
27  \
28  template <typename T> \
29  struct DetectMember_##IDENTIFIER<T, std::void_t<decltype(std::declval<T>().IDENTIFIER)>> \
30  : public std::true_type \
31  { \
32  }
33 
34 DEFINE_MEMBER_DETECTOR(allow_goal_modification);
39 
40 #undef DEFINE_MEMBER_DETECTOR
41 
42 #define DEFINE_STATIC_MEMBER_DETECTOR(IDENTIFIER) \
43  template <typename T, typename = void> \
44  struct DetectStaticMember_##IDENTIFIER : public std::false_type \
45  { \
46  }; \
47  \
48  template <typename T> \
49  struct DetectStaticMember_##IDENTIFIER<T, std::void_t<decltype(T::IDENTIFIER)>> \
50  : public std::true_type \
51  { \
52  }
53 
54 DEFINE_STATIC_MEMBER_DETECTOR(AVOIDANCE_BY_LC_LEFT);
55 DEFINE_STATIC_MEMBER_DETECTOR(AVOIDANCE_BY_LC_RIGHT);
63 DEFINE_STATIC_MEMBER_DETECTOR(EXT_REQUEST_LANE_CHANGE_LEFT);
64 DEFINE_STATIC_MEMBER_DETECTOR(EXT_REQUEST_LANE_CHANGE_RIGHT);
67 DEFINE_STATIC_MEMBER_DETECTOR(INTERSECTION_OCCLUSION);
69 DEFINE_STATIC_MEMBER_DETECTOR(LANE_CHANGE_RIGHT);
79 
80 #undef DEFINE_STATIC_MEMBER_DETECTOR
81 } // namespace concealer
82 
83 #endif // CONCEALER__MEMBER_DETECTOR_HPP_
Definition: autoware_universe.hpp:40
DEFINE_MEMBER_DETECTOR(allow_goal_modification)
DEFINE_STATIC_MEMBER_DETECTOR(AVOIDANCE_BY_LC_LEFT)
auto distance(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2)
Definition: detection_sensor.cpp:36