Stride Reference Manual  1.0
CasesFile.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 <fstream>
23 #include <string>
24 #include <vector>
25 
26 namespace stride {
27 namespace output {
28 
32 class CasesFile {
33 public:
35  CasesFile(const std::string& file = "stride_cases");
36 
38  ~CasesFile();
39 
41  void print(const std::vector<unsigned int>& cases);
42 
43 private:
45  void initialize(const std::string& file);
46 
47 private:
48  std::ofstream m_fstream;
49 };
50 
51 }
52 }
53 
CasesFile(const std::string &file="stride_cases")
Constructor: initialize.
Definition: CasesFile.cpp:30
Produces a file with daily cases count.
Definition: CasesFile.h:32
std::ofstream m_fstream
The file stream.
Definition: CasesFile.h:48
Time Dependent Person DataType.
Definition: NoBehaviour.h:17
void initialize(const std::string &file)
Generate file name and open the file stream.
Definition: CasesFile.cpp:38
void print(const std::vector< unsigned int > &cases)
Print the given cases with corresponding tag.
Definition: CasesFile.cpp:42
~CasesFile()
Destructor: close the file stream.
Definition: CasesFile.cpp:34