SUMO - Simulation of Urban MObility
GUIGlObject_AbstractAdd.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Base class for additional objects (detectors etc.)
18 /****************************************************************************/
19 #ifndef GUIGlObject_AbstractAdd_h
20 #define GUIGlObject_AbstractAdd_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include "GUIGlObjectTypes.h"
29 #include "GUIGlObject.h"
30 #include <vector>
31 #include <map>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
41 
42 public:
44  GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string& id);
45 
48 
50  static void clearDictionary();
51 
53  static GUIGlObject_AbstractAdd* get(const std::string& name);
54 
56  static void remove(GUIGlObject_AbstractAdd* o);
57 
59  static const std::vector<GUIGlObject_AbstractAdd*>& getObjectList();
60 
62  static std::vector<GUIGlID> getIDList(GUIGlObjectType typeFilter);
63 
64 protected:
66  static std::map<std::string, GUIGlObject_AbstractAdd*> myObjects;
67 
69  static std::vector<GUIGlObject_AbstractAdd*> myObjectList;
70 };
71 
72 
73 #endif
74 
75 /****************************************************************************/
76 
GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string &id)
constructor
static std::map< std::string, GUIGlObject_AbstractAdd * > myObjects
Map from names of loaded additional objects to the objects themselves.
GUIGlObjectType
static std::vector< GUIGlObject_AbstractAdd * > myObjectList
The list of all addtional objects currently loaded.
static void clearDictionary()
Clears the dictionary (the objects will not be deleted)
static const std::vector< GUIGlObject_AbstractAdd * > & getObjectList()
Returns the list of all additional objects.
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.