Eclipse 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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Base class for additional objects (detectors etc.)
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <vector>
26 #include <map>
27 
28 #include "GUIGlObjectTypes.h"
29 #include "GUIGlObject.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 
40 public:
42  GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string& id, FXIcon* icon);
43 
46 
48  static void clearDictionary();
49 
51  static GUIGlObject_AbstractAdd* get(const std::string& name);
52 
54  static void remove(GUIGlObject_AbstractAdd* o);
55 
57  static const std::vector<GUIGlObject_AbstractAdd*>& getObjectList();
58 
60  static std::vector<GUIGlID> getIDList(GUIGlObjectType typeFilter);
61 
62 protected:
64  static std::map<std::string, GUIGlObject_AbstractAdd*> myObjects;
65 
67  static std::vector<GUIGlObject_AbstractAdd*> myObjectList;
68 };
GUIGlObjectType
static const std::vector< GUIGlObject_AbstractAdd * > & getObjectList()
Returns the list of all additional objects.
static void remove(GUIGlObject_AbstractAdd *o)
Removes an object.
static void clearDictionary()
Clears the dictionary (the objects will not be deleted)
static GUIGlObject_AbstractAdd * get(const std::string &name)
Returns a named object.
static std::vector< GUIGlObject_AbstractAdd * > myObjectList
The list of all addtional objects currently loaded.
GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string &id, FXIcon *icon)
constructor
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.
static std::map< std::string, GUIGlObject_AbstractAdd * > myObjects
Map from names of loaded additional objects to the objects themselves.