source: tmcsimulator/branches/ATMSCommunicator/NetworkReader.h @ 76

Revision 76, 1.1 KB checked in by jtorres, 9 years ago (diff)

In network.java, LoopDetectorStation?.java and LoopDetector?.java, added network writing capabilities. The network can now be written to a specified xml file to be read by the cpp ATMS RPC program. The network reader is finished and reads in all static network data correctly

Line 
1// Include guard
2#ifndef __NETWORKREADER_H_INCLUDED__
3#define __NETWORKREADER_H_INCLUDED__
4
5// Forward declared dependencies
6
7// Included dependencies
8#include "network.h"
9#include <string>
10#include <string.h>
11
12/* A NetworkReader reads in traffic network data from an input file.
13 *
14 * A NetworkReader contains two public methods 'getLines' and 'getLoops',
15 * which are getters for the list of FEP_LINES, and LDS_LOOPS, respectively.
16 *
17 * Example of network input file:
18 * < INSERT EXAMPLE HERE >
19 *
20 * Author: John A Torres
21 * Version: 9/8/2017
22 */
23class NetworkReader
24{
25    public:
26        // Constructor:
27        //    networkFile: name of network input file
28        NetworkReader(string networkFile);
29        // Destructor
30        ~NetworkReader(); // Destructor
31
32        vector<FEP_LINE> getLines(); // Getter for FEP_LINE list
33        vector<LDS_LOOP> getLoops(); // Getter for LDS_LOOP list
34    private:
35        string networkFile; // File containing Line and Loop data
36
37        bool DataAvail(char flag, int num); // Helper function for msgDataPack
38        unsigned char * msgDataPack(LDS_LOOP loop); // Packs the message sent to ATMS
39};
40
41#endif
Note: See TracBrowser for help on using the repository browser.