Stride Reference Manual  - generated for commit 9643b11
LocationsReader.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 2018, Jan Broeckhove and Bistromatics group.
14  */
15 
16 #pragma once
17 
18 #include "geopop/GeoGrid.h"
19 #include "geopop/Location.h"
20 
21 #include <map>
22 #include <memory>
23 #include <string>
24 
25 namespace geopop {
26 
32 {
33 public:
35  explicit LocationsReader(std::unique_ptr<std::istream> inputStream) : m_inputStream(std::move(inputStream)) {}
36 
38  virtual ~LocationsReader() = default;
39 
41  virtual void FillGeoGrid(GeoGrid&) const = 0;
42 
43 protected:
44  std::unique_ptr<std::istream> m_inputStream;
45 };
46 
47 } // namespace geopop
Create an abstract Reader which fills a GeoGrid with the cities found in file.
virtual void FillGeoGrid(GeoGrid &) const =0
Add the locations to the GeoGrid.
LocationsReader(std::unique_ptr< std::istream > inputStream)
Construct the CitiesReader with an istream containing the file content.
STL namespace.
A Geographic grid of simulation region contains Locations that in turn contain an index to the Contac...
Definition: GeoGrid.h:41
Namespace for the geographic and demograhic classes.
Definition: Coordinate.h:21
std::unique_ptr< std::istream > m_inputStream
The istream with the file content.
virtual ~LocationsReader()=default
Default destructor.