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

An implementation of the GeoGridWriter using Protocol Buffers This class is used to write a GeoGrid to a Proto file. More...

#include <GeoGridProtoWriter.h>

Inheritance diagram for geopop::GeoGridProtoWriter:
Inheritance graph
Collaboration diagram for geopop::GeoGridProtoWriter:
Collaboration graph

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...
 
- Public Member Functions inherited from geopop::GeoGridWriter
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

geopop::GeoGridProtoWriter::GeoGridProtoWriter ( )

Construct the GeoGridProtoWriter.

Definition at line 36 of file GeoGridProtoWriter.cpp.

Member Function Documentation

void geopop::GeoGridProtoWriter::Write ( GeoGrid geoGrid,
std::ostream &  stream 
)
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().

Here is the call graph for this function:

void geopop::GeoGridProtoWriter::WriteContactPool ( stride::ContactPool contactPool,
proto::GeoGrid_Location_ContactPools_ContactPool protoContactPool 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void geopop::GeoGridProtoWriter::WriteCoordinate ( const Coordinate coordinate,
proto::GeoGrid_Location_Coordinate protoCoordinate 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void geopop::GeoGridProtoWriter::WritePerson ( stride::Person person,
proto::GeoGrid_Person protoPerson 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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

The persons found when looping over the ContactPools.

Definition at line 71 of file GeoGridProtoWriter.h.

Referenced by Write(), and WriteContactPool().


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