SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIGlObjectStorage.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A storage for displayed objects via their numerical id
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIGlObjectStorage_h
23 #define GUIGlObjectStorage_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <map>
36 #include <string>
37 #include <set>
38 #include <fx.h>
39 #include "GUIGlObject.h"
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
61 public:
64 
65 
68 
69 
79  GUIGlID registerObject(GUIGlObject* object, const std::string& fullName);
80 
81 
91 
92 
101  GUIGlObject* getObjectBlocking(const std::string& fullName);
102 
103 
113  bool remove(GUIGlID id);
114 
115 
120  void clear();
121 
122 
128  void unblockObject(GUIGlID id);
129 
130 
134  void setNetObject(GUIGlObject* object) {
135  myNetObject = object;
136  }
137 
138 
143  return myNetObject;
144  }
145 
146 
150 
151 
154  std::set<GUIGlID> getAllIDs() const;
155 
156 private:
158  typedef std::map<GUIGlID, GUIGlObject*> ObjectMap;
159 
162 
163  /* @brief The known objects by their fill name (used when loading selection
164  * from file */
165  std::map<std::string, GUIGlObject*> myFullNameMap;
166 
169 
172 
175 
177  mutable MFXMutex myLock;
178 
181 
182 
183 private:
186 
189 
190 
191 };
192 
193 
194 #endif
195 
196 /****************************************************************************/
197