Stride Reference Manual  - generated for commit 9643b11
GeoGridProtoReader.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 "GeoGridReader.h"
19 #include "contact/ContactPool.h"
20 #include "contact/ContactType.h"
21 #include "geopop/Location.h"
22 
23 #include <memory>
24 #include <set>
25 
26 namespace proto {
27 class GeoGrid_Location;
31 class GeoGrid_Person;
32 } // namespace proto
33 
34 namespace geopop {
35 
41 {
42 public:
44  GeoGridProtoReader(std::unique_ptr<std::istream> inputStream, stride::Population* pop);
45 
47  GeoGridProtoReader(const GeoGridProtoReader&) = delete;
48 
50  GeoGridProtoReader operator=(const GeoGridProtoReader&) = delete;
51 
53  void Read() override;
54 
55 private:
57  void ParseContactPools(std::shared_ptr<Location> loc,
58  const proto::GeoGrid_Location_ContactPools& protoContactPools);
59 
61  void ParseContactPool(std::shared_ptr<Location> loc,
64 
66  Coordinate ParseCoordinate(const proto::GeoGrid_Location_Coordinate& protoCoordinate);
67 
69  std::shared_ptr<Location> ParseLocation(const proto::GeoGrid_Location& protoLocation);
70 
72  stride::Person* ParsePerson(const proto::GeoGrid_Person& person);
73 };
74 
75 } // namespace geopop
Id
Enumerates the ContactPool types.
Definition: ContactType.h:34
Header for the core ContactPool class.
An implementation of the GeoGridReader using Protocol Buffers.
Key Data structure: container for (a) all individuals in the population (b) the ContactPoolSys wchich...
Definition: Population.h:47
Definition of ContactPool Id Type.
Namespace for the geographic and demograhic classes.
Definition: Coordinate.h:21
An abstract base class for creating a GeoGrid that was read from a file, can be implemented using mul...
Definition: GeoGridReader.h:37
boost::geometry::model::point< double, 2, boost::geometry::cs::geographic< boost::geometry::degree >> Coordinate
Definition: Coordinate.h:23
Store and handle person data.
Definition: Person.h:34