29 #include <xercesc/sax2/Attributes.hpp>
30 #include <xercesc/sax2/DefaultHandler.hpp>
34 #define ENGINE_TAG_VEHICLES "vehicles"
35 #define ENGINE_TAG_VEHICLE "vehicle"
36 #define ENGINE_TAG_VEHICLE_ID "id"
37 #define ENGINE_TAG_VEHICLE_DESCRIPTION "description"
38 #define ENGINE_TAG_GEARS "gears"
39 #define ENGINE_TAG_GEAR "gear"
40 #define ENGINE_TAG_GEAR_N "n"
41 #define ENGINE_TAG_GEAR_RATIO "ratio"
42 #define ENGINE_TAG_GEAR_DIFFERENTIAL "differential"
43 #define ENGINE_TAG_MASS "mass"
44 #define ENGINE_TAG_MASS_MASS "mass"
45 #define ENGINE_TAG_MASS_FACTOR "massFactor"
46 #define ENGINE_TAG_WHEELS "wheels"
47 #define ENGINE_TAG_WHEELS_DIAMETER "diameter"
48 #define ENGINE_TAG_WHEELS_FRICTION "friction"
49 #define ENGINE_TAG_WHEELS_CR1 "cr1"
50 #define ENGINE_TAG_WHEELS_CR2 "cr2"
51 #define ENGINE_TAG_DRAG "drag"
52 #define ENGINE_TAG_DRAG_CAIR "cAir"
53 #define ENGINE_TAG_DRAG_SECTION "section"
54 #define ENGINE_TAG_ENGINE "engine"
55 #define ENGINE_TAG_ENGINE_TYPE "type"
56 #define ENGINE_TAG_ENGINE_EFFICIENCY "efficiency"
57 #define ENGINE_TAG_ENGINE_CYLINDERS "cylinders"
58 #define ENGINE_TAG_ENGINE_MINRPM "minRpm"
59 #define ENGINE_TAG_ENGINE_MAXRPM "maxRpm"
60 #define ENGINE_TAG_ENGINE_TAU_EX "tauEx"
61 #define ENGINE_TAG_ENGINE_TAU_BURN "tauBurn"
62 #define ENGINE_TAG_ENGINE_POWER "power"
63 #define ENGINE_TAG_ENGINE_POWER_RPM "rpm"
64 #define ENGINE_TAG_ENGINE_POWER_HP "hp"
65 #define ENGINE_TAG_ENGINE_POWER_KW "kw"
66 #define ENGINE_TAG_ENGINE_POWER_SLOPE "slope"
67 #define ENGINE_TAG_ENGINE_POWER_INTERCEPT "intercept"
68 #define ENGINE_TAG_SHIFTING "shifting"
69 #define ENGINE_TAG_SHIFTING_RPM "rpm"
70 #define ENGINE_TAG_SHIFTING_DELTARPM "deltaRpm"
71 #define ENGINE_TAG_BRAKES "brakes"
72 #define ENGINE_TAG_BRAKES_TAU "tau"
74 #define TAG_VEHICLES 0
100 void startElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
101 const XMLCh*
const qname,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
103 void endElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
104 const XMLCh*
const qname);
116 void loadMassData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
122 void loadDragData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
127 void loadWheelsData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
131 void loadEngineData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
135 void loadGearData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
152 void loadBrakesData(
const XERCES_CPP_NAMESPACE::Attributes& attrs);
159 int existsAttribute(std::string tag,
const char* attribute,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
164 std::string
parseStringAttribute(std::string tag,
const char* attribute,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
170 int parseIntAttribute(std::string tag,
const char* attribute,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
176 double parseDoubleAttribute(std::string tag,
const char* attribute,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
const EngineParameters & getEngineParameters()
std::string parseStringAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
virtual ~VehicleEngineHandler()
Destructor.
std::vector< double > gearRatios
void loadEngineModelData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
EngineParameters engineParameters
void loadDifferentialData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadGearData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
VehicleEngineHandler(const std::string &toLoad)
double parsePolynomialCoefficient(int index, const XERCES_CPP_NAMESPACE::Attributes &attrs)
int parseIntAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadShiftingData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadWheelsData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadMassData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
int existsAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
void loadEngineData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
void loadBrakesData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
void raiseUnknownTagError(std::string tag)
double parseDoubleAttribute(std::string tag, const char *attribute, const XERCES_CPP_NAMESPACE::Attributes &attrs)
const VehicleEngineHandler & operator=(const VehicleEngineHandler &s)
invalidated assignment operator
void raiseMissingAttributeError(std::string tag, std::string attribute)
std::string vehicleToLoad
void loadDragData(const XERCES_CPP_NAMESPACE::Attributes &attrs)
VehicleEngineHandler(const VehicleEngineHandler &s)
invalidated copy constructor