Stride Reference Manual  - generated for commit 9643b11
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InfectedViewer.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 2018, Kuylen E, Willem L, Broeckhove J
15  */
16 
22 #include "sim/event/Id.h"
23 
24 #include <memory>
25 #include <vector>
26 
27 namespace stride {
28 
29 class SimRunner;
30 
31 namespace viewers {
32 
35 {
36 public:
38  explicit InfectedViewer(std::shared_ptr<SimRunner> runner) : m_infected(), m_runner(std::move(runner)) {}
39 
40  std::vector<unsigned int> GetInfectionCounts() { return m_infected; }
41 
43  void Update(sim_event::Id id);
44 
45 private:
46  std::vector<unsigned int> m_infected;
47  std::shared_ptr<SimRunner> m_runner;
48 };
49 
50 } // namespace viewers
51 } // namespace stride
void Update(sim_event::Id id)
Let viewer perform update.
Id
Enumerates the event.
Definition: Id.h:30
std::shared_ptr< SimRunner > m_runner
STL namespace.
std::vector< unsigned int > m_infected
Viewer gathers infection count at each sim step.
std::vector< unsigned int > GetInfectionCounts()
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
InfectedViewer(std::shared_ptr< SimRunner > runner)
Instantiate cases viewer.
Definition of EventId.