All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ModelDatabasePrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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/thread.hpp>
25 #include <boost/thread/mutex.hpp>
26 
27 #include "gazebo/common/Event.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace common
33  {
36  {
38  public: boost::thread *updateCacheThread;
39 
41  public: std::map<std::string, std::string> modelCache;
42 
44  public: bool stop;
45 
47  public: boost::mutex updateMutex;
48 
50  public: boost::mutex callbacksMutex;
51 
53  public: boost::recursive_mutex startCacheMutex;
54 
56  public: boost::condition_variable updateCacheCondition;
57 
59  public: boost::condition_variable updateCacheCompleteCondition;
60 
63  public: typedef boost::function<
64  void (const std::map<std::string, std::string> &)> CallbackFunc;
65 
68  public: event::EventT<
69  void (std::map<std::string, std::string>)> modelDBUpdated;
70  };
71  }
72 }
73 #endif
boost::function< void(const std::map< std::string, std::string > &)> CallbackFunc
Definition: ModelDatabasePrivate.hh:64
boost::condition_variable updateCacheCompleteCondition
Condition variable for completion of one cache update.
Definition: ModelDatabasePrivate.hh:59
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:69
boost::mutex callbacksMutex
Protects callback list.
Definition: ModelDatabasePrivate.hh:50
bool stop
True to stop the background thread.
Definition: ModelDatabasePrivate.hh:44
boost::recursive_mutex startCacheMutex
Mutex to protect cache thread status checks.
Definition: ModelDatabasePrivate.hh:53
Private class attributes for ModelDatabase.
Definition: ModelDatabasePrivate.hh:35
boost::condition_variable updateCacheCondition
Condition variable for the updateCacheThread.
Definition: ModelDatabasePrivate.hh:56
std::map< std::string, std::string > modelCache
A dictionary of all model names indexed by their uri.
Definition: ModelDatabasePrivate.hh:41
boost::thread * updateCacheThread
Thread to update the model cache.
Definition: ModelDatabasePrivate.hh:38
boost::mutex updateMutex
Cache update mutex.
Definition: ModelDatabasePrivate.hh:47
A class for event processing.
Definition: Event.hh:156
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48