Stride Reference Manual  - generated for commit 9643b11
PersonsFile.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2017, Kuylen E, Willem L, Broeckhove J
14  */
15 
21 #pragma once
22 
23 #include <fstream>
24 #include <memory>
25 #include <string>
26 
27 namespace stride {
28 
29 class Population;
30 
31 namespace output {
32 
37 {
38 public:
40  explicit PersonsFile(const std::string& output_dir = "output");
41 
43  ~PersonsFile();
44 
46  void Print(std::shared_ptr<const Population> population);
47 
48 private:
50  void Initialize(const std::string& output_dir);
51 
52 private:
53  std::ofstream m_fstream;
54 };
55 
56 } // namespace output
57 } // namespace stride
void Initialize(const std::string &output_dir)
Generate file name and open the file stream.
Definition: PersonsFile.cpp:36
void Print(std::shared_ptr< const Population > population)
Print the given cases with corresponding tag.
Definition: PersonsFile.cpp:45
Produces a file with daily cases count.
Definition: PersonsFile.h:36
PersonsFile(const std::string &output_dir="output")
Constructor: initialize.
Definition: PersonsFile.cpp:32
~PersonsFile()
Destructor: close the file stream.
Definition: PersonsFile.cpp:34
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28