SUMO - Simulation of Urban MObility
NIVissimVehicleType.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 "
NIVissimVehicleType.h
"
32
33
NIVissimVehicleType::DictType
NIVissimVehicleType::myDict
;
34
35
NIVissimVehicleType::NIVissimVehicleType
(
const
std::string& name,
36
const
std::string& category,
const
RGBColor
& color)
37
: myName(name), myCategory(category),
38
myColor(color) {}
39
40
41
NIVissimVehicleType::~NIVissimVehicleType
() {}
42
43
44
45
bool
46
NIVissimVehicleType::dictionary
(
int
id
,
const
std::string& name,
const
std::string& category,
47
const
RGBColor
& color) {
48
NIVissimVehicleType
* o =
new
NIVissimVehicleType
(name, category, color);
49
if
(!
dictionary
(
id
, o)) {
50
delete
o;
51
return
false
;
52
}
53
return
true
;
54
}
55
56
57
bool
58
NIVissimVehicleType::dictionary
(
int
id
,
NIVissimVehicleType
* 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
NIVissimVehicleType
*
69
NIVissimVehicleType::dictionary
(
int
id
) {
70
DictType::iterator i =
myDict
.find(
id
);
71
if
(i ==
myDict
.end()) {
72
return
0;
73
}
74
return
(*i).second;
75
}
76
77
void
78
NIVissimVehicleType::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
windows_config.h
RGBColor
Definition:
RGBColor.h:46
NIVissimVehicleType::NIVissimVehicleType
NIVissimVehicleType(const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:35
NIVissimVehicleType::dictionary
static bool dictionary(int id, const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:46
config.h
NIVissimVehicleType::~NIVissimVehicleType
~NIVissimVehicleType()
Definition:
NIVissimVehicleType.cpp:41
NIVissimVehicleType.h
NIVissimVehicleType::clearDict
static void clearDict()
Definition:
NIVissimVehicleType.cpp:78
NIVissimVehicleType::myDict
static DictType myDict
Definition:
NIVissimVehicleType.h:60
NIVissimVehicleType::DictType
std::map< int, NIVissimVehicleType * > DictType
Definition:
NIVissimVehicleType.h:59
NIVissimVehicleType
Definition:
NIVissimVehicleType.h:43
src
netimport
vissim
tempstructs
NIVissimVehicleType.cpp
Generated on Sun Dec 24 2017 17:07:43 for SUMO - Simulation of Urban MObility by
1.8.13