SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RORouteHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Parser and container for routes during their loading
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 RORouteHandler_h
23 #define RORouteHandler_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 <vector>
38 #include <utils/common/SUMOTime.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
46 class ROEdge;
47 class RONet;
48 class RORoute;
49 class RORouteDef;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
64 public:
66  RORouteHandler(RONet& net, const std::string& file,
67  const bool tryRepair,
68  const bool emptyDestinationsAllowed,
69  const bool ignoreErrors);
70 
72  virtual ~RORouteHandler();
73 
74 protected:
76 
77 
85  virtual void myStartElement(int element,
86  const SUMOSAXAttributes& attrs);
87 
88 
95  virtual void myEndElement(int element);
97 
98 
105  void parseFromTo(std::string element,
106  const SUMOSAXAttributes& attrs);
107 
108 
111 
114 
116  void openRoute(const SUMOSAXAttributes& attrs);
117 
123  void closeRoute(const bool mayBeDisconnected = false);
124 
126  void openRouteDistribution(const SUMOSAXAttributes& attrs);
127 
129  void closeRouteDistribution();
130 
132  void closeVehicle();
133 
135  void closePerson();
136 
138  void closeFlow();
139 
141  void addStop(const SUMOSAXAttributes& attrs);
142 
144  void parseEdges(const std::string& desc, std::vector<const ROEdge*>& into,
145  const std::string& rid);
146 
147 protected:
150 
152  std::vector<const ROEdge*> myActiveRoute;
153 
156 
158  const bool myTryRepair;
159 
162 
165 
168 
171 
174 
177 
178 private:
180  RORouteHandler(const RORouteHandler& s);
181 
184 
185 };
186 
187 
188 #endif
189 
190 /****************************************************************************/
191 
RORouteDef * myCurrentAlternatives
The currently parsed route alternatives.
const bool myEmptyDestinationsAllowed
Information whether the &quot;to&quot; attribute is mandatory.
void closeVehicleTypeDistribution()
SUMOReal myCurrentCosts
The currently parsed route costs.
std::vector< const ROEdge * > myActiveRoute
The current route.
void closePerson()
Ends the processing of a person.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
MsgHandler *const myErrorOutput
Depending on the &quot;ignore-errors&quot; option different outputs are used.
virtual void myEndElement(int element)
Called when a closing tag occurs.
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
void closeVehicle()
Ends the processing of a vehicle.
RandomDistributor< SUMOVTypeParameter * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability-&gt;vehicle type)
RORouteHandler(RONet &net, const std::string &file, const bool tryRepair, const bool emptyDestinationsAllowed, const bool ignoreErrors)
standard constructor
RONet & myNet
The current route.
Encapsulated SAX-Attributes.
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
RORouteHandler & operator=(const RORouteHandler &s)
Invalidated assignment operator.
A basic edge for routing applications.
Definition: ROEdge.h:67
void parseEdges(const std::string &desc, std::vector< const ROEdge * > &into, const std::string &rid)
Parse edges from strings.
Parser for routes during their loading.
The router&#39;s network representation.
Definition: RONet.h:65
void openRoute(const SUMOSAXAttributes &attrs)
void parseFromTo(std::string element, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
const bool myTryRepair
Information whether routes shall be repaired.
Parser and container for routes during their loading.
Base class for a vehicle&#39;s route definition.
Definition: RORouteDef.h:63
void closeRoute(const bool mayBeDisconnected=false)
OutputDevice_String * myActivePlan
The plan of the current person.
virtual ~RORouteHandler()
standard destructor
#define SUMOReal
Definition: config.h:221
void closeFlow()
Ends the processing of a flow.
A complete router&#39;s route.
Definition: RORoute.h:58
An output device that encapsulates an ofstream.
void closeRouteDistribution()
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.