Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NIVissimClosures.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2002-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
/****************************************************************************/
19
// -------------------
20
/****************************************************************************/
21
#include <config.h>
22
23
#include <string>
24
#include <
utils/common/VectorHelper.h
>
25
#include "
NIVissimClosures.h
"
26
27
28
NIVissimClosures::DictType
NIVissimClosures::myDict
;
29
30
NIVissimClosures::NIVissimClosures
(
const
std::string&
id
,
31
int
from_node,
int
to_node,
32
std::vector<int>& overEdges)
33
: myID(id), myFromNode(from_node), myToNode(to_node),
34
myOverEdges(overEdges) {}
35
36
37
NIVissimClosures::~NIVissimClosures
() {}
38
39
40
bool
41
NIVissimClosures::dictionary
(
const
std::string&
id
,
42
int
from_node,
int
to_node,
43
std::vector<int>& overEdges) {
44
NIVissimClosures
* o =
new
NIVissimClosures
(
id
, from_node, to_node,
45
overEdges);
46
if
(!
dictionary
(
id
, o)) {
47
delete
o;
48
return
false
;
49
}
50
return
true
;
51
}
52
53
54
bool
55
NIVissimClosures::dictionary
(
const
std::string& name,
NIVissimClosures
* o) {
56
DictType::iterator i =
myDict
.find(name);
57
if
(i ==
myDict
.end()) {
58
myDict
[name] = o;
59
return
true
;
60
}
61
return
false
;
62
}
63
64
65
NIVissimClosures
*
66
NIVissimClosures::dictionary
(
const
std::string& name) {
67
DictType::iterator i =
myDict
.find(name);
68
if
(i ==
myDict
.end()) {
69
return
nullptr
;
70
}
71
return
(*i).second;
72
}
73
74
75
76
void
77
NIVissimClosures::clearDict
() {
78
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
79
delete
(*i).second;
80
}
81
myDict
.clear();
82
}
83
84
85
/****************************************************************************/
NIVissimClosures.h
VectorHelper.h
NIVissimClosures
Definition
NIVissimClosures.h:34
NIVissimClosures::DictType
std::map< std::string, NIVissimClosures * > DictType
Definition
NIVissimClosures.h:46
NIVissimClosures::~NIVissimClosures
~NIVissimClosures()
Definition
NIVissimClosures.cpp:37
NIVissimClosures::NIVissimClosures
NIVissimClosures(const std::string &id, int from_node, int to_node, std::vector< int > &overEdges)
Definition
NIVissimClosures.cpp:30
NIVissimClosures::myDict
static DictType myDict
Definition
NIVissimClosures.h:47
NIVissimClosures::dictionary
static bool dictionary(const std::string &id, int from_node, int to_node, std::vector< int > &overEdges)
Definition
NIVissimClosures.cpp:41
NIVissimClosures::clearDict
static void clearDict()
Definition
NIVissimClosures.cpp:77
src
netimport
vissim
tempstructs
NIVissimClosures.cpp
Generated on Sat Nov 9 2024 00:10:30 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8