Gazebo Fuel_tools

API Reference

4.9.1
gz/fuel_tools/ModelIter.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_MODELITER_HH_
19 #define GZ_FUEL_TOOLS_MODELITER_HH_
20 
21 #include <memory>
22 
23 #include "gz/fuel_tools/Helpers.hh"
24 #include "gz/fuel_tools/Model.hh"
25 
26 #ifdef _WIN32
27 // Disable warning C4251 which is triggered by
28 // std::unique_ptr
29 #pragma warning(push)
30 #pragma warning(disable: 4251)
31 #endif
32 
33 namespace ignition
34 {
35  namespace fuel_tools
36  {
38  class FuelClient;
39  class ModelIterPrivate;
40  class ModelIterFactory;
41 
43  class IGNITION_FUEL_TOOLS_VISIBLE ModelIter
44  {
45  friend ModelIterFactory;
46 
49  protected: explicit ModelIter(std::unique_ptr<ModelIterPrivate> _dptr);
50 
53  public: ModelIter(ModelIter && _old);
54 
56  public: ~ModelIter();
57 
60  public: operator bool();
61 
64  public: operator bool() const;
65 
68  public: ModelIter &operator++();
69 
72  public: Model &operator*();
73 
76  public: Model *operator->();
77 
79  private: std::unique_ptr<ModelIterPrivate> dataPtr;
80  };
81  }
82 }
83 
84 #ifdef _MSC_VER
85 #pragma warning(pop)
86 #endif
87 
88 #endif
class for iterating through models
Definition: gz/fuel_tools/ModelIter.hh:43
ModelIter(std::unique_ptr< ModelIterPrivate > _dptr)
Construct an iterator with the data it needs to function.
Model & operator*()
Dereference operator.
Defines how to identify a model.
Definition: gz/fuel_tools/Model.hh:67
~ModelIter()
Default destructor.
Model * operator->()
-> operator
ModelIter & operator++()
Prefix increment.