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-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
/****************************************************************************/
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
#include <string>
32
#include <
utils/common/RGBColor.h
>
33
#include <
utils/common/VectorHelper.h
>
34
#include "
NIVissimVehTypeClass.h
"
35
36
37
NIVissimVehTypeClass::DictType
NIVissimVehTypeClass::myDict
;
38
39
NIVissimVehTypeClass::NIVissimVehTypeClass
(
int
id
,
40
const
std::string& name,
41
const
RGBColor
& color,
42
std::vector<int>& types)
43
: myID(id), myName(name), myColor(color), myTypes(types) {}
44
45
NIVissimVehTypeClass::~NIVissimVehTypeClass
() {}
46
47
48
bool
49
NIVissimVehTypeClass::dictionary
(
int
id
,
const
std::string& name,
50
const
RGBColor
& color,
51
std::vector<int>& types) {
52
NIVissimVehTypeClass
* o =
new
NIVissimVehTypeClass
(
id
, name, color, types);
53
if
(!
dictionary
(
id
, o)) {
54
delete
o;
55
return
false
;
56
}
57
return
true
;
58
}
59
60
61
62
63
bool
64
NIVissimVehTypeClass::dictionary
(
int
name,
NIVissimVehTypeClass
* o) {
65
DictType::iterator i =
myDict
.find(name);
66
if
(i ==
myDict
.end()) {
67
myDict
[name] = o;
68
return
true
;
69
}
70
return
false
;
71
}
72
73
74
NIVissimVehTypeClass
*
75
NIVissimVehTypeClass::dictionary
(
int
name) {
76
DictType::iterator i =
myDict
.find(name);
77
if
(i ==
myDict
.end()) {
78
return
0;
79
}
80
return
(*i).second;
81
}
82
83
84
void
85
NIVissimVehTypeClass::clearDict
() {
86
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
87
delete
(*i).second;
88
}
89
myDict
.clear();
90
}
91
92
93
94
/****************************************************************************/
95
NIVissimVehTypeClass::dictionary
static bool dictionary(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:49
RGBColor.h
windows_config.h
RGBColor
Definition:
RGBColor.h:46
NIVissimVehTypeClass::myDict
static DictType myDict
Definition:
NIVissimVehTypeClass.h:62
config.h
NIVissimVehTypeClass::~NIVissimVehTypeClass
~NIVissimVehTypeClass()
Definition:
NIVissimVehTypeClass.cpp:45
NIVissimVehTypeClass::NIVissimVehTypeClass
NIVissimVehTypeClass(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:39
NIVissimVehTypeClass::clearDict
static void clearDict()
Definition:
NIVissimVehTypeClass.cpp:85
NIVissimVehTypeClass::DictType
std::map< int, NIVissimVehTypeClass * > DictType
Definition:
NIVissimVehTypeClass.h:61
VectorHelper.h
NIVissimVehTypeClass
Definition:
NIVissimVehTypeClass.h:44
NIVissimVehTypeClass.h
src
netimport
vissim
tempstructs
NIVissimVehTypeClass.cpp
Generated on Fri Jun 29 2018 13:14:36 for SUMO - Simulation of Urban MObility by
1.8.13