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