Gazebo Fuel_tools

API Reference

7.3.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:
51  explicit IGN_DEPRECATED(5) LocalCache(const ClientConfig *_config);
52 
54  public: virtual ~LocalCache();
55 
58  public: virtual ModelIter AllModels();
59 
62  public: virtual WorldIter AllWorlds() const;
63 
67  public: virtual Model MatchingModel(const ModelIdentifier &_id);
68 
72  public: virtual bool MatchingWorld(WorldIdentifier &_id) const;
73 
78  public: virtual ModelIter MatchingModels(const ModelIdentifier &_id);
79 
84  public: virtual WorldIter MatchingWorlds(
85  const WorldIdentifier &_id) const;
86 
93  public: virtual bool SaveModel(
94  const ModelIdentifier &_id,
95  const std::string &_data,
96  const bool _overwrite);
97 
103  public: virtual bool SaveWorld(
104  WorldIdentifier &_id,
105  const std::string &_data,
106  const bool _overwrite);
107 
109  private: std::shared_ptr<LocalCachePrivate> dataPtr;
110  };
111  }
112 }
113 
114 #ifdef _MSC_VER
115 #pragma warning(pop)
116 #endif
117 
118 #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