ModelDatabasePrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 #ifndef _GAZEBO_MODELDATABSE_PRIVATE_HH_
18 #define _GAZEBO_MODELDATABSE_PRIVATE_HH_
19 
20 #include <list>
21 #include <map>
22 #include <string>
23 
24 #include <boost/function.hpp>
25 #include <boost/thread.hpp>
26 #include <boost/thread/mutex.hpp>
27 
28 #include "gazebo/common/Event.hh"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace common
34  {
37  {
39  public: boost::thread *updateCacheThread;
40 
42  public: std::map<std::string, std::string> modelCache;
43 
45  public: bool stop;
46 
48  public: boost::mutex updateMutex;
49 
51  public: boost::mutex callbacksMutex;
52 
54  public: boost::recursive_mutex startCacheMutex;
55 
57  public: boost::condition_variable updateCacheCondition;
58 
60  public: boost::condition_variable updateCacheCompleteCondition;
61 
64  public: typedef boost::function<
65  void (const std::map<std::string, std::string> &)> CallbackFunc;
66 
69  public: event::EventT<
70  void (std::map<std::string, std::string>)> modelDBUpdated;
71  };
72  }
73 }
74 #endif
boost::function< void(const std::map< std::string, std::string > &)> CallbackFunc
Definition: ModelDatabasePrivate.hh:65
boost::condition_variable updateCacheCompleteCondition
Condition variable for completion of one cache update.
Definition: ModelDatabasePrivate.hh:60
event::EventT< void(std::map< std::string, std::string >)> modelDBUpdated
Triggered when the model data has been updated after calling ModelDatabase::GetModels() ...
Definition: ModelDatabasePrivate.hh:70
boost::mutex callbacksMutex
Protects callback list.
Definition: ModelDatabasePrivate.hh:51
bool stop
True to stop the background thread.
Definition: ModelDatabasePrivate.hh:45
boost::recursive_mutex startCacheMutex
Mutex to protect cache thread status checks.
Definition: ModelDatabasePrivate.hh:54
Private class attributes for ModelDatabase.
Definition: ModelDatabasePrivate.hh:36
#define GZ_COMMON_VISIBLE
Definition: system.hh:84
boost::condition_variable updateCacheCondition
Condition variable for the updateCacheThread.
Definition: ModelDatabasePrivate.hh:57
std::map< std::string, std::string > modelCache
A dictionary of all model names indexed by their uri.
Definition: ModelDatabasePrivate.hh:42
boost::thread * updateCacheThread
Thread to update the model cache.
Definition: ModelDatabasePrivate.hh:39
boost::mutex updateMutex
Cache update mutex.
Definition: ModelDatabasePrivate.hh:48
A class for event processing.
Definition: Event.hh:181