Stride Reference Manual  - generated for commit 9643b11
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
geopop::GeoGridJSONWriter Class Reference

Writes a GeoGrid to a JSON file. More...

#include <GeoGridJSONWriter.h>

Inheritance diagram for geopop::GeoGridJSONWriter:
Inheritance graph
Collaboration diagram for geopop::GeoGridJSONWriter:
Collaboration graph

Public Member Functions

 GeoGridJSONWriter ()
 Construct the GeoGridJSONWriter. More...
 
void Write (GeoGrid &geoGrid, std::ostream &stream) override
 Write the provided GeoGrid to the proved ostream in JSON format. More...
 
- Public Member Functions inherited from geopop::GeoGridWriter
virtual ~GeoGridWriter ()=default
 Construct the Writer. More...
 

Private Member Functions

boost::property_tree::ptree WriteContactCenter (std::shared_ptr< ContactCenter > contactCenter)
 Create a Boost Property Tree containing all info needed to reconstruct a ContactCenter. More...
 
boost::property_tree::ptree WriteContactPool (stride::ContactPool *contactPool)
 Create a Boost Property Tree containing all info needed to reconstruct a ContactPool. More...
 
boost::property_tree::ptree WriteCoordinate (const Coordinate &coordinate)
 Create a Boost Property Tree containing all info needed to reconstruct a Coordinate. More...
 
boost::property_tree::ptree WriteLocation (const Location &location)
 Create a Boost Property Tree containing all info needed to reconstruct a Location. More...
 
boost::property_tree::ptree WritePerson (stride::Person *person)
 Create a Boost Property Tree containing all info needed to reconstruct a Person. More...
 

Private Attributes

std::set< stride::Person * > m_persons_found
 The persons found when looping over the ContactPools. More...
 

Detailed Description

Writes a GeoGrid to a JSON file.

Definition at line 36 of file GeoGridJSONWriter.h.

Constructor & Destructor Documentation

geopop::GeoGridJSONWriter::GeoGridJSONWriter ( )

Construct the GeoGridJSONWriter.

Definition at line 34 of file GeoGridJSONWriter.cpp.

Member Function Documentation

void geopop::GeoGridJSONWriter::Write ( GeoGrid geoGrid,
std::ostream &  stream 
)
overridevirtual

Write the provided GeoGrid to the proved ostream in JSON format.

Implements geopop::GeoGridWriter.

Definition at line 36 of file GeoGridJSONWriter.cpp.

References m_persons_found, WriteLocation(), and WritePerson().

Here is the call graph for this function:

ptree geopop::GeoGridJSONWriter::WriteContactCenter ( std::shared_ptr< ContactCenter >  contactCenter)
private

Create a Boost Property Tree containing all info needed to reconstruct a ContactCenter.

Definition at line 60 of file GeoGridJSONWriter.cpp.

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

Referenced by WriteLocation().

Here is the call graph for this function:

Here is the caller graph for this function:

ptree geopop::GeoGridJSONWriter::WriteContactPool ( stride::ContactPool contactPool)
private

Create a Boost Property Tree containing all info needed to reconstruct a ContactPool.

Definition at line 77 of file GeoGridJSONWriter.cpp.

References stride::ContactPool::GetId(), and m_persons_found.

Referenced by WriteContactCenter().

Here is the call graph for this function:

Here is the caller graph for this function:

ptree geopop::GeoGridJSONWriter::WriteCoordinate ( const Coordinate coordinate)
private

Create a Boost Property Tree containing all info needed to reconstruct a Coordinate.

Definition at line 92 of file GeoGridJSONWriter.cpp.

Referenced by WriteLocation().

Here is the caller graph for this function:

ptree geopop::GeoGridJSONWriter::WriteLocation ( const Location location)
private

Create a Boost Property Tree containing all info needed to reconstruct a Location.

Definition at line 100 of file GeoGridJSONWriter.cpp.

References geopop::Location::CRefOutgoingCommutes(), geopop::Location::GetCoordinate(), geopop::Location::GetID(), geopop::Location::GetName(), geopop::Location::GetPopCount(), geopop::Location::GetProvince(), stride::ContactType::IdList, WriteContactCenter(), and WriteCoordinate().

Referenced by Write().

Here is the call graph for this function:

Here is the caller graph for this function:

ptree geopop::GeoGridJSONWriter::WritePerson ( stride::Person person)
private

Create a Boost Property Tree containing all info needed to reconstruct a Person.

Definition at line 131 of file GeoGridJSONWriter.cpp.

References stride::Person::GetAge(), stride::Person::GetId(), and stride::Person::GetPoolId().

Referenced by Write().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::set<stride::Person*> geopop::GeoGridJSONWriter::m_persons_found
private

The persons found when looping over the ContactPools.

Definition at line 62 of file GeoGridJSONWriter.h.

Referenced by Write(), and WriteContactPool().


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