/** 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 LDS_LOOPS, 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__
// Forward declared dependencies
// Included dependencies
#include "network.h"
#include
#include
#include
#include
#include "tinyxml.h"
class NetworkReader
{
public:
NetworkReader(const char * networkFile); // Constructor
~NetworkReader(); // Destructor
vector getLines(); // Getter for FEP_LINE list
vector getStations(); // Getter for LDS_LOOP list
private:
vector lines;
vector stations;
int ldsIndex;
void loadLines(const char * networkFileName);
LDS_LOOP parseStation(TiXmlElement *stationElem, FEP_LINE line);
FEP_LINE parseLine(TiXmlElement *lineElem);
bool DataAvail(char flag, int num); // Helper function for msgDataPack
unsigned char * msgDataPack(LDS_LOOP loop); // Packs the message sent to ATMS
};
#endif