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