Ignition Physics

API Reference

5.1.0
RemoveEntities.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 IGNITION_PHYSICS_REMOVEENTITIES_HH_
19 #define IGNITION_PHYSICS_REMOVEENTITIES_HH_
20 
21 #include <string>
22 
24 
25 namespace ignition
26 {
27  namespace physics
28  {
32  class IGNITION_PHYSICS_VISIBLE RemoveModelFromWorld : public virtual Feature
33  {
34  public: template <typename PolicyT, typename FeaturesT>
35  class World : public virtual Feature::World<PolicyT, FeaturesT>
36  {
41  public: bool RemoveModel(std::size_t _index);
42 
47  public: bool RemoveModel(const std::string &_name);
48  };
49 
50  public: template <typename PolicyT, typename FeaturesT>
51  class Model : public virtual Feature::Model<PolicyT, FeaturesT>
52  {
55  public: bool Remove();
56 
58  public: bool Removed() const;
59  };
60 
61  public: template <typename PolicyT>
62  class Implementation : public virtual Feature::Implementation<PolicyT>
63  {
64  // World functions
65  public: virtual bool RemoveModelByIndex(
66  const Identity &_worldID, std::size_t _modelIndex) = 0;
67 
68  public: virtual bool RemoveModelByName(
69  const Identity &_worldID, const std::string &_modelName) = 0;
70 
71  // Model functions
72  public: virtual bool RemoveModel(
73  const Identity &_modelID) = 0;
74 
75  public: virtual bool ModelRemoved(const Identity &_modelID) const = 0;
76  };
77  };
78 
82  class IGNITION_PHYSICS_VISIBLE RemoveNestedModelFromModel
83  : public virtual Feature
84  {
85  public: template <typename PolicyT, typename FeaturesT>
86  class Model : public virtual Feature::Model<PolicyT, FeaturesT>
87  {
92  public: bool RemoveNestedModel(std::size_t _index);
93 
98  public: bool RemoveNestedModel(const std::string &_name);
99  };
100 
101  public: template <typename PolicyT>
102  class Implementation : public virtual Feature::Implementation<PolicyT>
103  {
104  public: virtual bool RemoveNestedModelByIndex(
105  const Identity &_modelID, std::size_t _modelIndex) = 0;
106 
107  public: virtual bool RemoveNestedModelByName(
108  const Identity &_modelID, const std::string &_modelName) = 0;
109  };
110  };
111 
112  using RemoveEntities = FeatureList<
115  >;
116  }
117 }
118 
119 #include <ignition/physics/detail/RemoveEntities.hh>
120 
121 #endif
This class defines the concept of a Feature. It should be inherited by classes that define some plugi...
Definition: Feature.hh:35
STL class.
This feature removes a nested Model entity from the specified parent Model.
Definition: RemoveEntities.hh:82
Definition: RemoveEntities.hh:51
Placeholder class in case a Feature does not define its own World API.
Definition: Feature.hh:49
Definition: RemoveEntities.hh:35
Placeholder class in case a Feature does not define its own Model API.
Definition: Feature.hh:58
This feature removes a Model entity from the index-specified World.
Definition: RemoveEntities.hh:32
Use a FeatureList to aggregate a list of Features.
Definition: FeatureList.hh:51