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

An implementation of the GeoGridReader using JSON. More...

#include <GeoGridJSONReader.h>

Inheritance diagram for geopop::GeoGridJSONReader:
Inheritance graph
Collaboration diagram for geopop::GeoGridJSONReader:
Collaboration graph

Public Member Functions

 GeoGridJSONReader (std::unique_ptr< std::istream > inputStream, stride::Population *pop)
 Construct the GeoGridJSONReader with the istream which contains the JSON. More...
 
 GeoGridJSONReader (const GeoGridJSONReader &)=delete
 No copy constructor. More...
 
GeoGridJSONReader operator= (const GeoGridJSONReader &)=delete
 No copy assignement. More...
 
void Read () override
 Actually perform the read and return the GeoGrid. More...
 
- Public Member Functions inherited from geopop::GeoGridReader
 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...
 

Private Member Functions

std::shared_ptr< ContactCenter > ParseContactCenter (boost::property_tree::ptree &contactCenter)
 Create a ContactCenter based on the information stored in the provided boost property tree. More...
 
stride::ContactPoolParseContactPool (boost::property_tree::ptree &contactPool, stride::ContactType::Id typeId)
 Create a ContactCenter based on the information stored in the provided boost property tree. More...
 
Coordinate ParseCoordinate (boost::property_tree::ptree &coordinate)
 Create a Coordinate based on the information stored in the provided boost property tree. More...
 
std::shared_ptr< LocationParseLocation (boost::property_tree::ptree &location)
 Create a Location based on the information stored in the provided boost property tree. More...
 
stride::PersonParsePerson (boost::property_tree::ptree &person)
 Create a Person based on the information stored in the provided boost property tree. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geopop::GeoGridReader
void AddCommutes (GeoGrid &geoGrid)
 Add the commutes that were found to their respective Locations symmetrically. More...
 
- Protected Attributes inherited from geopop::GeoGridReader
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 implementation of the GeoGridReader using JSON.

This class is used to read a GeoGrid from a JSON file.

Definition at line 33 of file GeoGridJSONReader.h.

Constructor & Destructor Documentation

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

Construct the GeoGridJSONReader with the istream which contains the JSON.

Definition at line 34 of file GeoGridJSONReader.cpp.

geopop::GeoGridJSONReader::GeoGridJSONReader ( const GeoGridJSONReader )
delete

No copy constructor.

Member Function Documentation

GeoGridJSONReader geopop::GeoGridJSONReader::operator= ( const GeoGridJSONReader )
delete

No copy assignement.

void geopop::GeoGridJSONReader::Read ( )
overridevirtual
shared_ptr< ContactCenter > geopop::GeoGridJSONReader::ParseContactCenter ( boost::property_tree::ptree &  contactCenter)
private

Create a ContactCenter based on the information stored in the provided boost property tree.

Definition at line 103 of file GeoGridJSONReader.cpp.

References ParseContactPool(), and stride::ContactLogMode::ToString().

Referenced by ParseLocation().

Here is the call graph for this function:

Here is the caller graph for this function:

ContactPool * geopop::GeoGridJSONReader::ParseContactPool ( boost::property_tree::ptree &  contactPool,
stride::ContactType::Id  typeId 
)
private

Create a ContactCenter based on the information stored in the provided boost property tree.

Definition at line 135 of file GeoGridJSONReader.cpp.

References stride::ContactPoolSys::CreateContactPool(), geopop::GeoGridReader::m_people, geopop::GeoGridReader::m_population, and stride::Population::RefPoolSys().

Referenced by ParseContactCenter().

Here is the call graph for this function:

Here is the caller graph for this function:

Coordinate geopop::GeoGridJSONReader::ParseCoordinate ( boost::property_tree::ptree &  coordinate)
private

Create a Coordinate based on the information stored in the provided boost property tree.

Definition at line 96 of file GeoGridJSONReader.cpp.

Referenced by ParseLocation().

Here is the caller graph for this function:

shared_ptr< Location > geopop::GeoGridJSONReader::ParseLocation ( boost::property_tree::ptree &  location)
private

Create a Location based on the information stored in the provided boost property tree.

Definition at line 68 of file GeoGridJSONReader.cpp.

References geopop::GeoGridReader::m_commutes, ParseContactCenter(), and ParseCoordinate().

Referenced by Read().

Here is the call graph for this function:

Here is the caller graph for this function:

Person * geopop::GeoGridJSONReader::ParsePerson ( boost::property_tree::ptree &  person)
private

Create a Person based on the information stored in the provided boost property tree.

Definition at line 152 of file GeoGridJSONReader.cpp.

References stride::Population::CreatePerson(), and geopop::GeoGridReader::m_population.

Referenced by Read().

Here is the call graph for this function:

Here is the caller graph for this function:


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