/** * File: NetworkReader.h * * A NetworkReader reads in data about the traffic network from a specified * xml file. * * A NetworkReader contains two public methods 'getLines' and 'getLoops', * which are getters for the list of FEP_LINES, and STATIONS, respectively. * * Example XML file: * * * * 5 * 20 * 1 * 1 * 1123005673 * 1357648 * 26492 * * * 1205270 * 5 * 19 * MAIN 1 * 33.0 * S * 5 * 0 * 0 * * * 1205272 * RAMP_ON * 1 * 0 * 0 * 0 * * ....... * * * @author John A. Torres * @verions 9/08/2017 */ // Include guard #ifndef __NETWORKREADER_H_INCLUDED__ #define __NETWORKREADER_H_INCLUDED__ // Included dependencies #include "network.h" #include #include #include #include "tinyxml.h" #include "DataPacker.h" class NetworkReader { public: NetworkReader(const char * networkFile); // Constructor ~NetworkReader(); // Destructor vector getLines(); // Getter for FEP_LINE list vector getStations(); // Getter for STATION list private: vector lines; vector stations; int ldsIndex; void loadLines(const char * networkFileName); LOOP * parseLoop(TiXmlElement * loopElem); STATION * parseStation(TiXmlElement *stationElem, FEP_LINE *line); FEP_LINE * parseLine(TiXmlElement *lineElem); }; #endif