Gazebo Physics

API Reference

9.2.0
FeatureList.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_PHYSICS_FEATURELIST_HH_
19#define GZ_PHYSICS_FEATURELIST_HH_
20
21#include <tuple>
22
23#include <gz/physics/Feature.hh>
24
25#if defined(_MSC_VER)
26#pragma warning(push)
32#pragma warning(disable: 4584)
33#endif // defined(_MSC_VER)
34
35namespace gz
36{
37 namespace physics
38 {
39 namespace detail
40 {
41 // Forward declarations
42 template <typename...> struct CombineLists;
43 template <bool, typename...> struct SelfConflict;
44 template <typename> struct IterateList;
45 }
46
60 template <typename... FeaturesT>
61 struct FeatureList : detail::IterateList<TypeList<FeaturesT...>>
62 {
67 public: using FlatFeatureTypeList =
68 typename detail::CombineLists<FeaturesT...>::Result;
69
77 public: using Features =
78 typename detail::ToTuple<FlatFeatureTypeList>::type;
79
81 public: using FeatureTypeList = TypeList<FeaturesT...>;
82
84 public: using FeatureTuple = std::tuple<FeaturesT...>;
85
91 public: template <typename F>
92 static constexpr bool HasFeature();
93
107 public: template <typename SomeFeatureList,
108 bool AssertNoConflict = false>
109 static constexpr bool ConflictsWith();
110
113 public: using RequiredFeatures = void;
114
115 // Check that this FeatureList does not contain any self-conflicts.
116 static_assert(!detail::SelfConflict<true, FeaturesT...>::value,
117 "FeatureList ERROR: YOUR LIST CONTAINS CONFLICTING FEATURES!");
118 };
119
124 template <typename... ConflictingFeatures>
126
131 template <typename... RequiredFeatures>
133 }
134}
135
136#include <gz/physics/detail/FeatureList.hh>
137
138#if defined(_MSC_VER)
139#pragma warning(pop)
140#endif // defined(_MSC_VER)
141#endif // GZ_PHYSICS_FEATURELIST_HH_