Stride Reference Manual  - generated for commit 9643b11
geopop::GeoGridReader Class Referenceabstract

An abstract base class for creating a GeoGrid that was read from a file, can be implemented using multiple file types (proto and json are currently implemented) More...

#include <GeoGridReader.h>

Inheritance diagram for geopop::GeoGridReader:
Inheritance graph
Collaboration diagram for geopop::GeoGridReader:
Collaboration graph

Public Member Functions

 GeoGridReader (std::unique_ptr< std::istream > inputStream, stride::Population *pop)
 Parametrized constructor. More...
 
 GeoGridReader (const GeoGridReader &)=delete
 No copy constructor. More...
 
GeoGridReaderoperator= (const GeoGridReader &)=delete
 No copy assignment. More...
 
virtual ~GeoGridReader ()=default
 Default destructor. More...
 
virtual void Read ()=0
 Perform the actual read and return the created GeoGrid. More...
 

Protected Member Functions

void AddCommutes (GeoGrid &geoGrid)
 Add the commutes that were found to their respective Locations symmetrically. More...
 

Protected Attributes

std::map< unsigned int, stride::Person * > m_people
 < Store the persons (id->person) that were found while loping over the ContactPools. More...
 
std::vector< std::tuple< unsigned int, unsigned int, double > > m_commutes
 
std::unique_ptr< std::istream > m_inputStream
 File to read. More...
 
stride::Populationm_population
 Population to use in the GeoGrid may be nullptr. More...
 

Detailed Description

An abstract base class for creating a GeoGrid that was read from a file, can be implemented using multiple file types (proto and json are currently implemented)

Definition at line 37 of file GeoGridReader.h.

Constructor & Destructor Documentation

geopop::GeoGridReader::GeoGridReader ( std::unique_ptr< std::istream >  inputStream,
stride::Population pop 
)

Parametrized constructor.

Definition at line 23 of file GeoGridReader.cpp.

geopop::GeoGridReader::GeoGridReader ( const GeoGridReader )
delete

No copy constructor.

virtual geopop::GeoGridReader::~GeoGridReader ( )
virtualdefault

Default destructor.

Member Function Documentation

GeoGridReader& geopop::GeoGridReader::operator= ( const GeoGridReader )
delete

No copy assignment.

virtual void geopop::GeoGridReader::Read ( )
pure virtual

Perform the actual read and return the created GeoGrid.

Implemented in geopop::GeoGridProtoReader, and geopop::GeoGridJSONReader.

void geopop::GeoGridReader::AddCommutes ( GeoGrid geoGrid)
protected

Add the commutes that were found to their respective Locations symmetrically.

Definition at line 27 of file GeoGridReader.cpp.

References geopop::GeoGrid::GetById(), and m_commutes.

Referenced by geopop::GeoGridJSONReader::Read(), and geopop::GeoGridProtoReader::Read().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::map<unsigned int, stride::Person*> geopop::GeoGridReader::m_people
protected

< Store the persons (id->person) that were found while loping over the ContactPools.

Commutes from, to, number.

Definition at line 61 of file GeoGridReader.h.

Referenced by geopop::GeoGridJSONReader::ParseContactPool(), geopop::GeoGridProtoReader::ParseContactPool(), geopop::GeoGridJSONReader::Read(), and geopop::GeoGridProtoReader::Read().

std::vector<std::tuple<unsigned int, unsigned int, double> > geopop::GeoGridReader::m_commutes
protected
std::unique_ptr<std::istream> geopop::GeoGridReader::m_inputStream
protected

File to read.

Definition at line 66 of file GeoGridReader.h.

Referenced by geopop::GeoGridJSONReader::Read(), and geopop::GeoGridProtoReader::Read().


The documentation for this class was generated from the following files: