EPANET  3.0
EPANET Development Project
inputparser.h
Go to the documentation of this file.
1 /* EPANET 3
2  *
3  * Copyright (c) 2016 Open Water Analytics
4  * Licensed under the terms of the MIT License (see the LICENSE file for details).
5  *
6  */
7 
10 
11 #ifndef INPUTPARSER_H_
12 #define INPUTPARSER_H_
13 
14 #include "Input/nodeparser.h"
15 #include "Input/linkparser.h"
16 #include "Input/patternparser.h"
17 #include "Input/curveparser.h"
18 #include "Input/optionparser.h"
19 #include "Input/controlparser.h"
20 
21 #include <string>
22 #include <vector>
23 
24 class Network;
25 
34 
36 {
37  public:
38  InputParser(Network* nw);
39  virtual ~InputParser();
40  virtual void parseLine(std::string& line, int section) = 0;
41  Network* network;
42 };
43 
50 
51 class ObjectParser : public InputParser
52 {
53  public:
54  ObjectParser(Network* nw);
55  void parseLine(std::string& line, int section);
56 };
57 
60 
62 {
63  public:
65  void parseLine(std::string& line, int section);
66 
67  private:
68  NodeParser nodeParser;
69  LinkParser linkParser;
70  PatternParser patternParser;
71  CurveParser curveParser;
72  OptionParser optionParser;
73  ControlParser controlParser;
74  std::vector<std::string> tokens;
75 
76  void parseNodeProperty(int type, std::string& nodeName);
77  void parseLinkProperty(int type, std::string& linkName);
78  void parseReactProperty(std::string& reactType);
79 };
80 
81 #endif
Definition: patternparser.h:20
Description of the OptionParser class.
Description of the PatternParser class.
The CurveParser class is used to parse a line of input data for curve data (pairs of x...
Definition: curveparser.h:23
Describes the NodeParser class.
Parses a network element&#39;s properties from a line of input.
Definition: inputparser.h:61
The NodeParser class is used to parse lines of input data for network nodes read from a text file...
Definition: nodeparser.h:25
Parses a new network element from a line of input.
Definition: inputparser.h:51
Parses a control statement from a line of text.
Definition: controlparser.h:27
Parses lines of network input data from a text file.
Definition: inputparser.h:35
Parses lines of project option data from a text file.
Definition: optionparser.h:22
Describes the CurveParser class.
Description of the NodeParser class.
Contains the data elements that describe a pipe network.
Definition: network.h:41
Describes the ControlParser class.