Gazebo Fuel_tools

API Reference

7.3.1
gz/fuel_tools/Model.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 GZ_FUEL_TOOLS_MODEL_HH_
19 #define GZ_FUEL_TOOLS_MODEL_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gz/fuel_tools/Helpers.hh"
25 #include "gz/fuel_tools/Result.hh"
27 
28 #ifdef _WIN32
29 // Disable warning C4251 which is triggered by
30 // std::shared_ptr
31 #pragma warning(push)
32 #pragma warning(disable: 4251)
33 #endif
34 
35 namespace ignition
36 {
37  namespace fuel_tools
38  {
40  class ModelPrivate;
41 
43  class ModelIter;
44 
46  class ModelIterPrivate;
47 
49  class LocalCache;
50 
52  class LocalCachePrivate;
53 
55  class IterIds;
56 
58  class IterRESTIds;
59 
61  class IterRestIds;
62 
64  class ModelIterTest;
65 
67  class IGNITION_FUEL_TOOLS_VISIBLE Model
68  {
69  friend IterIds;
70  friend IterRESTIds;
71  friend IterRestIds;
72  friend ModelIter;
73  friend ModelIterPrivate;
74  friend ModelIterTest;
75  friend LocalCache;
76  friend LocalCachePrivate;
77 
79  public: Model();
80 
83  public: Model(const Model &_orig) = default;
84 
87  protected: explicit Model(std::shared_ptr<ModelPrivate> _dptr);
88 
90  public: operator bool() const;
91 
94  public: operator bool();
95 
98  public: ModelIdentifier Identification() const;
99 
103  public: Result Fetch() const;
104 
108  public: std::string PathToModel() const;
109 
111  private: std::shared_ptr<ModelPrivate> dataPtr;
112  };
113  }
114 }
115 
116 #ifdef _MSC_VER
117 #pragma warning(pop)
118 #endif
119 
120 #endif
class for iterating through models
Definition: gz/fuel_tools/ModelIter.hh:43
STL class.
ModelIdentifier Identification() const
Returns information identifying the model.
Defines how to identify a model.
Definition: gz/fuel_tools/ModelIdentifier.hh:45
Class describing a result of an operation.
Definition: gz/fuel_tools/Result.hh:91
Model()
Default constructor.
Defines how to identify a model.
Definition: gz/fuel_tools/Model.hh:67
std::string PathToModel() const
Returns a path to the model on disk if it is already cached.
Result Fetch() const
Make sure this model is in the local cache.
Class for managing stuff in the local cache.
Definition: gz/fuel_tools/LocalCache.hh:46