Gazebo Physics

API Reference

5.3.2
gz/physics/RequestEngine.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_REQUESTENGINE_HH_
19 #define GZ_PHYSICS_REQUESTENGINE_HH_
20 
21 #include <memory>
22 #include <set>
23 #include <string>
24 
26 
27 namespace ignition
28 {
29  namespace physics
30  {
33  template <typename FeaturePolicyT, typename FeatureListT>
35  {
36  // Forward declaration of the Engine type that will be returned
37  using EnginePtrType = EnginePtr<FeaturePolicyT, FeatureListT>;
38 
39  // Tuple of features that are being requested
40  using Features = FeatureListT;
41 
58  template <typename PtrT>
59  static EnginePtrType From(
60  const PtrT &_pimpl,
61  const std::size_t _engineID = 0);
62 
73  template <typename PtrT>
74  static bool Verify(const PtrT &_pimpl);
75 
87  template <typename PtrT>
88  static std::set<std::string> MissingFeatureNames(const PtrT &_pimpl);
89  };
90 
91 #define IGN_PHYSICS_REQUEST_FEATURES_MACRO(X) \
92  template <typename FeatureList> \
93  using RequestEngine ## X = \
94  RequestEngine<FeaturePolicy ## X, FeatureList>;
95 
100  }
101 }
102 
103 #include <gz/physics/detail/RequestEngine.hh>
104 
105 #endif
static bool Verify(const PtrT &_pimpl)
Check that a physics plugin has all the requested features.
#define IGN_PHYSICS_REQUEST_FEATURES_MACRO(X)
Definition: gz/physics/RequestEngine.hh:91
static std::set< std::string > MissingFeatureNames(const PtrT &_pimpl)
Get a set of the names of the requested features that are missing from this plugin.
static EnginePtrType From(const PtrT &_pimpl, const std::size_t _engineID=0)
Get an Engine from the given physics plugin.
This class provides utilities for inspecting what features are available in a plugin.
Definition: gz/physics/RequestEngine.hh:34
FeatureListT Features
Definition: gz/physics/RequestEngine.hh:40
EnginePtr< FeaturePolicyT, FeatureListT > EnginePtrType
Definition: gz/physics/RequestEngine.hh:37