SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
NIVissimSource.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-2016 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 <string>
33
#include <map>
34
#include "
NIVissimSource.h
"
35
36
#ifdef CHECK_MEMORY_LEAKS
37
#include <
foreign/nvwa/debug_new.h
>
38
#endif // CHECK_MEMORY_LEAKS
39
40
NIVissimSource::DictType
NIVissimSource::myDict
;
41
42
NIVissimSource::NIVissimSource
(
const
std::string&
id
,
const
std::string& name,
43
const
std::string& edgeid)
44
: myID(id), myName(name), myEdgeID(edgeid) {}
45
46
47
NIVissimSource::~NIVissimSource
() {}
48
49
50
bool
51
NIVissimSource::dictionary
(
const
std::string&
id
,
const
std::string& name,
52
const
std::string& edgeid) {
53
NIVissimSource
* o =
new
NIVissimSource
(
id
, name, edgeid);
54
if
(!
dictionary
(
id
, o)) {
55
delete
o;
56
return
false
;
57
}
58
return
true
;
59
}
60
61
62
bool
63
NIVissimSource::dictionary
(
const
std::string&
id
,
NIVissimSource
* 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
NIVissimSource
*
74
NIVissimSource::dictionary
(
const
std::string&
id
) {
75
DictType::iterator i =
myDict
.find(
id
);
76
if
(i ==
myDict
.end()) {
77
return
0;
78
}
79
return
(*i).second;
80
}
81
82
83
void
84
NIVissimSource::clearDict
() {
85
for
(DictType::iterator i =
myDict
.begin(); i !=
myDict
.end(); i++) {
86
delete
(*i).second;
87
}
88
myDict
.clear();
89
}
90
91
92
93
/****************************************************************************/
94
NIVissimSource::~NIVissimSource
~NIVissimSource()
Definition:
NIVissimSource.cpp:47
windows_config.h
debug_new.h
NIVissimSource::clearDict
static void clearDict()
Definition:
NIVissimSource.cpp:84
config.h
NIVissimSource::myDict
static DictType myDict
Definition:
NIVissimSource.h:60
NIVissimSource.h
NIVissimSource::NIVissimSource
NIVissimSource(const std::string &id, const std::string &name, const std::string &edgeid)
Definition:
NIVissimSource.cpp:42
NIVissimSource
Definition:
NIVissimSource.h:43
NIVissimSource::DictType
std::map< std::string, NIVissimSource * > DictType
Definition:
NIVissimSource.h:59
NIVissimSource::dictionary
static bool dictionary(const std::string &id, const std::string &name, const std::string &edgeid)
Definition:
NIVissimSource.cpp:51
src
netimport
vissim
tempstructs
NIVissimSource.cpp
Generated on Sun Mar 19 2017 15:07:41 for SUMO - Simulation of Urban MObility by
1.8.8