Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNEHierarchicalStructureParents.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-2025 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/****************************************************************************/
18// Structure for GNEHierarchicalElements centered in parents
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <vector>
24
25// ===========================================================================
26// template declarations
27// ===========================================================================
28
29template <typename ParentType>
30using GNEHierarchicalContainerParents = std::vector<ParentType>;
31
32// ===========================================================================
33// class declarations
34// ===========================================================================
35
37class GNEJunction;
38class GNEEdge;
39class GNELane;
40class GNEAdditional;
43class GNEGenericData;
45
46// ===========================================================================
47// class definitions
48// ===========================================================================
49
52
53public:
56
58 void clear();
59
61 template<typename ParentType>
63
65 template<typename ParentType>
66 ParentType at(const int index) const;
67
72 template<typename ParentType>
73 void add(ParentType parent, const int index = -1);
74
76 template<typename ParentType>
77 void remove(ParentType parent);
78
83 template<typename ParentType>
84 void replaceSingle(const int index, ParentType newParent);
85
87 template<typename ParentType>
89
90private:
93
96
99
102
105
108
111};
std::vector< ParentType > GNEHierarchicalContainerParents
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
Hierarchical structure used for keep parents.
GNEHierarchicalContainerParents< GNETAZSourceSink * > myParentTAZSourceSinks
parents TAZSourceSinks (Unused, but needed for function addElementInParentsAndChildren)
void remove(ParentType parent)
remove parent element
void replaceAll(const GNEHierarchicalContainerParents< ParentType > &newParents)
update all parent element
ParentType at(const int index) const
get parent at the given position
GNEHierarchicalContainerParents< GNEJunction * > myParentJunctions
parents junctions
GNEHierarchicalContainerParents< GNEDemandElement * > myParentDemandElements
parents demand elements
GNEHierarchicalContainerParents< GNELane * > myParentLanes
parents lanes
const GNEHierarchicalContainerParents< ParentType > & get() const
get parents
GNEHierarchicalContainerParents< GNEAdditional * > myParentAdditionals
parents additionals
GNEHierarchicalContainerParents< GNEGenericData * > myParentGenericDatas
parents generic datas
void add(ParentType parent, const int index=-1)
add parent element
void replaceSingle(const int index, ParentType newParent)
update single parent element
GNEHierarchicalContainerParents< GNEEdge * > myParentEdges
parents edges
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46