Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/marouter/ROMARouteHandler.h
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file ROMARouteHandler.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Michael Behrisch
18
/// @date Mon, 9 Jul 2001
19
///
20
// Parser and container for routes during their loading
21
/****************************************************************************/
22
#pragma once
23
#include <config.h>
24
25
#include <utils/xml/SUMOSAXHandler.h>
26
27
28
// ===========================================================================
29
// class declarations
30
// ===========================================================================
31
class ODMatrix;
32
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
37
/**
38
* @class ROMARouteHandler
39
* @brief Parser and container for routes during their loading
40
*
41
* ROMARouteHandler transforms vehicles, trips and flows into contributions
42
* to an ODMatrix.
43
*/
44
class ROMARouteHandler : public SUMOSAXHandler {
45
public:
46
/// standard constructor
47
ROMARouteHandler(ODMatrix& matrix);
48
49
/// standard destructor
50
virtual ~ROMARouteHandler();
51
52
protected:
53
/// @name inherited from GenericSAXHandler
54
//@{
55
56
/** @brief Called on the opening of a tag;
57
*
58
* @param[in] element ID of the currently opened element
59
* @param[in] attrs Attributes within the currently opened element
60
* @exception ProcessError If something fails
61
* @see GenericSAXHandler::myStartElement
62
*/
63
void myStartElement(int element, const SUMOSAXAttributes& attrs);
64
65
void myEndElement(int element);
66
//@}
67
68
private:
69
/// @brief The matrix to fill
70
ODMatrix& myMatrix;
71
72
/// @brief The keys for reading taz
73
std::vector<std::string> myTazParamKeys;
74
/// @brief The current vehicle parameters
75
SUMOVehicleParameter* myVehicleParameter;
76
77
/// @brief whether to ignore attributes fromTaz, toTaz
78
const bool myIgnoreTaz;
79
80
/// @brief scale for loading vehicles
81
double myScale;
82
83
/// @brief number of parsed vehicles
84
int myNumLoaded;
85
86
private:
87
/// @brief Invalidated copy constructor
88
ROMARouteHandler(const ROMARouteHandler& s);
89
90
/// @brief Invalidated assignment operator
91
ROMARouteHandler& operator=(const ROMARouteHandler& s);
92
93
};
94
95