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
Modules
Pages
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-2015 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
#ifdef CHECK_MEMORY_LEAKS
38
#include <
foreign/nvwa/debug_new.h
>
39
#endif // CHECK_MEMORY_LEAKS
40
41
42
NIVissimVehTypeClass::DictType
NIVissimVehTypeClass::myDict
;
43
44
NIVissimVehTypeClass::NIVissimVehTypeClass
(
int
id
,
45
const
std::string& name,
46
const
RGBColor
& color,
47
std::vector<int>& types)
48
: myID(id), myName(name), myColor(color), myTypes(types) {}
49
50
NIVissimVehTypeClass::~NIVissimVehTypeClass
() {}
51
52
53
bool
54
NIVissimVehTypeClass::dictionary
(
int
id
,
const
std::string& name,
55
const
RGBColor
& color,
56
std::vector<int>& types) {
57
NIVissimVehTypeClass
* o =
new
NIVissimVehTypeClass
(
id
, name, color, types);
58
if
(!
dictionary
(
id
, o)) {
59
delete
o;
60
return
false
;
61
}
62
return
true
;
63
}
64
65
66
67
68
bool
69
NIVissimVehTypeClass::dictionary
(
int
name,
NIVissimVehTypeClass
* o) {
70
DictType::iterator i =
myDict
.find(name);
71
if
(i ==
myDict
.end()) {
72
myDict
[name] = o;
73
return
true
;
74
}
75
return
false
;
76
}
77
78
79
NIVissimVehTypeClass
*
80
NIVissimVehTypeClass::dictionary
(
int
name) {
81
DictType::iterator i =
myDict
.find(name);
82
if
(i ==
myDict
.end()) {
83
return
0;
84
}
85
return
(*i).second;
86
}
87
88
89
void
90
NIVissimVehTypeClass::clearDict
() {
91
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
92
delete
(*i).second;
93
}
94
myDict
.clear();
95
}
96
97
98
99
/****************************************************************************/
100
NIVissimVehTypeClass::dictionary
static bool dictionary(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:54
RGBColor.h
windows_config.h
RGBColor
Definition:
RGBColor.h:47
debug_new.h
NIVissimVehTypeClass::myDict
static DictType myDict
Definition:
NIVissimVehTypeClass.h:63
config.h
NIVissimVehTypeClass::~NIVissimVehTypeClass
~NIVissimVehTypeClass()
Definition:
NIVissimVehTypeClass.cpp:50
NIVissimVehTypeClass::NIVissimVehTypeClass
NIVissimVehTypeClass(int id, const std::string &name, const RGBColor &color, std::vector< int > &types)
Definition:
NIVissimVehTypeClass.cpp:44
NIVissimVehTypeClass::clearDict
static void clearDict()
Definition:
NIVissimVehTypeClass.cpp:90
NIVissimVehTypeClass::DictType
std::map< int, NIVissimVehTypeClass * > DictType
Definition:
NIVissimVehTypeClass.h:62
VectorHelper.h
NIVissimVehTypeClass
Definition:
NIVissimVehTypeClass.h:45
NIVissimVehTypeClass.h
home
anton
import_LD
packages
sumo
mod18
sumo-0.23.0
src
netimport
vissim
tempstructs
NIVissimVehTypeClass.cpp
Generated on Mon May 4 2015 21:28:56 for SUMO - Simulation of Urban MObility by
1.8.8