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.org/sumo
3 // Copyright (C) 2001-2022 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 "GUIGlObjectTypes.h"
26 #include "GUIGlObject.h"
27 #include <vector>
28 #include <map>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
38 
39 public:
41  GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string& id);
42 
45 
47  static void clearDictionary();
48 
50  static GUIGlObject_AbstractAdd* get(const std::string& name);
51 
53  static void remove(GUIGlObject_AbstractAdd* o);
54 
56  static const std::vector<GUIGlObject_AbstractAdd*>& getObjectList();
57 
59  static std::vector<GUIGlID> getIDList(GUIGlObjectType typeFilter);
60 
61 protected:
63  static std::map<std::string, GUIGlObject_AbstractAdd*> myObjects;
64 
66  static std::vector<GUIGlObject_AbstractAdd*> myObjectList;
67 };
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.
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.
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.