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
SAXWeightsHandler.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// An XML-handler for network weights
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef SAXWeightsHandler_h
23
#define SAXWeightsHandler_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <string>
36
#include <
utils/xml/SUMOSAXHandler.h
>
37
#include <
utils/common/SUMOTime.h
>
38
39
40
// ===========================================================================
41
// class declarations
42
// ===========================================================================
43
class
OptionsCont
;
44
class
RONet
;
45
class
ROEdge
;
46
47
48
// ===========================================================================
49
// class definitions
50
// ===========================================================================
76
class
SAXWeightsHandler
:
public
SUMOSAXHandler
{
77
public
:
82
class
EdgeFloatTimeLineRetriever
{
83
public
:
85
EdgeFloatTimeLineRetriever
() { }
86
88
virtual
~EdgeFloatTimeLineRetriever
() { }
89
97
virtual
void
addEdgeWeight
(
const
std::string&
id
,
98
SUMOReal
val,
SUMOReal
beg,
SUMOReal
end)
const
= 0;
99
100
private
:
101
EdgeFloatTimeLineRetriever
&
operator=
(
const
EdgeFloatTimeLineRetriever
&);
// just to avoid a compiler warning
102
};
103
108
class
ToRetrieveDefinition
{
109
public
:
111
ToRetrieveDefinition
(
const
std::string& attributeName,
bool
edgeBased,
112
EdgeFloatTimeLineRetriever
& destination);
113
115
~ToRetrieveDefinition
();
116
117
public
:
119
std::string
myAttributeName
;
120
122
bool
myAmEdgeBased
;
123
125
EdgeFloatTimeLineRetriever
&
myDestination
;
126
128
SUMOReal
myAggValue
;
129
131
size_t
myNoLanes
;
132
134
bool
myHadAttribute
;
135
136
private
:
138
ToRetrieveDefinition
(
const
ToRetrieveDefinition
&);
139
141
ToRetrieveDefinition
&
operator=
(
const
ToRetrieveDefinition
&);
142
143
};
144
151
SAXWeightsHandler
(
const
std::vector<ToRetrieveDefinition*>& defs,
152
const
std::string& file);
153
154
160
SAXWeightsHandler
(
ToRetrieveDefinition
* def,
161
const
std::string& file);
162
163
165
~SAXWeightsHandler
();
166
167
168
protected
:
170
171
179
void
myStartElement
(
int
element,
180
const
SUMOSAXAttributes
& attrs);
181
182
189
void
myEndElement
(
int
elemente);
191
192
193
private
:
195
void
tryParse
(
const
SUMOSAXAttributes
& attrs,
bool
isEdge);
196
197
198
private
:
200
std::vector<ToRetrieveDefinition*>
myDefinitions
;
201
203
SUMOReal
myCurrentTimeBeg
;
204
206
SUMOReal
myCurrentTimeEnd
;
207
209
std::string
myCurrentEdgeID
;
210
211
212
private
:
214
SAXWeightsHandler
(
const
SAXWeightsHandler
& src);
215
217
SAXWeightsHandler
&
operator=
(
const
SAXWeightsHandler
& src);
218
219
};
220
221
222
#endif
223
224
/****************************************************************************/
225
build
buildd
sumo-0.18~dfsg
src
utils
xml
SAXWeightsHandler.h
Generated on Wed Oct 23 2013 01:15:12 for SUMO - Simulation of Urban MObility by
1.8.4