Eclipse SUMO - Simulation of Urban MObility
NIVissimVehTypeClass.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
/****************************************************************************/
15
// -------------------
16
/****************************************************************************/
17
18
19
// ===========================================================================
20
// included modules
21
// ===========================================================================
22
#include <
config.h
>
23
24
#include <string>
25
#include <
utils/common/RGBColor.h
>
26
#include <
utils/common/VectorHelper.h
>
27
#include "
NIVissimVehTypeClass.h
"
28
29
30
NIVissimVehTypeClass::DictType
NIVissimVehTypeClass::myDict
;
31
32
NIVissimVehTypeClass::NIVissimVehTypeClass
(
int
id
,
33
const
std::string& name,
34
const
RGBColor
& color,
35
std::vector<int>& types)
36
: myID(id), myName(name), myColor(color), myTypes(types) {}
37
38
NIVissimVehTypeClass::~NIVissimVehTypeClass
() {}
39
40
41
bool
42
NIVissimVehTypeClass::dictionary
(
int
id
,
const
std::string& name,
43
const
RGBColor
& color,
44
std::vector<int>& types) {
45
NIVissimVehTypeClass
* o =
new
NIVissimVehTypeClass
(
id
, name, color, types);
46
if
(!
dictionary
(
id
, o)) {
47
delete
o;
48
return
false
;
49
}
50
return
true
;
51
}
52
53
54
55
56
bool
57
NIVissimVehTypeClass::dictionary
(
int
name,
NIVissimVehTypeClass
* 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
NIVissimVehTypeClass
*
68
NIVissimVehTypeClass::dictionary
(
int
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
void
78
NIVissimVehTypeClass::clearDict
() {
79
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
80
delete
(*i).second;
81
}
82
myDict
.clear();
83
}
84
85
86
87
/****************************************************************************/
88
NIVissimVehTypeClass::clearDict
static void clearDict()
Definition:
NIVissimVehTypeClass.cpp:78
NIVissimVehTypeClass
Definition:
NIVissimVehTypeClass.h:37
NIVissimVehTypeClass::myDict
static DictType myDict
Definition:
NIVissimVehTypeClass.h:55
NIVissimVehTypeClass::~NIVissimVehTypeClass
~NIVissimVehTypeClass()
Definition:
NIVissimVehTypeClass.cpp:38
NIVissimVehTypeClass::NIVissimVehTypeClass
NIVissimVehTypeClass(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:32
NIVissimVehTypeClass.h
RGBColor.h
VectorHelper.h
RGBColor
Definition:
RGBColor.h:39
NIVissimVehTypeClass::dictionary
static bool dictionary(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:42
config.h
NIVissimVehTypeClass::DictType
std::map< int, NIVissimVehTypeClass * > DictType
Definition:
NIVissimVehTypeClass.h:54
src
netimport
vissim
tempstructs
NIVissimVehTypeClass.cpp
Generated on Sun Dec 13 2020 08:44:58 for Eclipse SUMO - Simulation of Urban MObility by
1.8.20