Warning: Can't use blame annotator:
svn blame failed on branches/fep_rpc_client/NetworkReader.h: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/branches/fep_rpc_client/NetworkReader.h @ 79

Revision 79, 2.1 KB checked in by jtorres, 9 years ago (diff)

new atmsdriver package in trunk. fep_rpc_client dynamic data packing added in branches. fep_rpc_client refactored data packing code into static DataPacker? class. Added vds_data folder into config/. Added new project configuration for ATMSDriver.

RevLine 
1/**
2 * File: NetworkReader.h
3 *
4 * A NetworkReader reads in data about the traffic network from a specified
5 * xml file.
6 *
7 * A NetworkReader contains two public methods 'getLines' and 'getLoops',
8 * which are getters for the list of FEP_LINES, and LDS_LOOPS, respectively.
9 *
10 * Example XML file:
11 * <code>
12 * <Network>
13 * <Line>
14 *   <Line_Num>5</Line_Num>
15 *   <Count>20</Count>
16 *   <Schedule>1</Schedule>
17 *   <Line_Info>1</Line_Info>
18 *   <System_Key>1123005673</System_Key>
19 *   <Global_Seq>1357648</Global_Seq>
20 *   <Schedule_Seq>26492</Schedule_Seq>
21 *   <Stations>
22 *     <Station>
23 *       <LDS_ID>1205270</LDS_ID>
24 *       <Line_Num>5</Line_Num>
25 *       <Drop>19</Drop>
26 *       <Location>MAIN 1</Location>
27 *       <Post_Mile>33.0</Post_Mile>
28 *       <Direction>S</Direction>
29 *       <Freeway>5</Freeway>
30 *       <ML_Tot_Vol>0</ML_Tot_Vol>
31 *       <Opp_Tot_Vol>0</Opp_Tot_Vol>
32 *       <Loops>
33 *         <Loop>
34 *           <Loop_ID>1205272</Loop_ID>
35 *           <Loop_Location>RAMP_ON</Loop_Location>
36 *           <Lane_Num>1</Lane_Num>
37 *           <Vol>0</Vol>
38 *           <Occ>0</Occ>
39 *           <Spd>0</Spd>
40 *         </Loop>
41 *          .......
42 * </code>
43 *
44 * @author John A. Torres
45 * @verions 9/08/2017
46 */
47
48// Include guard
49#ifndef __NETWORKREADER_H_INCLUDED__
50#define __NETWORKREADER_H_INCLUDED__
51
52// Included dependencies
53#include "network.h"
54#include <vector>
55#include <string.h>
56#include <iostream>
57#include "tinyxml.h"
58#include "DataPacker.h"
59
60class NetworkReader
61{
62    public:
63        NetworkReader(const char * networkFile); // Constructor
64        ~NetworkReader(); // Destructor
65       
66        vector<FEP_LINE*> getLines(); // Getter for FEP_LINE list
67        vector<LDS_LOOP*> getStations(); // Getter for LDS_LOOP list
68    private:
69        vector<FEP_LINE*> lines;
70        vector<LDS_LOOP*> stations;
71        int ldsIndex;
72
73        void loadLines(const char * networkFileName);
74        LOOP * parseLoop(TiXmlElement * loopElem);
75        LDS_LOOP * parseStation(TiXmlElement *stationElem, FEP_LINE *line);
76        FEP_LINE * parseLine(TiXmlElement *lineElem);
77};
78
79#endif
Note: See TracBrowser for help on using the repository browser.