SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NIVissimVehTypeClass.cpp
Go to the documentation of this file.
1
/****************************************************************************/
7
// -------------------
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
10
// Copyright (C) 2001-2013 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
#include <string>
32
#include <
utils/common/RGBColor.h
>
33
#include <
utils/common/VectorHelper.h
>
34
#include "
NIVissimVehTypeClass.h
"
35
36
#ifdef CHECK_MEMORY_LEAKS
37
#include <
foreign/nvwa/debug_new.h
>
38
#endif // CHECK_MEMORY_LEAKS
39
40
41
NIVissimVehTypeClass::DictType
NIVissimVehTypeClass::myDict
;
42
43
NIVissimVehTypeClass::NIVissimVehTypeClass
(
int
id
,
44
const
std::string& name,
45
const
RGBColor
& color,
46
std::vector<int>& types)
47
: myID(id), myName(name), myColor(color), myTypes(types) {}
48
49
NIVissimVehTypeClass::~NIVissimVehTypeClass
() {}
50
51
52
bool
53
NIVissimVehTypeClass::dictionary
(
int
id
,
const
std::string& name,
54
const
RGBColor
& color,
55
std::vector<int>& types) {
56
NIVissimVehTypeClass
* o =
new
NIVissimVehTypeClass
(
id
, name, color, types);
57
if
(!
dictionary
(
id
, o)) {
58
delete
o;
59
return
false
;
60
}
61
return
true
;
62
}
63
64
65
66
67
bool
68
NIVissimVehTypeClass::dictionary
(
int
name,
NIVissimVehTypeClass
* o) {
69
DictType::iterator i =
myDict
.find(name);
70
if
(i ==
myDict
.end()) {
71
myDict
[name] = o;
72
return
true
;
73
}
74
return
false
;
75
}
76
77
78
NIVissimVehTypeClass
*
79
NIVissimVehTypeClass::dictionary
(
int
name) {
80
DictType::iterator i =
myDict
.find(name);
81
if
(i ==
myDict
.end()) {
82
return
0;
83
}
84
return
(*i).second;
85
}
86
87
88
void
89
NIVissimVehTypeClass::clearDict
() {
90
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
91
delete
(*i).second;
92
}
93
myDict
.clear();
94
}
95
96
97
98
/****************************************************************************/
99
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
netimport
vissim
tempstructs
NIVissimVehTypeClass.cpp
Generated on Sun Jun 16 2013 07:08:08 for SUMO - Simulation of Urban MObility by
1.8.1.2