Go to the documentation of this file.
17 #ifndef _GAZEBO_MODELDATABSE_HH_
18 #define _GAZEBO_MODELDATABSE_HH_
24 #include <boost/function.hpp>
31 #define GZ_MODEL_MANIFEST_FILENAME "model.config"
34 #define GZ_MODEL_DB_MANIFEST_FILENAME "database.config"
41 class ModelDatabasePrivate;
60 public:
void Start(
bool _fetchImmediately =
false);
67 public: std::string GetURI();
74 public: std::map<std::string, std::string> GetModels();
84 void (
const std::map<std::string, std::string> &)> _func);
93 public: std::string GetModelName(
const std::string &_uri);
97 public: std::string GetModelConfig(
const std::string &_uri);
101 public: std::string GetDBConfig(
const std::string &_uri);
110 public: std::string GetModelPath(
const std::string &_uri,
111 bool _forceDownload =
false);
119 public: std::string GetModelFile(
const std::string &_uri);
127 public:
void DownloadDependencies(
const std::string &_path);
134 public:
bool HasModel(
const std::string &_modelName);
139 private: std::string GetManifestImpl(
const std::string &_uri);
144 private:
void UpdateModelCache(
bool _fetchImmediately);
148 private:
bool UpdateModelCacheImpl();
151 private: ModelDatabasePrivate *dataPtr;
bool HasModel(const std::string &_modelName)
Returns true if the model exists on the database.
void Start(bool _fetchImmediately=false)
Start the model database.
Forward declarations for the common classes.
Definition: Animation.hh:26
Singleton template class.
Definition: SingletonT.hh:33
void DownloadDependencies(const std::string &_path)
Download all dependencies for a give model path.
std::string GetModelName(const std::string &_uri)
Get the name of a model based on a URI.
std::string GetModelFile(const std::string &_uri)
Get a model's SDF file based on a URI.
std::string GetDBConfig(const std::string &_uri)
Return the database.config file as a string.
std::string GetModelPath(const std::string &_uri, bool _forceDownload=false)
Get the local path to a model.
std::string GetModelConfig(const std::string &_uri)
Return the model.config file as a string.
Connects to model database, and has utility functions to find models.
Definition: ModelDatabase.hh:49
void Fini()
Finalize the model database.
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
std::string GetURI()
Returns the the global model database URI.
std::map< std::string, std::string > GetModels()
Returns the dictionary of all the model names.