SUMO - Simulation of Urban MObility
NIVissimVehicleType.cpp
Go to the documentation of this file.
1
/****************************************************************************/
7
// -------------------
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10
// Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11
/****************************************************************************/
12
//
13
// This file is part of SUMO.
14
// SUMO is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
/****************************************************************************/
20
21
22
// ===========================================================================
23
// included modules
24
// ===========================================================================
25
#ifdef _MSC_VER
26
#include <
windows_config.h
>
27
#else
28
#include <
config.h
>
29
#endif
30
31
32
#include "
NIVissimVehicleType.h
"
33
34
NIVissimVehicleType::DictType
NIVissimVehicleType::myDict
;
35
36
NIVissimVehicleType::NIVissimVehicleType
(
const
std::string& name,
37
const
std::string& category,
const
RGBColor
& color)
38
: myName(name), myCategory(category),
39
myColor(color) {}
40
41
42
NIVissimVehicleType::~NIVissimVehicleType
() {}
43
44
45
46
bool
47
NIVissimVehicleType::dictionary
(
int
id
,
const
std::string& name,
const
std::string& category,
48
const
RGBColor
& color) {
49
NIVissimVehicleType
* o =
new
NIVissimVehicleType
(name, category, color);
50
if
(!
dictionary
(
id
, o)) {
51
delete
o;
52
return
false
;
53
}
54
return
true
;
55
}
56
57
58
bool
59
NIVissimVehicleType::dictionary
(
int
id
,
NIVissimVehicleType
* o) {
60
DictType::iterator i =
myDict
.find(
id
);
61
if
(i ==
myDict
.end()) {
62
myDict
[id] = o;
63
return
true
;
64
}
65
return
false
;
66
}
67
68
69
NIVissimVehicleType
*
70
NIVissimVehicleType::dictionary
(
int
id
) {
71
DictType::iterator i =
myDict
.find(
id
);
72
if
(i ==
myDict
.end()) {
73
return
0;
74
}
75
return
(*i).second;
76
}
77
78
void
79
NIVissimVehicleType::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
windows_config.h
RGBColor
Definition:
RGBColor.h:47
NIVissimVehicleType::NIVissimVehicleType
NIVissimVehicleType(const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:36
NIVissimVehicleType::dictionary
static bool dictionary(int id, const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:47
config.h
NIVissimVehicleType::~NIVissimVehicleType
~NIVissimVehicleType()
Definition:
NIVissimVehicleType.cpp:42
NIVissimVehicleType.h
NIVissimVehicleType::clearDict
static void clearDict()
Definition:
NIVissimVehicleType.cpp:79
NIVissimVehicleType::myDict
static DictType myDict
Definition:
NIVissimVehicleType.h:61
NIVissimVehicleType::DictType
std::map< int, NIVissimVehicleType * > DictType
Definition:
NIVissimVehicleType.h:60
NIVissimVehicleType
Definition:
NIVissimVehicleType.h:44
src
netimport
vissim
tempstructs
NIVissimVehicleType.cpp
Generated on Fri Nov 3 2017 20:31:28 for SUMO - Simulation of Urban MObility by
1.8.13