Stride Reference Manual
- generated for commit 9643b11
|
An implementation of the GeoGridWriter using Protocol Buffers This class is used to write a GeoGrid to a Proto file. More...
#include <GeoGridProtoWriter.h>
Public Member Functions | |
GeoGridProtoWriter () | |
Construct the GeoGridProtoWriter. More... | |
void | Write (GeoGrid &geoGrid, std::ostream &stream) override |
Write the GeoGrid to the ostream in Protobuf format. More... | |
![]() | |
virtual | ~GeoGridWriter ()=default |
Construct the Writer. More... | |
Private Member Functions | |
void | WriteContactPools (stride::ContactType::Id typeId, stride::util::SegmentedVector< stride::ContactPool * > &contactPools, proto::GeoGrid_Location_ContactPools *protoContactPools) |
Create a ProtoBuf ContactPools structure. More... | |
void | WriteContactPool (stride::ContactPool *contactPool, proto::GeoGrid_Location_ContactPools_ContactPool *protoContactPool) |
Create a ProtoBuf ContactPool containing all the info needed to reconstruct a ContactPool. More... | |
void | WriteCoordinate (const Coordinate &coordinate, proto::GeoGrid_Location_Coordinate *protoCoordinate) |
Create a ProtoBuf Coordinate containing all the info needed to reconstruct a Coordinate.. More... | |
void | WriteLocation (Location &location, proto::GeoGrid_Location *protoLocation) |
Create a ProtoBuf Location containing all the info needed to reconstruct a Location. More... | |
void | WritePerson (stride::Person *person, proto::GeoGrid_Person *protoPerson) |
Create a ProtoBuf Person containing all the 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... | |
An implementation of the GeoGridWriter using Protocol Buffers This class is used to write a GeoGrid to a Proto file.
Definition at line 42 of file GeoGridProtoWriter.h.
geopop::GeoGridProtoWriter::GeoGridProtoWriter | ( | ) |
Construct the GeoGridProtoWriter.
Definition at line 36 of file GeoGridProtoWriter.cpp.
|
overridevirtual |
Write the GeoGrid to the ostream in Protobuf format.
Implements geopop::GeoGridWriter.
Definition at line 38 of file GeoGridProtoWriter.cpp.
References proto::GeoGrid::add_locations(), proto::GeoGrid::add_persons(), m_persons_found, WriteLocation(), and WritePerson().
|
private |
Create a ProtoBuf ContactPools structure.
Definition at line 58 of file GeoGridProtoWriter.cpp.
References proto::GeoGrid_Location_ContactPools::add_pools(), proto::GeoGrid_Location_ContactPools_Type_College, proto::GeoGrid_Location_ContactPools_Type_Household, proto::GeoGrid_Location_ContactPools_Type_K12School, proto::GeoGrid_Location_ContactPools_Type_PrimaryCommunity, proto::GeoGrid_Location_ContactPools_Type_SecondaryCommunity, proto::GeoGrid_Location_ContactPools_Type_Workplace, proto::GeoGrid_Location_ContactPools::set_type(), and WriteContactPool().
Referenced by WriteLocation().
|
private |
Create a ProtoBuf ContactPool containing all the info needed to reconstruct a ContactPool.
Definition at line 75 of file GeoGridProtoWriter.cpp.
References proto::GeoGrid_Location_ContactPools_ContactPool::add_people(), stride::ContactPool::GetId(), m_persons_found, and proto::GeoGrid_Location_ContactPools_ContactPool::set_id().
Referenced by WriteContactPools().
|
private |
Create a ProtoBuf Coordinate containing all the info needed to reconstruct a Coordinate..
Definition at line 85 of file GeoGridProtoWriter.cpp.
References proto::GeoGrid_Location_Coordinate::set_latitude(), and proto::GeoGrid_Location_Coordinate::set_longitude().
Referenced by WriteLocation().
|
private |
Create a ProtoBuf Location containing all the info needed to reconstruct a Location.
Definition at line 92 of file GeoGridProtoWriter.cpp.
References proto::GeoGrid_Location::add_commutes(), proto::GeoGrid_Location::add_contactpools(), geopop::Location::CRefOutgoingCommutes(), geopop::Location::GetCoordinate(), geopop::Location::GetID(), geopop::Location::GetName(), geopop::Location::GetPopCount(), geopop::Location::GetProvince(), stride::ContactType::IdList, geopop::Location::RefPools(), proto::GeoGrid_Location::set_allocated_coordinate(), proto::GeoGrid_Location::set_id(), proto::GeoGrid_Location::set_name(), proto::GeoGrid_Location::set_population(), proto::GeoGrid_Location::set_province(), proto::GeoGrid_Location_Commute::set_to(), WriteContactPools(), and WriteCoordinate().
Referenced by Write().
|
private |
Create a ProtoBuf Person containing all the info needed to reconstruct a Person.
Definition at line 114 of file GeoGridProtoWriter.cpp.
References stride::Person::GetAge(), stride::Person::GetId(), proto::GeoGrid_Person::set_age(), and proto::GeoGrid_Person::set_id().
Referenced by Write().
|
private |
The persons found when looping over the ContactPools.
Definition at line 71 of file GeoGridProtoWriter.h.
Referenced by Write(), and WriteContactPool().