17 #ifndef _GAZEBO_MODELDATABSE_HH_
18 #define _GAZEBO_MODELDATABSE_HH_
23 #include <boost/thread.hpp>
24 #include <boost/thread/mutex.hpp>
28 #define GZ_MODEL_MANIFEST_FILENAME "model.config"
31 #define GZ_MODEL_DB_MANIFEST_FILENAME "database.config"
53 public: std::string
GetURI();
60 public: std::map<std::string, std::string>
GetModels();
68 void (
const std::map<std::string, std::string> &)> _func);
77 public: std::string
GetModelName(
const std::string &_uri);
85 public: std::string
GetDBConfig(
const std::string &_uri);
90 public: std::string
GetManifest(
const std::string &_uri)
100 public: std::string
GetModelPath(
const std::string &_uri,
101 bool _forceDownload =
false);
109 public: std::string
GetModelFile(
const std::string &_uri);
124 public:
bool HasModel(
const std::string &_modelName);
129 private: std::string GetManifestImpl(
const std::string &_uri);
132 private:
void UpdateModelCache();
136 private:
bool UpdateModelCacheImpl();
139 private: std::map<std::string, std::string> modelCache;
145 private: boost::mutex updateMutex;
148 private: boost::thread *updateCacheThread;
151 private: boost::condition_variable updateCacheCondition;
155 private:
typedef boost::function<
156 void (
const std::map<std::string, std::string> &)> CallbackFunc;
160 private: std::list<CallbackFunc> callbacks;