SUMO - Simulation of Urban MObility
NIVissimSource.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3
// Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4
/****************************************************************************/
5
//
6
// This program and the accompanying materials
7
// are made available under the terms of the Eclipse Public License v2.0
8
// which accompanies this distribution, and is available at
9
// http://www.eclipse.org/legal/epl-v20.html
10
//
11
/****************************************************************************/
17
// -------------------
18
/****************************************************************************/
19
20
21
// ===========================================================================
22
// included modules
23
// ===========================================================================
24
#ifdef _MSC_VER
25
#include <
windows_config.h
>
26
#else
27
#include <
config.h
>
28
#endif
29
30
31
#include <string>
32
#include <map>
33
#include "
NIVissimSource.h
"
34
35
NIVissimSource::DictType
NIVissimSource::myDict
;
36
37
NIVissimSource::NIVissimSource
(
const
std::string&
id
,
const
std::string& name,
38
const
std::string& edgeid)
39
: myID(id), myName(name), myEdgeID(edgeid) {}
40
41
42
NIVissimSource::~NIVissimSource
() {}
43
44
45
bool
46
NIVissimSource::dictionary
(
const
std::string&
id
,
const
std::string& name,
47
const
std::string& edgeid) {
48
NIVissimSource
* o =
new
NIVissimSource
(
id
, name, edgeid);
49
if
(!
dictionary
(
id
, o)) {
50
delete
o;
51
return
false
;
52
}
53
return
true
;
54
}
55
56
57
bool
58
NIVissimSource::dictionary
(
const
std::string&
id
,
NIVissimSource
* o) {
59
DictType::iterator i =
myDict
.find(
id
);
60
if
(i ==
myDict
.end()) {
61
myDict
[id] = o;
62
return
true
;
63
}
64
return
false
;
65
}
66
67
68
NIVissimSource
*
69
NIVissimSource::dictionary
(
const
std::string&
id
) {
70
DictType::iterator i =
myDict
.find(
id
);
71
if
(i ==
myDict
.end()) {
72
return
0;
73
}
74
return
(*i).second;
75
}
76
77
78
void
79
NIVissimSource::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
NIVissimSource::~NIVissimSource
~NIVissimSource()
Definition:
NIVissimSource.cpp:42
windows_config.h
NIVissimSource::clearDict
static void clearDict()
Definition:
NIVissimSource.cpp:79
config.h
NIVissimSource::myDict
static DictType myDict
Definition:
NIVissimSource.h:59
NIVissimSource.h
NIVissimSource::NIVissimSource
NIVissimSource(const std::string &id, const std::string &name, const std::string &edgeid)
Definition:
NIVissimSource.cpp:37
NIVissimSource
Definition:
NIVissimSource.h:42
NIVissimSource::DictType
std::map< std::string, NIVissimSource * > DictType
Definition:
NIVissimSource.h:58
NIVissimSource::dictionary
static bool dictionary(const std::string &id, const std::string &name, const std::string &edgeid)
Definition:
NIVissimSource.cpp:46
src
netimport
vissim
tempstructs
NIVissimSource.cpp
Generated on Sat May 12 2018 19:00:22 for SUMO - Simulation of Urban MObility by
1.8.13