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
NIVissimVehicleType.cpp
Go to the documentation of this file.
1
/****************************************************************************/
7
// -------------------
8
/****************************************************************************/
9
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
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
32
#include "
NIVissimVehicleType.h
"
33
34
#ifdef CHECK_MEMORY_LEAKS
35
#include <
foreign/nvwa/debug_new.h
>
36
#endif // CHECK_MEMORY_LEAKS
37
38
NIVissimVehicleType::DictType
NIVissimVehicleType::myDict
;
39
40
NIVissimVehicleType::NIVissimVehicleType
(
int
id
,
41
const
std::string& name,
const
std::string& category,
SUMOReal
length,
42
const
RGBColor
& color,
SUMOReal
amax,
SUMOReal
dmax)
43
: myID(id), myName(name), myCategory(category), myLength(length),
44
myColor(color), myAMax(amax), myDMax(dmax) {}
45
46
47
NIVissimVehicleType::~NIVissimVehicleType
() {}
48
49
50
51
bool
52
NIVissimVehicleType::dictionary
(
int
id
,
53
const
std::string& name,
const
std::string& category,
SUMOReal
length,
54
const
RGBColor
& color,
SUMOReal
amax,
SUMOReal
dmax) {
55
NIVissimVehicleType
* o =
new
NIVissimVehicleType
(
id
, name, category,
56
length, color, amax, dmax);
57
if
(!
dictionary
(
id
, o)) {
58
delete
o;
59
return
false
;
60
}
61
return
true
;
62
}
63
64
65
bool
66
NIVissimVehicleType::dictionary
(
int
id
,
NIVissimVehicleType
* o) {
67
DictType::iterator i =
myDict
.find(
id
);
68
if
(i ==
myDict
.end()) {
69
myDict
[id] = o;
70
return
true
;
71
}
72
return
false
;
73
}
74
75
76
NIVissimVehicleType
*
77
NIVissimVehicleType::dictionary
(
int
id
) {
78
DictType::iterator i =
myDict
.find(
id
);
79
if
(i ==
myDict
.end()) {
80
return
0;
81
}
82
return
(*i).second;
83
}
84
85
void
86
NIVissimVehicleType::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
build
buildd
sumo-0.18~dfsg
src
netimport
vissim
tempstructs
NIVissimVehicleType.cpp
Generated on Wed Oct 23 2013 01:15:11 for SUMO - Simulation of Urban MObility by
1.8.4