Eclipse SUMO - Simulation of Urban MObility
VTypesHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2014-2024 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 /****************************************************************************/
18 // An XML-Handler for reading vTypes
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <string>
24 #include <utility>
26 
27 class EnergyParams;
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
39 public:
40  static const int INVALID_VALUE = -999999;
41 
42 public:
47  VTypesHandler(const std::string& file, std::map<std::string, SUMOVTypeParameter*>& vTypes);
48 
49 
52 
53  void closeVType();
55  UNUSED_PARAMETER(attrs);
56  }
58  void openRoute(const SUMOSAXAttributes& attrs) {
59  UNUSED_PARAMETER(attrs);
60  }
61  void openFlow(const SUMOSAXAttributes& attrs) {
62  UNUSED_PARAMETER(attrs);
63  }
64  void openRouteFlow(const SUMOSAXAttributes& attrs) {
65  UNUSED_PARAMETER(attrs);
66  }
67  void openTrip(const SUMOSAXAttributes& attrs) {
68  UNUSED_PARAMETER(attrs);
69  }
70  void closeRoute(const bool mayBeDisconnected = false) {
71  UNUSED_PARAMETER(mayBeDisconnected);
72  }
74  UNUSED_PARAMETER(attrs);
75  }
77  void closeVehicle() {}
78  void closePerson() {}
79  void closePersonFlow() {}
80  void closeContainer() {}
82  void closeFlow() {}
83  void closeTrip() {}
85  UNUSED_PARAMETER(attrs);
86  return nullptr;
87  }
88  void addPersonTrip(const SUMOSAXAttributes& attrs) {
89  UNUSED_PARAMETER(attrs);
90  }
91  void addWalk(const SUMOSAXAttributes& attrs) {
92  UNUSED_PARAMETER(attrs);
93  }
94  void addRide(const SUMOSAXAttributes& attrs) {
95  UNUSED_PARAMETER(attrs);
96  }
97  void addTransport(const SUMOSAXAttributes& attrs) {
98  UNUSED_PARAMETER(attrs);
99  }
100  void addTranship(const SUMOSAXAttributes& attrs) {
101  UNUSED_PARAMETER(attrs);
102  }
103 
104 protected:
105 
106 
107 private:
108  std::map<std::string, SUMOVTypeParameter*>& myVTypes;
109 
110 
111 private:
114 
117 
118 
119 };
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
An upper class for objects with additional parameters.
Definition: EnergyParams.h:43
Parser for routes during their loading.
Encapsulated SAX-Attributes.
Definition of vehicle stop (position and duration)
An XML-Handler for amitran and netstate trajectories.
Definition: VTypesHandler.h:38
void closeContainerFlow()
Ends the processing of a container flow.
Definition: VTypesHandler.h:81
void closeVehicle()
Ends the processing of a vehicle.
Definition: VTypesHandler.h:77
void closePerson()
Ends the processing of a person.
Definition: VTypesHandler.h:78
void closeFlow()
Ends the processing of a flow.
Definition: VTypesHandler.h:82
VTypesHandler(const VTypesHandler &s)
invalidated copy constructor
static const int INVALID_VALUE
Definition: VTypesHandler.h:40
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
Definition: VTypesHandler.h:57
VTypesHandler(const std::string &file, std::map< std::string, SUMOVTypeParameter * > &vTypes)
Constructor.
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
Definition: VTypesHandler.h:67
VTypesHandler & operator=(const VTypesHandler &s)
invalidated assignment operator
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
Definition: VTypesHandler.h:54
void closeTrip()
Ends the processing of a trip.
Definition: VTypesHandler.h:83
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
Definition: VTypesHandler.h:58
~VTypesHandler()
Destructor.
void closePersonFlow()
Ends the processing of a person flow.
Definition: VTypesHandler.h:79
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
void openFlow(const SUMOSAXAttributes &attrs)
opens a flow for reading
Definition: VTypesHandler.h:61
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
Definition: VTypesHandler.h:88
std::map< std::string, SUMOVTypeParameter * > & myVTypes
void closeVType()
Ends the processing of a vehicle type.
void closeRouteDistribution()
closes (ends) the building of a distribution
Definition: VTypesHandler.h:76
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
Definition: VTypesHandler.h:73
void closeContainer()
Ends the processing of a container.
Definition: VTypesHandler.h:80
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
Definition: VTypesHandler.h:97
void closeRoute(const bool mayBeDisconnected=false)
Definition: VTypesHandler.h:70
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
Definition: VTypesHandler.h:91
void openRouteFlow(const SUMOSAXAttributes &attrs)
opens a route flow for reading
Definition: VTypesHandler.h:64
SUMOVehicleParameter::Stop * addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
Definition: VTypesHandler.h:84
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
Definition: VTypesHandler.h:94