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)
99 public: std::string
GetModelPath(
const std::string &_uri);
107 public: std::string
GetModelFile(
const std::string &_uri);
122 public:
bool HasModel(
const std::string &_modelName);
127 private: std::string GetManifestImpl(
const std::string &_uri);
130 private:
void UpdateModelCache();
134 private:
bool UpdateModelCacheImpl();
137 private: std::map<std::string, std::string> modelCache;
143 private: boost::mutex updateMutex;
146 private: boost::thread *updateCacheThread;
149 private: boost::condition_variable updateCacheCondition;
153 private:
typedef boost::function<
154 void (
const std::map<std::string, std::string> &)> CallbackFunc;
158 private: std::list<CallbackFunc> callbacks;