Gazebo Fuel_tools

API Reference

4.9.1
gz/fuel_tools/LocalCache.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_LOCALCACHE_HH_
19 #define GZ_FUEL_TOOLS_LOCALCACHE_HH_
20 
21 #include <memory>
22 #include <string>
23 
24 #include "gz/fuel_tools/Helpers.hh"
25 #include "gz/fuel_tools/Model.hh"
28 
29 #ifdef _WIN32
30 // Disable warning C4251 which is triggered by
31 // std::shared_ptr
32 #pragma warning(push)
33 #pragma warning(disable: 4251)
34 #endif
35 
36 namespace ignition
37 {
38  namespace fuel_tools
39  {
41  class ClientConfig;
42  class LocalCachePrivate;
43  class ModelIdentifier;
44 
46  class IGNITION_FUEL_TOOLS_VISIBLE LocalCache
47  {
50  public: explicit LocalCache(const ClientConfig *_config);
51 
53  public: virtual ~LocalCache();
54 
57  public: virtual ModelIter AllModels();
58 
61  public: virtual WorldIter AllWorlds() const;
62 
66  public: virtual Model MatchingModel(const ModelIdentifier &_id);
67 
71  public: virtual bool MatchingWorld(WorldIdentifier &_id) const;
72 
77  public: virtual ModelIter MatchingModels(const ModelIdentifier &_id);
78 
83  public: virtual WorldIter MatchingWorlds(
84  const WorldIdentifier &_id) const;
85 
92  public: virtual bool SaveModel(
93  const ModelIdentifier &_id,
94  const std::string &_data,
95  const bool _overwrite);
96 
102  public: virtual bool SaveWorld(
103  WorldIdentifier &_id,
104  const std::string &_data,
105  const bool _overwrite);
106 
108  private: std::shared_ptr<LocalCachePrivate> dataPtr;
109  };
110  }
111 }
112 
113 #ifdef _MSC_VER
114 #pragma warning(pop)
115 #endif
116 
117 #endif
High level interface to ignition fuel.
Definition: gz/fuel_tools/ClientConfig.hh:109
class for iterating through models
Definition: gz/fuel_tools/ModelIter.hh:43
STL class.
virtual ModelIter MatchingModels(const ModelIdentifier &_id)
Get all models partially matching an ID.
Defines how to identify a model.
Definition: gz/fuel_tools/ModelIdentifier.hh:45
virtual ModelIter AllModels()
Get all models in offline cache.
virtual Model MatchingModel(const ModelIdentifier &_id)
Get the first model matching all fields on an id.
class for iterating through worlds
Definition: gz/fuel_tools/WorldIter.hh:42
Defines how to identify a model.
Definition: gz/fuel_tools/Model.hh:67
LocalCache(const ClientConfig *_config)
Constructor.
virtual bool SaveModel(const ModelIdentifier &_id, const std::string &_data, const bool _overwrite)
Add a model from packed data to the local cache.
virtual ~LocalCache()
destructor
virtual WorldIter MatchingWorlds(const WorldIdentifier &_id) const
Get all worlds partially matching an ID.
virtual bool MatchingWorld(WorldIdentifier &_id) const
Get the first world matching all fields on an id.
Defines how to identify a world.
Definition: gz/fuel_tools/WorldIdentifier.hh:42
virtual bool SaveWorld(WorldIdentifier &_id, const std::string &_data, const bool _overwrite)
Add a world from packed data to the local cache.
virtual WorldIter AllWorlds() const
Get all worlds in offline cache.
Class for managing stuff in the local cache.
Definition: gz/fuel_tools/LocalCache.hh:46