EPANET  3.0
EPANET Development Project
reportwriter.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 REPORTWRITER_H_
12 #define REPORTWRITER_H_
13 
14 #include <string>
15 #include <fstream>
16 #include <iostream>
17 #include <cstdio>
18 
19 class Network;
20 class Node;
21 class Link;
22 class OutputFile;
23 
25 {
26  public:
27  ReportWriter(std::ofstream& ofs, Network* nw);
28  ~ReportWriter();
29 
30  void writeHeading();
31  void writeSummary(std::string inpFileName);
32  void writeResults(int t);
33  int writeReport(std::string inpFileName, OutputFile* outFile);
34 
35  private:
36  std::ofstream& sout;
37  Network* network;
38 
39  void writeEnergyResults(OutputFile* outFile);
40  void writeEnergyHeader();
41  void writePumpResults(Link* link, float* x);
42  void writeSavedResults(OutputFile* outFile);
43  void writeLinkHeader();
44  void writeLinkResults(Link* link, float* x);
45  void writeNodeHeader();
46  void writeNodeResults(Node* node, float* x);
47  void writeNumber(float x, int width, int precis);
48 };
49 
50 #endif
A connection point between links in a network.
Definition: node.h:30
Definition: reportwriter.h:24
Manages the writing and reading of analysis results to a binary file.
Definition: outputfile.h:30
Contains the data elements that describe a pipe network.
Definition: network.h:41