Eclipse SUMO - Simulation of Urban MObility
VehicleEngineHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-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 /****************************************************************************/
19 #pragma once
20 #include <config.h>
21 
22 #include <string>
24 #include "EngineParameters.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 public:
40  VehicleEngineHandler(const std::string& toLoad);
41 
43  virtual ~VehicleEngineHandler();
44 
46  return engineParameters;
47  }
48 
49 protected:
51 
52 
63  void myStartElement(int element, const SUMOSAXAttributes& attrs);
64 
71  void myEndElement(int element);
73 
78  void loadEngineModelData(const XERCES_CPP_NAMESPACE::Attributes& attrs);
79 
80 private:
81  //vehicle type to load
82  std::string vehicleToLoad;
83  //skip loading of current vehicle data
84  bool skip;
85  //current loaded gear
87  //where to store loaded data
89  //vector of gear ratios
90  std::vector<double> gearRatios;
91 
97  enum EngineXMLTag {
111  };
112 
113 
147  };
148 
151 
154 
155 
156 private:
159 
162 
163 };
A handler which converts occurring elements and attributes into enums.
Encapsulated SAX-Attributes.
EngineXMLAttr
Numbers representing engine-XML - attributes.
const EngineParameters & getEngineParameters()
virtual ~VehicleEngineHandler()
Destructor.
std::vector< double > gearRatios
void loadEngineModelData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
EngineParameters engineParameters
VehicleEngineHandler(const std::string &toLoad)
void myEndElement(int element)
Called when a closing tag occurs.
EngineXMLTag
Numbers representing engine-XML - element names.
static SequentialStringBijection::Entry engineAttrs[]
The names of engine-XML attributes (for passing to GenericSAXHandler)
static SequentialStringBijection::Entry engineTags[]
The names of engine-XML elements (for passing to GenericSAXHandler)
const VehicleEngineHandler & operator=(const VehicleEngineHandler &s)
invalidated assignment operator
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
VehicleEngineHandler(const VehicleEngineHandler &s)
invalidated copy constructor