SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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-2015 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
(
const
std::string& name,
41
const
std::string& category,
const
RGBColor
& color)
42
: myName(name), myCategory(category),
43
myColor(color) {}
44
45
46
NIVissimVehicleType::~NIVissimVehicleType
() {}
47
48
49
50
bool
51
NIVissimVehicleType::dictionary
(
int
id
,
const
std::string& name,
const
std::string& category,
52
const
RGBColor
& color) {
53
NIVissimVehicleType
* o =
new
NIVissimVehicleType
(name, category, color);
54
if
(!
dictionary
(
id
, o)) {
55
delete
o;
56
return
false
;
57
}
58
return
true
;
59
}
60
61
62
bool
63
NIVissimVehicleType::dictionary
(
int
id
,
NIVissimVehicleType
* o) {
64
DictType::iterator i =
myDict
.find(
id
);
65
if
(i ==
myDict
.end()) {
66
myDict
[id] = o;
67
return
true
;
68
}
69
return
false
;
70
}
71
72
73
NIVissimVehicleType
*
74
NIVissimVehicleType::dictionary
(
int
id
) {
75
DictType::iterator i =
myDict
.find(
id
);
76
if
(i ==
myDict
.end()) {
77
return
0;
78
}
79
return
(*i).second;
80
}
81
82
void
83
NIVissimVehicleType::clearDict
() {
84
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
85
delete
(*i).second;
86
}
87
myDict
.clear();
88
}
89
90
91
92
/****************************************************************************/
93
windows_config.h
RGBColor
Definition:
RGBColor.h:47
debug_new.h
NIVissimVehicleType::NIVissimVehicleType
NIVissimVehicleType(const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:40
NIVissimVehicleType::dictionary
static bool dictionary(int id, const std::string &name, const std::string &category, const RGBColor &color)
Definition:
NIVissimVehicleType.cpp:51
config.h
NIVissimVehicleType::~NIVissimVehicleType
~NIVissimVehicleType()
Definition:
NIVissimVehicleType.cpp:46
NIVissimVehicleType.h
NIVissimVehicleType::clearDict
static void clearDict()
Definition:
NIVissimVehicleType.cpp:83
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
build
sumo-3Ncg_a
sumo-0.23.0+dfsg1
src
netimport
vissim
tempstructs
NIVissimVehicleType.cpp
Generated by
1.8.9.1