Ignition Physics

API Reference

2.3.0
Feature.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 IGNITION_PHYSICS_FEATURE_HH_
19 #define IGNITION_PHYSICS_FEATURE_HH_
20 
21 #include <cstddef>
22 #include <memory>
23 #include <tuple>
24 
25 #include <ignition/physics/Export.hh>
27 
28 namespace ignition
29 {
30  namespace physics
31  {
35  class Feature
36  {
39  public: template <typename Policy, typename FeaturesT>
40  class Engine : public virtual Entity<Policy, FeaturesT>
41  {
43  public: virtual ~Engine() = default;
44  };
45 
48  public: template <typename Policy, typename FeaturesT>
49  class World : public virtual Entity<Policy, FeaturesT>
50  {
52  public: virtual ~World() = default;
53  };
54 
57  public: template <typename Policy, typename FeaturesT>
58  class Model : public virtual Entity<Policy, FeaturesT>
59  {
61  public: virtual ~Model() = default;
62  };
63 
66  public: template <typename Policy, typename FeaturesT>
67  class Link : public virtual Entity<Policy, FeaturesT>
68  {
70  public: virtual ~Link() = default;
71  };
72 
75  public: template <typename Policy, typename FeaturesT>
76  class Joint : public virtual Entity<Policy, FeaturesT>
77  {
79  public: virtual ~Joint() = default;
80  };
81 
84  public: template <typename Policy, typename FeaturesT>
85  class Shape : public virtual Entity<Policy, FeaturesT>
86  {
88  public: virtual ~Shape() = default;
89  };
90 
91  public: template <typename Policy>
92  class Implementation : public detail::Implementation
93  {
107  public: virtual Identity InitiateEngine(std::size_t engineID = 0) = 0;
108 
110  public: virtual ~Implementation() = default;
111  };
112 
117  template <typename SomeFeatureList, bool /*AssertNoConflict*/ = false>
118  static constexpr bool ConflictsWith()
119  {
120  return false;
121  }
122 
127  using RequiredFeatures = void;
128  };
129  }
130 }
131 
132 #endif
Placeholder class in case a Feature does not define its own Shape API.
Definition: Feature.hh:85
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: Entity.hh:216
void RequiredFeatures
By default, a blank feature will not require any other features. If your feature does require some ot...
Definition: Feature.hh:127
This class defines the concept of a Feature. It should be inherited by classes that define some plugi...
Definition: Feature.hh:35
static constexpr bool ConflictsWith()
By default, a blank feature will not conflict with any other features. If your feature does conflict ...
Definition: Feature.hh:118
Placeholder class in case a Feature does not define its own Joint API.
Definition: Feature.hh:76
Placeholder class for the Engine API. Every Engine feature MUST inherit this class.
Definition: Feature.hh:40
Placeholder class in case a Feature does not define its own World API.
Definition: Feature.hh:49
Placeholder class in case a Feature does not define its own Model API.
Definition: Feature.hh:58
virtual ~Engine()=default
Virtual destructor.