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